error / not_in_roster / requested / message icons are no more taken in transporticonset, but in jabber iconset. Fixes #1250
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 705 B |
Before Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 946 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 971 B |
Before Width: | Height: | Size: 944 B |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 819 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 823 B |
Before Width: | Height: | Size: 869 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 310 B |
Before Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 711 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 735 B |
Before Width: | Height: | Size: 711 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 584 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 830 B |
Before Width: | Height: | Size: 709 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 766 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 866 B |
Before Width: | Height: | Size: 766 B |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2 KiB |
|
@ -803,8 +803,9 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
# Set banner image
|
||||
img_32 = gajim.interface.roster.get_appropriate_state_images(jid,
|
||||
size = '32')
|
||||
img_16 = gajim.interface.roster.get_appropriate_state_images(jid)
|
||||
size = '32', icon_name = show)
|
||||
img_16 = gajim.interface.roster.get_appropriate_state_images(jid,
|
||||
icon_name = show)
|
||||
if img_32.has_key(show) and img_32[show].get_pixbuf():
|
||||
# we have 32x32! use it!
|
||||
banner_image = img_32[show]
|
||||
|
@ -1088,10 +1089,11 @@ class ChatControl(ChatControlBase):
|
|||
def get_tab_image(self):
|
||||
num_unread = self.nb_unread
|
||||
# Set tab image (always 16x16); unread messages show the 'message' image
|
||||
img_16 = gajim.interface.roster.get_appropriate_state_images(self.contact.jid)
|
||||
tab_img = None
|
||||
|
||||
if num_unread and gajim.config.get('show_unread_tab_icon'):
|
||||
img_16 = gajim.interface.roster.get_appropriate_state_images(
|
||||
self.contact.jid, icon_name = 'message')
|
||||
tab_img = img_16['message']
|
||||
else:
|
||||
contact = gajim.contacts.get_contact_with_highest_priority(self.account,
|
||||
|
@ -1099,6 +1101,8 @@ class ChatControl(ChatControlBase):
|
|||
if not contact:
|
||||
# For transient contacts
|
||||
contact = self.contact
|
||||
img_16 = gajim.interface.roster.get_appropriate_state_images(
|
||||
self.contact.jid, icon_name = contact.show)
|
||||
tab_img = img_16[contact.show]
|
||||
|
||||
return tab_img
|
||||
|
|
|
@ -274,7 +274,8 @@ class GroupchatControl(ChatControlBase):
|
|||
|
||||
def get_tab_image(self):
|
||||
# Set tab image (always 16x16); unread messages show the 'message' image
|
||||
img_16 = gajim.interface.roster.get_appropriate_state_images(self.room_jid)
|
||||
img_16 = gajim.interface.roster.get_appropriate_state_images(
|
||||
self.room_jid, icon_name = 'message')
|
||||
|
||||
tab_image = None
|
||||
if self.attention_flag and gajim.config.get('show_unread_tab_icon'):
|
||||
|
@ -337,7 +338,8 @@ class GroupchatControl(ChatControlBase):
|
|||
if no_queue: # We didn't have a queue: we change icons
|
||||
model = self.list_treeview.get_model()
|
||||
state_images =\
|
||||
gajim.interface.roster.get_appropriate_state_images(self.room_jid)
|
||||
gajim.interface.roster.get_appropriate_state_images(
|
||||
self.room_jid, icon_name = 'message')
|
||||
image = state_images['message']
|
||||
model[iter][C_IMG] = image
|
||||
if gajim.interface.systray_enabled:
|
||||
|
|
|
@ -316,11 +316,15 @@ class RosterWindow:
|
|||
if gajim.groups[account].has_key(group):
|
||||
del gajim.groups[account][group]
|
||||
|
||||
def get_appropriate_state_images(self, jid, size = '16'):
|
||||
def get_appropriate_state_images(self, jid, size = '16',
|
||||
icon_name = 'online'):
|
||||
'''check jid and return the appropriate state images dict for
|
||||
the demanded size'''
|
||||
the demanded size. icon_name is taken into account when jis is from
|
||||
transport: transport iconset doesn't contain all icons, so we fall back
|
||||
to jabber one'''
|
||||
transport = gajim.get_transport_name_from_jid(jid)
|
||||
if transport:
|
||||
if transport and icon_name in \
|
||||
self.transports_state_images[size][transport]:
|
||||
return self.transports_state_images[size][transport]
|
||||
return self.jabber_state_images[size]
|
||||
|
||||
|
@ -391,12 +395,13 @@ class RosterWindow:
|
|||
child_iter = model.iter_next(child_iter)
|
||||
if self.tree.row_expanded(path):
|
||||
state_images = self.get_appropriate_state_images(jid,
|
||||
size = 'opened')
|
||||
size = 'opened', icon_name = icon_name)
|
||||
else:
|
||||
state_images = self.get_appropriate_state_images(jid,
|
||||
size = 'closed')
|
||||
size = 'closed', icon_name = icon_name)
|
||||
else:
|
||||
state_images = self.get_appropriate_state_images(jid, size = '16')
|
||||
state_images = self.get_appropriate_state_images(jid,
|
||||
icon_name = icon_name)
|
||||
|
||||
img = state_images[icon_name]
|
||||
|
||||
|
@ -2350,18 +2355,20 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
|||
except RuntimeError:
|
||||
pass
|
||||
|
||||
def load_iconset(self, path, pixbuf2 = None):
|
||||
def load_iconset(self, path, pixbuf2 = None, transport = False):
|
||||
'''load an iconset from the given path, and add pixbuf2 on top left of
|
||||
each static images'''
|
||||
imgs = {}
|
||||
path += '/'
|
||||
list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', 'invisible',
|
||||
'offline', 'error', 'requested', 'message', 'opened', 'closed',
|
||||
'not in roster', 'muc_active', 'muc_inactive')
|
||||
if pixbuf2:
|
||||
if transport:
|
||||
list = ('online', 'chat', 'away', 'xa', 'dnd', 'offline')
|
||||
else:
|
||||
list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd',
|
||||
'invisible','offline', 'error', 'requested', 'message',
|
||||
'not in roster')
|
||||
'invisible', 'offline', 'error', 'requested', 'message', 'opened',
|
||||
'closed', 'not in roster', 'muc_active', 'muc_inactive')
|
||||
if pixbuf2:
|
||||
list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd',
|
||||
'offline', 'error', 'requested', 'message')
|
||||
for state in list:
|
||||
# try to open a pixfile with the correct method
|
||||
state_file = state.replace(' ', '_')
|
||||
|
@ -2408,9 +2415,9 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
|||
continue
|
||||
folder = os.path.join(t_path, transport, '16x16')
|
||||
self.transports_state_images['opened'][transport] = self.load_iconset(
|
||||
folder, pixo)
|
||||
folder, pixo, transport = True)
|
||||
self.transports_state_images['closed'][transport] = self.load_iconset(
|
||||
folder, pixc)
|
||||
folder, pixc, transport = True)
|
||||
|
||||
def reload_jabber_state_images(self):
|
||||
self.make_jabber_state_images()
|
||||
|
@ -2957,10 +2964,10 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
|||
continue
|
||||
folder = os.path.join(path, transport, '32x32')
|
||||
self.transports_state_images['32'][transport] = self.load_iconset(
|
||||
folder)
|
||||
folder, transport = True)
|
||||
folder = os.path.join(path, transport, '16x16')
|
||||
self.transports_state_images['16'][transport] = self.load_iconset(
|
||||
folder)
|
||||
folder, transport = True)
|
||||
|
||||
# uf_show, img, show, sensitive
|
||||
liststore = gtk.ListStore(str, gtk.Image, str, bool)
|
||||
|
|