diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-02-02 14:17:15 +0100 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-02-02 14:17:15 +0100 |
| commit | 9eb8eb3c8a1b291da7359a9fc1f1c749272a1f28 (patch) | |
| tree | 6ec5b46400b7bf5b69af41dd26484f51b02ef9c4 /src/Applet/Applet.cpp | |
| download | abrt-9eb8eb3c8a1b291da7359a9fc1f1c749272a1f28.tar.gz abrt-9eb8eb3c8a1b291da7359a9fc1f1c749272a1f28.tar.xz abrt-9eb8eb3c8a1b291da7359a9fc1f1c749272a1f28.zip | |
Initial git commit
Diffstat (limited to 'src/Applet/Applet.cpp')
| -rw-r--r-- | src/Applet/Applet.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp new file mode 100644 index 0000000..39b0cc4 --- /dev/null +++ b/src/Applet/Applet.cpp @@ -0,0 +1,40 @@ +#include "CCApplet.h" +#include "DBusManager.h" +#include <iostream> + +//@@global applet object +CApplet *applet; +static void +crash_notify_cb(DBusGProxy *proxy, char* progname, gpointer user_data) +{ + DBusError error; + dbus_error_init (&error); +#ifdef DEBUG + std::cerr << "Application " << progname << " has crashed!" << std::endl; +#endif + /* smth happend, show the blinking icon */ + applet->BlinkIcon(true); + applet->ShowIcon(); +} + +int main(int argc, char **argv) +{ + Gtk::Main kit(argc, argv); + applet = new CApplet(); + CDBusManager dm; + /* connect to the daemon */ + try + { + dm.ConnectToDaemon(); + } + catch(std::string err) + { + std::cerr << "Applet: " << err << std::endl; + return -1; + } + /* catch the CC crash notify on the dbus */ + dm.RegisterToMessage("Crash",G_CALLBACK(crash_notify_cb),NULL,NULL); + /* run the main loop and wait for some events */ + Gtk::Main::run(); + return 0; +} |
