summaryrefslogtreecommitdiff
path: root/src/capplet/mate-notification-applet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/capplet/mate-notification-applet.c')
-rw-r--r--src/capplet/mate-notification-applet.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/capplet/mate-notification-applet.c b/src/capplet/mate-notification-applet.c
index d6620b7..8d1f6c7 100644
--- a/src/capplet/mate-notification-applet.c
+++ b/src/capplet/mate-notification-applet.c
@@ -345,6 +345,24 @@ toggle_do_not_disturb (MateNotificationApplet *applet)
g_settings_set_boolean (applet->settings, GSETTINGS_KEY_DO_NOT_DISTURB, !current_state);
}
+static gboolean
+notification_applet_activate (MatePanelApplet *applet_widget,
+ const gchar *action,
+ guint32 timestamp,
+ MateNotificationApplet *applet)
+{
+ if (g_strcmp0 (action, "show-history") == 0) {
+ if (applet->history_context) {
+ show_notification_history (applet->history_context);
+ }
+ return TRUE;
+ } else if (g_strcmp0 (action, "toggle-dnd") == 0) {
+ toggle_do_not_disturb (applet);
+ return TRUE;
+ }
+ return FALSE;
+}
+
static void
update_count_badge (MateNotificationApplet *applet)
{
@@ -449,6 +467,10 @@ applet_main (MatePanelApplet *applet_widget)
g_signal_connect (G_OBJECT (applet_widget), "button-press-event",
G_CALLBACK (applet_button_press_cb), applet);
+ /* D-Bus activation handling */
+ g_signal_connect (G_OBJECT (applet_widget), "activate",
+ G_CALLBACK (notification_applet_activate), applet);
+
/* set up context menu */
applet->action_group = gtk_action_group_new ("Notification Status Actions");
#ifdef ENABLE_NLS