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 | |
parent | 6916d03ad63e4a4b63f065ef2f445d51eb2bb224 (diff) | |
download | gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.tar gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.tar.gz gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.tar.bz2 gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.tar.lz gsoc2013-evolution-b446318dfa53347210444123d20433cc7829105a.tar.xz 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
-rw-r--r-- | mail/ChangeLog | 10 | ||||
-rw-r--r-- | mail/mail-config.c | 35 | ||||
-rw-r--r-- | mail/mail-config.h | 3 | ||||
-rw-r--r-- | mail/message-tag-followup.c | 12 |
4 files changed, 56 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index fe710567e9..668123ed90 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +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. + 2002-08-06 Jeffrey Stedfast <fejj@ximian.com> * mail-local.c (save_metainfo): Save to a temporary file first 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; +} + diff --git a/mail/mail-config.h b/mail/mail-config.h index 1e4699f773..49c1013785 100644 --- a/mail/mail-config.h +++ b/mail/mail-config.h @@ -322,6 +322,9 @@ gchar * mail_config_signature_run_script (gchar *script); gboolean mail_config_get_show_signature_info (void); void mail_config_set_show_signature_info (gboolean show); +int mail_config_get_week_start_day(void); +int mail_config_get_time_24hour(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/mail/message-tag-followup.c b/mail/message-tag-followup.c index 4edbfc1d26..bee65fab6d 100644 --- a/mail/message-tag-followup.c +++ b/mail/message-tag-followup.c @@ -39,6 +39,7 @@ #include <gal/util/e-unicode-i18n.h> #include "message-tag-followup.h" +#include "mail-config.h" static void message_tag_followup_class_init (MessageTagFollowUpClass *class); static void message_tag_followup_init (MessageTagFollowUp *followup); @@ -217,13 +218,16 @@ GtkWidget * target_date_new (const char *s1, const char *s2, int i1, int i2) { GtkWidget *widget; - + int start; + widget = e_date_edit_new (); e_date_edit_set_show_date (E_DATE_EDIT (widget), TRUE); e_date_edit_set_show_time (E_DATE_EDIT (widget), TRUE); - e_date_edit_set_week_start_day (E_DATE_EDIT (widget), 6); - /* FIXME: make this locale dependant?? */ - e_date_edit_set_use_24_hour_format (E_DATE_EDIT (widget), FALSE); + + start = (mail_config_get_week_start_day()+6) % 7; /* Note that this is 0 (Sun) to 6 (Sat), conver to 0 (mon) to 6 (sun) */ + + e_date_edit_set_week_start_day (E_DATE_EDIT (widget), start); + e_date_edit_set_use_24_hour_format (E_DATE_EDIT (widget), mail_config_get_time_24hour()); e_date_edit_set_allow_no_date_set (E_DATE_EDIT (widget), TRUE); e_date_edit_set_time_popup_range (E_DATE_EDIT (widget), 0, 24); |