aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-config.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-09-18 09:35:46 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-09-18 09:35:46 +0800
commit999889586bbb251669c5a384f1b5d03bd72d0a6d (patch)
tree7041172cea75e0ee3556c3629425a8cda60bd58f /calendar/gui/calendar-config.c
parent5772dcbe43079dd8cf59e5458cb44a7a749df66f (diff)
downloadgsoc2013-evolution-999889586bbb251669c5a384f1b5d03bd72d0a6d.tar.gz
gsoc2013-evolution-999889586bbb251669c5a384f1b5d03bd72d0a6d.tar.zst
gsoc2013-evolution-999889586bbb251669c5a384f1b5d03bd72d0a6d.zip
added a timeout to refresh the list every 10 minutes. Not ideal, as the
2001-09-17 Damon Chaplin <damon@ximian.com> * gui/calendar-model.c: added a timeout to refresh the list every 10 minutes. Not ideal, as the user may be editing a task when it gets refreshed. (adjust_query_sexp): use the 'completed-before?' operator to filter out tasks according to the config settings. * gui/dialogs/task-details-page.c (task_details_page_fill_widgets): added support for the 'Completed' date. This code must have got lost somewhere, as it used to work. (date_changed_cb): set the priv->updating flag while updating the other widgets. * pcs/cal-backend-file.c (cal_backend_file_update_objects): made sure we freed the components. * pcs/query.c (func_completed_before): added 'completed-before?' operator. * gui/calendar-config.c (calendar_config_configure_e_cell_date_edit): don't set the lower & upper hour. Use 0-24 like the EDateEdit does. * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_show_config): set the 12/24-hour time format options sensitive only if we support both. * gui/calendar-config.c (config_read): if the locale doesn't define 'am' and 'pm' strings then we must use 24-hour format. * gui/calendar-commands.c (calendar_set_folder_bar_label): don't translate the '%d' as it doesn't make much sense. Resolves bug #8027. svn path=/trunk/; revision=12925
Diffstat (limited to 'calendar/gui/calendar-config.c')
-rw-r--r--calendar/gui/calendar-config.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index 33be9f2f02..aed61238ec 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -90,14 +90,16 @@ calendar_config_init (void)
config_read ();
}
-static gboolean
-locale_uses_24h_time_format (void)
+/* Returns TRUE if the locale has 'am' and 'pm' strings defined, in which
+ case the user can choose between 12 and 24-hour time formats. */
+gboolean
+calendar_config_locale_supports_12_hour_format (void)
{
char s[16];
time_t t = 0;
strftime (s, sizeof s, "%p", gmtime (&t));
- return s[0] == '\0';
+ return s[0] != '\0';
}
static void
@@ -128,8 +130,15 @@ config_read (void)
config->week_start_day = bonobo_config_get_long_with_default (db,
"/Calendar/Display/WeekStartDay", 1, NULL);
- config->use_24_hour_format = bonobo_config_get_boolean_with_default (
- db, "/Calendar/Display/Use24HourFormat", locale_uses_24h_time_format (), NULL);
+ /* If the locale defines 'am' and 'pm' strings then the user has the
+ choice of 12-hour or 24-hour time format, with 12-hour as the
+ default. If the locale doesn't have 'am' and 'pm' strings we have
+ to use 24-hour format, or strftime()/strptime() won't work. */
+ if (calendar_config_locale_supports_12_hour_format ()) {
+ config->use_24_hour_format = bonobo_config_get_boolean_with_default (db, "/Calendar/Display/Use24HourFormat", FALSE, NULL);
+ } else {
+ config->use_24_hour_format = TRUE;
+ }
config->week_start_day = bonobo_config_get_long_with_default (db,
"/Calendar/Display/WeekStartDay", 1, NULL);
@@ -687,15 +696,19 @@ calendar_config_configure_e_cell_date_edit (ECellDateEdit *ecde)
start_hour = calendar_config_get_day_start_hour ();
end_hour = calendar_config_get_day_end_hour ();
+
/* Round up the end hour. */
if (calendar_config_get_day_end_minute () != 0)
- end_hour = end_hour + 1 % 24;
+ end_hour++;
e_cell_date_edit_freeze (ecde);
gtk_object_set (GTK_OBJECT (ecde),
"use_24_hour_format", use_24_hour,
+#if 0
+ /* We use the default 0 - 24 now. */
"lower_hour", start_hour,
"upper_hour", end_hour,
+#endif
NULL);
e_cell_date_edit_thaw (ecde);
}
@@ -725,6 +738,10 @@ calendar_config_configure_e_calendar_table (ECalendarTable *cal_table)
calendar_config_configure_e_cell_date_edit (cal_table->dates_cell);
+ /* Reload the event/tasks, since the 'Hide Completed Tasks' option
+ may have been changed, so the query needs to be updated. */
+ calendar_model_refresh (model);
+
/* This is for changing the colors of the text; they will be re-fetched
* by ECellText when the table is redrawn.
*/