aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@src.gnome.org>2007-08-23 22:33:10 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-08-23 22:33:10 +0800
commitebb7bb517c697e05b3f64b07f8e993a9d9bd865c (patch)
tree8186c07fb446271397f9b5fa339017aff3a33b5b /calendar/gui/e-day-view.c
parent4dc713c7197dd5475ef077097561710e45cf5ee0 (diff)
downloadgsoc2013-evolution-ebb7bb517c697e05b3f64b07f8e993a9d9bd865c.tar.gz
gsoc2013-evolution-ebb7bb517c697e05b3f64b07f8e993a9d9bd865c.tar.zst
gsoc2013-evolution-ebb7bb517c697e05b3f64b07f8e993a9d9bd865c.zip
2007-08-23 mcrha Fix for bug #201201 and bug #201202
svn path=/trunk/; revision=34076
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 0be2ddfb41..18a99cd9cf 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -751,6 +751,9 @@ e_day_view_init (EDayView *day_view)
/* String to use in 12-hour time format for times in the afternoon. */
day_view->pm_string = _("pm");
+ day_view->bc_event_time = 0;
+ day_view->before_click_dtstart = 0;
+ day_view->before_click_dtend = 0;
/*
* Top Canvas
@@ -1094,6 +1097,9 @@ e_day_view_init (EDayView *day_view)
/* String to use in 12-hour time format for times in the afternoon. */
day_view->pm_string = _("pm");
+ day_view->bc_event_time = 0;
+ day_view->before_click_dtstart = 0;
+ day_view->before_click_dtend = 0;
/*
* Top Canvas
@@ -3410,6 +3416,11 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
time_t dtstart, dtend;
e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend);
+ if (dtstart < day_view->before_click_dtend && dtend > day_view->before_click_dtstart) {
+ dtstart = day_view->before_click_dtstart;
+ dtend = day_view->before_click_dtend;
+ e_day_view_set_selected_time_range ((ECalendarView *) day_view, dtstart, dtend);
+ }
e_calendar_view_new_appointment_for (E_CALENDAR_VIEW (day_view),
dtstart, dtend,
TRUE, FALSE);
@@ -3423,6 +3434,9 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
GDK_POINTER_MOTION_MASK
| GDK_BUTTON_RELEASE_MASK,
FALSE, NULL, event->time) == 0) {
+ if (event->time - day_view->bc_event_time > 250)
+ e_day_view_get_selected_time_range ((ECalendarView *) day_view, &day_view->before_click_dtstart, &day_view->before_click_dtend);
+ day_view->bc_event_time = event->time;
e_day_view_start_selection (day_view, day, -1);
}
} else if (event->button == 3) {
@@ -3543,6 +3557,11 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
time_t dtstart, dtend;
e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend);
+ if (dtstart < day_view->before_click_dtend && dtend > day_view->before_click_dtstart) {
+ dtstart = day_view->before_click_dtstart;
+ dtend = day_view->before_click_dtend;
+ e_day_view_set_selected_time_range ((ECalendarView *) day_view, dtstart, dtend);
+ }
e_calendar_view_new_appointment_for (E_CALENDAR_VIEW (day_view),
dtstart, dtend,
FALSE, FALSE);
@@ -3556,6 +3575,9 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
GDK_POINTER_MOTION_MASK
| GDK_BUTTON_RELEASE_MASK,
FALSE, NULL, event->time) == 0) {
+ if (event->time - day_view->bc_event_time > 250)
+ e_day_view_get_selected_time_range ((ECalendarView *) day_view, &day_view->before_click_dtstart, &day_view->before_click_dtend);
+ day_view->bc_event_time = event->time;
e_day_view_start_selection (day_view, day, row);
g_signal_emit_by_name (day_view, "selected_time_changed");
}