summaryrefslogtreecommitdiffstats
path: root/src/Applet/CCApplet.cpp
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-04-07 17:59:06 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-04-07 17:59:06 +0200
commitbcfcaa2f737332665a9e4ea54ce6caa1f713afda (patch)
treedb2d9c70a9a7bcfe0718a6fbfa6a677509f336ec /src/Applet/CCApplet.cpp
parent0e96f49ddb33421efcdd55d543439f622e707164 (diff)
downloadabrt-bcfcaa2f737332665a9e4ea54ce6caa1f713afda.tar.gz
abrt-bcfcaa2f737332665a9e4ea54ce6caa1f713afda.tar.xz
abrt-bcfcaa2f737332665a9e4ea54ce6caa1f713afda.zip
Added notification thru libnotify
Diffstat (limited to 'src/Applet/CCApplet.cpp')
-rw-r--r--src/Applet/CCApplet.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp
index 80964887..13c734ea 100644
--- a/src/Applet/CCApplet.cpp
+++ b/src/Applet/CCApplet.cpp
@@ -27,13 +27,17 @@ CApplet::CApplet(DBus::Connection &connection, const char *path, const char *nam
: DBus::ObjectProxy(connection, path, name)
{
m_pStatusIcon = gtk_status_icon_new_from_stock(GTK_STOCK_DIALOG_WARNING);
+ char notify_title[5] = "ABRT";
+ notify_init(notify_title);
+ m_pNotification = notify_notification_new_with_status_icon("Warning!",NULL, NULL,m_pStatusIcon);
+ notify_notification_set_urgency (m_pNotification,NOTIFY_URGENCY_CRITICAL);
+ notify_notification_set_timeout(m_pNotification, 5000);
gtk_status_icon_set_visible(m_pStatusIcon,FALSE);
// LMB click
//TODO add some actions!
g_signal_connect(G_OBJECT(m_pStatusIcon),"activate",GTK_SIGNAL_FUNC(CApplet::OnAppletActivate_CB), this);
g_signal_connect(G_OBJECT(m_pStatusIcon),"popup_menu",GTK_SIGNAL_FUNC(CApplet::OnMenuPopup_cb), this);
SetIconTooltip("Pending events: %i",m_mapEvents.size());
-
}
CApplet::~CApplet()
@@ -79,6 +83,7 @@ void CApplet::SetIconTooltip(const char *format, ...)
va_end (args);
if (n != -1)
{
+ notify_notification_update (m_pNotification, "Warning!",buf, NULL);
gtk_status_icon_set_tooltip(m_pStatusIcon,buf);
}
else
@@ -109,6 +114,7 @@ void CApplet::OnMenuPopup_cb(GtkStatusIcon *status_icon,
void CApplet::ShowIcon()
{
gtk_status_icon_set_visible(m_pStatusIcon,true);
+ notify_notification_show(m_pNotification,NULL);
}
void CApplet::HideIcon()