Commit e16d7764 authored by Marinus Schraal's avatar Marinus Schraal Committed by Jean Felder

artistalbumswidget: Pass application around

Cleanup some arguments by passing the application object instead.
parent 90bba029
Pipeline #99452 passed with stages
in 7 minutes
......@@ -58,7 +58,7 @@ class ArtistsView(BaseView):
super().__init__(
'artists', _("Artists"), application, sidebar_container)
self._player = player
self._application = application
self._artists = {}
self._window = application.props.window
......@@ -152,7 +152,7 @@ class ArtistsView(BaseView):
return
self._artist_albums = ArtistAlbumsWidget(
coreartist, self._player, self._window, False)
coreartist, self._application, False)
artist_albums_frame = Gtk.Frame(
shadow_type=Gtk.ShadowType.NONE, hexpand=True)
artist_albums_frame.add(self._artist_albums)
......
......@@ -46,13 +46,14 @@ class SearchView(BaseView):
@log
def __init__(self, application, player):
self._application = application
self._coremodel = application.props.coremodel
self._model = self._coremodel.props.songs_search
self._album_model = self._coremodel.props.albums_search
self._artist_model = self._coremodel.props.artists_search
super().__init__('search', None, application)
self._player = player
self._player = self._application.props.player
self.previous_view = None
......@@ -195,7 +196,7 @@ class SearchView(BaseView):
# self.emit('song-activated', widget)
self._artist_albums_widget = ArtistAlbumsWidget(
coreartist, self._player, self._window, False)
coreartist, self._application, False)
self.add(self._artist_albums_widget)
self._artist_albums_widget.show()
......
......@@ -51,13 +51,14 @@ class ArtistAlbumsWidget(Gtk.ListBox):
@log
def __init__(
self, coreartist, player, window, selection_mode_allowed=False):
self, coreartist, application, selection_mode_allowed=False):
super().__init__()
self._application = application
self._artist = coreartist.props.artist
self._model = coreartist.props.model
self._player = player
self._player = self._application.props.player
self._selection_mode_allowed = selection_mode_allowed
self._window = window
self._widgets = []
......@@ -79,7 +80,7 @@ class ArtistAlbumsWidget(Gtk.ListBox):
if self.props.selection_mode:
return
coremodel = self._player._app.props.coremodel
coremodel = self._application.props.coremodel
def _on_playlist_loaded(klass):
self._player.play(song_widget.props.coresong)
......@@ -91,7 +92,7 @@ class ArtistAlbumsWidget(Gtk.ListBox):
def _add_album(self, corealbum):
widget = ArtistAlbumWidget(
corealbum, self._selection_mode_allowed,
self._songs_grid_size_group, self._cover_size_group, self._window)
self._songs_grid_size_group, self._cover_size_group)
self.bind_property(
'selection-mode', widget, 'selection-mode',
......
......@@ -53,7 +53,7 @@ class ArtistAlbumWidget(Gtk.Box):
def __init__(
self, corealbum, selection_mode_allowed, size_group=None,
cover_size_group=None, window=None):
cover_size_group=None):
super().__init__(orientation=Gtk.Orientation.HORIZONTAL)
self._size_group = size_group
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment