From 6b8203916f668c6e19d5dffe51b34f33e6421077 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sat, 12 Mar 2005 15:50:13 +0000 Subject: [PATCH] ticket 86 remains --- plugins/gtkgui/config.py | 17 +++++------------ plugins/gtkgui/dialogs.py | 3 +++ plugins/gtkgui/roster_window.py | 2 ++ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py index 2903ef69e..ffab5a2b7 100644 --- a/plugins/gtkgui/config.py +++ b/plugins/gtkgui/config.py @@ -1002,7 +1002,7 @@ class Account_modification_window: self.xml.get_widget('autoconnect_checkbutton').set_active(\ infos['autoconnect']) #default is checked - self.xml.get_widget('sync_with_global_status_checkbutton').set_active(1) + self.xml.get_widget('sync_with_global_status_checkbutton').set_active(True) if infos.has_key('sync_with_global_status'): self.xml.get_widget('sync_with_global_status_checkbutton').set_active(\ infos['sync_with_global_status']) @@ -1035,12 +1035,8 @@ class Account_modification_window: list_no_log_for.append(name) self.infos['no_log_for'] = ' '.join(list_no_log_for) - sync_with_global_status = 0 - if self.xml.get_widget('sync_with_global_status_checkbutton').\ - get_active(): - sync_with_global_status = 1 - self.plugin.accounts[self.account]['sync_with_global_status'] =\ - sync_with_global_status + self.plugin.accounts[self.account]['sync_with_global_status'] = \ + self.xml.get_widget('sync_with_global_status_checkbutton').get_active() use_proxy = 0 if self.xml.get_widget('use_proxy_checkbutton').get_active(): @@ -1111,7 +1107,7 @@ class Account_modification_window: 'autoconnect': autoconnect, 'use_proxy': use_proxy, 'proxyhost': \ proxyhost, 'proxyport': proxyport, 'keyid': keyID, \ 'keyname': key_name, 'savegpgpass': save_gpg_password, \ - 'gpgpassword': gpg_password, 'sync_with_global_status':\ + 'gpgpassword': gpg_password, 'sync_with_global_status': \ sync_with_global_status, 'no_log_for': self.infos['no_log_for']} self.plugin.send('CONFIG', None, ('accounts', self.plugin.accounts, \ 'GtkGui')) @@ -1372,10 +1368,7 @@ class Accounts_window: self.plugin.windows[account_modification_window].window.present() def on_sync_with_global_status_checkbutton_toggled(self, widget): - if widget.get_active(): - self.plugin.accounts[account]['sync_with_global_status'] = 0 - else: - self.plugin.accounts[account]['sync_with_global_status'] = 1 + self.plugin.accounts[account]['sync_with_global_status'] = widget.get_active() def __init__(self, plugin): self.plugin = plugin diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index 51e6d7ab9..4c8480d4f 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -625,6 +625,7 @@ class New_message_dialog: """When Chat button is clicked""" jid = self.jid_entry.get_text() # use User class, new_chat expects it that way + # is it in the roster? if not self.plugin.roster.contacts[self.account].has_key(jid): user = gtkgui.User(jid, jid, ['not in the roster'], \ 'not in the roster', 'not in the roster', 'none', None, '', 0, '') @@ -632,10 +633,12 @@ class New_message_dialog: self.plugin.roster.add_user_to_roster(user.jid, self.account) else: user = self.plugin.roster.contacts[self.account][jid][0] + 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].window.present() + widget.get_toplevel().destroy() def __init__(self, plugin, account): diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index e0921cee0..2f644515b 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -788,9 +788,11 @@ class roster_window: tabbed_chat_window(user, self.plugin, account) else: self.plugin.windows[account]['chats']['tabbed'].new_user(user) + self.plugin.windows[account]['chats'][user.jid] = \ self.plugin.windows[account]['chats']['tabbed'] self.plugin.windows[account]['chats']['tabbed'].window.present() + else: self.plugin.windows[account]['chats'][user.jid] = \ tabbed_chat_window(user, self.plugin, account)