From 8ab5887301338bb93c4ab81d91d1473c3ccd996f Mon Sep 17 00:00:00 2001 From: Travis Shirk Date: Fri, 6 Jan 2006 01:48:59 +0000 Subject: [PATCH] state update fixes --- src/message_window.py | 2 +- src/roster_window.py | 37 +++++++++++++++---------------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/message_window.py b/src/message_window.py index 4cc6010f7..565b443de 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -568,7 +568,7 @@ class MessageWindowMgr: for w in self._windows.values(): yield w def controls(self): - for w in self._windows: + for w in self._windows.values(): for c in w.controls(): yield c diff --git a/src/roster_window.py b/src/roster_window.py index bd696172b..7c438c3d5 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -39,6 +39,7 @@ import disco import gtkgui_helpers import cell_renderer_image import tooltips +import message_control from common import gajim from common import helpers @@ -67,6 +68,8 @@ C_SECPIXBUF, # secondary_pixbuf (holds avatar or padlock) GTKGUI_GLADE = 'gtkgui.glade' +DEFAULT_ICONSET = 'dcraven' + class RosterWindow: '''Class for main window of gtkgui interface''' @@ -627,15 +630,13 @@ class RosterWindow: def change_roster_style(self, option): model = self.tree.get_model() model.foreach(self._change_style, option) + for win in gajim.interface.msg_win_mgr.windows(): + win.repaint_themed_widgets() # update gc's roster - for account in gajim.connections: - gcs = gajim.interface.instances[account]['gc'] - if gcs.has_key('tabbed'): - gcs['tabbed'].draw_all_roster() - else: - for room_jid in gcs: - gcs[room_jid].draw_all_roster() - + for ctl in gajim.interface.msg_win_mgr.controls(): + if ctl.type_id == message_control.TYPE_GC: + ctl.draw_all_roster() + def draw_roster(self): '''Clear and draw roster''' self.tree.get_model().clear() @@ -1142,7 +1143,7 @@ class RosterWindow: # using self.jabber_status_images is poopoo iconset = gajim.config.get('iconset') if not iconset: - iconset = 'dcraven' + iconset = DEFAULT_ICONSET path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16') state_images = self.load_iconset(path) @@ -1224,7 +1225,7 @@ class RosterWindow: menu = gtk.Menu() iconset = gajim.config.get('iconset') if not iconset: - iconset = 'dcraven' + iconset = DEFAULT_ICONSET path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16') for account in gajim.connections: state_images = self.load_iconset(path) @@ -2222,19 +2223,11 @@ _('If "%s" accepts this request you will know his or her status.') % jid) if gajim.interface.systray_enabled: gajim.interface.systray.set_img() - for ctl in gajim.interface.msg_win_mgr.controls(): - ctl.update_state() + for win in gajim.interface.msg_win_mgr.windows(): + for ctl in gajim.interface.msg_win_mgr.controls(): + ctl.update_state() + win.redraw_tab(ctl.contact) - # FIXME: All of this will go away with the above - for account in gajim.connections: - # FIXME - # Update opened groupchat windows - gcs = gajim.interface.instances[account]['gc'] - if gcs.has_key('tabbed'): - gcs['tabbed'].draw_all_roster() - else: - for room_jid in gcs: - gcs[room_jid].draw_all_roster() self.update_status_combobox() def repaint_themed_widgets(self):