state update fixes

This commit is contained in:
Travis Shirk 2006-01-06 01:48:59 +00:00
parent 893f15aeee
commit 8ab5887301
2 changed files with 16 additions and 23 deletions

View File

@ -568,7 +568,7 @@ class MessageWindowMgr:
for w in self._windows.values(): for w in self._windows.values():
yield w yield w
def controls(self): def controls(self):
for w in self._windows: for w in self._windows.values():
for c in w.controls(): for c in w.controls():
yield c yield c

View File

@ -39,6 +39,7 @@ import disco
import gtkgui_helpers import gtkgui_helpers
import cell_renderer_image import cell_renderer_image
import tooltips import tooltips
import message_control
from common import gajim from common import gajim
from common import helpers from common import helpers
@ -67,6 +68,8 @@ C_SECPIXBUF, # secondary_pixbuf (holds avatar or padlock)
GTKGUI_GLADE = 'gtkgui.glade' GTKGUI_GLADE = 'gtkgui.glade'
DEFAULT_ICONSET = 'dcraven'
class RosterWindow: class RosterWindow:
'''Class for main window of gtkgui interface''' '''Class for main window of gtkgui interface'''
@ -627,14 +630,12 @@ class RosterWindow:
def change_roster_style(self, option): def change_roster_style(self, option):
model = self.tree.get_model() model = self.tree.get_model()
model.foreach(self._change_style, option) model.foreach(self._change_style, option)
for win in gajim.interface.msg_win_mgr.windows():
win.repaint_themed_widgets()
# update gc's roster # update gc's roster
for account in gajim.connections: for ctl in gajim.interface.msg_win_mgr.controls():
gcs = gajim.interface.instances[account]['gc'] if ctl.type_id == message_control.TYPE_GC:
if gcs.has_key('tabbed'): ctl.draw_all_roster()
gcs['tabbed'].draw_all_roster()
else:
for room_jid in gcs:
gcs[room_jid].draw_all_roster()
def draw_roster(self): def draw_roster(self):
'''Clear and draw roster''' '''Clear and draw roster'''
@ -1142,7 +1143,7 @@ class RosterWindow:
# using self.jabber_status_images is poopoo # using self.jabber_status_images is poopoo
iconset = gajim.config.get('iconset') iconset = gajim.config.get('iconset')
if not iconset: if not iconset:
iconset = 'dcraven' iconset = DEFAULT_ICONSET
path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16') path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16')
state_images = self.load_iconset(path) state_images = self.load_iconset(path)
@ -1224,7 +1225,7 @@ class RosterWindow:
menu = gtk.Menu() menu = gtk.Menu()
iconset = gajim.config.get('iconset') iconset = gajim.config.get('iconset')
if not iconset: if not iconset:
iconset = 'dcraven' iconset = DEFAULT_ICONSET
path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16') path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16')
for account in gajim.connections: for account in gajim.connections:
state_images = self.load_iconset(path) 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: if gajim.interface.systray_enabled:
gajim.interface.systray.set_img() gajim.interface.systray.set_img()
for ctl in gajim.interface.msg_win_mgr.controls(): for win in gajim.interface.msg_win_mgr.windows():
ctl.update_state() 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() self.update_status_combobox()
def repaint_themed_widgets(self): def repaint_themed_widgets(self):