[gnome-system-tools] Dynamically set UIG and GID ranges for spin buttons
- From: Milan Bouchet-Valat <milanbv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-system-tools] Dynamically set UIG and GID ranges for spin buttons
- Date: Thu, 27 Aug 2009 20:48:57 +0000 (UTC)
commit e67ddba15a7cb227c42246afa655f75c2e1b6903
Author: Milan Bouchet-Valat <nalimilan club fr>
Date: Thu Aug 27 19:40:39 2009 +0200
Dynamically set UIG and GID ranges for spin buttons
Using static GtkAdjustments was not ideal, and hardcoding 65535 as a maximum could lead to problems when the actual limit was lower. We don't take into account the minimum non-system user ID yet. See https://bugs.launchpad.net/ubuntu/+source/system-tools-backends/+bug/303997.
interfaces/users.ui | 2 --
src/users/group-settings.c | 4 ++++
src/users/user-settings.c | 4 ++++
3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/interfaces/users.ui b/interfaces/users.ui
index db2e0e3..07572ff 100644
--- a/interfaces/users.ui
+++ b/interfaces/users.ui
@@ -3,7 +3,6 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment1">
- <property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
@@ -23,7 +22,6 @@
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
- <property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
diff --git a/src/users/group-settings.c b/src/users/group-settings.c
index e3f3af4..02a434b 100644
--- a/src/users/group-settings.c
+++ b/src/users/group-settings.c
@@ -184,6 +184,10 @@ 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
+ GST_USERS_TOOL (tool)->maximum_gid);
+
group_members_table_set_from_group (group);
return dialog;
diff --git a/src/users/user-settings.c b/src/users/user-settings.c
index d9d7f31..6ce975d 100644
--- a/src/users/user-settings.c
+++ b/src/users/user-settings.c
@@ -501,6 +501,10 @@ user_settings_dialog_new (OobsUser *user)
set_entry_text (widget, oobs_user_get_home_directory (user));
}
+ widget = gst_dialog_get_widget (tool->main_dialog, "user_settings_uid");
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0
+ GST_USERS_TOOL (tool)->maximum_uid);
+
return dialog;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]