Example #1
0
 def __init__(self, genre_ids, artist_ids, storage_type, view_type):
     """
         Init album view
         @param genre_ids as [int]
         @param artist_ids as [int]
         @param storage_type as StorageType
         @param view_type as ViewType
     """
     FlowBoxView.__init__(self, storage_type, view_type)
     self._genre_ids = genre_ids
     self._artist_ids = artist_ids
     self._storage_type = storage_type
     self.__populate_wanted = True
     if genre_ids and genre_ids[0] < 0:
         if genre_ids[0] == Type.WEB:
             (youtube_dl, env) = get_youtube_dl()
             if youtube_dl is None:
                 self._empty_message = _("Missing youtube-dl command")
                 self.show_placeholder(True)
                 self.__populate_wanted = False
             elif not get_network_available("YOUTUBE"):
                 self._empty_message =\
                     _("Network unavailable or disabled in settings")
                 self.show_placeholder(True)
                 self.__populate_wanted = False
         self._empty_icon_name = get_icon_name(genre_ids[0])
     return [(App().scanner, "updated", "_on_collection_updated"),
             (App().player, "loading-changed", "_on_loading_changed"),
             (App().player, "current-changed", "_on_current_changed"),
             (App().art, "album-artwork-changed", "_on_artwork_changed")]
Example #2
0
 def __init__(self, genre_ids, artist_ids, view_type=ViewType.SCROLLED):
     """
         Init album view
         @param genre_ids as [int]
         @param artist_ids as [int]
         @param view_type as ViewType
     """
     FlowBoxView.__init__(self, view_type)
     ViewController.__init__(self, ViewControllerType.ALBUM)
     self._widget_class = AlbumSimpleWidget
     self.__genre_ids = genre_ids
     self.__artist_ids = artist_ids
     if genre_ids and genre_ids[0] < 0:
         if genre_ids[0] == Type.WEB:
             if not Gio.NetworkMonitor.get_default().get_network_available(
             ):
                 self._empty_message = _("Network not available")
                 self._box.hide()
             elif GLib.find_program_in_path("youtube-dl") is None:
                 self._empty_message = _("Missing youtube-dl command")
                 self._box.hide()
             elif not get_network_available("SPOTIFY") or\
                     not get_network_available("YOUTUBE"):
                 self._empty_message = _("You need to enable Spotify ") + \
                                       _("and YouTube in network settings")
                 self._box.hide()
         self._empty_icon_name = get_icon_name(genre_ids[0])
     if view_type & ViewType.SMALL:
         self._scrolled.set_policy(Gtk.PolicyType.NEVER,
                                   Gtk.PolicyType.NEVER)
Example #3
0
 def __init__(self, view_type):
     """
         Init decade view
         @param view_type as ViewType
     """
     FlowBoxView.__init__(self, view_type)
     self._widget_class = AlbumsDecadeWidget
     self._empty_icon_name = get_icon_name(Type.YEARS)
 def __init__(self):
     """
         Init decade view
     """
     FlowBoxView.__init__(self)
     self.__lazy_queue_backup = None
     self._widget_class = RoundedArtistWidget
     self.connect("realize", self.__on_realize)
     self.connect("unrealize", self.__on_unrealize)
     self.connect("destroy", self.__on_destroy)
Example #5
0
 def __init__(self, genre_ids, artist_ids):
     """
         Init album view
         @param genre ids as [int]
         @param artist ids as [int]
     """
     FlowBoxView.__init__(self)
     ViewController.__init__(self, ViewControllerType.ALBUM)
     self._widget_class = AlbumSimpleWidget
     self.__genre_ids = genre_ids
     self.__artist_ids = artist_ids
Example #6
0
 def __init__(self, view_type, destroy=True):
     """
         Init artist view
         @param view_type as ViewType
         @param destroy as bool
     """
     FlowBoxView.__init__(self)
     self.__view_type = view_type
     self.__destroy = destroy
     self._widget_class = RoundedArtistWidget
     self.connect("destroy", self.__on_destroy)
     self._empty_icon_name = get_icon_name(Type.ARTISTS)
Example #7
0
 def __init__(self, storage_type, view_type):
     """
         Init decade view
         @param storage_type as StorageType
         @param view_type as ViewType
     """
     from lollypop.widgets_banner_flowbox import FlowboxBannerWidget
     FlowBoxView.__init__(self, storage_type, view_type | ViewType.OVERLAY)
     self._empty_icon_name = get_icon_name(Type.YEARS)
     self.__banner = FlowboxBannerWidget([Type.YEARS], [], self.view_type)
     self.__banner.show()
     self.__banner.connect("play-all", self.__on_banner_play_all)
     self.add_widget(self._box, self.__banner)
Example #8
0
 def __init__(self, storage_type, view_type):
     """
         Init artist view
         @param storage_type as StorageType
         @param view_type as ViewType
     """
     FlowBoxView.__init__(self, storage_type, view_type)
     self.connect("destroy", self.__on_destroy)
     self._empty_icon_name = get_icon_name(Type.ARTISTS)
     return [
         (App().art, "artist-artwork-changed",
          "_on_artist_artwork_changed"),
         (App().scanner, "updated", "_on_collection_updated")
     ]
Example #9
0
 def __init__(self):
     """
         Init view
     """
     FlowBoxView.__init__(self)
     ViewController.__init__(self, ViewControllerType.RADIO)
     self._widget_class = RadioWidget
     self.__radios = Radios()
     builder = Gtk.Builder()
     builder.add_from_resource("/org/gnome/Lollypop/RadiosView.ui")
     builder.connect_signals(self)
     self.insert_row(0)
     self.attach(builder.get_object("widget"), 0, 0, 1, 1)
     self.__pop_tunein = TuneinPopover(self.__radios)
     self.__pop_tunein.set_relative_to(builder.get_object("search_btn"))
 def __init__(self, obj=None):
     """
         Init decade view
         @param obj as Track/Album
     """
     self.__obj = obj
     self.__signal_id = None
     new_playlist_button = Gtk.Button(_("New playlist"))
     new_playlist_button.connect("clicked", self.__on_new_button_clicked)
     new_playlist_button.set_property("halign", Gtk.Align.CENTER)
     new_playlist_button.set_hexpand(True)
     new_playlist_button.set_margin_top(5)
     new_playlist_button.show()
     FlowBoxView.__init__(self)
     self.insert_row(0)
     self.attach(new_playlist_button, 0, 0, 1, 1)
     self._widget_class = PlaylistRoundedWidget
 def __init__(self, view_type):
     """
         Init decade view
         @param view_type as ViewType
     """
     FlowBoxView.__init__(self, StorageType.ALL,
                          view_type | ViewType.OVERLAY)
     self.__signal_id = None
     self._empty_icon_name = "emblem-documents-symbolic"
     if self.args is None:
         self.add_widget(self._box, None)
     else:
         self.__banner = PlaylistsBannerWidget(self)
         self.__banner.show()
         self.add_widget(self._box, self.__banner)
     return [(App().playlists, "playlists-added", "_on_playlist_added"),
             (App().playlists, "playlists-removed", "_on_playlist_removed"),
             (App().playlists, "playlists-renamed", "_on_playlist_renamed")]
Example #12
0
 def __init__(self, view_type=ViewType.SCROLLED):
     """
         Init view
         @param view_type as ViewType
     """
     FlowBoxView.__init__(self, view_type)
     ViewController.__init__(self, ViewControllerType.RADIO)
     self._widget_class = RadioWidget
     self._empty_icon_name = get_icon_name(Type.RADIOS)
     self.__radios = Radios()
     builder = Gtk.Builder()
     builder.add_from_resource("/org/gnome/Lollypop/RadiosView.ui")
     builder.connect_signals(self)
     self.insert_row(0)
     self.attach(builder.get_object("widget"), 0, 0, 1, 1)
     self.__pop_tunein = None
     if not get_network_available("TUNEIN"):
         builder.get_object("search_btn").hide()
Example #13
0
 def __init__(self, obj, view_type=ViewType.SCROLLED):
     """
         Init decade view
         @param obj as Track/Album
         @param view_type as ViewType
     """
     FlowBoxView.__init__(self, view_type)
     self._empty_icon_name = "emblem-documents-symbolic"
     self.__obj = obj
     self.__signal_id = None
     if not view_type & ViewType.DEVICES:
         new_playlist_button = Gtk.Button(_("New playlist"))
         new_playlist_button.connect("clicked",
                                     self.__on_new_button_clicked)
         new_playlist_button.set_property("halign", Gtk.Align.CENTER)
         new_playlist_button.set_hexpand(True)
         new_playlist_button.set_margin_top(5)
         new_playlist_button.show()
         self.insert_row(0)
         self.attach(new_playlist_button, 0, 0, 1, 1)
     self._widget_class = PlaylistRoundedWidget
Example #14
0
 def __init__(self):
     """
         Init decade view
     """
     FlowBoxView.__init__(self)
     self._widget_class = AlbumsDecadeWidget