more general method to update tags that works for tabbed and not tabbed chat window

This commit is contained in:
Yann Leboulanger 2005-02-11 23:13:19 +00:00
parent cb3d49d732
commit 21f8057fed
2 changed files with 20 additions and 7 deletions

View File

@ -193,13 +193,11 @@ class preference_Window:
self.plugin.config['userfont'] = fontStr self.plugin.config['userfont'] = fontStr
#update opened chat windows #update opened chat windows
for a in self.plugin.accounts.keys(): for a in self.plugin.accounts.keys():
for w in self.plugin.windows[a]['chats'].keys(): if self.plugin.windows[a]['chats'].has_key('tabbed'):
self.plugin.windows[a]['chats'][w].tagIn.\ self.plugin.windows[a]['chats']['tabbed'].update_tags()
set_property("foreground", self.plugin.config['inmsgcolor']) else:
self.plugin.windows[a]['chats'][w].tagOut.\ for jid in self.plugin.windows[a]['chats'].keys():
set_property("foreground", self.plugin.config['outmsgcolor']) self.plugin.windows[a]['chats'][jid].update_tags()
self.plugin.windows[a]['chats'][w].tagStatus.\
set_property("foreground", self.plugin.config['statusmsgcolor'])
#IconStyle #IconStyle
ist = self.combo_iconstyle.entry.get_text() ist = self.combo_iconstyle.entry.get_text()
self.plugin.config['iconstyle'] = ist self.plugin.config['iconstyle'] = ist

View File

@ -235,6 +235,15 @@ class tabbed_chat_Window:
self.print_conversation(_("%s is now %s (%s)") % (user.name, \ self.print_conversation(_("%s is now %s (%s)") % (user.name, \
user.show, user.status), user.jid, 'status') user.show, user.status), user.jid, 'status')
def update_tags(self):
for jid in self.tagIn:
self.tagIn[jid].set_property("foreground", \
self.plugin.config['inmsgcolor'])
self.tagOut[jid].set_property("foreground", \
self.plugin.config['outmsgcolor'])
self.tagStatus[jid].set_property("foreground", \
self.plugin.config['statusmsgcolor'])
def show_title(self): def show_title(self):
unread = 0 unread = 0
for jid in self.nb_unread: for jid in self.nb_unread:
@ -580,6 +589,12 @@ class message_Window:
start = "* " start = "* "
self.window.set_title(start + self.user.name + " (" + self.account + ")") self.window.set_title(start + self.user.name + " (" + self.account + ")")
def update_tags(self):
self.tagIn.set_property("foreground", self.plugin.config['inmsgcolor'])
self.tagOut.set_property("foreground", self.plugin.config['outmsgcolor'])
self.tagStatus.set_property("foreground", \
self.plugin.config['statusmsgcolor'])
def set_image(self, image, jid): def set_image(self, image, jid):
if image.get_storage_type() == gtk.IMAGE_ANIMATION: if image.get_storage_type() == gtk.IMAGE_ANIMATION:
self.img.set_from_animation(image.get_animation()) self.img.set_from_animation(image.get_animation())