[Xfce4-commits] <xfce4-settings:jeromeg/settings-editor> Only allow to edit the property if it's not locked.

Jérôme Guelfucci noreply at xfce.org
Mon Dec 21 00:32:04 CET 2009


Updating branch refs/heads/jeromeg/settings-editor
         to 5deee894b1b1d5316b5b7f9ded5ad46dbde60ee0 (commit)
       from 98e817cb56602e1cdad584c549a6441f14ba502e (commit)

commit 5deee894b1b1d5316b5b7f9ded5ad46dbde60ee0
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Mon Dec 21 00:17:24 2009 +0100

    Only allow to edit the property if it's not locked.

 xfce4-settings-editor/main_window.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xfce4-settings-editor/main_window.c b/xfce4-settings-editor/main_window.c
index 6ed731a..446e9a8 100644
--- a/xfce4-settings-editor/main_window.c
+++ b/xfce4-settings-editor/main_window.c
@@ -60,7 +60,7 @@ load_properties (XfconfChannel *channel, GtkTreeStore *store, GtkTreeView *treev
 static void
 cb_channel_treeview_selection_changed (GtkTreeSelection *selection, gpointer user_data);
 static void
-cb_property_treeview_selection_changed (GtkTreeSelection *selection, gpointer user_data);
+cb_property_treeview_selection_changed (GtkTreeSelection *selection, GtkWidget *edit_button);
 static void
 cb_property_treeview_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data);
 
@@ -148,7 +148,7 @@ xfce4_settings_editor_main_window_new(void)
     g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_channel_treeview_selection_changed), NULL);
 
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (property_treeview));
-    g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_property_treeview_selection_changed), NULL);
+    g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_property_treeview_selection_changed), property_edit_button);
 
 
     /* Connect signal-handlers to toolbar buttons */
@@ -442,7 +442,7 @@ cb_channel_treeview_selection_changed (GtkTreeSelection *selection, gpointer use
 }
 
 static void
-cb_property_treeview_selection_changed (GtkTreeSelection *selection, gpointer user_data)
+cb_property_treeview_selection_changed (GtkTreeSelection *selection, GtkWidget *edit_button)
 {
     GtkTreeModel *model;
     GtkTreeIter iter;
@@ -481,6 +481,10 @@ cb_property_treeview_selection_changed (GtkTreeSelection *selection, gpointer us
     }
 
     current_property = prop_name;
+
+    /* Set the state of the edit button */
+    gtk_widget_set_sensitive (edit_button,
+                              !xfconf_channel_is_property_locked (current_channel, current_property));
 }
 
 static void



More information about the Xfce4-commits mailing list