[Xfce4-commits] [panel-plugins/xfce4-genmon-plugin] 01/01: Add support for "genmon" in 'xfce4-panel --plugin-event' (Bug #10734)

noreply at xfce.org noreply at xfce.org
Sun Jun 5 21:07:40 CEST 2016


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

landry pushed a commit to branch master
in repository panel-plugins/xfce4-genmon-plugin.

commit 76bd6d78220ca0c5af7beaa6700a271459d6806b
Author: ToZ <tpaulic at hotmail.com>
Date:   Sun Jun 5 21:05:04 2016 +0200

    Add support for "genmon" in 'xfce4-panel --plugin-event' (Bug #10734)
---
 panel-plugin/main.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index 63def58..e4a32fc 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -773,6 +773,32 @@ static gboolean genmon_set_size (XfcePanelPlugin *plugin, int size, genmon_t *po
 }/* genmon_set_size() */
 
 /**************************************************************/
+// call: xfce4-panel --plugin-event=genmon-X:refresh:bool:true
+//    where genmon-X is the genmon widget id (e.g. genmon-7)
+
+static gboolean genmon_remote_event (XfcePanelPlugin *plugin,
+                                    const gchar *name,
+                                    const GValue *value,
+                                    genmon_t *genmon)
+{
+    g_return_val_if_fail (value == NULL || G_IS_VALUE (value), FALSE);
+    if (strcmp (name, "refresh") == 0)
+        {
+        if (value != NULL
+            && G_VALUE_HOLDS_BOOLEAN (value)
+            && g_value_get_boolean (value))
+            {
+            /* update the display */
+            DisplayCmdOutput (genmon);
+            }
+        return TRUE;
+        }
+
+    return FALSE;
+}/* genmon_remote_event() */
+
+
+/**************************************************************/
 
 static void genmon_construct (XfcePanelPlugin *plugin)
 {
@@ -807,6 +833,8 @@ static void genmon_construct (XfcePanelPlugin *plugin)
     g_signal_connect (plugin, "configure-plugin",
         G_CALLBACK (genmon_create_options), genmon);
 
+    g_signal_connect (plugin, "remote-event", G_CALLBACK (genmon_remote_event), genmon);
+
     g_signal_connect (G_OBJECT (genmon->oMonitor.wButton), "clicked",
         G_CALLBACK (ExecOnClickCmd), genmon);
 }

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


More information about the Xfce4-commits mailing list