diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py
index 70e20cb22..16ffaf040 100644
--- a/plugins/gtkgui/dialogs.py
+++ b/plugins/gtkgui/dialogs.py
@@ -221,8 +221,9 @@ class passphrase_Window:
msg = self.entry.get_text()
else:
msg = -1
+ chk = self.xml.get_widget("save_checkbutton")
self.win.destroy()
- return msg
+ return msg, chk.get_active()
def on_key_pressed(self, widget, event):
if event.keyval == gtk.keysyms.Return:
@@ -242,8 +243,9 @@ class passphrase_Window:
def get_pass(self):
self.autoconnect = 0
+ chk = self.xml.get_widget("save_checkbutton")
self.win.destroy()
- return self.msg
+ return self.msg, chk.get_active()
def delete_event(self, widget=None):
"""close window"""
diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade
index 016d23195..4409f5581 100644
--- a/plugins/gtkgui/gtkgui.glade
+++ b/plugins/gtkgui/gtkgui.glade
@@ -8563,6 +8563,25 @@ on the server.
False
+
+
+
+ True
+ True
+ Save password ?
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
0
diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py
index 136ca96bb..0892de717 100644
--- a/plugins/gtkgui/gtkgui.py
+++ b/plugins/gtkgui/gtkgui.py
@@ -1392,12 +1392,15 @@ class roster_Window:
w = passphrase_Window('Enter your password for your account %s' % account, autoconnect)
if autoconnect:
gtk.main()
- passphrase = w.get_pass()
+ passphrase, save = w.get_pass()
else:
- passphrase = w.run()
+ passphrase, save = w.run()
if passphrase == -1:
return
self.plugin.send('PASSPHRASE', account, passphrase)
+ if save:
+ self.plugin.accounts[account]['savepass'] = 1
+ self.plugin.accounts[account]['password'] = passphrase
keyid = None
save_gpg_pass = 0
@@ -1414,11 +1417,14 @@ class roster_Window:
w = passphrase_Window('Enter your passphrase for your the GPG key of your account %s' % account, autoconnect)
if autoconnect:
gtk.main()
- passphrase = w.get_pass()
+ passphrase, save = w.get_pass()
else:
- passphrase = w.run()
+ passphrase, save = w.run()
if passphrase == -1:
passphrase = ''
+ if save:
+ self.plugin.accounts[account]['savegpgpass'] = 1
+ self.plugin.accounts[account]['gpgpassword'] = passphrase
self.plugin.send('GPGPASSPHRASE', account, passphrase)
self.plugin.send('STATUS', account, (status, txt))
if status == 'online' and self.plugin.sleeper.getState() != \