Skip to content
Snippets Groups Projects
Commit 3c2ba42a authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

we can now save password in password_window

parent d8305fb2
No related branches found
No related tags found
No related merge requests found
......@@ -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"""
......
......@@ -8563,6 +8563,25 @@ on the server.</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="save_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Save password ?</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
......
......@@ -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() != \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment