passphrase/password unification looks better now
This commit is contained in:
parent
6d6b9796f0
commit
fb4a62d3cc
|
@ -210,10 +210,10 @@ class infoUser_Window:
|
|||
|
||||
self.xml.signal_autoconnect(self)
|
||||
|
||||
class passphrase_Window:
|
||||
"""Class for Passphrase Window"""
|
||||
class passphrase_dialog:
|
||||
"""Class for passphrase_dialog"""
|
||||
def run(self):
|
||||
"""Wait for Ok button to be pressed and return passphrase"""
|
||||
"""Wait for OK button to be pressed and return passphrase/password"""
|
||||
rep = self.window.run()
|
||||
if rep == gtk.RESPONSE_OK:
|
||||
passphrase = self.passphrase_entry.get_text()
|
||||
|
@ -231,12 +231,12 @@ class passphrase_Window:
|
|||
else:
|
||||
self.window.response(gtk.RESPONSE_OK)
|
||||
|
||||
def on_ok__button_clicked(self, widget):
|
||||
def on_ok_button_clicked(self, widget):
|
||||
if self.autoconnect:
|
||||
self.passphrase = self.passphrase_entry.get_text()
|
||||
gtk.main_quit()
|
||||
|
||||
def on_cancel__button_clicked(self, widget):
|
||||
def on_cancel_button_clicked(self, widget):
|
||||
if self.autoconnect:
|
||||
gtk.main_quit()
|
||||
|
||||
|
@ -252,13 +252,14 @@ class passphrase_Window:
|
|||
if self.autoconnect:
|
||||
gtk.main_quit()
|
||||
|
||||
def __init__(self, text, autoconnect=0):
|
||||
def __init__(self, labeltext, checkbuttontext, autoconnect=0):
|
||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'passphrase_dialog', APP)
|
||||
self.window = self.xml.get_widget('passphrase_dialog')
|
||||
self.passphrase_entry = self.xml.get_widget('passphrase_entry')
|
||||
self.passphrase = -1
|
||||
self.autoconnect = autoconnect
|
||||
self.xml.get_widget('message_label').set_text(text)
|
||||
self.xml.get_widget('message_label').set_text(labeltext)
|
||||
self.xml.get_widget('save_passphrase_checkbutton').set_label(checkbuttontext)
|
||||
self.xml.signal_autoconnect(self)
|
||||
|
||||
class choose_gpg_Window:
|
||||
|
|
|
@ -7803,7 +7803,7 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkLabel" id="message_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="label" translatable="yes">label</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
|
@ -7845,7 +7845,7 @@ Custom</property>
|
|||
<widget class="GtkCheckButton" id="save_passphrase_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Save passphrase</property>
|
||||
<property name="label" translatable="yes">checkbutton</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
|
|
|
@ -1836,7 +1836,8 @@ class roster_window:
|
|||
save_pass = self.plugin.accounts[account]["savepass"]
|
||||
if not save_pass and not self.plugin.connected[account]:
|
||||
passphrase = ''
|
||||
w = passphrase_Window('Enter your password for your account %s' % account, autoconnect)
|
||||
w = passphrase_dialog('Enter your password for account %s' %account,\
|
||||
'Save password', autoconnect)
|
||||
if autoconnect:
|
||||
gtk.main()
|
||||
passphrase, save = w.get_pass()
|
||||
|
@ -1864,7 +1865,8 @@ class roster_window:
|
|||
passphrase = self.plugin.accounts[account]['gpgpassword']
|
||||
else:
|
||||
passphrase = ''
|
||||
w = passphrase_Window('Enter your passphrase for your the GPG key of your account %s' % account, autoconnect)
|
||||
w = passphrase_dialog('Enter GPG key passphrase for account %s'\
|
||||
% account, 'Save passphrase', autoconnect)
|
||||
if autoconnect:
|
||||
gtk.main()
|
||||
passphrase, save = w.get_pass()
|
||||
|
|
Loading…
Reference in New Issue