[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 01/03: daemon: Show info dialog if already running

noreply at xfce.org noreply at xfce.org
Tue Mar 24 08:44:48 CET 2020


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 panel-plugins/xfce4-clipman-plugin.

commit 6699658bd5118a348aebe264c1171f6862c9b5a1
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Tue Mar 24 08:42:32 2020 +0100

    daemon: Show info dialog if already running
---
 panel-plugin/main-status-icon.c | 1 +
 panel-plugin/plugin.c           | 9 +++++++++
 panel-plugin/plugin.h           | 1 +
 3 files changed, 11 insertions(+)

diff --git a/panel-plugin/main-status-icon.c b/panel-plugin/main-status-icon.c
index 9996d5f..d0dc1e3 100644
--- a/panel-plugin/main-status-icon.c
+++ b/panel-plugin/main-status-icon.c
@@ -73,6 +73,7 @@ main (gint argc,
   if (g_application_get_is_remote (G_APPLICATION (app)))
     {
       g_message ("Primary instance org.xfce.clipman already running");
+      plugin_daemon_show_info_dialog ();
       g_object_unref (app);
       return FALSE;
     }
diff --git a/panel-plugin/plugin.c b/panel-plugin/plugin.c
index c53c2f6..38e84f1 100644
--- a/panel-plugin/plugin.c
+++ b/panel-plugin/plugin.c
@@ -55,6 +55,14 @@ clipboard_manager_ownership_exists (void)
   return XGetSelectionOwner (display, atom);
 }
 
+void
+plugin_daemon_show_info_dialog (void)
+{
+  xfce_dialog_show_info (NULL,
+                         _("Could not start the Clipboard Manager Daemon because it is already running."),
+                         _("The Xfce Clipboard Manager is already running."));
+}
+
 /*
  * Plugin functions
  */
@@ -87,6 +95,7 @@ plugin_register (void)
   if (g_application_get_is_remote (G_APPLICATION (plugin->app)))
     {
       g_message ("Primary instance org.xfce.clipman already running");
+      plugin_daemon_show_info_dialog ();
       g_object_unref (plugin->app);
       return FALSE;
     }
diff --git a/panel-plugin/plugin.h b/panel-plugin/plugin.h
index e66a4ab..a4e4169 100644
--- a/panel-plugin/plugin.h
+++ b/panel-plugin/plugin.h
@@ -63,6 +63,7 @@ struct _MyPlugin
  * Plugin functions
  */
 
+void                    plugin_daemon_show_info_dialog  (void);
 MyPlugin*               plugin_register                 ();
 void                    plugin_load                     (MyPlugin *plugin);
 void                    plugin_save                     (MyPlugin *plugin);

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


More information about the Xfce4-commits mailing list