[gthumb] set the about button insensitive when no extension is selected
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] set the about button insensitive when no extension is selected
- Date: Sun, 26 Jun 2011 21:02:06 +0000 (UTC)
commit 2c32367a624a367c045412a24d20eacf383cd727
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Jun 26 22:40:24 2011 +0200
set the about button insensitive when no extension is selected
data/ui/extensions-preferences.ui | 2 +-
gthumb/dlg-preferences-extensions.c | 25 ++++++++++++++-----------
2 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/data/ui/extensions-preferences.ui b/data/ui/extensions-preferences.ui
index e234712..1bb392d 100644
--- a/data/ui/extensions-preferences.ui
+++ b/data/ui/extensions-preferences.ui
@@ -74,7 +74,6 @@
<property name="height_request">350</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<placeholder/>
@@ -157,6 +156,7 @@
<object class="GtkButton" id="about_button">
<property name="label">gtk-about</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
diff --git a/gthumb/dlg-preferences-extensions.c b/gthumb/dlg-preferences-extensions.c
index 423844e..01124f8 100644
--- a/gthumb/dlg-preferences-extensions.c
+++ b/gthumb/dlg-preferences-extensions.c
@@ -330,22 +330,25 @@ static void
list_view_selection_changed_cb (GtkTreeSelection *treeselection,
gpointer user_data)
{
- BrowserData *data = user_data;
- GtkTreeModel *model;
- GtkTreeIter iter;
- GthExtensionDescription *description;
- GthExtension *extension;
+ BrowserData *data = user_data;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ GthExtension *extension;
+
+ extension = NULL;
model = GTK_TREE_MODEL (data->model_filter);
- if (! gtk_tree_selection_get_selected (treeselection, &model, &iter))
- return;
+ if (gtk_tree_selection_get_selected (treeselection, &model, &iter)) {
+ GthExtensionDescription *description;
- gtk_tree_model_get (model, &iter, EXTENSION_DESCRIPTION_COLUMN, &description, -1);
+ gtk_tree_model_get (model, &iter, EXTENSION_DESCRIPTION_COLUMN, &description, -1);
+ extension = gth_extension_description_get_extension (description);
- extension = gth_extension_description_get_extension (description);
- gtk_widget_set_sensitive (GET_WIDGET ("preferences_button"), (extension != NULL) && gth_extension_is_configurable (extension));
+ g_object_unref (description);
+ }
- g_object_unref (description);
+ gtk_widget_set_sensitive (GET_WIDGET ("about_button"), (extension != NULL));
+ gtk_widget_set_sensitive (GET_WIDGET ("preferences_button"), (extension != NULL) && gth_extension_is_configurable (extension));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]