From 4dcfba32b141ca6df3034d838dea03b34e01bfb4 Mon Sep 17 00:00:00 2001
From: Denis Fomin <fominde@gmail.com>
Date: Fri, 23 Aug 2013 11:26:48 +0400
Subject: [PATCH] Change history icon if theme have 'document-open-recent'
 icon. Fixes #6893

---
 src/roster_window.py | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/roster_window.py b/src/roster_window.py
index 536b523497..6e0743a228 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -5219,6 +5219,12 @@ class RosterWindow:
         """
         if not force and not self.actions_menu_needs_rebuild:
             return
+        history_menuitem = self.xml.get_object('history_menuitem')
+        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.ICON_SIZE_MENU)
+            history_menuitem.set_image(history_icon)
         new_chat_menuitem = self.xml.get_object('new_chat_menuitem')
         single_message_menuitem = self.xml.get_object(
                 'send_single_message_menuitem')
@@ -6141,8 +6147,13 @@ class RosterWindow:
         menu.append(item)
 
         history_menuitem = gtk.ImageMenuItem(_('_History'))
-        history_icon = gtk.image_new_from_stock(gtk.STOCK_JUSTIFY_FILL, \
-            gtk.ICON_SIZE_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.ICON_SIZE_MENU)
+        else:
+            history_icon = gtk.image_new_from_stock(gtk.STOCK_JUSTIFY_FILL,
+                gtk.ICON_SIZE_MENU)
         history_menuitem.set_image(history_icon)
         history_menuitem .connect('activate', self.on_history, contact, account)
         menu.append(history_menuitem)
@@ -6219,8 +6230,12 @@ class RosterWindow:
 
         # History manager
         item = gtk.ImageMenuItem(_('History Manager'))
-        icon = gtk.image_new_from_stock(gtk.STOCK_JUSTIFY_FILL,
-            gtk.ICON_SIZE_MENU)
+        if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'):
+            icon = gtk.Image()
+            icon.set_from_icon_name('document-open-recent', gtk.ICON_SIZE_MENU)
+        else:
+            icon = gtk.image_new_from_stock(gtk.STOCK_JUSTIFY_FILL,
+                gtk.ICON_SIZE_MENU)
         item.set_image(icon)
         menu.append(item)
         item.connect('activate', self.on_history_manager_menuitem_activate)
-- 
GitLab