Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2007-11-30 18:18:26 +0300
committerYann Leboulanger <asterix@lagaule.org>2007-11-30 18:18:26 +0300
commit75ee2169d7525be17c15c3e1b3249349a69eed38 (patch)
tree1ae391584d3174fb8990b7b5fbba7901ed3e6f75
parentca796ae62f0310f8ff840ea25b7fe3e4c5c4d936 (diff)
fix the ability to choose GPG key before we connect
remove useless config option usegpg
-rw-r--r--src/common/config.py1
-rw-r--r--src/common/connection.py8
-rw-r--r--src/common/zeroconf/connection_zeroconf.py7
-rw-r--r--src/config.py6
4 files changed, 8 insertions, 14 deletions
diff --git a/src/common/config.py b/src/common/config.py
index 441d43b99..3c403f460 100644
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -157,7 +157,6 @@ class Config:
'lastfm_username': [ opt_str, '', _('The username used to identify the Last.fm account.')],
'notify_on_new_gmail_email': [ opt_bool, True ],
'notify_on_new_gmail_email_extra': [ opt_bool, False ],
- 'usegpg': [ opt_bool, False, '', True ],
'use_gpg_agent': [ opt_bool, False ],
'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')],
'restore_lines': [opt_int, 4, _('How many lines to remember from previous conversation when a chat tab/window is reopened.')],
diff --git a/src/common/connection.py b/src/common/connection.py
index d56814364..55d6d6627 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -107,6 +107,8 @@ class Connection(ConnectionHandlers):
self.last_connection = None # last ClientCommon instance
self.is_zeroconf = False
self.gpg = None
+ if USE_GPG:
+ self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
self.status = ''
self.priority = gajim.get_priority(name, 'offline')
self.old_show = ''
@@ -767,9 +769,6 @@ class Connection(ConnectionHandlers):
})
if USE_GPG and not self.gpg:
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
- gajim.config.set('usegpg', True)
- else:
- gajim.config.set('usegpg', False)
self.connect_and_init(show, msg, sign_msg)
elif show == 'offline':
@@ -1036,9 +1035,6 @@ class Connection(ConnectionHandlers):
return
if USE_GPG:
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
- gajim.config.set('usegpg', True)
- else:
- gajim.config.set('usegpg', False)
gajim.connections[self.name] = self
self.dispatch('ACC_OK', (self.new_account_info))
self.new_account_info = None
diff --git a/src/common/zeroconf/connection_zeroconf.py b/src/common/zeroconf/connection_zeroconf.py
index 235bada1a..36f56a347 100644
--- a/src/common/zeroconf/connection_zeroconf.py
+++ b/src/common/zeroconf/connection_zeroconf.py
@@ -62,6 +62,8 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
self.connected = 0 # offline
self.connection = None
self.gpg = None
+ if USE_GPG:
+ self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
self.is_zeroconf = True
self.privacy_rules_supported = False
self.blocked_contacts = []
@@ -87,10 +89,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
# Do we continue connection when we get roster (send presence,get vcard...)
self.continue_connect_info = None
if USE_GPG:
- self.gpg = GnuPG.GnuPG()
- gajim.config.set('usegpg', True)
- else:
- gajim.config.set('usegpg', False)
+ self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
self.get_config_values_or_default()
diff --git a/src/config.py b/src/config.py
index 20540364e..20f09dd16 100644
--- a/src/config.py
+++ b/src/config.py
@@ -1514,7 +1514,7 @@ class AccountsWindow:
# Personal tab
gpg_key_label = self.xml.get_widget('gpg_key_label2')
- if gajim.config.get('usegpg'):
+ if rajim.connections[gajim.ZEROCONF_ACC_NAME].gpg:
self.xml.get_widget('gpg_choose_button2').set_sensitive(True)
self.init_account_gpg()
else:
@@ -1542,7 +1542,7 @@ class AccountsWindow:
use_gpg_agent_checkbutton = self.xml.get_widget(
'use_gpg_agent_checkbutton' + widget_name_add)
- if not keyid or not gajim.config.get('usegpg'):
+ if not keyid or not gajim.connections[account].gpg:
use_gpg_agent_checkbutton.set_sensitive(False)
gpg_key_label.set_text(_('No key selected'))
gpg_name_label.set_text('')
@@ -1605,7 +1605,7 @@ class AccountsWindow:
# Personal tab
gpg_key_label = self.xml.get_widget('gpg_key_label1')
- if gajim.config.get('usegpg'):
+ if gajim.connections[account].gpg:
self.xml.get_widget('gpg_choose_button1').set_sensitive(True)
self.init_account_gpg()
else: