[Xfce4-commits] <xfce4-settings:jeromeg/settings-editor> Set the state of the new property button on channel change.
Jérôme Guelfucci
noreply at xfce.org
Sat Dec 26 22:32:03 CET 2009
Updating branch refs/heads/jeromeg/settings-editor
to 83226dd0a6bf6a00ea7e597a20288215c0efb838 (commit)
from 0213a9bc9184f1c9f66e8e8ea0bf45d649338b9f (commit)
commit 83226dd0a6bf6a00ea7e597a20288215c0efb838
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