[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 01/01: plugin: Add "Clipman settings..." menuitem
noreply at xfce.org
noreply at xfce.org
Sun Mar 29 23:09:51 CEST 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 248065e5b39dec3ef2e29365067e10b6793be57f
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sun Mar 29 23:08:50 2020 +0200
plugin: Add "Clipman settings..." menuitem
---
panel-plugin/menu.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/menu.c b/panel-plugin/menu.c
index 9853866..b48d7ee 100644
--- a/panel-plugin/menu.c
+++ b/panel-plugin/menu.c
@@ -279,12 +279,18 @@ cb_clear_history (ClipmanMenu *menu)
}
static void
-cb_launch_clipman_history (ClipmanMenu *menu)
+cb_launch_clipman_bin (ClipmanMenu *menu,
+ gpointer user_data)
{
GError *error = NULL;
GtkWidget *error_dialog;
+ GtkWidget *mi = GTK_WIDGET (user_data);
+
+ if (g_strcmp0 (gtk_menu_item_get_label (GTK_MENU_ITEM (mi)), "_Show full history...") == 0)
+ g_spawn_command_line_async ("xfce4-clipman-history", &error);
+ else
+ g_spawn_command_line_async ("xfce4-clipman-settings", &error);
- g_spawn_command_line_async ("xfce4-clipman-history", &error);
if (error != NULL)
{
error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
@@ -527,7 +533,7 @@ clipman_menu_init (ClipmanMenu *menu)
{
mi = gtk_menu_item_new_with_mnemonic (_("_Show full history..."));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
- g_signal_connect_swapped (mi, "activate", G_CALLBACK (cb_launch_clipman_history), menu);
+ g_signal_connect_swapped (mi, "activate", G_CALLBACK (cb_launch_clipman_bin), mi);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -538,6 +544,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS
gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
g_signal_connect_swapped (mi, "activate", G_CALLBACK (cb_clear_history), menu);
+ mi = gtk_menu_item_new_with_mnemonic (_("_Clipman settings..."));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+ g_signal_connect_swapped (mi, "activate", G_CALLBACK (cb_launch_clipman_bin), mi);
+
/* Show all the items */
gtk_widget_show_all (GTK_WIDGET (menu));
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list