From 3e5c7b184d39ca677a271ba728c70fdc3f240838 Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Fri, 23 Aug 2013 12:23:10 +0400 Subject: [PATCH] Coding standards --- src/groupchat_control.py | 14 ++++++-------- src/gui_menu_builder.py | 4 +--- src/roster_window.py | 6 ++---- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 0e4df9cdd..6381f7caf 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -348,8 +348,8 @@ class GroupchatControl(ChatControlBase): widget.show() if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'): - img = self.xml.get_object('image8') - img.set_from_icon_name('document-open-recent', gtk.ICON_SIZE_MENU) + img = self.xml.get_object('image8') + img.set_from_icon_name('document-open-recent', gtk.ICON_SIZE_MENU) widget = self.xml.get_object('list_treeview') id_ = widget.connect('row_expanded', self.on_list_treeview_row_expanded) self.handlers[id_] = widget @@ -823,13 +823,11 @@ class GroupchatControl(ChatControlBase): request_voice_separator = xml.get_object('request_voice_separator') if gtkgui_helpers.gtk_icon_theme.has_icon('bookmark-new'): - img = gtk.Image() - img.set_from_icon_name('bookmark-new', gtk.ICON_SIZE_MENU) - bookmark_room_menuitem.set_image(img) + gtkgui_helpers.add_image_to_menuitem(bookmark_room_menuitem, + 'bookmark-new') if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'): - img = gtk.Image() - img.set_from_icon_name('document-open-recent', gtk.ICON_SIZE_MENU) - history_menuitem.set_image(img) + gtkgui_helpers.add_image_to_menuitem(history_menuitem, + 'document-open-recent') if hide_buttonbar_items: change_nick_menuitem.hide() diff --git a/src/gui_menu_builder.py b/src/gui_menu_builder.py index d16f73a25..4471c9c6d 100644 --- a/src/gui_menu_builder.py +++ b/src/gui_menu_builder.py @@ -253,9 +253,7 @@ control=None, gc_contact=None, is_anonymous=True): account) history_menuitem.connect('activate', roster.on_history, contact, account) if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'): - img = gtk.Image() - img.set_from_icon_name('document-open-recent', gtk.ICON_SIZE_MENU) - history_menuitem.set_image(img) + gtkgui_helpers.add_image_to_menuitem(history_menuitem, 'bookmark-new') if control: convert_to_gc_menuitem.connect('activate', diff --git a/src/roster_window.py b/src/roster_window.py index 6e0743a22..280f02b55 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -5221,10 +5221,8 @@ class RosterWindow: 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) + gtkgui_helpers.add_image_to_menuitem(history_menuitem, + 'document-open-recent') new_chat_menuitem = self.xml.get_object('new_chat_menuitem') single_message_menuitem = self.xml.get_object( 'send_single_message_menuitem')