diff options
author | Not Zed <NotZed@Ximian.com> | 2002-08-07 10:56:10 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-08-07 10:56:10 +0800 |
commit | b446318dfa53347210444123d20433cc7829105a (patch) | |
tree | 928473cfb46370e46fe004d4cd69918203d1afa2 /mail/mail-config.c | |
parent | 6916d03ad63e4a4b63f065ef2f445d51eb2bb224 (diff) | |
download | gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.tar.gz gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.tar.zst gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.zip |
Set the week start day from the calendar prefs, do same for 24 hour
2002-08-07 Not Zed <NotZed@Ximian.com>
* message-tag-followup.c (target_date_new): Set the week start day
from the calendar prefs, do same for 24 hour format. See #23423.
* mail-config.c (config_read): Added week_start_day from
Calendar/Display config. Also time_24hour format.
(mail_config_get_week_start_day):
(mail_config_get_time_24hour): And read-only accessors.
svn path=/trunk/; revision=17723
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index 2d5950ba3d..491885f32c 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -131,6 +131,10 @@ typedef struct { MailConfigLabel labels[5]; gboolean signature_info; + + /* readonly fields from calendar */ + int week_start_day; + int time_24hour; } MailConfig; static MailConfig *config = NULL; @@ -586,6 +590,17 @@ config_import_old_signatures () } } +/* copied from calendar-config */ +static gboolean +locale_supports_12_hour_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) { @@ -955,6 +970,13 @@ config_read (void) config->signature_info = bonobo_config_get_boolean_with_default (config->db, "/Mail/Info/show_signature_editor_info", TRUE, NULL); + + config->week_start_day = bonobo_config_get_long_with_default(config->db, "/Calendar/Display/WeekStartDay", 1, NULL); + if (locale_supports_12_hour_format()) { + config->time_24hour = bonobo_config_get_boolean_with_default(config->db, "/Calendar/Display/Use24HourFormat", FALSE, NULL); + } else { + config->time_24hour = TRUE; + } } #define bonobo_config_set_string_wrapper(db, path, val, ev) bonobo_config_set_string (db, path, val ? val : "", ev) @@ -3092,3 +3114,16 @@ mail_config_set_show_signature_info (gboolean show) { config->signature_info = show; } + +int +mail_config_get_week_start_day(void) +{ + return config->week_start_day; +} + +int +mail_config_get_time_24hour(void) +{ + return config->time_24hour; +} + |