[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 24/28: Make the actions tab more sensitive

noreply at xfce.org noreply at xfce.org
Thu May 19 20:06:26 CEST 2016


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

ochosi pushed a commit to branch master
in repository panel-plugins/xfce4-clipman-plugin.

commit 43ceb7103dbd3b7839c80177b3ab1937b186e327
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed May 18 00:15:37 2016 +0200

    Make the actions tab more sensitive
---
 panel-plugin/xfce4-clipman-settings.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/panel-plugin/xfce4-clipman-settings.c b/panel-plugin/xfce4-clipman-settings.c
index 439f896..60c4597 100644
--- a/panel-plugin/xfce4-clipman-settings.c
+++ b/panel-plugin/xfce4-clipman-settings.c
@@ -42,6 +42,7 @@ static void             cb_show_help                    (GtkButton *button);
 static void             setup_actions_treeview          (GtkTreeView *treeview);
 static void             refresh_actions_treeview        (GtkTreeView *treeview);
 static void             apply_action                    (const gchar *original_action_name);
+static void             cb_enable_actions               (GtkCheckButton *checkbutton);
 static void             cb_actions_selection_changed    (GtkTreeSelection *selection);
 static void             cb_add_action                   (GtkButton *button);
 static void             cb_edit_action                  (GtkButton *button);
@@ -76,6 +77,7 @@ prop_dialog_run (void)
 {
   GtkWidget *action_dialog;
   GtkWidget *combobox;
+  GtkWidget *checkbutton;
 
   builder = gtk_builder_new ();
   gtk_builder_add_from_string (builder, settings_dialog_ui, settings_dialog_ui_length, NULL);
@@ -123,6 +125,8 @@ prop_dialog_run (void)
   xfconf_g_property_bind (xfconf_channel, "/settings/enable-actions", G_TYPE_BOOLEAN,
                           gtk_builder_get_object (builder, "enable-actions"), "active");
 
+  checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "enable-actions"));
+  g_signal_connect (GTK_WIDGET (checkbutton), "toggled", G_CALLBACK (cb_enable_actions), NULL);
   g_signal_connect (gtk_builder_get_object (builder, "button-add-action"), "clicked", G_CALLBACK (cb_add_action), NULL);
   g_signal_connect (gtk_builder_get_object (builder, "button-edit-action"), "clicked", G_CALLBACK (cb_edit_action), NULL);
   g_signal_connect (gtk_builder_get_object (builder, "button-delete-action"), "clicked", G_CALLBACK (cb_delete_action), NULL);
@@ -140,6 +144,7 @@ prop_dialog_run (void)
 
   setup_actions_treeview (GTK_TREE_VIEW (gtk_builder_get_object (builder, "actions")));
   setup_commands_treeview (GTK_TREE_VIEW (gtk_builder_get_object (builder, "commands")));
+  cb_enable_actions (GTK_CHECK_BUTTON (checkbutton));
   setup_test_regex_dialog ();
 
   /* Callbacks for the OK button sensitivity in the edit action dialog */
@@ -385,6 +390,20 @@ apply_action (const gchar *original_action_name)
 }
 
 static void
+cb_enable_actions (GtkCheckButton *checkbutton)
+{
+    gboolean sensitive;
+
+    sensitive = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton));
+
+    gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "actions")), sensitive);
+    gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "button-add-action")), sensitive);
+    gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "button-edit-action")), sensitive);
+    gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "button-delete-action")), sensitive);
+    gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "button-reset-actions")), sensitive);
+}
+
+static void
 cb_actions_selection_changed (GtkTreeSelection *selection)
 {
   GtkTreeModel *model;

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


More information about the Xfce4-commits mailing list