[gnome-system-tools] Set GID combo box range before filling it



commit 7336ecc0572ecb12990e24f742740864dc3c8d7d
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Fri Nov 6 16:49:33 2009 +0100

    Set GID combo box range before filling it
    
    Setting the range after the GID caused it the be set to 0 the first time the dialog was run.

 src/users/group-settings.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/users/group-settings.c b/src/users/group-settings.c
index 5d44aad..078d7e5 100644
--- a/src/users/group-settings.c
+++ b/src/users/group-settings.c
@@ -162,6 +162,10 @@ group_settings_dialog_new (OobsGroup *group)
 	dialog = gst_dialog_get_widget (tool->main_dialog, "group_settings_dialog");
 	name = oobs_group_get_name (group);
 
+	/* Set this before setting the GID so that it's not rejected */
+	widget = gst_dialog_get_widget (tool->main_dialog, "group_settings_gid");
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0, G_MAXINT32);
+
 	if (!name) {
 		g_object_set_data (G_OBJECT (dialog), "is_new", GINT_TO_POINTER (TRUE));
 		gtk_window_set_title (GTK_WINDOW (dialog), _("New group"));
@@ -184,9 +188,6 @@ group_settings_dialog_new (OobsGroup *group)
 	gtk_entry_set_text (GTK_ENTRY (widget), (name) ? name : "");
 	gtk_widget_set_sensitive (widget, (name == NULL));
 
-	widget = gst_dialog_get_widget (tool->main_dialog, "group_settings_gid");
-	gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0, G_MAXINT32);
-
 	group_members_table_set_from_group (group);
 
 	return dialog;



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