From d5bdbc372f3d6708df787d2f4d26bbd2134f2926 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Tue, 29 Sep 2009 10:17:05 +0200 Subject: GUI: send the reporters settings as an argument for Report() - daemon shouldn't read from $HOME dir, as it is unsecure and won't work on NFS mounted homes. --- src/Gui/CCDBusBackend.py | 8 ++++---- src/Gui/CCMainWindow.py | 10 ++++++++-- src/Gui/PluginList.py | 3 +++ 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py index b4fc8467..7b952a64 100644 --- a/src/Gui/CCDBusBackend.py +++ b/src/Gui/CCDBusBackend.py @@ -75,7 +75,7 @@ class DBusManager(gobject.GObject): self.connect_to_daemon() # disconnect callback - def disconnected(*args): + def disconnected(self, *args): print "disconnect" def error_handler_cb(self,error): @@ -88,7 +88,7 @@ class DBusManager(gobject.GObject): # used to silently ingore dbus timeouts pass - def dummy(*args): + def dummy(self, *args): # dummy function for async method call to workaround the timeout pass @@ -194,9 +194,9 @@ class DBusManager(gobject.GObject): except dbus.exceptions.DBusException, e: raise Exception(e) - def Report(self,report): + def Report(self, report, reporters_settings = None): # map < Plguin_name vec > - self.cc.Report(report, reply_handler=self.report_done, error_handler=self.error_handler_cb, timeout=60) + self.cc.Report(report,reporters_settings, reply_handler=self.report_done, error_handler=self.error_handler_cb, timeout=60) def DeleteDebugDump(self,UUID): return self.cc.DeleteDebugDump(UUID) diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 1502c0dd..d10304c8 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -14,6 +14,7 @@ from CCReporterDialog import ReporterDialog from PluginsSettingsDialog import PluginsSettingsDialog from SettingsDialog import SettingsDialog from CCReport import Report +from PluginList import getPluginInfoList import ABRTExceptions from abrt_utils import _ @@ -122,9 +123,11 @@ class MainWindow(): self.ccdaemon.connect("show", self.show_cb) self.ccdaemon.connect("daemon-state-changed", self.on_daemon_state_changed_cb) self.ccdaemon.connect("report-done", self.on_report_done_cb) - + # load data #self.load() + self.pluginlist = getPluginInfoList(self.ccdaemon) + def on_daemon_state_changed_cb(self, widget, state): if state == "up": self.hydrate() @@ -294,7 +297,10 @@ class MainWindow(): self.update_pBar = False self.pBarWindow.show_all() self.timer = gobject.timeout_add (100,self.progress_update_cb) - self.ccdaemon.Report(result) + reporters_settings = {} + for plugin in self.pluginlist.getReporterPlugins(): + reporters_settings[str(plugin)] = plugin.Settings + self.ccdaemon.Report(result, reporters_settings) #self.hydrate() except Exception, e: gui_error_message(_("Reporting failed!\n%s" % e)) diff --git a/src/Gui/PluginList.py b/src/Gui/PluginList.py index 005bffee..431a5f62 100644 --- a/src/Gui/PluginList.py +++ b/src/Gui/PluginList.py @@ -46,6 +46,9 @@ class PluginInfoList(list): def getAnalyzerPlugins(self): return [x for x in self if x["Enabled"] == 'yes' and x["Type"] == 'Analyzer'] + + def getReporterPlugins(self): + return [x for x in self if x["Enabled"] == 'yes' and x["Type"] == 'Reporter'] -- cgit