diff options
author | Zbigniew Chyla <cyba@gnome.pl> | 2001-08-18 16:38:49 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2001-08-18 16:38:49 +0800 |
commit | a7135aebdabb051dc9e0c7c74676f75f4ca388ed (patch) | |
tree | 9e5e12b8ec951e35f00175cbd0cc79504027611a | |
parent | 7b3fe06340b59ed5e1bec5b9798e3edb586be4e4 (diff) | |
download | gsoc2013-evolution-a7135aebdabb051dc9e0c7c74676f75f4ca388ed.tar gsoc2013-evolution-a7135aebdabb051dc9e0c7c74676f75f4ca388ed.tar.gz gsoc2013-evolution-a7135aebdabb051dc9e0c7c74676f75f4ca388ed.tar.bz2 gsoc2013-evolution-a7135aebdabb051dc9e0c7c74676f75f4ca388ed.tar.lz gsoc2013-evolution-a7135aebdabb051dc9e0c7c74676f75f4ca388ed.tar.xz gsoc2013-evolution-a7135aebdabb051dc9e0c7c74676f75f4ca388ed.tar.zst gsoc2013-evolution-a7135aebdabb051dc9e0c7c74676f75f4ca388ed.zip |
New. (config_read): Use locale's setting as default for
2001-08-18 Zbigniew Chyla <cyba@gnome.pl>
* gui/calendar-config.c (locale_uses_24h_time_format): New.
(config_read): Use locale's setting as default for
/Calendar/Display/Use24HourFormat so that Europeans don't have to
switch to 24-hour format manually.
svn path=/trunk/; revision=12200
-rw-r--r-- | calendar/ChangeLog | 7 | ||||
-rw-r--r-- | calendar/gui/calendar-config.c | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 5153925678..de9ebfa34b 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2001-08-18 Zbigniew Chyla <cyba@gnome.pl> + + * gui/calendar-config.c (locale_uses_24h_time_format): New. + (config_read): Use locale's setting as default for + /Calendar/Display/Use24HourFormat so that Europeans don't have to + switch to 24-hour format manually. + 2001-08-17 Damon Chaplin <damon@ximian.com> * gui/gnome-cal.c (gnome_calendar_new_task): new function to open the diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index b75c267984..fd95a573b0 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -28,6 +28,7 @@ */ #include <config.h> +#include <time.h> #include <libgnome/gnome-defs.h> #include <libgnome/gnome-config.h> #include <libgnomeui/gnome-dialog.h> @@ -86,6 +87,15 @@ calendar_config_init (void) config_read (); } +static gboolean +locale_uses_24h_time_format (void) +{ + char s[16]; + time_t t = 0; + + strftime (s, sizeof s, "%p", gmtime (&t)); + return s[0] == '\0'; +} static void config_read (void) @@ -115,7 +125,7 @@ config_read (void) "/Calendar/Display/WeekStartDay", 1, NULL); config->use_24_hour_format = bonobo_config_get_boolean_with_default ( - db, "/Calendar/Display/Use24HourFormat", FALSE, NULL); + db, "/Calendar/Display/Use24HourFormat", locale_uses_24h_time_format (), NULL); config->week_start_day = bonobo_config_get_long_with_default (db, "/Calendar/Display/WeekStartDay", 1, NULL); |