Replacing some of the icons. Fixes #7445

This commit is contained in:
Denis Fomin 2013-08-28 18:33:27 +04:00
parent 064200f07e
commit 4d0005a9ab
6 changed files with 34 additions and 18 deletions

View File

@ -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)

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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: