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

This commit is contained in:
Nikos Kouremenos 2005-05-03 16:39:27 +00:00
parent 68b0672437
commit dd5eaf1ab9
3 changed files with 14 additions and 12 deletions

View File

@ -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()

View File

@ -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):

View File

@ -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(