[Xfce4-commits] <xfce4-settings:master> Set the state of the new property button on channel change.

Jérôme Guelfucci noreply at xfce.org
Tue Jan 19 19:34:16 CET 2010


Updating branch refs/heads/master
         to 97f75185a5e01a2e04fd5125054d36bb7c78055e (commit)
       from 35952f609fb4f84c621f11f8b21211885d9f92f1 (commit)

commit 97f75185a5e01a2e04fd5125054d36bb7c78055e
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Fri Dec 25 00:49:04 2009 +0100

    Set the state of the new property button on channel change.

 xfce4-settings-editor/main_window.c               |    8 ++++++++
 xfce4-settings-editor/xfce4-settings-editor.glade |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xfce4-settings-editor/main_window.c b/xfce4-settings-editor/main_window.c
index fb6c403..afaafbe 100644
--- a/xfce4-settings-editor/main_window.c
+++ b/xfce4-settings-editor/main_window.c
@@ -441,9 +441,12 @@ cb_channel_treeview_selection_changed (GtkTreeSelection *selection, GtkBuilder *
     GtkTreeIter iter;
     XfconfChannel *channel;
     GObject *property_treeview;
+    GObject *property_new_button;
     GtkTreeModel *tree_store = NULL;
     GValue value = {0, };
 
+    property_new_button = gtk_builder_get_object (builder, "property_new_button");
+
     if (current_channel)
     {
         g_object_unref (G_OBJECT(current_channel));
@@ -451,7 +454,12 @@ cb_channel_treeview_selection_changed (GtkTreeSelection *selection, GtkBuilder *
     }
 
     if (! gtk_tree_selection_get_selected (selection, &model, &iter))
+    {
+        gtk_widget_set_sensitive (GTK_WIDGET (property_new_button), FALSE);
         return;
+    }
+
+    gtk_widget_set_sensitive (GTK_WIDGET (property_new_button), TRUE);
 
     property_treeview = gtk_builder_get_object (builder, "property_treeview");
     tree_store = gtk_tree_view_get_model (GTK_TREE_VIEW (property_treeview));
diff --git a/xfce4-settings-editor/xfce4-settings-editor.glade b/xfce4-settings-editor/xfce4-settings-editor.glade
index 91d4d33..5853146 100644
--- a/xfce4-settings-editor/xfce4-settings-editor.glade
+++ b/xfce4-settings-editor/xfce4-settings-editor.glade
@@ -295,6 +295,7 @@
                           <object class="GtkToolButton" id="property_new_button">
                             <property name="visible">True</property>
                             <property name="tooltip_text" translatable="yes">New property</property>
+                            <property name="sensitive">False</property>
                             <property name="stock_id">gtk-new</property>
                           </object>
                           <packing>



More information about the Xfce4-commits mailing list