def __init__(self): img = gtk.Image() img.set_from_pixbuf( icon_factory.load_icon(gtk.STOCK_ZOOM_IN, gtk.ICON_SIZE_SMALL_TOOLBAR)) ToolMenuButton.__init__(self, img, "") self.zoom_level = self._default_zoom group = None menu = gtk.Menu() for name, days in self._zoomlist: group = self._make_menu_item(group, name, days) if days == self.zoom_level: group.set_active(True) menu.append(group) item = gtk.SeparatorMenuItem() menu.append(item) item = gtk.CheckMenuItem(_("Show timeline")) item.connect("activate", lambda w: self.emit("open-timeline")) menu.append(item) menu.show_all() self.set_menu(menu) self.show_all()
def get_icon(self, icon_size): icon = None if self.buddyicon: icon = icon_factory.load_icon(self.buddyicon, icon_size) if icon: icon = icon_factory.make_icon_frame(icon, icon_size, True) if not icon: acct_type = self.get_nice_protocol() if acct_type == "aim" and self.get_name()[:1].isdigit(): # ICQ screennames start with a number acct_type = "icq" icon = icon_factory.load_icon("im-" + acct_type, icon_size) if not icon: icon = icon_factory.load_icon("stock_person", icon_size) return icon
def get_icon(self, icon_size): if self.icon: return icon_factory.load_icon(self.icon, icon_size) if not self.thumbnailer: self.thumbnailer = Thumbnailer(self.get_uri(), self.get_mimetype()) return self.thumbnailer.get_icon(icon_size, self.get_timestamp())
def get_icon(self, icon_size): if self.icon_name: try: found = gnomedesktop.find_icon(icon_theme, self.icon_name, icon_size, 0) return icon_factory.load_icon(found, icon_size) except IOError: print " !!! Unable to load icon_name:", self.icon_name return LauncherItem.get_icon(self, icon_size)
def get_icon(self, icon_size): icon = None if self.buddy_icon: icon = icon_factory.load_icon(self.buddy_icon, icon_size) if icon: icon = icon_factory.make_icon_frame(icon, icon_size, True) if not icon: acct_type = self.get_account().get_nice_protocol() if acct_type == "aim" and self.get_screenname()[:1].isdigit(): # ICQ screennames start with a number acct_type = "icq" icon = icon_factory.load_icon("im-" + acct_type, icon_size) if not icon: icon = icon_factory.load_icon("stock_person", icon_size) try: if not self.get_is_online(): icon = icon_factory.greyscale(icon) except (dbus.DBusException, TypeError): icon = icon_factory.greyscale(icon) return icon
def get_icon(self, icon_size): if self.item: return self.item.get_icon(icon_size) else: ### FIXME: Support appgroups and applications? ### FIXME: Gaim/Pidgin has a tendency to set the group leader icon ### to the latest buddy icon. if self.app_group.get_res_class() == "Gaim": icon = "gaim" elif self.app_group.get_res_class() == "Pidgin": icon = "pidgin" else: icon = self.app_group.get_icon() return icon_factory.load_icon(icon, icon_size)
def _status_changed(self): status_str = pidgin_reader.get_global_status() icon = None if status_str == _("Available"): icon = gtk.STOCK_YES elif status_str == _("Offline"): icon = gtk.STOCK_CANCEL elif status_str == _("Away"): icon = gtk.STOCK_NO elif status_str == _("Invisible"): # FIXME: Need icon for invisible icon = "status-invisible" else: print " !!! Unknown Pidgin status:", status_str if icon: self.get_icon_widget().set_from_pixbuf( icon_factory.load_icon(icon, gtk.ICON_SIZE_BUTTON)) self.set_label(status_str.capitalize())
def get_icon(self, icon_size): icon = self.menu_entry.get_icon() if icon: return icon_factory.load_icon(icon, icon_size) return None
def get_icon(self, icon_size): if self.icon: return icon_factory.load_icon(self.icon, icon_size) return None