From 88a9c7fdaee695f15a9aeaaef177c0318896dc6a Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Tue, 28 Jul 2009 15:22:48 +0200 Subject: Applet: Added detection whether daemon is running --- src/Applet/Applet.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Applet/Applet.cpp') diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index b3ea05b..3ae9b4a 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; } -- cgit