Exemplo n.º 1
0
 def _on_album_activated(self, flowbox, child):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param child as Gtk.FlowboxChild
     """
     album_widget = child.get_child()
     if self._press_rect is None:
         if self._context_album_id == album_widget.get_id():
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         else:
             self._init_context_position()
             self._context_album_id = album_widget.get_id()
             self._populate_context(self._context_album_id)
             self._context.show()
     else:
         if self._context_album_id is not None:
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         popover = AlbumPopoverWidget(album_widget.get_id(),
                                      self._genre_ids, self._artist_ids)
         popover.set_relative_to(album_widget)
         popover.set_pointing_to(self._press_rect)
         album_widget.update_overlay()
         popover.show()
Exemplo n.º 2
0
 def _on_album_activated(self, flowbox, child):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param child as Gtk.FlowboxChild
     """
     album_widget = child.get_child()
     if self._press_rect is None:
         if self._context_album_id == album_widget.get_id():
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         else:
             if Lp().settings.get_value('auto-play'):
                 album = Album(album_widget.get_id())
                 track = Track(album.tracks_ids[0])
                 Lp().player.load(track)
                 Lp().player.set_albums(track.id, None, self._genre_id)
             else:
                 self._context_album_id = album_widget.get_id()
                 self._populate_context(self._context_album_id)
                 self._context.show()
     else:
         if self._context_album_id is not None:
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         popover = AlbumPopoverWidget(album_widget.get_id(), self._genre_id)
         popover.set_relative_to(album_widget)
         popover.set_pointing_to(self._press_rect)
         self._context_widget = popover.get_widget()
         popover.connect('destroy', self._on_popover_destroyed)
         popover.show()
Exemplo n.º 3
0
 def _on_album_activated(self, flowbox, child):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param child as Gtk.FlowboxChild
     """
     album_widget = child.get_child()
     if self._press_rect is None:
         if self._context_album_id == album_widget.get_id():
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         else:
             self._init_context_position()
             self._context_album_id = album_widget.get_id()
             self._populate_context(self._context_album_id)
             self._context.show()
     else:
         if self._context_album_id is not None:
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         popover = AlbumPopoverWidget(album_widget.get_id(),
                                      self._genre_ids,
                                      self._artist_ids)
         popover.set_relative_to(album_widget)
         popover.set_pointing_to(self._press_rect)
         album_widget.update_overlay()
         popover.show()
Exemplo n.º 4
0
 def _on_album_activated(self, flowbox, child):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param child as Gtk.FlowboxChild
     """
     album_widget = child.get_child()
     if self._press_rect is None:
         if self._context_album_id == album_widget.get_id():
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         else:
             if Lp().settings.get_value('auto-play'):
                 album = Album(album_widget.get_id())
                 track = Track(album.tracks_ids[0])
                 Lp().player.load(track)
                 Lp().player.set_albums(track.id, None,
                                        self._genre_id)
             else:
                 self._context_album_id = album_widget.get_id()
                 self._populate_context(self._context_album_id)
                 self._context.show()
     else:
         if self._context_album_id is not None:
             self._context_album_id = None
             self._context.hide()
             self._context_widget.destroy()
             self._context_widget = None
         popover = AlbumPopoverWidget(album_widget.get_id(),
                                      self._genre_id)
         popover.set_relative_to(album_widget)
         popover.set_pointing_to(self._press_rect)
         popover.show()