aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorZbigniew Chyla <cyba@gnome.pl>2001-08-18 16:38:49 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-08-18 16:38:49 +0800
commita7135aebdabb051dc9e0c7c74676f75f4ca388ed (patch)
tree9e5e12b8ec951e35f00175cbd0cc79504027611a /calendar/gui
parent7b3fe06340b59ed5e1bec5b9798e3edb586be4e4 (diff)
downloadgsoc2013-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
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-config.c12
1 files changed, 11 insertions, 1 deletions
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);