diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-10-08 16:07:14 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-10-08 16:07:14 +0200 |
| commit | e6f8f27e67c99cb8daa44cadcf01257d4f269108 (patch) | |
| tree | 555fbeec2a94230aca86280c31a5bdcf80d10f9a | |
| parent | a1330d4f0271e5a22f1764302b18bf5e1665a68e (diff) | |
| download | abrt-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
| -rw-r--r-- | lib/Plugins/Bugzilla.GTKBuilder | 22 | ||||
| -rw-r--r-- | src/Gui/PluginSettingsUI.py | 14 |
2 files changed, 35 insertions, 1 deletions
diff --git a/lib/Plugins/Bugzilla.GTKBuilder b/lib/Plugins/Bugzilla.GTKBuilder index 2c2d63c..998dc73 100644 --- a/lib/Plugins/Bugzilla.GTKBuilder +++ b/lib/Plugins/Bugzilla.GTKBuilder @@ -4,6 +4,8 @@ <!-- interface-naming-policy project-wide --> <object class="GtkDialog" id="PluginDialog"> <property name="border_width">5</property> + <property name="modal">True</property> + <property name="window_position">center-on-parent</property> <property name="type_hint">normal</property> <property name="has_separator">False</property> <child internal-child="vbox"> @@ -27,7 +29,7 @@ <child> <object class="GtkTable" id="table1"> <property name="visible">True</property> - <property name="n_rows">3</property> + <property name="n_rows">4</property> <property name="n_columns">2</property> <child> <object class="GtkLabel" id="lBugzillaURL"> @@ -93,6 +95,24 @@ <property name="bottom_attach">3</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="cb_Password"> + <property name="label" translatable="yes">Show password</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + </packing> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">1</property> 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: |
