def check_active_dynamic_icon(self, icon_object): icon_name = icon_object.entry.get_text() try: path = get_foobnix_resourse_path_by_name(icon_name) self.controls.trayicon.set_from_file(path) except TypeError: pass
def _set_image_from_path(self, path, size): if not os.path.isfile(path): path = get_foobnix_resourse_path_by_name(path) self._pixbuf = create_pixbuf_from_path(path, size) logging.debug("Change icon path %s" % path) self._resource = path
def create_pixbuf_from_path(path, size=None): if not path: return None if not os.path.isfile(path): path = get_foobnix_resourse_path_by_name(path) if size: return GdkPixbuf.Pixbuf.new_from_file_at_size(path, size, size) else: return GdkPixbuf.Pixbuf.new_from_file(path) #@UndefinedVariable
def _update_info(self, bean): if not bean: return if not self.sound_menu: # if dbus initialization can't be finished return image = "file:///" + get_foobnix_resourse_path_by_name(ICON_FOOBNIX) if bean.image: if bean.image.startswith("/"): image = "file:///" + bean.image else: image = bean.image artists = None if bean.artist: artists = [bean.artist] self.sound_menu.song_changed(artists=artists, title=bean.title or bean.text, album=bean.album, cover=image)
def get_fobnix_logo(self): return get_foobnix_resourse_path_by_name(ICON_FOOBNIX)