diff options
author | Damon Chaplin <damon@ximian.com> | 2001-09-27 12:02:17 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-09-27 12:02:17 +0800 |
commit | b235a79effc13b17b0bffc78189b831493bd37d6 (patch) | |
tree | 1717b8309b347b794dd05f7bfd657c57d1707f82 /calendar/gui/e-day-view.c | |
parent | f0c38138fa31e7e03c289f75c85d4c214ff9dcca (diff) | |
download | gsoc2013-evolution-b235a79effc13b17b0bffc78189b831493bd37d6.tar gsoc2013-evolution-b235a79effc13b17b0bffc78189b831493bd37d6.tar.gz gsoc2013-evolution-b235a79effc13b17b0bffc78189b831493bd37d6.tar.bz2 gsoc2013-evolution-b235a79effc13b17b0bffc78189b831493bd37d6.tar.lz gsoc2013-evolution-b235a79effc13b17b0bffc78189b831493bd37d6.tar.xz gsoc2013-evolution-b235a79effc13b17b0bffc78189b831493bd37d6.tar.zst gsoc2013-evolution-b235a79effc13b17b0bffc78189b831493bd37d6.zip |
added comparison functions for these special cell types. But the date and
2001-09-26 Damon Chaplin <damon@ximian.com>
* gui/e-calendar-table.c (date_compare_cb):
(percent_compare_cb):
(priority_compare_cb): added comparison functions for these special
cell types. But the date and percent ones don't work yet due to the
use of static text buffers for return cell values.
(e_calendar_table_init): added the comparison functions to the
ETableExtras. NOTE: task_compare_cb() never seems to be called.
I'm not sure why it is there.
* gui/e-calendar-table.etspec: set the comparison function names for
the date/percent/priority fields.
* cal-util/cal-util.c (cal_util_priority_to_string):
(cal_util_priority_from_string): new utility functions.
* gui/calendar-model.c (get_priority):
(set_priority): used above utility functions, and removed the warning
dialog which isn't useful now that the field isn't editable.
* gui/dialogs/event-page.c (times_updated): handle timezones and for
all-day events make sure it stays an all-day event after adjusting.
Fixes bugs #5945 and #10222.
* gui/calendar-commands.c (pixmaps): fixed the E_PIXMAP paths - the
edit items were moved beneath 'EditPlaceholder'. This gets rid of
those long Bonobo warnings! (and we get the icons back)
* gui/dialogs/comp-editor.c (pixmaps): removed the PrintPreview toolbar
icon, since it doesn't appear in the xml file. Gets rid of warning.
* gui/dialogs/event-page.c (notify_dates_changed): new function to
emit the notification signal when the dates are changed. It also
handles timezones now.
* gui/dialogs/comp-editor-page.h (CompEditorPageDates): used
CalComponentDateTime for start/end/due so we have the timezone as well
as the time.
* gui/dialogs/comp-editor-util.c (comp_editor_dates): updated to get
the timezones as well as the times.
(comp_editor_free_dates): new function needed to free all the structs.
* gui/dialogs/recurrence-page.c (recurrence_page_set_dates): added call
to preview_recur() to make sure the preview gets updated.
* gui/dialogs/alarm-page.c (alarm_page_fill_widgets): free the
CompEditorPageDates struct after use.
* gui/tag-calendar.c (tag_calendar_by_comp): added 'comp_is_on_server'
argument. If FALSE, we try to use builtin timezones first. This is
needed for the recurrence page of the event editor, because the
timezones may not have been added to the server yet. This and the
changes to the notification stuff should fix bug #5034.
* gui/gnome-cal.c (dn_query_obj_updated_cb): call above
tag_calendar_by_comp() with TRUE since the events will be on the
server in this case.
* gui/e-day-view-layout.c:
* gui/e-day-view.c: made sure an event always takes up at least one
row, even when the start & end times are the same. Fixes bug #5944.
I don't know if we should try to also handle events with the end time
before the start time.
* gui/e-week-view.c (e_week_view_style_set): check that the small font
is actually smaller than the normal font. If it isn't, don't use it.
Hopefully fixes bug #6876.
(e_week_view_on_new_appointment): if only one day is selected, then
we set the initial time of the event to 1/2-hour from the start of the
working day, to differentiate 'New Appointment' from 'New All Day
Event'. Fixes bug #8892.
* gui/e-day-view.c (e_day_view_on_new_appointment): do the same as the
above.
svn path=/trunk/; revision=13186
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r-- | calendar/gui/e-day-view.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 80b79bf2f5..77343b4763 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -3255,6 +3255,8 @@ e_day_view_on_event_click (EDayView *day_view, day_view->resize_drag_pos = pos; day_view->resize_start_row = event->start_minute / day_view->mins_per_row; day_view->resize_end_row = (event->end_minute - 1) / day_view->mins_per_row; + if (day_view->resize_end_row < day_view->resize_start_row) + day_view->resize_end_row = day_view->resize_start_row; day_view->resize_bars_event_day = day; day_view->resize_bars_event_num = event_num; @@ -3526,8 +3528,27 @@ e_day_view_on_new_appointment (GtkWidget *widget, gpointer data) { EDayView *day_view = E_DAY_VIEW (data); time_t dtstart, dtend; + struct icaltimetype itt; - e_day_view_get_selected_time_range (day_view, &dtstart, &dtend); + /* Edit a new event. If only one day is selected in the top canvas, + we set the time to the first 1/2-hour of the working day. */ + if (day_view->selection_in_top_canvas + && day_view->selection_start_day != -1 + && day_view->selection_start_day == day_view->selection_end_day) { + dtstart = day_view->day_starts[day_view->selection_start_day]; + itt = icaltime_from_timet_with_zone (dtstart, FALSE, + day_view->zone); + itt.hour = calendar_config_get_day_start_hour (); + itt.minute = calendar_config_get_day_start_minute (); + dtstart = icaltime_as_timet_with_zone (itt, day_view->zone); + + icaltime_adjust (&itt, 0, 0, 30, 0); + dtend = icaltime_as_timet_with_zone (itt, day_view->zone); + } else { + e_day_view_get_selected_time_range (day_view, &dtstart, + &dtend); + } + gnome_calendar_new_appointment_for ( day_view->calendar, dtstart, dtend, FALSE); } @@ -5834,6 +5855,9 @@ e_day_view_get_event_position (EDayView *day_view, start_row = event->start_minute / day_view->mins_per_row; end_row = (event->end_minute - 1) / day_view->mins_per_row; + if (end_row < start_row) + end_row = start_row; + cols_in_row = day_view->cols_per_row[day][start_row]; start_col = event->start_row_or_col; num_columns = event->num_columns; @@ -6320,6 +6344,9 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, day_view->drag_event_num); start_row = event->start_minute / day_view->mins_per_row; end_row = (event->end_minute - 1) / day_view->mins_per_row; + if (end_row < start_row) + end_row = start_row; + num_rows = end_row - start_row + 1; } @@ -6690,6 +6717,9 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, /* Calculate time offset from start row. */ start_row = event->start_minute / day_view->mins_per_row; end_row = (event->end_minute - 1) / day_view->mins_per_row; + if (end_row < start_row) + end_row = start_row; + num_rows = end_row - start_row + 1; start_offset = event->start_minute % day_view->mins_per_row; |