def song_changed(self, window, song): if not self.window.is_active(): self.set_for_song(song) if song.art_pixbuf: #logging.debug("has albumart", song.art_pixbuf, song.art_pixbuf.get_width()) self.notification.set_icon_from_pixbuf(song.art_pixbuf) else: self.notification.props.icon_name = get_data_file('media/pithos-mono.png') self.notification.show()
def song_changed(self, window, song): if not self.window.is_active(): self.set_for_song(song) if song.art_pixbuf: #logging.debug("has albumart", song.art_pixbuf, song.art_pixbuf.get_width()) self.notification.set_icon_from_pixbuf(song.art_pixbuf) else: self.notification.props.icon_name = get_data_file( 'media/pithos-mono.png') self.notification.show()
def on_enable(self): self.visible = True self.delete_callback_handle = self.window.connect("delete-event", self.toggle_visible) self.state_callback_handle = self.window.connect("play-state-changed", self.play_state_changed) self.song_callback_handle = self.window.connect("song-changed", self.song_changed) if indicator_capable: self.ind.set_status(appindicator.STATUS_ACTIVE) else: self.statusicon = gtk.status_icon_new_from_file(get_data_file('media', 'icon.png')) self.statusicon.connect('activate', self.toggle_visible) self.build_context_menu()
def on_enable(self): self.visible = True self.delete_callback_handle = self.window.connect( "delete-event", self.toggle_visible) self.state_callback_handle = self.window.connect( "play-state-changed", self.play_state_changed) self.song_callback_handle = self.window.connect( "song-changed", self.song_changed) if indicator_capable: self.ind.set_status(appindicator.STATUS_ACTIVE) else: self.statusicon = gtk.status_icon_new_from_file( get_data_file('media', 'icon.png')) self.statusicon.connect('activate', self.toggle_visible) self.build_context_menu()
def on_enable(self): self.delete_callback_handle = self.window.connect("delete-event", self.toggle_visible) self.state_callback_handle = self.window.connect("play-state-changed", self.play_state_changed) self.song_callback_handle = self.window.connect("song-changed", self.song_changed) if indicator_capable: self.ind.set_status(AppIndicator.IndicatorStatus.ACTIVE) else: icon_info = Gtk.IconTheme.lookup_icon (Gtk.IconTheme.get_default(), 'pithos-tray-icon', 48, 0) if icon_info and Gtk.IconInfo.get_filename (icon_info): filename = Gtk.IconInfo.get_filename (icon_info) else: filename = get_data_file('media', 'pithos-tray-icon.png') self.statusicon = Gtk.StatusIcon.new () self.statusicon.set_from_file (filename) self.statusicon.connect('activate', self.toggle_visible) self.build_context_menu()
def on_prepare(self): if indicator_capable: self.ind = AppIndicator.Indicator.new_with_path("pithos-tray-icon", \ "pithos-tray-icon", \ AppIndicator.IndicatorCategory.APPLICATION_STATUS, \ get_data_file('media'))
def on_prepare(self): if indicator_capable: self.ind = appindicator.Indicator("pithos", \ "pithos-mono", \ appindicator.CATEGORY_APPLICATION_STATUS, \ get_data_file('media'))