aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/event-editor.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-12-15 19:39:48 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-12-15 19:39:48 +0800
commit937d719a6a5b880df4b75cfe8318d37fd4a4e814 (patch)
tree6185ecc76c9e1f333d47d2d35dbb8c91021d3fea /calendar/gui/event-editor.c
parent5674d76445b199855d4d431b6db4c0302f4a932b (diff)
downloadgsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.tar
gsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.tar.gz
gsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.tar.bz2
gsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.tar.lz
gsoc2013-evolution-937d719a6a5b880df4b75cfe8318d37fd4a4e814.tar.xz
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/event-editor.c')
-rw-r--r--calendar/gui/event-editor.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index 6f30b45797..726f29e67d 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -37,6 +37,7 @@
#include "calendar-config.h"
#include "tag-calendar.h"
#include "weekday-picker.h"
+#include "widget-util.h"
@@ -174,7 +175,6 @@ static GtkObjectClass *parent_class;
extern int day_begin, day_end;
extern char *user_name;
extern int am_pm_flag;
-extern int week_starts_on_monday;
static void append_exception (EventEditor *ee, time_t t);
@@ -416,7 +416,7 @@ make_recur_weekly_special (EventEditor *ee)
/* Set the weekdays */
- weekday_picker_set_week_starts_on_monday (wp, week_starts_on_monday);
+ weekday_picker_set_week_start_day (wp, calendar_config_get_week_start_day ());
weekday_picker_set_days (wp, priv->recurrence_weekday_day_mask);
weekday_picker_set_blocked_days (wp, priv->recurrence_weekday_blocked_day_mask);
@@ -669,12 +669,10 @@ make_recur_ending_until_special (EventEditor *ee)
/* Create the widget */
- priv->recurrence_ending_date_edit = e_date_edit_new ();
+ priv->recurrence_ending_date_edit = date_edit_new (TRUE, FALSE);
de = E_DATE_EDIT (priv->recurrence_ending_date_edit);
- e_date_edit_set_show_time (de, FALSE);
gtk_container_add (GTK_CONTAINER (priv->recurrence_ending_special), GTK_WIDGET (de));
-
gtk_widget_show_all (GTK_WIDGET (de));
/* Set the value */
@@ -2030,7 +2028,7 @@ simple_recur_to_comp_object (EventEditor *ee, CalComponent *comp)
r.freq = e_dialog_option_menu_get (priv->recurrence_interval_unit, recur_freq_map);
r.interval = e_dialog_spin_get_int (priv->recurrence_interval_value);
- r.week_start = week_starts_on_monday ? ICAL_MONDAY_WEEKDAY : ICAL_SUNDAY_WEEKDAY;
+ r.week_start = ICAL_SUNDAY_WEEKDAY + calendar_config_get_week_start_day ();
/* Frequency-specific data */
@@ -3188,32 +3186,11 @@ recurrence_exception_delete_cb (GtkWidget *widget, EventEditor *ee)
GtkWidget *
make_date_edit (void)
{
- return date_edit_new (time (NULL), FALSE);
+ return date_edit_new (TRUE, TRUE);
}
GtkWidget *
-make_date_edit_with_time (void)
-{
- return date_edit_new (time (NULL), TRUE);
-}
-
-
-GtkWidget *
-date_edit_new (time_t the_time, int show_time)
-{
- GtkWidget *dedit;
-
- dedit = e_date_edit_new ();
- /* FIXME: Set other options. */
- e_date_edit_set_show_time (E_DATE_EDIT (dedit), show_time);
- e_date_edit_set_time_popup_range (E_DATE_EDIT (dedit), calendar_config_get_day_start_hour (), calendar_config_get_day_end_hour ());
- return dedit;
-}
-
-
-
-GtkWidget *
make_spin_button (int val, int low, int high)
{
GtkAdjustment *adj;