From 113a96ef1f5e9a0bad7ce47abfbbb87ffd178932 Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Sun, 17 Mar 2013 23:14:34 +0400 Subject: [PATCH] Change history icon if theme have 'document-open-recent' icon. part 2 --- src/groupchat_control.py | 4 ++++ src/roster_window.py | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 5d964d327..9db25d2c0 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -2423,6 +2423,10 @@ class GroupchatControl(ChatControlBase): self.handlers[id_] = item item = xml.get_object('history_menuitem') + if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'): + img = Gtk.Image() + img.set_from_icon_name('document-open-recent', Gtk.IconSize.MENU) + item.set_image(img) id_ = item.connect('activate', self.on_history, nick) self.handlers[id_] = item diff --git a/src/roster_window.py b/src/roster_window.py index db71b9b21..b15631ded 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -6239,6 +6239,9 @@ class RosterWindow: history_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(_('_History')) history_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_FILL, \ Gtk.IconSize.MENU) + if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'): + history_icon = Gtk.Image() + history_icon.set_from_icon_name('document-open-recent', Gtk.IconSize.MENU) history_menuitem.set_image(history_icon) history_menuitem .connect('activate', self.on_history, contact, account) menu.append(history_menuitem) @@ -6594,6 +6597,13 @@ class RosterWindow: self.xml.get_object('show_roster_menuitem').set_active(True) + if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'): + history_icon = Gtk.Image() + history_icon.set_from_icon_name('document-open-recent', + Gtk.IconSize.MENU) + history_menuitem = self.xml.get_object('history_menuitem') + history_menuitem.set_image(history_icon) + # columns col = Gtk.TreeViewColumn() # list of renderers with attributes / properties in the form: