Example #1
0
 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
Example #2
0
    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
Example #3
0
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
Example #4
0
 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)
Example #5
0
 def get_fobnix_logo(self):
     return get_foobnix_resourse_path_by_name(ICON_FOOBNIX)