aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/year-view.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-09-29 08:54:21 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-09-29 08:54:21 +0800
commit550314f75b3a94e468e5f1117b9425d6d3784161 (patch)
treec80a72f998e8eaa090f3f0a3cd423fa8344f43f5 /calendar/year-view.c
parenta73b55050bd1c94567161aed1b3123eeb76c75d0 (diff)
downloadgsoc2013-evolution-550314f75b3a94e468e5f1117b9425d6d3784161.tar.gz
gsoc2013-evolution-550314f75b3a94e468e5f1117b9425d6d3784161.tar.zst
gsoc2013-evolution-550314f75b3a94e468e5f1117b9425d6d3784161.zip
New file that presents a quick view of the events in a particular day when
1998-09-28 Federico Mena Quintero <federico@nuclecu.unam.mx> * quick-view.[ch]: New file that presents a quick view of the events in a particular day when the mouse is clicked on the year view. Work in progress. * year-view.c (do_quick_view_popup): New function that creates a quick view for the events in a day. * Makefile.am (gnomecal_SOURCES): Added quick-view.[ch] to the list of sources. svn path=/trunk/; revision=413
Diffstat (limited to 'calendar/year-view.c')
-rw-r--r--calendar/year-view.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/calendar/year-view.c b/calendar/year-view.c
index 2027cac398..d5710228df 100644
--- a/calendar/year-view.c
+++ b/calendar/year-view.c
@@ -13,6 +13,7 @@
#include "year-view.h"
#include "main.h"
#include "mark.h"
+#include "quick-view.h"
#include "timeutil.h"
@@ -305,6 +306,27 @@ do_popup_menu (YearView *yv, GdkEventButton *event, int allow_new, int allow_day
gnome_popup_menu_do_popup (menu, NULL, NULL, event, yv);
}
+/* Creates the quick view when the user clicks on a day */
+static void
+do_quick_view_popup (YearView *yv, GdkEventButton *event, int year, int month, int day)
+{
+ time_t day_start, day_end;
+ GList *list;
+ GtkWidget *qv;
+
+ day_start = time_from_day (year, month, day);
+ day_end = time_end_of_day (day_start);
+
+ list = calendar_get_events_in_range (yv->calendar->cal, day_start, day_end);
+
+ qv = quick_view_new (yv->calendar, "Put the date here", list);
+
+ quick_view_do_popup (QUICK_VIEW (qv), event);
+
+ gtk_widget_destroy (qv);
+ calendar_destroy_event_list (list);
+}
+
/* Event handler for days in the year's month items */
static gint
day_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
@@ -325,10 +347,7 @@ day_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
break;
if (event->button.button == 1) {
- gnome_calendar_dayjump (yv->calendar,
- time_from_day (mitem->year,
- mitem->month,
- day));
+ do_quick_view_popup (yv, (GdkEventButton *) event, mitem->year, mitem->month, day);
return TRUE;
} else if (event->button.button == 3) {
do_popup_menu (yv, (GdkEventButton *) event, TRUE, TRUE, TRUE, TRUE,