Beispiel #1
0
 def set_view_type(self, view_type):
     """
         Update view type
         @param view_type as ViewType
     """
     RoundedAlbumsWidget.set_view_type(self, view_type)
     self.set_size_request(self._art_size,
                           self._art_size + self.__font_height)
    def populate(self):
        """
            Populate widget content
        """

        RoundedAlbumsWidget.populate(self)
        self._widget.connect("enter-notify-event", self._on_enter_notify)
        self._widget.connect("leave-notify-event", self._on_leave_notify)
 def populate(self):
     """
         Populate widget content
     """
     if self._artwork is None:
         RoundedAlbumsWidget.populate(self)
     else:
         self.set_artwork()
Beispiel #4
0
 def __init__(self, item_ids):
     """
         Init widget
         @param decade as [int]
     """
     OverlayHelper.__init__(self)
     decade_str = "%s - %s" % (item_ids[0], item_ids[-1])
     RoundedAlbumsWidget.__init__(self, item_ids, decade_str, decade_str)
Beispiel #5
0
 def populate(self):
     """
         Populate widget content
     """
     if self._artwork is None:
         self._lock_overlay = False
         RoundedAlbumsWidget.populate(self)
         self._widget.connect("enter-notify-event", self._on_enter_notify)
         self._widget.connect("leave-notify-event", self._on_leave_notify)
     else:
         self.set_artwork()
 def __init__(self, item_ids, view_type, font_height):
     """
         Init widget
         @param decade as [int]
         @param view_type as ViewType
         @param font_height as int
     """
     decade_str = "%s - %s" % (item_ids[0], item_ids[-1])
     RoundedAlbumsWidget.__init__(self, item_ids, decade_str, decade_str,
                                  view_type, font_height)
     self._genre = Type.YEARS
Beispiel #7
0
 def __init__(self, genre_id, view_type, font_height):
     """
         Init widget
         @param Genre as [int]
         @param view_type as ViewType
         @param font_height as int
     """
     OverlayGenreHelper.__init__(self)
     self.__font_height = font_height
     name = sortname = App().genres.get_name(genre_id)
     RoundedAlbumsWidget.__init__(self, genre_id, name, sortname, view_type)
     self._genre = Type.GENRES
Beispiel #8
0
 def __init__(self, genre_id, storage_type, view_type, font_height):
     """
         Init widget
         @param Genre as [int]
         @param view_type as ViewType
         @param font_height as int
     """
     self.__storage_type = storage_type
     name = sortname = App().genres.get_name(genre_id)
     RoundedAlbumsWidget.__init__(self, genre_id, name, sortname, view_type,
                                  font_height)
     self._genre = Type.GENRES
 def __init__(self, playlist_id, view_type, font_height):
     """
         Init widget
         @param playlist_id as playlist_id
         @param view_type as ViewType
         @param font_height as int
     """
     name = sortname = App().playlists.get_name(playlist_id)
     RoundedAlbumsWidget.__init__(self, playlist_id, name, sortname,
                                  view_type, font_height)
     self._track_ids = []
     self._genre = Type.PLAYLISTS
     return [(App().art, "artwork-cleared", "_on_artwork_cleared")]
 def populate(self):
     """
         Populate widget content
     """
     if self._artwork is None:
         RoundedAlbumsWidget.populate(self)
         self._widget.connect("enter-notify-event", self._on_enter_notify)
         self._widget.connect("leave-notify-event", self._on_leave_notify)
         self.connect("button-release-event",
                      self.__on_button_release_event)
         self.__gesture = Gtk.GestureLongPress.new(self)
         self.__gesture.connect("pressed", self.__on_gesture_pressed)
         # We want to get release event after gesture
         self.__gesture.set_propagation_phase(Gtk.PropagationPhase.CAPTURE)
         self.__gesture.set_button(0)
     else:
         self.set_artwork()
 def __init__(self, playlist_id, obj):
     """
         Init widget
         @param playlist_id as playlist_id
         @param obj as Track/Album
     """
     OverlayHelper.__init__(self)
     name = sortname = App().playlists.get_name(playlist_id)
     RoundedAlbumsWidget.__init__(self, playlist_id, name, sortname)
     self.__track_ids = []
     self.__obj = obj
     if obj is not None:
         if isinstance(obj, Album) or\
                 isinstance(obj, Disc):
             self.__add = not App().playlists.exists_album(playlist_id, obj)
         else:
             self.__add = not App().playlists.exists_track(
                 playlist_id, obj.uri)
 def __init__(self, playlist_id, obj, view_type, font_height):
     """
         Init widget
         @param playlist_id as playlist_id
         @param obj as Track/Album
         @param view_type as ViewType
         @param font_height as int
     """
     OverlayPlaylistHelper.__init__(self)
     self.__font_height = font_height
     name = sortname = App().playlists.get_name(playlist_id)
     RoundedAlbumsWidget.__init__(self, playlist_id, name, sortname,
                                  view_type)
     self._track_ids = []
     self._obj = obj
     self._genre = Type.PLAYLISTS
     if obj is not None:
         if isinstance(obj, Album) or\
                 isinstance(obj, Disc):
             self._add = not App().playlists.exists_album(playlist_id, obj)
         else:
             self._add = not App().playlists.exists_track(
                 playlist_id, obj.uri)