[gnome-system-tools] Use OOBS_MAX_[UG]ID instead of hardcoding a limit for spin buttons
- From: Milan Bouchet-Valat <milanbv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-system-tools] Use OOBS_MAX_[UG]ID instead of hardcoding a limit for spin buttons
- Date: Sat, 5 Dec 2009 18:30:09 +0000 (UTC)
commit 83dac6845f7e9b23332c68857c8a8f3ef5c95aae
Author: Milan Bouchet-Valat <nalimilan club fr>
Date: Sat Dec 5 17:01:52 2009 +0100
Use OOBS_MAX_[UG]ID instead of hardcoding a limit for spin buttons
liboobs now defines these constants so that it fully takes into account both what range the system-tools-backends protocol accepts, and what the system's types can hold. Currently, the maximum possible value will be G_MAXINT32, when the system supports it.
src/users/group-settings.c | 3 ++-
src/users/user-settings.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/users/group-settings.c b/src/users/group-settings.c
index 2dfdb24..335d1df 100644
--- a/src/users/group-settings.c
+++ b/src/users/group-settings.c
@@ -24,6 +24,7 @@
#include <config.h>
#include "gst.h"
#include <glib/gi18n.h>
+#include <oobs/oobs-defines.h>
#include <string.h>
#include <ctype.h>
@@ -135,7 +136,7 @@ group_settings_dialog_new (OobsGroup *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);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0, OOBS_MAX_GID);
if (!name) {
g_object_set_data (G_OBJECT (dialog), "is_new", GINT_TO_POINTER (TRUE));
diff --git a/src/users/user-settings.c b/src/users/user-settings.c
index 33cde21..de4fc81 100644
--- a/src/users/user-settings.c
+++ b/src/users/user-settings.c
@@ -24,6 +24,7 @@
#include <config.h>
#include <glib/gi18n.h>
+#include <oobs/oobs-defines.h>
#include "gst.h"
#include <string.h>
@@ -366,7 +367,7 @@ user_settings_set (OobsUser *user)
/* Set this before setting the UID so that it's not rejected */
widget = gst_dialog_get_widget (tool->main_dialog, "user_settings_uid");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0, G_MAXINT32);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0, OOBS_MAX_UID);
if (!user) {
config = OOBS_USERS_CONFIG (GST_USERS_TOOL (tool)->users_config);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]