From 04e55476818a48a4245ce4f7443cd4e5c291a9eb Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Fri, 22 Jul 2005 21:51:56 +0000 Subject: [PATCH] autoconnect True for first account, 2nd and up autoconnect to False --- src/common/config.py | 2 +- src/config.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/config.py b/src/common/config.py index 1ce28ee6f..2e3730916 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -128,7 +128,7 @@ class Config: 'password': [ opt_str, '' ], 'resource': [ opt_str, 'gajim' ], 'priority': [ opt_int, 5 ], - 'autoconnect': [ opt_bool, True ], + 'autoconnect': [ opt_bool, False ], 'proxy': [ opt_str, '' ], 'keyid': [ opt_str, '' ], 'keyname': [ opt_str, '' ], diff --git a/src/config.py b/src/config.py index f3a4c23fd..30ec6b62c 100644 --- a/src/config.py +++ b/src/config.py @@ -962,8 +962,11 @@ class AccountModificationWindow: self.xml.get_widget('save_button').grab_focus() else: # we create a new account if len(gajim.connections) == 0: # is it the first accound we're creating? - # the first account *has* to sync - self.xml.get_widget('sync_with_global_status_checkbutton').set_active(True) + # the first account *has* to sync by default + self.xml.get_widget('sync_with_global_status_checkbutton')\ + .set_active(True) + # the first account *has* to autoconnect by default + self.xml.get_widget('autoconnect_checkbutton').set_active(True) self.xml.get_widget('name_entry').set_text('Main') self.xml.get_widget('jid_entry').grab_focus() self.window.show_all() @@ -1062,11 +1065,14 @@ class AccountModificationWindow: self.xml.get_widget('autoconnect_checkbutton').set_active(gajim.config.\ get_per('accounts', self.account, 'autoconnect')) - if len(gajim.connections) != 0: # only if we already have one account already + if len(gajim.connections) != 0: + # only if we already have one account already # we check that so we avoid the first account to have sync=False self.xml.get_widget('sync_with_global_status_checkbutton').set_active( gajim.config.get_per('accounts', self.account, 'sync_with_global_status')) + self.xml.get_widget('autoconnect_checkbutton').set_active( + gajim.config.get_per('accounts', self.account, 'autoconnect')) list_no_log_for = gajim.config.get_per('accounts', self.account, 'no_log_for').split() if self.account in list_no_log_for: