summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--config/gdm.conf.in1
-rw-r--r--daemon/gdm.h1
-rw-r--r--docs/C/gdm.sgml12
-rw-r--r--gui/gdmconfig-strings.c2
-rw-r--r--gui/gdmconfig.c2
-rw-r--r--gui/gdmconfig.glade31
-rw-r--r--gui/gdmlogin.c24
8 files changed, 73 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index a1267419..f114fc21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Sep 11 02:34:47 2001 George Lebl <jirka@5z.com>
+
+ * daemon/gdm.h, config/gdm.conf.in, gui/gdmconfig.(c|glade),
+ gui/gdmlogin.c, docs/C/gdm.sgml: Apply and finish a patch from
+ Terje Rosten <terjeros@phys.ntnu.no> to add an option to force
+ 24 hour clock on the greeter
+
Tue Sep 11 01:37:42 2001 George Lebl <jirka@5z.com>
* daemon/errorgui.c: use the safe fork function
diff --git a/config/gdm.conf.in b/config/gdm.conf.in
index 0b981935..72cb549c 100644
--- a/config/gdm.conf.in
+++ b/config/gdm.conf.in
@@ -98,6 +98,7 @@ BackgroundProgram=
ShowGnomeChooserSession=true
ShowGnomeFailsafeSession=true
ShowXtermFailsafeSession=true
+Use24Clock=false
[chooser]
DefaultHostImg=@EXPANDED_PIXMAPDIR@/nohost.png
diff --git a/daemon/gdm.h b/daemon/gdm.h
index b87a642b..f16be9ff 100644
--- a/daemon/gdm.h
+++ b/daemon/gdm.h
@@ -215,6 +215,7 @@
#define GDM_KEY_SET_POSITION "greeter/SetPosition=false"
#define GDM_KEY_POSITIONX "greeter/PositionX=0"
#define GDM_KEY_POSITIONY "greeter/PositionY=0"
+#define GDM_KEY_USE_24_CLOCK "greeter/Use24Clock=false"
#define GDM_KEY_SCAN "chooser/ScanTime=3"
#define GDM_KEY_HOST "chooser/DefaultHostImg=" EXPANDED_PIXMAPDIR "/nohost.png"
diff --git a/docs/C/gdm.sgml b/docs/C/gdm.sgml
index 423334da..462dbdeb 100644
--- a/docs/C/gdm.sgml
+++ b/docs/C/gdm.sgml
@@ -1529,6 +1529,18 @@
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term>Use24Clock</term>
+ <listitem>
+ <synopsis>Use24Clock=false</synopsis>
+ <para>
+ Force the use of 24 hour clock even if the locale would default
+ to a 12 hour clock. In some locales that normally use 24 hour
+ format (like cs_CZ) this setting has no effect.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term>Welcome</term>
diff --git a/gui/gdmconfig-strings.c b/gui/gdmconfig-strings.c
index c2d738b8..cb7a5fcb 100644
--- a/gui/gdmconfig-strings.c
+++ b/gui/gdmconfig-strings.c
@@ -77,6 +77,8 @@ gchar *s = N_("sv_SE");
gchar *s = N_("tr_TR");
gchar *s = N_("This is the locale that GDM uses when it cannot find what the system locale is set to. This should be in the standard format such as \"en_US\" for American English or \"cs_CZ\" for Czech");
gchar *s = N_("ca_ES");
+gchar *s = N_("Always use the 24 hour format for the clock in the greeter, even if the norm for the current locale is 12 hour");
+gchar *s = N_("Always use 24 hour clock format");
gchar *s = N_("Position");
gchar *s = N_("Set the initial position of the login window to the values below");
gchar *s = N_("Manually set position");
diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c
index ba80c3f3..8e45521e 100644
--- a/gui/gdmconfig.c
+++ b/gui/gdmconfig.c
@@ -836,6 +836,7 @@ gdm_config_parse_most (gboolean factory)
gdm_spin_set ("position_x", gnome_config_get_int (GDM_KEY_POSITIONX));
gdm_spin_set ("position_y", gnome_config_get_int (GDM_KEY_POSITIONY));
gdm_spin_set ("xinerama_screen", gnome_config_get_int (GDM_KEY_XINERAMASCREEN));
+ gdm_toggle_set("use_24_clock", gnome_config_get_bool (GDM_KEY_USE_24_CLOCK));
gdm_entry_set("exclude_users", gnome_config_get_string (GDM_KEY_EXCLUDE));
/* font picker is in parse_remaining() */
@@ -1444,6 +1445,7 @@ write_config (void)
gdm_spin_write("position_x", GDM_KEY_POSITIONX);
gdm_spin_write("position_y", GDM_KEY_POSITIONY);
gdm_spin_write("xinerama_screen", GDM_KEY_XINERAMASCREEN);
+ gdm_toggle_write("use_24_clock", GDM_KEY_USE_24_CLOCK);
gdm_entry_write("exclude_users", GDM_KEY_EXCLUDE);
gdm_font_write("font_picker", GDM_KEY_FONT);
diff --git a/gui/gdmconfig.glade b/gui/gdmconfig.glade
index 35497fdc..a8892733 100644
--- a/gui/gdmconfig.glade
+++ b/gui/gdmconfig.glade
@@ -888,7 +888,7 @@ This is %n
<class>GtkTable</class>
<name>table47</name>
<border_width>3</border_width>
- <rows>1</rows>
+ <rows>2</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>3</row_spacing>
@@ -993,6 +993,35 @@ tr_TR
<text>ca_ES</text>
</widget>
</widget>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>use_24_clock</name>
+ <tooltip>Always use the 24 hour format for the clock in the greeter, even if the norm for the current locale is 12 hour</tooltip>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>can_apply_now</handler>
+ <last_modification_time>Tue, 21 Mar 2000 21:36:47 GMT</last_modification_time>
+ </signal>
+ <label>Always use 24 hour clock format</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
</widget>
</widget>
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index 70ec022f..76b11e72 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -108,6 +108,7 @@ static gchar *GdmExclude;
static gchar *GdmGlobalFaceDir;
static gchar *GdmDefaultFace;
static gboolean GdmTimedLoginEnable;
+static gboolean GdmUse24Clock;
static gchar *GdmTimedLogin;
static gint GdmTimedLoginDelay;
static gboolean GdmLockPosition;
@@ -830,6 +831,8 @@ gdm_login_parse_config (void)
GdmTimedLogin = NULL;
GdmTimedLoginDelay = 5;
}
+
+ GdmUse24Clock = gnome_config_get_bool (GDM_KEY_USE_24_CLOCK);
gnome_config_pop_prefix();
@@ -2540,12 +2543,21 @@ update_clock (gpointer data)
time (&the_time);
the_tm = localtime (&the_time);
- if (strftime (str, sizeof (str), _("%a %b %d, %I:%M %p"), the_tm) == 0) {
- /* according to docs, if the string does not fit, the
- * contents of str are undefined, thus just use
- * ??? */
- strcpy (str, "???");
- }
+ if (GdmUse24Clock) {
+ if (strftime (str, sizeof (str), _("%a %b %d, %H:%M %p"), the_tm) == 0) {
+ /* according to docs, if the string does not fit, the
+ * contents of str are undefined, thus just use
+ * ??? */
+ strcpy (str, "???");
+ }
+ } else {
+ if (strftime (str, sizeof (str), _("%a %b %d, %I:%M %p"), the_tm) == 0) {
+ /* according to docs, if the string does not fit, the
+ * contents of str are undefined, thus just use
+ * ??? */
+ strcpy (str, "???");
+ }
+ }
str [sizeof(str)-1] = '\0'; /* just for sanity */
gtk_label_set (GTK_LABEL (clock_label), str);