[gnome-color-manager] trivial: do not allow the user to click profile info with no profile selected



commit f0084103cd6335a235d7b64a57d581fd25d353a5
Author: Richard Hughes <richard hughsie com>
Date:   Tue Mar 29 17:52:40 2011 +0100

    trivial: do not allow the user to click profile info with no profile selected

 src/gcm-prefs.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 4f0f900..453b341 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -844,9 +844,9 @@ gcm_prefs_add_profiles_suitable_for_devices (GcmPrefsPriv *prefs,
 
 		/* add */
 		gcm_prefs_combobox_add_profile (widget,
-						     profile_tmp,
-						     GCM_PREFS_ENTRY_TYPE_PROFILE,
-						     &iter);
+						profile_tmp,
+						GCM_PREFS_ENTRY_TYPE_PROFILE,
+						&iter);
 	}
 
 	/* add a import entry */
@@ -1492,7 +1492,9 @@ gcm_prefs_profile_treeview_clicked_cb (GtkTreeSelection *selection,
 		widget = GTK_WIDGET (gtk_builder_get_object (prefs->builder,
 						     "toolbutton_profile_remove"));
 		gtk_widget_set_sensitive (widget, FALSE);
-
+		widget = GTK_WIDGET (gtk_builder_get_object (prefs->builder,
+						     "toolbutton_profile_view"));
+		gtk_widget_set_sensitive (widget, FALSE);
 		g_debug ("no row selected");
 		return;
 	}
@@ -1522,6 +1524,11 @@ gcm_prefs_profile_treeview_clicked_cb (GtkTreeSelection *selection,
 		gtk_widget_set_tooltip_text (widget, _("Cannot remove automatically added profile"));
 		gtk_widget_set_sensitive (widget, FALSE);
 	}
+
+	/* allow getting profile info */
+	widget = GTK_WIDGET (gtk_builder_get_object (prefs->builder,
+					     "toolbutton_profile_view"));
+	gtk_widget_set_sensitive (widget, TRUE);
 	g_object_unref (profile);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]