summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Daemon/CommLayerServerDBus.cpp13
-rw-r--r--src/Daemon/CommLayerServerDBus.h6
-rw-r--r--src/Daemon/Daemon.cpp11
-rw-r--r--src/Gui/CCDump.py7
-rw-r--r--src/Gui/CCMainWindow.py12
-rw-r--r--src/Gui/CC_gui_functions.py9
-rw-r--r--src/Gui/ccgui.glade212
7 files changed, 256 insertions, 14 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp
index 7fa4fb65..f0a9149b 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -1,12 +1,18 @@
+#include "abrtlib.h"
#include "CommLayerServerDBus.h"
#include <iostream>
#include "ABRTException.h"
+void attach_dbus_dispatcher_to_glib_main_context()
+{
+ DBus::Glib::BusDispatcher* dispatcher;
+ dispatcher = new DBus::Glib::BusDispatcher();
+ dispatcher->attach(NULL);
+ DBus::default_dispatcher = dispatcher;
+}
+
DBus::Connection *CCommLayerServerDBus::init_dbus(CCommLayerServerDBus *self)
{
- self->m_pDispatcher = new DBus::Glib::BusDispatcher();
- self->m_pDispatcher->attach(NULL);
- DBus::default_dispatcher = self->m_pDispatcher;
self->m_pConn = new DBus::Connection(DBus::Connection::SystemBus());
return self->m_pConn;
}
@@ -31,7 +37,6 @@ CCommLayerServerDBus::CCommLayerServerDBus()
CCommLayerServerDBus::~CCommLayerServerDBus()
{
- delete m_pDispatcher;
}
vector_crash_infos_t CCommLayerServerDBus::GetCrashInfos(const std::string &pSender)
diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h
index fe95d5ca..ad245061 100644
--- a/src/Daemon/CommLayerServerDBus.h
+++ b/src/Daemon/CommLayerServerDBus.h
@@ -13,7 +13,6 @@ class CCommLayerServerDBus
{
private:
DBus::Connection *m_pConn;
- DBus::Glib::BusDispatcher *m_pDispatcher;
static DBus::Connection *init_dbus(CCommLayerServerDBus *self);
public:
CCommLayerServerDBus();
@@ -44,3 +43,8 @@ class CCommLayerServerDBus
virtual void Warning(const std::string& pDest, const std::string& pMessage);
};
+/*
+ * This must be done before instances of CCommLayerServerDBus are created
+ * (otherwise "new DBus::Connection(DBus::Connection::SystemBus())" fails)
+ */
+void attach_dbus_dispatcher_to_glib_main_context();
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index 47a963cf..81484d16 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -522,7 +522,6 @@ static gboolean handle_event_cb(GIOChannel *gio, GIOCondition condition, gpointe
int main(int argc, char** argv)
{
- GIOChannel* pGio;
int daemonize = 0;
signal(SIGTERM, handle_fatal_signal);
@@ -565,6 +564,7 @@ int main(int argc, char** argv)
xdup(0);
}
+ GIOChannel* pGio = NULL;
CCrashWatcher watcher;
/* Initialization */
@@ -592,6 +592,7 @@ int main(int argc, char** argv)
FindNewDumps(DEBUG_DUMPS_DIR);
/* (comment here) */
#ifdef ENABLE_DBUS
+ attach_dbus_dispatcher_to_glib_main_context();
g_pCommLayer = new CCommLayerServerDBus();
#elif ENABLE_SOCKET
g_pCommLayer = new CCommLayerServerSocket();
@@ -616,9 +617,11 @@ int main(int argc, char** argv)
catch (...)
{
/* Initialization error. Clean up, in reverse order */
+ error_msg("error while initializing daemon");
unlink(VAR_RUN_PIDFILE);
unlink(VAR_RUN_LOCK_FILE);
- g_io_channel_unref(pGio);
+ if (pGio)
+ g_io_channel_unref(pGio);
delete g_pCommLayer;
/* This restores /proc/sys/kernel/core_pattern, among other things: */
g_pPluginManager->UnLoadPlugins();
@@ -631,8 +634,8 @@ int main(int argc, char** argv)
}
/* Inform parent that initialization failed */
if (daemonize)
- kill(getppid(), SIGINT);
- error_msg_and_die("error while initializing daemon, exiting");
+ kill(getppid(), SIGINT);
+ error_msg_and_die("exiting");
}
/* Inform parent that we initialized ok */
diff --git a/src/Gui/CCDump.py b/src/Gui/CCDump.py
index feb294a4..6993598e 100644
--- a/src/Gui/CCDump.py
+++ b/src/Gui/CCDump.py
@@ -15,6 +15,7 @@ class Dump():
self.Package = None
self.Time = None
self.Description = None
+ self.Message = None
self.Reported = None
def getUUID(self):
@@ -34,6 +35,12 @@ class Dump():
def isReported(self):
return self.Reported[CONTENT] == "1"
+
+ def getMessage(self):
+ if not self.Message:
+ return []
+ #return self.Message[CONTENT].split('\n')
+ return self.Message[CONTENT]
def getTime(self,format):
#print format
diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py
index 7ae31775..e96db2bf 100644
--- a/src/Gui/CCMainWindow.py
+++ b/src/Gui/CCMainWindow.py
@@ -42,7 +42,7 @@ class MainWindow():
self.wTree = gtk.glade.XML(self.gladefile)
#Get the Main Window, and connect the "destroy" event
- self.window = self.wTree.get_widget("main_window2")
+ self.window = self.wTree.get_widget("main_window3")
self.window.set_default_size(700, 480)
if (self.window):
self.window.connect("delete_event", self.delete_event_cb)
@@ -203,6 +203,16 @@ class MainWindow():
# this should work until we keep the row object in the last position
dump = dumpsListStore.get_value(dumpsListStore.get_iter(path[0]), dumpsListStore.get_n_columns()-1)
#move this to Dump class
+ if dump.isReported():
+ report_label = "<b>This crash has been reported, you can find the report(s) at:</b>\n"
+ for message in dump.getMessage().split('\n'):
+ if message:
+ if "http" in message or "file:///" in message:
+ message = "<a href=\"%s\">%s</a>" % (message, message)
+ report_label += "%s\n" % message
+ self.wTree.get_widget("lReported").set_markup(report_label)
+ else:
+ self.wTree.get_widget("lReported").set_markup("<b>Not reported!</b>")
lPackage = self.wTree.get_widget("lPackage")
self.wTree.get_widget("lDescription").set_label(dump.getDescription())
diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py
index 6e44160f..5a1d3541 100644
--- a/src/Gui/CC_gui_functions.py
+++ b/src/Gui/CC_gui_functions.py
@@ -2,7 +2,8 @@
import gtk
import subprocess
import sys
-# url markup is supported from gtk 2.18 so we need to use libsexy
+# url markup is supported from gtk 2.17 so we need to use libsexy
+# FIXME: make a new branch for rawhide with gtk 2.17 and remove this
if gtk.gtk_version[1] < 17:
from sexy import UrlLabel as Label
on_url_clicked_signal = "url-activated"
@@ -51,9 +52,11 @@ def gui_report_dialog ( report_status_dict, parent_dialog,
if report_status_dict[plugin][0] == '0':
status_label.set_markup("<span foreground='red'>%s</span>" % report_status_dict[plugin][1])
elif report_status_dict[plugin][0] == '1':
- if "http" in report_status_dict[plugin][1] or report_status_dict[plugin][1][0] == '/':
+ if "http" in report_status_dict[plugin][1] or "file://" in report_status_dict[plugin][1]:
status_label.set_markup("<a href=\"%s\">%s</a>" % (report_status_dict[plugin][1], report_status_dict[plugin][1]))
- status_label.connect(on_url_clicked_signal, on_url_clicked)
+ # FIXME: make a new branch for rawhide with gtk 2.17 and remove this
+ if gtk.gtk_version[1] < 17:
+ status_label.connect(on_url_clicked_signal, on_url_clicked)
else:
status_label.set_text("%s" % report_status_dict[plugin][1])
status_vbox.pack_start(status_hbox, expand=False)
diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade
index e063ec4d..80655ff5 100644
--- a/src/Gui/ccgui.glade
+++ b/src/Gui/ccgui.glade
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<glade-interface>
- <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-requires gtk+ 2.14 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="main_window2">
<property name="title" translatable="yes">Automatic Bug Reporting Tool</property>
@@ -292,4 +292,214 @@ Zdenek Prikryl &lt;zprikryl@redhat.com&gt;</property>
</widget>
</child>
</widget>
+ <widget class="GtkWindow" id="main_window3">
+ <property name="title" translatable="yes">Automatic Bug Reporting Tool</property>
+ <property name="window_position">center</property>
+ <child>
+ <widget class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkMenuBar" id="menubar2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkMenuItem" id="menuitem5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_File</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="menu4">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImageMenuItem" id="miQuit">
+ <property name="label">gtk-quit</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="edit">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="menu1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImageMenuItem" id="miPreferences">
+ <property name="label">gtk-preferences</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="menuitem8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="menu6">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImageMenuItem" id="miAbout">
+ <property name="label">gtk-about</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolbar" id="toolbar1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkToolButton" id="bDelete">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="label" translatable="yes">Delete</property>
+ <property name="stock_id">gtk-delete</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="bReport">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="label" translatable="yes">Report</property>
+ <property name="stock_id">gtk-save</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton1">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkScrolledWindow" id="swDumps">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkTreeView" id="tvDumps">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEventBox" id="evDescription">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="Description">
+ <property name="visible">True</property>
+ <property name="xalign">0.05000000074505806</property>
+ <property name="label" translatable="yes">&lt;span color="white"&gt;Description&lt;/span&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="resize_mode">queue</property>
+ <child>
+ <widget class="GtkLabel" id="lDescription">
+ <property name="visible">True</property>
+ <property name="xalign">0.10000000149011612</property>
+ <property name="yalign">0.20000000298023224</property>
+ <property name="selectable">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="lReported">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Not reported!&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ <property name="justify">fill</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkStatusbar" id="statusbar1">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>