diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-09 20:05:17 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-09 20:05:17 +0800 |
commit | cb63647c88004417175888cd06a96a1b1ecbb050 (patch) | |
tree | 10bb68910ff15b28e5a09d4a7e2a2c18819a7d32 /calendar | |
parent | ccde653db3ef8645b1f7fed7f1ffccca4f71100f (diff) | |
download | gsoc2013-evolution-cb63647c88004417175888cd06a96a1b1ecbb050.tar gsoc2013-evolution-cb63647c88004417175888cd06a96a1b1ecbb050.tar.gz gsoc2013-evolution-cb63647c88004417175888cd06a96a1b1ecbb050.tar.bz2 gsoc2013-evolution-cb63647c88004417175888cd06a96a1b1ecbb050.tar.lz gsoc2013-evolution-cb63647c88004417175888cd06a96a1b1ecbb050.tar.xz gsoc2013-evolution-cb63647c88004417175888cd06a96a1b1ecbb050.tar.zst gsoc2013-evolution-cb63647c88004417175888cd06a96a1b1ecbb050.zip |
CompEditor: Add a "week-start-day" property.
Automatically configured, of course, by ESettingsCompEditor.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 51 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.h | 3 |
2 files changed, 54 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 2dd0b2d13b..cb7de1f881 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -108,6 +108,8 @@ struct _CompEditorPrivate { icaltimezone *zone; gboolean use_24_hour_format; + gint week_start_day; + gint work_day_end_hour; gint work_day_end_minute; gint work_day_start_hour; @@ -137,6 +139,7 @@ enum { PROP_SUMMARY, PROP_TIMEZONE, PROP_USE_24_HOUR_FORMAT, + PROP_WEEK_START_DAY, PROP_WORK_DAY_END_HOUR, PROP_WORK_DAY_END_MINUTE, PROP_WORK_DAY_START_HOUR, @@ -1422,6 +1425,12 @@ comp_editor_set_property (GObject *object, g_value_get_boolean (value)); return; + case PROP_WEEK_START_DAY: + comp_editor_set_week_start_day ( + COMP_EDITOR (object), + g_value_get_int (value)); + return; + case PROP_WORK_DAY_END_HOUR: comp_editor_set_work_day_end_hour ( COMP_EDITOR (object), @@ -1505,6 +1514,12 @@ comp_editor_get_property (GObject *object, COMP_EDITOR (object))); return; + case PROP_WEEK_START_DAY: + g_value_set_int ( + value, comp_editor_get_week_start_day ( + COMP_EDITOR (object))); + return; + case PROP_WORK_DAY_END_HOUR: g_value_set_int ( value, comp_editor_get_work_day_end_hour ( @@ -1893,6 +1908,19 @@ comp_editor_class_init (CompEditorClass *class) g_object_class_install_property ( object_class, + PROP_WEEK_START_DAY, + g_param_spec_int ( + "week-start-day", + "Week Start Day", + NULL, + 0, /* Monday */ + 6, /* Sunday */ + 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, PROP_WORK_DAY_END_HOUR, g_param_spec_int ( "work-day-end-hour", @@ -2530,6 +2558,29 @@ comp_editor_set_use_24_hour_format (CompEditor *editor, } gint +comp_editor_get_week_start_day (CompEditor *editor) +{ + g_return_val_if_fail (IS_COMP_EDITOR (editor), 0); + + return editor->priv->week_start_day; +} + +void +comp_editor_set_week_start_day (CompEditor *editor, + gint week_start_day) +{ + g_return_if_fail (IS_COMP_EDITOR (editor)); + g_return_if_fail (week_start_day >= 0 && week_start_day < 7); + + if (week_start_day == editor->priv->week_start_day) + return; + + editor->priv->week_start_day = week_start_day; + + g_object_notify (G_OBJECT (editor), "week-start-day"); +} + +gint comp_editor_get_work_day_end_hour (CompEditor *editor) { g_return_val_if_fail (IS_COMP_EDITOR (editor), 0); diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h index 72598acfe0..b343081dcc 100644 --- a/calendar/gui/dialogs/comp-editor.h +++ b/calendar/gui/dialogs/comp-editor.h @@ -134,6 +134,9 @@ gboolean comp_editor_get_use_24_hour_format void comp_editor_set_use_24_hour_format (CompEditor *editor, gboolean use_24_hour_format); +gint comp_editor_get_week_start_day (CompEditor *editor); +void comp_editor_set_week_start_day (CompEditor *editor, + gint week_start_day); gint comp_editor_get_work_day_end_hour (CompEditor *editor); void comp_editor_set_work_day_end_hour |