diff options
author | Damon Chaplin <damon@helixcode.com> | 2001-01-08 08:47:35 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-01-08 08:47:35 +0800 |
commit | a223b88a9034f0c33f2e979403e1352ff822f8a2 (patch) | |
tree | 180ec792800fb8d2468fb2ae6829b5c87cc7f5f8 /calendar/gui/calendar-config.c | |
parent | 45b8f9d767b5a178e0fdcb48901e664334fd8183 (diff) | |
download | gsoc2013-evolution-a223b88a9034f0c33f2e979403e1352ff822f8a2.tar.gz gsoc2013-evolution-a223b88a9034f0c33f2e979403e1352ff822f8a2.tar.zst gsoc2013-evolution-a223b88a9034f0c33f2e979403e1352ff822f8a2.zip |
added new source files for the Tasks folders.
2001-01-08 Damon Chaplin <damon@helixcode.com>
* gui/Makefile.am: added new source files for the Tasks folders.
* gui/e-tasks.[hc]: new widget to encapsulate the Tasks view.
* gui/tasks-control.[hc]: new files to implement the Tasks control.
* gui/tasks-control-factory.[hc]: new files to implement the factory
for the Tasks controls. (I think the way I've split the code up is a
lot cleaner than the GnomeCal implementation - the factory file just
contains the factory functions and the control file contains all the
control functions. Maybe we should make GnomeCal like this.)
* gui/main.c: initialize the Tasks control factory.
* gui/component-factory.c: added support for the Tasks control.
Also added a "create_folder" function so we can now create new Tasks
and Calendar folders within Evolution.
I'm not a Bonobo expert so someone might want to check these over.
* gui/calendar-config.[hc]: added convenience functions to configure
the common settings of ECalendar and EDateEdit widgets.
* gui/dialogs/task-editor.c (task_editor_create_date_edit):
* gui/gnome-cal.c (gnome_calendar_update_config_settings):
* gui/event-editor.c: used function to configure the ECalendars
and EDateEdits.
* gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
fixed minor bug in format strings.
svn path=/trunk/; revision=7297
Diffstat (limited to 'calendar/gui/calendar-config.c')
-rw-r--r-- | calendar/gui/calendar-config.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 0245a05f2a..dc12e60ab4 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -421,3 +421,58 @@ calendar_config_set_working_days (CalWeekdays days) config->working_days = days; } + +/* This sets all the common config settings for an ECalendar widget. + These are the week start day, and whether we show week numbers. */ +void +calendar_config_configure_e_calendar (ECalendar *cal) +{ + gboolean dnav_show_week_no; + gint week_start_day; + + dnav_show_week_no = calendar_config_get_dnav_show_week_no (); + + /* Note that this is 0 (Sun) to 6 (Sat). */ + week_start_day = calendar_config_get_week_start_day (); + + /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */ + week_start_day = (week_start_day + 6) % 7; + + gnome_canvas_item_set (GNOME_CANVAS_ITEM (cal->calitem), + "show_week_numbers", dnav_show_week_no, + "week_start_day", week_start_day, + NULL); +} + + +/* This sets all the common config settings for an EDateEdit widget. + These are the week start day, whether we show week numbers, whether we + use 24 hour format, and the hours of the working day to use in the time + popup. */ +void +calendar_config_configure_e_date_edit (EDateEdit *dedit) +{ + gboolean dnav_show_week_no, use_24_hour; + gint week_start_day, start_hour, end_hour; + + dnav_show_week_no = calendar_config_get_dnav_show_week_no (); + + /* Note that this is 0 (Sun) to 6 (Sat). */ + week_start_day = calendar_config_get_week_start_day (); + + /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */ + week_start_day = (week_start_day + 6) % 7; + + use_24_hour = calendar_config_get_24_hour_format (); + + 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; + + e_date_edit_set_week_start_day (dedit, week_start_day); + e_date_edit_set_show_week_numbers (dedit, dnav_show_week_no); + e_date_edit_set_use_24_hour_format (dedit, use_24_hour); + e_date_edit_set_time_popup_range (dedit, start_hour, end_hour); +} |