diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-09-08 12:58:19 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-09-08 12:58:19 +0200 |
commit | e065ed970b01cd4d145466918921d592aeab952c (patch) | |
tree | 0da70f2db3c6bbcb5f51cb303c6348c57b8b55f6 /src | |
parent | cea9d8bb0b407f6675ed063e0fd4152ab2a9e128 (diff) | |
download | abrt-e065ed970b01cd4d145466918921d592aeab952c.tar.gz abrt-e065ed970b01cd4d145466918921d592aeab952c.tar.xz abrt-e065ed970b01cd4d145466918921d592aeab952c.zip |
GUI: added UI for global settings (just preview, not usable!)
Diffstat (limited to 'src')
-rw-r--r-- | src/Gui/ABRTPlugin.py | 3 | ||||
-rw-r--r-- | src/Gui/CCDBusBackend.py | 13 | ||||
-rw-r--r-- | src/Gui/CCMainWindow.py | 10 | ||||
-rw-r--r-- | src/Gui/Makefile.am | 3 | ||||
-rw-r--r-- | src/Gui/PluginList.py | 8 | ||||
-rw-r--r-- | src/Gui/PluginsSettingsDialog.py (renamed from src/Gui/SettingsDialog.py) | 4 | ||||
-rw-r--r-- | src/Gui/ccgui.glade | 7 | ||||
-rw-r--r-- | src/Gui/settings.GtkBuilder | 260 |
8 files changed, 299 insertions, 9 deletions
diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py index da9c9e5..4a94e67 100644 --- a/src/Gui/ABRTPlugin.py +++ b/src/Gui/ABRTPlugin.py @@ -57,4 +57,7 @@ class PluginInfo(): def __str__(self): return self.Name + + def __getitem__(self, item): + return self.__dict__[item] diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py index b0230bd..8e09f6d 100644 --- a/src/Gui/CCDBusBackend.py +++ b/src/Gui/CCDBusBackend.py @@ -171,10 +171,10 @@ class DBusManager(gobject.GObject): print "Started our job: %s" % job_id self.addJob(job_id) - def jobdone_cb(self, dest, job_id): + def jobdone_cb(self, dest, uuid): if self.uniq_name == dest: - print "Our job: %s is done." % job_id - dump = self.cc.GetJobResult(job_id) + print "Our job: %s is done." % uuid + dump = self.cc.GetJobResult(uuid) if dump: self.emit("analyze-complete", dump) else: @@ -219,7 +219,7 @@ class DBusManager(gobject.GObject): #for i in settings.keys(): # print i return settings - + def registerPlugin(self, plugin_name): return self.cc.RegisterPlugin(plugin_name) @@ -229,3 +229,8 @@ class DBusManager(gobject.GObject): def setPluginSettings(self, plugin_name, plugin_settings): return self.cc.SetPluginSettings(plugin_name, plugin_settings) + def getSettings(self): + return self.cc.GetSettings() + + def setSettings(self, settings): + return self.cc.SetSettings(settings) diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index e747256..4fe0775 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -11,6 +11,7 @@ import CCDBusBackend from CC_gui_functions import * from CCDumpList import getDumpList, DumpList from CCReporterDialog import ReporterDialog +from PluginsSettingsDialog import PluginsSettingsDialog from SettingsDialog import SettingsDialog from CCReport import Report import ABRTExceptions @@ -108,6 +109,7 @@ class MainWindow(): self.wTree.get_widget("miQuit").connect("activate", self.on_bQuit_clicked) self.wTree.get_widget("miAbout").connect("activate", self.on_miAbout_clicked) self.wTree.get_widget("miPreferences").connect("activate", self.on_miPreferences_clicked) + self.wTree.get_widget("miSettings").connect("activate", self.on_miSettings_clicked) # connect handlers for daemon signals self.ccdaemon.connect("crash", self.on_data_changed_cb, None) self.ccdaemon.connect("analyze-complete", self.on_analyze_complete_cb, self.pBarWindow) @@ -133,9 +135,15 @@ class MainWindow(): dialog.hide() def on_miPreferences_clicked(self, widget): - dialog = SettingsDialog(self.window,self.ccdaemon) + dialog = PluginsSettingsDialog(self.window,self.ccdaemon) dialog.hydrate() dialog.show() + + def on_miSettings_clicked(self, widget): + dialog = SettingsDialog(self.window, self.ccdaemon) + dialog.hydrate() + dialog.show() + self.ccdaemon.getSettings() def warning_cb(self, daemon, message=None): # try to hide the progressbar, we dont really care if it was visible .. diff --git a/src/Gui/Makefile.am b/src/Gui/Makefile.am index 6435c1f..8fea394 100644 --- a/src/Gui/Makefile.am +++ b/src/Gui/Makefile.am @@ -5,7 +5,8 @@ bin_SCRIPTS = abrt-gui PYTHON_FILES = CCDBusBackend.py CCDumpList.py CCDump.py CC_gui_functions.py \ CCReporterDialog.py CCReport.py abrt_utils.py \ CCMainWindow.py CellRenderers.py ABRTExceptions.py \ - SettingsDialog.py ABRTPlugin.py PluginList.py PluginSettingsUI.py + SettingsDialog.py ABRTPlugin.py PluginList.py PluginSettingsUI.py \ + SettingsDialog.py GLADE_FILES = ccgui.glade report.glade settings.GtkBuilder dialogs.GtkBuilder diff --git a/src/Gui/PluginList.py b/src/Gui/PluginList.py index 591096b..76bdf81 100644 --- a/src/Gui/PluginList.py +++ b/src/Gui/PluginList.py @@ -33,6 +33,14 @@ class PluginInfoList(list): return else: print "db == None!" + + + def getEnabledPlugins(self): + return [x for x in self if x["Enabled"] == 'yes'] + + def getActionPlugins(self): + return [x for x in self if x["Enabled"] == 'yes' and x["Type"] == 'Action'] + __PFList = None diff --git a/src/Gui/SettingsDialog.py b/src/Gui/PluginsSettingsDialog.py index 79dfad7..b56f9d7 100644 --- a/src/Gui/SettingsDialog.py +++ b/src/Gui/PluginsSettingsDialog.py @@ -6,7 +6,7 @@ from PluginSettingsUI import PluginSettingsUI from ABRTPlugin import PluginSettings, PluginInfo from abrt_utils import _ -class SettingsDialog: +class PluginsSettingsDialog: def __init__(self, parent, daemon): #print "Settings dialog init" self.ccdaemon = daemon @@ -17,7 +17,7 @@ class SettingsDialog: self.builder.add_from_file(builderfile) except Exception, e: print e - self.window = self.builder.get_object("wSettings") + self.window = self.builder.get_object("wPluginsSettings") if not self.window: raise Exception(_("Can't load gui description for SettingsDialog!")) #self.window.set_parent(parent) diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index 7b8dd24..67bf6fa 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -148,6 +148,13 @@ Zdenek Prikryl <zprikryl@redhat.com></property> <property name="use_stock">True</property> </widget> </child> + <child> + <widget class="GtkMenuItem" id="miSettings"> + <property name="visible">True</property> + <property name="label" translatable="yes">Global settings</property> + <property name="use_underline">True</property> + </widget> + </child> </widget> </child> </widget> diff --git a/src/Gui/settings.GtkBuilder b/src/Gui/settings.GtkBuilder index 575b77c..676f390 100644 --- a/src/Gui/settings.GtkBuilder +++ b/src/Gui/settings.GtkBuilder @@ -2,7 +2,7 @@ <interface> <requires lib="gtk+" version="2.14"/> <!-- interface-naming-policy project-wide --> - <object class="GtkWindow" id="wSettings"> + <object class="GtkWindow" id="wPluginsSettings"> <property name="title" translatable="yes">Settings</property> <property name="modal">True</property> <property name="default_width">450</property> @@ -214,4 +214,262 @@ </object> </child> </object> + <object class="GtkWindow" id="wGlobalSettings"> + <property name="title" translatable="yes">Global Settings</property> + <property name="modal">True</property> + <property name="default_width">450</property> + <property name="default_height">400</property> + <child> + <object class="GtkVBox" id="gsvbox1"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkNotebook" id="notebook1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkTable" id="stable1"> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">3</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + <child type="tab"> + <object class="GtkLabel" id="pCommon"> + <property name="visible">True</property> + <property name="label" translatable="yes">Common</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="cron_vbox"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkScrolledWindow" id="swCronJobs"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</property> + <child> + <object class="GtkViewport" id="vpCronJobs"> + <property name="visible">True</property> + <property name="resize_mode">queue</property> + <child> + <object class="GtkVBox" id="vbCronJobs"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <placeholder/> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="cron_add_button_hbox"> + <property name="visible">True</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkAlignment" id="add_alignment1"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="add_alignment2"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="bAddCronJob"> + <property name="label" translatable="yes">gtk-add</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="pCron"> + <property name="visible">True</property> + <property name="label" translatable="yes">Cron</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkTable" id="stable3"> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">3</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="pAnacre"> + <property name="visible">True</property> + <property name="label" translatable="yes">Analyzers, Actions, Reporters</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="button_align_hbox"> + <property name="visible">True</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkAlignment" id=" button_alignment"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="shbox1"> + <property name="visible">True</property> + <property name="spacing">14</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkButton" id="bCancelSettings"> + <property name="label" translatable="yes">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="bSaveSettings"> + <property name="label" translatable="yes">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> </interface> |