error / not_in_roster / requested / message icons are no more taken in transporticonset, but in jabber iconset. Fixes #1250

This commit is contained in:
Yann Leboulanger 2006-02-26 15:08:59 +00:00
parent b2cd018b52
commit 6af1c3dbdc
65 changed files with 35 additions and 22 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

View file

@ -803,8 +803,9 @@ class ChatControl(ChatControlBase):
# Set banner image # Set banner image
img_32 = gajim.interface.roster.get_appropriate_state_images(jid, img_32 = gajim.interface.roster.get_appropriate_state_images(jid,
size = '32') size = '32', icon_name = show)
img_16 = gajim.interface.roster.get_appropriate_state_images(jid) 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(): if img_32.has_key(show) and img_32[show].get_pixbuf():
# we have 32x32! use it! # we have 32x32! use it!
banner_image = img_32[show] banner_image = img_32[show]
@ -1088,10 +1089,11 @@ class ChatControl(ChatControlBase):
def get_tab_image(self): def get_tab_image(self):
num_unread = self.nb_unread num_unread = self.nb_unread
# Set tab image (always 16x16); unread messages show the 'message' image # 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 tab_img = None
if num_unread and gajim.config.get('show_unread_tab_icon'): 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'] tab_img = img_16['message']
else: else:
contact = gajim.contacts.get_contact_with_highest_priority(self.account, contact = gajim.contacts.get_contact_with_highest_priority(self.account,
@ -1099,6 +1101,8 @@ class ChatControl(ChatControlBase):
if not contact: if not contact:
# For transient contacts # For transient contacts
contact = self.contact 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] tab_img = img_16[contact.show]
return tab_img return tab_img

View file

@ -274,7 +274,8 @@ class GroupchatControl(ChatControlBase):
def get_tab_image(self): def get_tab_image(self):
# Set tab image (always 16x16); unread messages show the 'message' image # 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 tab_image = None
if self.attention_flag and gajim.config.get('show_unread_tab_icon'): 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 if no_queue: # We didn't have a queue: we change icons
model = self.list_treeview.get_model() model = self.list_treeview.get_model()
state_images =\ 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'] image = state_images['message']
model[iter][C_IMG] = image model[iter][C_IMG] = image
if gajim.interface.systray_enabled: if gajim.interface.systray_enabled:

View file

@ -316,11 +316,15 @@ class RosterWindow:
if gajim.groups[account].has_key(group): if gajim.groups[account].has_key(group):
del gajim.groups[account][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 '''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) 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.transports_state_images[size][transport]
return self.jabber_state_images[size] return self.jabber_state_images[size]
@ -391,12 +395,13 @@ class RosterWindow:
child_iter = model.iter_next(child_iter) child_iter = model.iter_next(child_iter)
if self.tree.row_expanded(path): if self.tree.row_expanded(path):
state_images = self.get_appropriate_state_images(jid, state_images = self.get_appropriate_state_images(jid,
size = 'opened') size = 'opened', icon_name = icon_name)
else: else:
state_images = self.get_appropriate_state_images(jid, state_images = self.get_appropriate_state_images(jid,
size = 'closed') size = 'closed', icon_name = icon_name)
else: 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] img = state_images[icon_name]
@ -2350,18 +2355,20 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
except RuntimeError: except RuntimeError:
pass 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 '''load an iconset from the given path, and add pixbuf2 on top left of
each static images''' each static images'''
imgs = {} imgs = {}
path += '/' path += '/'
list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', 'invisible', if transport:
'offline', 'error', 'requested', 'message', 'opened', 'closed', list = ('online', 'chat', 'away', 'xa', 'dnd', 'offline')
'not in roster', 'muc_active', 'muc_inactive') else:
if pixbuf2:
list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd',
'invisible','offline', 'error', 'requested', 'message', 'invisible', 'offline', 'error', 'requested', 'message', 'opened',
'not in roster') '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: for state in list:
# try to open a pixfile with the correct method # try to open a pixfile with the correct method
state_file = state.replace(' ', '_') state_file = state.replace(' ', '_')
@ -2408,9 +2415,9 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
continue continue
folder = os.path.join(t_path, transport, '16x16') folder = os.path.join(t_path, transport, '16x16')
self.transports_state_images['opened'][transport] = self.load_iconset( self.transports_state_images['opened'][transport] = self.load_iconset(
folder, pixo) folder, pixo, transport = True)
self.transports_state_images['closed'][transport] = self.load_iconset( self.transports_state_images['closed'][transport] = self.load_iconset(
folder, pixc) folder, pixc, transport = True)
def reload_jabber_state_images(self): def reload_jabber_state_images(self):
self.make_jabber_state_images() self.make_jabber_state_images()
@ -2957,10 +2964,10 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
continue continue
folder = os.path.join(path, transport, '32x32') folder = os.path.join(path, transport, '32x32')
self.transports_state_images['32'][transport] = self.load_iconset( self.transports_state_images['32'][transport] = self.load_iconset(
folder) folder, transport = True)
folder = os.path.join(path, transport, '16x16') folder = os.path.join(path, transport, '16x16')
self.transports_state_images['16'][transport] = self.load_iconset( self.transports_state_images['16'][transport] = self.load_iconset(
folder) folder, transport = True)
# uf_show, img, show, sensitive # uf_show, img, show, sensitive
liststore = gtk.ListStore(str, gtk.Image, str, bool) liststore = gtk.ListStore(str, gtk.Image, str, bool)