summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-10-08 16:07:14 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-10-08 16:07:14 +0200
commite6f8f27e67c99cb8daa44cadcf01257d4f269108 (patch)
tree555fbeec2a94230aca86280c31a5bdcf80d10f9a /src
parenta1330d4f0271e5a22f1764302b18bf5e1665a68e (diff)
downloadabrt-e6f8f27e67c99cb8daa44cadcf01257d4f269108.tar.gz
abrt-e6f8f27e67c99cb8daa44cadcf01257d4f269108.tar.xz
abrt-e6f8f27e67c99cb8daa44cadcf01257d4f269108.zip
GUI: added option to show password in plugin settings gui
- if there is an entry with visibility set to False and toggle button called the same name as entry, we make the toggle button to reveal the password in respective entry
Diffstat (limited to 'src')
-rw-r--r--src/Gui/PluginSettingsUI.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Gui/PluginSettingsUI.py b/src/Gui/PluginSettingsUI.py
index ae5b64d..a26f87f 100644
--- a/src/Gui/PluginSettingsUI.py
+++ b/src/Gui/PluginSettingsUI.py
@@ -25,6 +25,13 @@ class PluginSettingsUI(gtk.Dialog):
self.add(no_ui_label)
no_ui_label.show()
+ #connect show_pass buttons if present
+
+
+ def on_show_pass_toggled(self, button, entry=None):
+ if entry:
+ entry.set_visibility(button.get_active())
+
def hydrate(self):
if self.plugin_gui:
if self.pluginfo.Enabled == "yes":
@@ -35,6 +42,13 @@ class PluginSettingsUI(gtk.Dialog):
widget = self.plugin_gui.get_object("conf_%s" % key)
if type(widget) == gtk.Entry:
widget.set_text(value)
+ if widget.get_visibility() == False:
+ # if we find toggle button called the same name as entry and entry has
+ # visibility set to False, connect set_visible to it
+ # coz I guess it's toggle for revealing the password
+ button = self.plugin_gui.get_object("cb_%s" % key)
+ if type(button) == gtk.CheckButton:
+ button.connect("toggled", self.on_show_pass_toggled, widget)
elif type(widget) == gtk.CheckButton:
widget.set_active(value == "yes")
elif type(widget) == gtk.ComboBox: