From dd5eaf1ab9e0188c12ad9b89789fb0993519180a Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Tue, 3 May 2005 16:39:27 +0000 Subject: [PATCH] active_tab --> set_active_tab [I also though of a minute to start adding properties eg. foo.set_active_tab(bar) would be foo.tab = bar. if u like that we can see designing like that in the future --- src/dialogs.py | 9 +++++---- src/roster_window.py | 13 +++++++------ src/systray.py | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index 57ee82f27..61e1d24e3 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -535,7 +535,7 @@ class Join_groupchat_window: self.recently_groupchat = self.recently_groupchat[0:10] gajim.config.set('recently_groupchat', ' '.join(self.recently_groupchat)) self.plugin.roster.new_room(jid, nickname, self.account) - self.plugin.windows[self.account]['gc'][jid].active_tab(jid) + self.plugin.windows[self.account]['gc'][jid].set_active_tab(jid) self.plugin.windows[self.account]['gc'][jid].window.present() gajim.connections[self.account].join_gc(nickname, room, server, password) @@ -590,7 +590,7 @@ class New_message_dialog: if not self.plugin.windows[self.account]['chats'].has_key(jid): self.plugin.roster.new_chat(user, self.account) - self.plugin.windows[self.account]['chats'][jid].active_tab(jid) + self.plugin.windows[self.account]['chats'][jid].set_active_tab(jid) self.plugin.windows[self.account]['chats'][jid].window.present() class Change_password_dialog: @@ -708,6 +708,7 @@ class Popup_notification_window: self.plugin.roster.add_user_to_roster(user.self.jid, self.account) self.plugin.roster.new_chat(user, self.account) - self.plugin.windows[self.account]['chats'][self.jid].active_tab(self.jid) - self.plugin.windows[self.account]['chats'][self.jid].window.present() + chats_window = self.plugin.windows[self.account]['chats'][self.jid] + chats_window.set_active_tab(self.jid) + chats_window.window.present() self.adjust_height_and_move_popup_notification_windows() diff --git a/src/roster_window.py b/src/roster_window.py index 90bde9605..a8a6d2e47 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -406,14 +406,15 @@ class Roster_window: if not self.get_user_iter(user.jid, account): self.add_user_to_roster(user.jid, account) self.draw_contact(user.jid, account) - #Print status in chat window + #print status in chat window and update status image if self.plugin.windows[account]['chats'].has_key(user.jid): - self.plugin.windows[account]['chats'][user.jid].set_state_image(user.jid) + jid = user.jid + self.plugin.windows[account]['chats'][jid].set_state_image(jid) name = user.name if user.resource != '': name += '/' + user.resource - self.plugin.windows[account]['chats'][user.jid].print_conversation( - _('%s is now %s (%s)') % (name, show, status), user.jid, 'status') + self.plugin.windows[account]['chats'][jid].print_conversation( + _('%s is now %s (%s)') % (name, show, status), jid, 'status') def on_info(self, widget, user, account): '''Call vcard_information_window class to display user's information''' @@ -1078,10 +1079,10 @@ class Roster_window: self.tree.expand_row(path, False) else: if self.plugin.windows[account]['chats'].has_key(jid): - self.plugin.windows[account]['chats'][jid].active_tab(jid) + self.plugin.windows[account]['chats'][jid].set_active_tab(jid) elif self.contacts[account].has_key(jid): self.new_chat(self.contacts[account][jid][0], account) - self.plugin.windows[account]['chats'][jid].active_tab(jid) + self.plugin.windows[account]['chats'][jid].set_active_tab(jid) self.plugin.windows[account]['chats'][jid].window.present() def on_roster_treeview_row_expanded(self, widget, iter, path): diff --git a/src/systray.py b/src/systray.py index c893a8f0e..5113c897e 100644 --- a/src/systray.py +++ b/src/systray.py @@ -199,10 +199,10 @@ class Systray: jid = self.jids[0][1] acc = self.plugin.windows[account] if acc['gc'].has_key(jid): - acc['gc'][jid].active_tab(jid) + acc['gc'][jid].set_active_tab(jid) acc['gc'][jid].window.present() elif acc['chats'].has_key(jid): - acc['chats'][jid].active_tab(jid) + acc['chats'][jid].set_active_tab(jid) acc['chats'][jid].window.present() else: self.plugin.roster.new_chat(