diff options
| author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-08-10 10:21:25 +0200 |
|---|---|---|
| committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-08-10 10:21:56 +0200 |
| commit | 83a6ce9ad4b1828e163dc7172ef603201b748473 (patch) | |
| tree | 9d0580eba6c01cb5964655df42bafab9de91329b /src/Gui/PluginSettingsUI.py | |
| parent | e84ab7783d05eb7b5f1b55ab44e7c23c85e50516 (diff) | |
| download | abrt-83a6ce9ad4b1828e163dc7172ef603201b748473.tar.gz abrt-83a6ce9ad4b1828e163dc7172ef603201b748473.tar.xz abrt-83a6ce9ad4b1828e163dc7172ef603201b748473.zip | |
lower case direcotry(no code changed)
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/Gui/PluginSettingsUI.py')
| -rw-r--r-- | src/Gui/PluginSettingsUI.py | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/src/Gui/PluginSettingsUI.py b/src/Gui/PluginSettingsUI.py deleted file mode 100644 index db4c92de..00000000 --- a/src/Gui/PluginSettingsUI.py +++ /dev/null @@ -1,91 +0,0 @@ -import gtk -from abrt_utils import _, log, log1, log2 - -class PluginSettingsUI(): - def __init__(self, pluginfo, parent=None): - #print "Init PluginSettingsUI" - self.plugin_name = pluginfo.Name - self.Settings = pluginfo.Settings - self.pluginfo = pluginfo - self.plugin_gui = None - - if pluginfo.getGUI(): - self.plugin_gui = gtk.Builder() - self.plugin_gui.add_from_file(pluginfo.getGUI()) - self.dialog = self.plugin_gui.get_object("PluginDialog") - if not self.dialog: - raise Exception(_("Cannot find PluginDialog widget in the UI description!")) - self.dialog.set_title("%s" % pluginfo.getName()) - if parent: - self.dialog.set_transient_for(parent) - else: - # we shouldn't get here, but just to be safe - log1("No UI for plugin %s" % pluginfo) - raise Exception(_("No UI for the plugin <b>%s</b>, this is probably a bug.\n" - "Please report it at " - "<a href=\"https://fedorahosted.org/abrt/newticket\">" - "https://fedorahosted.org/abrt/newticket</a>") % pluginfo) - return - - if parent: - self.dialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT) - self.dialog.set_transient_for(parent) - self.dialog.set_modal(True) - - 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": - if self.Settings: - #print "Hydrating %s" % self.plugin_name - for key, value in self.Settings.iteritems(): - #print "%s:%s" % (key,value) - 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: - print _("Combo box is not implemented") - else: - #print "Plugin %s has no configuration." % self.plugin_name - pass - else: - #print "Plugin %s is disabled." % self.plugin_name - pass - - else: - print _("Nothing to hydrate!") - - def dehydrate(self): - #print "dehydrating %s" % self.pluginfo.getName() - if self.Settings: - for key in self.Settings.keys(): - #print key - #print "%s:%s" % (key,value) - widget = self.plugin_gui.get_object("conf_%s" % key) - if type(widget) == gtk.Entry: - self.Settings[key] = widget.get_text() - elif type(widget) == gtk.CheckButton: - if widget.get_active(): - self.Settings[key] = "yes" - else: - self.Settings[key] = "no" - elif type(widget) == gtk.ComboBox: - print _("Combo box is not implemented") - - def destroy(self): - self.dialog.destroy() - - def run(self): - return self.dialog.run() |
