diff options
author | Federico Mena Quintero <federico@helixcode.com> | 2000-12-15 19:39:48 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2000-12-15 19:39:48 +0800 |
commit | 937d719a6a5b880df4b75cfe8318d37fd4a4e814 (patch) | |
tree | 6185ecc76c9e1f333d47d2d35dbb8c91021d3fea /calendar/gui/widget-util.c | |
parent | 5674d76445b199855d4d431b6db4c0302f4a932b (diff) | |
download | gsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.tar.gz gsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.tar.zst gsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.zip |
Fixes bug #955.
2000-12-14 Federico Mena Quintero <federico@helixcode.com>
Fixes bug #955.
* gui/weekday-picker.c (WeekdayPickerPrivate): Added a field for
the week_start_day, to be used in the same way as
calendar-config.h defines it. Removed the week_starts_on_monday
flag.
(day_event_cb): Use the week_start_day.
(colorize_items): Likewise.
(configure_items): Likewise.
(weekday_picker_set_week_start_day): New function.
(weekday_picker_get_week_start_day): New function.
(weekday_picker_set_week_starts_on_monday): Removed function.
(weekday_picker_get_week_starts_on_monday): Removed function.
* gui/widget-util.[ch]: New files with utilities for creating or
configuring widgets.
* gui/widget-util.c (date_edit_new): New function to create an
EDateEdit configured with the calendar's preferences; moved over
from event-editor.c.
* gui/event-editor.c (make_recur_weekly_special): Use
weekday_picker_set_week_start_day() and the corresponding function
from calendar-config.h.
(init_widgets): Likewise.
(make_date_edit_with_time): Removed function.
(make_recur_ending_until_special): Use date_edit_new().
(make_date_edit): Likewise.
* gui/dialogs/task-editor.c (task_editor_create_date_edit): Likewise.
* gui/event-editor-dialog.glade: Removed references to
make_date_edit_with_time(); replace them with make_date_edit().
* gui/Makefile.am (evolution_calendar_SOURCES): Added
widget-util.[ch] to the list of sources.
svn path=/trunk/; revision=7037
Diffstat (limited to 'calendar/gui/widget-util.c')
-rw-r--r-- | calendar/gui/widget-util.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/calendar/gui/widget-util.c b/calendar/gui/widget-util.c new file mode 100644 index 0000000000..9d271d29f3 --- /dev/null +++ b/calendar/gui/widget-util.c @@ -0,0 +1,57 @@ +/* Evolution calendar - Widget utilities + * + * Copyright (C) 2000 Helix Code, Inc. + * + * Author: Federico Mena-Quintero <federico@helixcode.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <widgets/misc/e-dateedit.h> +#include "calendar-config.h" +#include "widget-util.h" + + + +/** + * date_edit_new: + * @show_date: Whether to show a date picker in the widget. + * @show_time: Whether to show a time picker in the widget. + * + * Creates a new #EDateEdit widget, configured using the calendar's preferences. + * + * Return value: A newly-created #EDateEdit widget. + **/ +GtkWidget * +date_edit_new (gboolean show_date, gboolean show_time) +{ + EDateEdit *dedit; + + dedit = E_DATE_EDIT (e_date_edit_new ()); + + e_date_edit_set_show_date (dedit, show_date); + e_date_edit_set_show_time (dedit, show_time); + e_date_edit_set_time_popup_range (dedit, + calendar_config_get_day_start_hour (), + calendar_config_get_day_end_hour ()); + e_date_edit_set_week_start_day (dedit, (calendar_config_get_week_start_day () + 6) % 7); + e_date_edit_set_show_week_numbers (dedit, calendar_config_get_dnav_show_week_no ()); + + return GTK_WIDGET (dedit); +} |