aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
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
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')
-rw-r--r--calendar/gui/e-day-view.c22
-rw-r--r--calendar/gui/e-day-view.h6
-rw-r--r--calendar/gui/e-week-view.c12
-rw-r--r--calendar/gui/e-week-view.h6
4 files changed, 46 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");
}
diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h
index 351bcd1039..f858ca6c26 100644
--- a/calendar/gui/e-day-view.h
+++ b/calendar/gui/e-day-view.h
@@ -453,6 +453,12 @@ struct _EDayView
gchar *pm_string;
gint am_string_width;
gint pm_string_width;
+
+ /* remember last selected interval when click and restore on double click,
+ if we double clicked inside that interval. */
+ guint32 bc_event_time;
+ time_t before_click_dtstart;
+ time_t before_click_dtend;
};
struct _EDayViewClass
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 97e08fe840..1be7358406 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -505,6 +505,9 @@ e_week_view_init (EWeekView *week_view)
/* String to use in 12-hour time format for times in the afternoon. */
week_view->pm_string = _("pm");
+ week_view->bc_event_time = 0;
+ week_view->before_click_dtstart = 0;
+ week_view->before_click_dtend = 0;
/*
* Titles Canvas. Note that we don't show it is only shown in the
@@ -2061,6 +2064,12 @@ e_week_view_on_button_press (GtkWidget *widget,
return FALSE;
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
+ time_t dtstart, dtend;
+
+ e_calendar_view_get_selected_time_range ((ECalendarView *) week_view, &dtstart, &dtend);
+ if (dtstart < week_view->before_click_dtend && dtend > week_view->before_click_dtstart) {
+ e_week_view_set_selected_time_range ((ECalendarView *) week_view, week_view->before_click_dtstart, week_view->before_click_dtend);
+ }
e_calendar_view_new_appointment_full (E_CALENDAR_VIEW (week_view), FALSE, FALSE, FALSE);
return TRUE;
}
@@ -2074,6 +2083,9 @@ e_week_view_on_button_press (GtkWidget *widget,
GDK_POINTER_MOTION_MASK
| GDK_BUTTON_RELEASE_MASK,
FALSE, NULL, event->time) == 0) {
+ if (event->time - week_view->bc_event_time > 250)
+ e_calendar_view_get_selected_time_range ((ECalendarView *) week_view, &week_view->before_click_dtstart, &week_view->before_click_dtend);
+ week_view->bc_event_time = event->time;
week_view->selection_start_day = day;
week_view->selection_end_day = day;
week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_END;
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
index 888d88bccb..ea2e6afd31 100644
--- a/calendar/gui/e-week-view.h
+++ b/calendar/gui/e-week-view.h
@@ -331,6 +331,12 @@ struct _EWeekView
gchar *pm_string;
gint am_string_width;
gint pm_string_width;
+
+ /* remember last selected interval when click and restore on double click,
+ if we double clicked inside that interval. */
+ guint32 bc_event_time;
+ time_t before_click_dtstart;
+ time_t before_click_dtend;
};
struct _EWeekViewClass