[Gustavo Carneiro] add GnomeKeyring support. see #2493

This commit is contained in:
Nikos Kouremenos 2006-10-05 23:06:54 +00:00
parent 005224518b
commit ebd6f65460
3 changed files with 7 additions and 5 deletions

View File

@ -30,6 +30,7 @@ import common.xmpp
from common import helpers
from common import gajim
from common import GnuPG
from common import passwords
from connection_handlers import *
USE_GPG = GnuPG.USE_GPG
@ -60,7 +61,7 @@ class Connection(ConnectionHandlers):
self.last_io = gajim.idlequeue.current_time()
self.last_sent = []
self.last_history_line = {}
self.password = gajim.config.get_per('accounts', name, 'password')
self.password = passwords.get_password(name)
self.server_resource = gajim.config.get_per('accounts', name, 'resource')
if gajim.config.get_per('accounts', self.name, 'keep_alives_enabled'):
self.keepalives = gajim.config.get_per('accounts', self.name,'keep_alive_every_foo_secs')

View File

@ -37,6 +37,7 @@ except:
from common import helpers
from common import gajim
from common import connection
from common import passwords
#---------- PreferencesWindow class -------------#
class PreferencesWindow:
@ -1454,9 +1455,9 @@ class AccountModificationWindow:
for opt in config:
gajim.config.set_per('accounts', name, opt, config[opt])
if config['savepass']:
gajim.connections[name].password = config['password']
passwords.save_password(name, config['password'])
else:
gajim.connections[name].password = None
passwords.save_password(name, None)
# refresh accounts window
if gajim.interface.instances.has_key('accounts'):
gajim.interface.instances['accounts'].init_accounts()

View File

@ -35,6 +35,7 @@ import notify
from common import gajim
from common import helpers
from common import passwords
from message_window import MessageWindowMgr
from chat_control import ChatControl
from groupchat_control import GroupchatControl
@ -2206,8 +2207,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
gajim.connections[account].password = passphrase
if save:
gajim.config.set_per('accounts', account, 'savepass', True)
gajim.config.set_per('accounts', account, 'password',
passphrase)
passwords.save_password(account, passphrase)
keyid = None
use_gpg_agent = gajim.config.get('use_gpg_agent')