[gnome-color-manager] If the profile viewer was set modal over the preferences dialog, then don't show a link back to the



commit 59fb92ee44ea4bdc2e15b192ecc4ccb019c27582
Author: Richard Hughes <richard hughsie com>
Date:   Sat Oct 16 09:32:56 2010 +0100

    If the profile viewer was set modal over the preferences dialog, then don't show a link back to the control center

 src/gcm-viewer.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index 0ab319d..8a0980f 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -490,6 +490,10 @@ gcm_window_set_parent_xid (GtkWindow *window, guint32 xid)
 
 	display = gdk_display_get_default ();
 	parent_window = gdk_window_foreign_new_for_display (display, xid);
+	if (parent_window == NULL) {
+		egg_warning ("failed to get parent window");
+		return;
+	}
 	our_window = gtk_widget_get_window (GTK_WIDGET (window));
 	if (our_window == NULL) {
 		egg_warning ("failed to get our window");
@@ -1229,6 +1233,10 @@ main (int argc, char **argv)
 	if (xid != 0) {
 		egg_debug ("Setting xid %i", xid);
 		gcm_window_set_parent_xid (GTK_WINDOW (main_window), xid);
+
+		/* hide the preferences button */
+		widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "button_preferences"));
+		gtk_widget_hide (widget);
 	}
 
 	/* refresh UI */



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