summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-10-05 11:49:41 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-10-05 11:49:41 +0200
commita56b047e24bbf96879e77f51867b96d515cdbfa6 (patch)
tree771db2b9aee034ad5641a3d3bc380ffa89ea3de2
parent36b35cc468872de5f3e87a1cc9c3851f87523ac8 (diff)
downloadabrt-a56b047e24bbf96879e77f51867b96d515cdbfa6.tar.gz
abrt-a56b047e24bbf96879e77f51867b96d515cdbfa6.tar.xz
abrt-a56b047e24bbf96879e77f51867b96d515cdbfa6.zip
manual merge
-rw-r--r--src/Gui/ABRTPlugin.py34
-rw-r--r--src/Gui/CC_gui_functions.py7
-rw-r--r--src/Gui/SettingsDialog.py4
3 files changed, 37 insertions, 8 deletions
diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py
index c77bd792..181126af 100644
--- a/src/Gui/ABRTPlugin.py
+++ b/src/Gui/ABRTPlugin.py
@@ -11,18 +11,34 @@ Email
Description
"""
from abrt_utils import _
+from ConfBackend import ConfBackendGnomeKeyring
class PluginSettings(dict):
def __init__(self):
+ dict.__init__(self)
#print "Init plugin settings"
- pass
def __init__(self, settings_dict):
+ dict.__init__(self)
for key in settings_dict.keys():
self[key] = settings_dict[key]
-
-"""Class to represent common plugin info"""
+
+ def check(self):
+ if "Password" in self.keys():
+ # password is missing
+ if not self["Password"]:
+ return False
+ # settings are OK
+ return True
+
+ def load(self, name):
+ print "load:", name
+
+ def save(self, name):
+ print "save: ", name
+
class PluginInfo():
+ """Class to represent common plugin info"""
types = {"Analyzer":_("Analyzer plugins"),
"Action":_("Action plugins"),
"Reporter":_("Reporter plugins"),
@@ -41,7 +57,7 @@ class PluginInfo():
self.Type = None
self.Email = None
self.Description = None
- self.Settings = None
+ self.Settings = PluginSettings({})
def getName(self):
return self.Name
@@ -60,4 +76,12 @@ class PluginInfo():
def __getitem__(self, item):
return self.__dict__[item]
-
+
+ def load_settings(self):
+ if self.Name:
+ self.Settings.load(self.Name)
+ else:
+ print "plugin name is not set, can't load it's settings"
+
+ def save_settings(self):
+ self.Settings.save(self.Name)
diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py
index 3665d1b4..2f860087 100644
--- a/src/Gui/CC_gui_functions.py
+++ b/src/Gui/CC_gui_functions.py
@@ -27,11 +27,13 @@ def on_url_clicked(label, url):
def gui_report_dialog ( report_status_dict, parent_dialog,
message_type=gtk.MESSAGE_INFO,
widget=None, page=0, broken_widget=None ):
+ MAX_WIDTH = 50
builder = gtk.Builder()
builderfile = "%s%sdialogs.glade" % (sys.path[0],"/")
builder.add_from_file(builderfile)
dialog = builder.get_object("ReportDialog")
-
+ dialog.set_default_size(200, 50)
+ dialog.set_resizable(False)
main_hbox = builder.get_object("main_hbox")
STATUS = 0
@@ -44,6 +46,7 @@ def gui_report_dialog ( report_status_dict, parent_dialog,
plugin_label.set_markup("<b>%s</b>: " % plugin)
plugin_label.set_justify(gtk.JUSTIFY_RIGHT)
status_label = Label()
+ status_label.set_max_width_chars(MAX_WIDTH)
status_label.set_selectable(True)
status_hbox.pack_start(plugin_label, expand=False)
status_hbox.pack_start(status_label, expand=False)
@@ -58,6 +61,8 @@ def gui_report_dialog ( report_status_dict, parent_dialog,
status_label.connect(on_url_clicked_signal, on_url_clicked)
else:
status_label.set_text("%s" % report_status_dict[plugin][1])
+ if len(report_status_dict[plugin][1]) > MAX_WIDTH:
+ status_label.set_tooltip_text(report_status_dict[plugin][1])
status_vbox.pack_start(status_hbox, expand=False)
main_hbox.pack_start(status_vbox)
diff --git a/src/Gui/SettingsDialog.py b/src/Gui/SettingsDialog.py
index 8c9c666d..4d85cd78 100644
--- a/src/Gui/SettingsDialog.py
+++ b/src/Gui/SettingsDialog.py
@@ -75,8 +75,8 @@ class SettingsDialog:
try:
self.pluginlist = getPluginInfoList(self.ccdaemon, refresh=True)
except Exception, e:
- print e
-
+ print "SettingsDialog: ", e
+
## hydrate cron jobs:
for key,val in self.settings["Cron"].iteritems():
# actionas are separated by ','