diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-07-28 15:22:48 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-07-28 15:22:48 +0200 |
commit | 88a9c7fdaee695f15a9aeaaef177c0318896dc6a (patch) | |
tree | d9866cf66a16b37305349e520fe47698f74deef8 /src/Applet/Applet.cpp | |
parent | 4e7ebc3c2bc770f0aac4f857954755fe8a3d074a (diff) | |
download | abrt-88a9c7fdaee695f15a9aeaaef177c0318896dc6a.tar.gz abrt-88a9c7fdaee695f15a9aeaaef177c0318896dc6a.tar.xz abrt-88a9c7fdaee695f15a9aeaaef177c0318896dc6a.zip |
Applet: Added detection whether daemon is running
Diffstat (limited to 'src/Applet/Applet.cpp')
-rw-r--r-- | src/Applet/Applet.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index b3ea05b9..3ae9b4a8 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -61,12 +61,16 @@ int main(int argc, char **argv) session.request_name("com.redhat.abrt.applet"); } - DBus::Connection conn = DBus::Connection::SystemBus(); - //CDBusClient client(conn, CC_DBUS_PATH, CC_DBUS_NAME); + DBus::Connection conn = DBus::Connection::SystemBus(); applet = new CApplet(conn, CC_DBUS_PATH, CC_DBUS_NAME); applet->ConnectCrashHandler(crash_notify_cb); - gtk_main(); + if(!conn.has_name(CC_DBUS_NAME)) + { + std::cout << "Daemon is not running" << std::endl; + applet->Disable("Daemon is not running"); + } gtk_main(); gdk_threads_leave(); + delete applet; return 0; } |