[Xfce4-commits] [apps/xfce4-notifyd] 15/24: panel-plugin: Add a settings menuitem for xfce4-notifyd-config

noreply at xfce.org noreply at xfce.org
Fri Sep 8 23:27:46 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-notifyd.

commit e262b760382c4aa0150b6aad76530cb5dfcf551a
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Thu Aug 24 08:26:12 2017 +0200

    panel-plugin: Add a settings menuitem for xfce4-notifyd-config
---
 panel-plugin/notification-plugin-log.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/panel-plugin/notification-plugin-log.c b/panel-plugin/notification-plugin-log.c
index 520da60..b9938cb 100644
--- a/panel-plugin/notification-plugin-log.c
+++ b/panel-plugin/notification-plugin-log.c
@@ -40,6 +40,25 @@
 
 
 
+static void
+notification_plugin_settings_activate_cb (GtkMenuItem *menuitem,
+                                          gpointer     user_data)
+{
+  GAppInfo *app_info;
+  GError   *error = NULL;
+
+  app_info = g_app_info_create_from_commandline ("xfce4-notifyd-config", "Notification Settings",
+                                                 G_APP_INFO_CREATE_NONE, NULL);
+  if (!g_app_info_launch (app_info, NULL, NULL, &error)) {
+    if (error != NULL) {
+      g_warning ("xfce4-notifyd-config could not be launched. %s", error->message);
+      g_error_free (error);
+    }
+  }
+}
+
+
+
 GKeyFile *
 xfce_notify_log_get (void)
 {
@@ -206,6 +225,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
   xfconf_g_property_bind (notification_plugin->channel, "/do-not-disturb", G_TYPE_BOOLEAN,
                           G_OBJECT (mi), "active");
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+  gtk_widget_show (mi);
 
   /* Reset the notification status icon since all items are now read */
   if (xfconf_channel_get_bool (notification_plugin->channel, "/do-not-disturb", TRUE))
@@ -216,5 +236,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS
                                   "notification-symbolic", GTK_ICON_SIZE_MENU);
   g_signal_connect (mi, "toggled",
                     G_CALLBACK (dnd_toggled_cb), notification_plugin);
+
+  mi = gtk_menu_item_new_with_mnemonic (_("_Notification settings..."));
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
   gtk_widget_show (mi);
+  g_signal_connect (mi, "activate", G_CALLBACK (notification_plugin_settings_activate_cb),
+                    notification_plugin);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list