diff --git a/src/chat_control.py b/src/chat_control.py index b1dde4ac556adef6c2cfd4693e728049a273e5be..d9690cecf5dfb1b9774ac3af1e2ed0d635494bc8 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -1496,9 +1496,10 @@ class ChatControl(ChatControlBase): self._send_file_button = self.xml.get_object('send_file_button') # add a special img for send file button - path_to_upload_img = gtkgui_helpers.get_icon_path('gajim-upload') - img = gtk.Image() - img.set_from_file(path_to_upload_img) + pixbuf = gtkgui_helpers.get_icon_pixmap('document-send', quiet=True) + if not pixbuf: + pixbuf = gtkgui_helpers.get_icon_pixmap('gajim-upload') + img = gtk.image_new_from_pixbuf(pixbuf) self._send_file_button.set_image(img) id_ = self._send_file_button.connect('clicked', self._on_send_file_menuitem_activate) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 419450bbd0ada192951f3deaf915ebdcb69d6614..50d041d30d69dc029c35bf49b6aabeaf53e2d361 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -171,12 +171,21 @@ class ConversationTextview(gobject.GObject): FOCUS_OUT_LINE_PIXBUF = gtkgui_helpers.get_icon_pixmap( 'gajim-muc_separator') - XEP0184_WARNING_PIXBUF = gtkgui_helpers.get_icon_pixmap( - 'gajim-receipt_missing') - XEP0184_RECEIVED_PIXBUF = gtkgui_helpers.get_icon_pixmap( - 'gajim-receipt_received') + XEP0184_WARNING_PIXBUF = gtkgui_helpers.get_icon_pixmap('gtk-no', + quiet=True) + if not XEP0184_WARNING_PIXBUF: + MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap( + 'gajim-receipt_missing') + XEP0184_RECEIVED_PIXBUF = gtkgui_helpers.get_icon_pixmap('gtk-yes', + quiet=True) + if not XEP0184_RECEIVED_PIXBUF: + MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap( + 'gajim-receipt_received') MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap( - 'gajim-message_corrected') + 'gtk-spell-check', quiet=True) + if not MESSAGE_CORRECTED_PIXBUF: + MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap( + 'gajim-message_corrected') # smooth scroll constants MAX_SCROLL_TIME = 0.4 # seconds diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 6381f7caf717f4b63603e6c0804ac4809265ec9c..69af7ebf50d35be73496f4dba0a015b153143add 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -2540,9 +2540,10 @@ class GroupchatControl(ChatControlBase): item = xml.get_object('send_file_menuitem') # add a special img for send file menuitem - path_to_upload_img = gtkgui_helpers.get_icon_path('gajim-upload') - img = gtk.Image() - img.set_from_file(path_to_upload_img) + pixbuf = gtkgui_helpers.get_icon_pixmap('document-send', quiet=True) + if not pixbuf: + pixbuf = gtkgui_helpers.get_icon_pixmap('gajim-upload') + img = gtk.image_new_from_pixbuf(pixbuf) item.set_image(img) if not c.resource: diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index abb1764031724266b63524bd4d872f69e79b26a8..17b9f34be09d39a0f1a8c74cf6ef67341d577093 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -44,11 +44,12 @@ from common import gajim gtk_icon_theme = gtk.icon_theme_get_default() gtk_icon_theme.append_search_path(gajim.ICONS_DIR) -def get_icon_pixmap(icon_name, size=16): +def get_icon_pixmap(icon_name, size=16, quiet=False): try: return gtk_icon_theme.load_icon(icon_name, size, 0) except gobject.GError, e: - log.error('Unable to load icon %s: %s' % (icon_name, str(e))) + if not quiet: + log.error('Unable to load icon %s: %s' % (icon_name, str(e))) def get_icon_path(icon_name, size=16): try: diff --git a/src/gui_interface.py b/src/gui_interface.py index 1a7658e5ccbed925d00903dede0c26651ed20e17..81e4e400787202d7b2255cb19844c473b45fa68b 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -2629,8 +2629,11 @@ class Interface: else: return gtkgui_helpers.load_activity_icon('unknown').get_pixbuf() elif isinstance(pep_obj, pep.UserLocationPEP): - path = gtkgui_helpers.get_icon_path('gajim-earth') - return gtk.gdk.pixbuf_new_from_file(path) + icon = gtkgui_helpers.get_icon_pixmap('applications-internet', + quiet=True) + if not icon: + icon = gtkgui_helpers.get_icon_pixmap('gajim-earth') + return icon def create_ipython_window(self): try: diff --git a/src/gui_menu_builder.py b/src/gui_menu_builder.py index 9616f431985bb09ffee82bed95e2bd7ca4191b2b..caf2a03f265e791fc11148ea5f8a7c34571f8004 100644 --- a/src/gui_menu_builder.py +++ b/src/gui_menu_builder.py @@ -205,9 +205,10 @@ control=None, gc_contact=None, is_anonymous=True): items_to_hide = [] # add a special img for send file menuitem - path_to_upload_img = gtkgui_helpers.get_icon_path('gajim-upload') - img = gtk.Image() - img.set_from_file(path_to_upload_img) + pixbuf = gtkgui_helpers.get_icon_pixmap('document-send', quiet=True) + if not pixbuf: + pixbuf = gtkgui_helpers.get_icon_pixmap('gajim-upload') + img = gtk.image_new_from_pixbuf(pixbuf) send_file_menuitem.set_image(img) if not our_jid: