aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/Makefile.am2
-rw-r--r--calendar/gnome-cal.h4
-rw-r--r--calendar/gui/Makefile.am2
-rw-r--r--calendar/gui/gnome-cal.h4
-rw-r--r--calendar/gui/quick-view.c217
-rw-r--r--calendar/gui/quick-view.h59
-rw-r--r--calendar/gui/year-view.c27
-rw-r--r--calendar/quick-view.c217
-rw-r--r--calendar/quick-view.h59
-rw-r--r--calendar/year-view.c27
11 files changed, 616 insertions, 14 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index fc2761ac1f..7fd66fdbaf 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+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.
+
1998-09-27 Federico Mena Quintero <federico@nuclecu.unam.mx>
* main.c: Hotkey for File/Exit should be C-q, not C-x.
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 3f1cb80632..bc6081dc10 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -45,6 +45,8 @@ gnomecal_SOURCES = \
popup-menu.c \
popup-menu.h \
prop.c \
+ quick-view.c \
+ quick-view.h \
timeutil.c \
timeutil.h \
view-utils.h \
diff --git a/calendar/gnome-cal.h b/calendar/gnome-cal.h
index afe546be2d..ab4f5ff304 100644
--- a/calendar/gnome-cal.h
+++ b/calendar/gnome-cal.h
@@ -8,9 +8,7 @@
#ifndef GNOME_CALENDAR_APP_H
#define GNOME_CALENDAR_APP_H
-#include <libgnome/gnome-defs.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gtkcalendar.h>
+#include <gnome.h>
#include "calendar.h"
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 3f1cb80632..bc6081dc10 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -45,6 +45,8 @@ gnomecal_SOURCES = \
popup-menu.c \
popup-menu.h \
prop.c \
+ quick-view.c \
+ quick-view.h \
timeutil.c \
timeutil.h \
view-utils.h \
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index afe546be2d..ab4f5ff304 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -8,9 +8,7 @@
#ifndef GNOME_CALENDAR_APP_H
#define GNOME_CALENDAR_APP_H
-#include <libgnome/gnome-defs.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gtkcalendar.h>
+#include <gnome.h>
#include "calendar.h"
diff --git a/calendar/gui/quick-view.c b/calendar/gui/quick-view.c
new file mode 100644
index 0000000000..cbb5cfb5c0
--- /dev/null
+++ b/calendar/gui/quick-view.c
@@ -0,0 +1,217 @@
+/* Quick view widget for Gnomecal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <federico@nuclecu.unam.mx
+ */
+
+#include <config.h>
+#include "quick-view.h"
+#include "main.h"
+
+
+static void quick_view_class_init (QuickViewClass *class);
+static void quick_view_init (QuickView *qv);
+
+
+GtkType
+quick_view_get_type (void)
+{
+ static GtkType quick_view_type = 0;
+
+ if (!quick_view_type) {
+ GtkTypeInfo quick_view_info = {
+ "QuickView",
+ sizeof (QuickView),
+ sizeof (QuickViewClass),
+ (GtkClassInitFunc) quick_view_class_init,
+ (GtkObjectInitFunc) quick_view_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ quick_view_type = gtk_type_unique (gtk_window_get_type (), &quick_view_info);
+ }
+
+ return quick_view_type;
+}
+
+static void
+quick_view_class_init (QuickViewClass *class)
+{
+}
+
+static void
+quick_view_init (QuickView *qv)
+{
+ GTK_WINDOW (qv)->type = GTK_WINDOW_POPUP;
+ gtk_window_position (GTK_WINDOW (qv), GTK_WIN_POS_MOUSE);
+}
+
+/* Handles button release events from the canvas in the quick view. When a button release is
+ * received, it pops down the quick view and calls gtk_main_quit().
+ */
+static gint
+button_release (GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ QuickView *qv;
+
+ qv = data;
+
+ if (event->button != qv->button)
+ return FALSE;
+
+ gdk_pointer_ungrab (event->time);
+ gtk_grab_remove (GTK_WIDGET (qv));
+ gtk_widget_hide (GTK_WIDGET (qv));
+
+ gtk_main_quit (); /* End modality */
+ return TRUE;
+}
+
+
+/* Creates the items corresponding to a single calendar object. Takes in the y position of the
+ * items to create and returns the y position of the next item to create.
+ */
+double
+create_items_for_event (QuickView *qv, CalendarObject *co, double y)
+{
+ GnomeCanvas *canvas;
+ char start[100], end[100];
+ struct tm start_tm, end_tm;
+ char *str;
+
+ /* FIXME: make this nice */
+
+ canvas = GNOME_CANVAS (qv->canvas);
+
+ start_tm = *localtime (&co->ev_start);
+ end_tm = *localtime (&co->ev_end);
+
+ if (am_pm_flag) {
+ strftime (start, sizeof (start), "%I:%M%p", &start_tm);
+ strftime (end, sizeof (end), "%I:%M%p", &end_tm);
+ } else {
+ strftime (start, sizeof (start), "%H:%M", &start_tm);
+ strftime (end, sizeof (end), "%H:%M", &end_tm);
+ }
+
+ str = g_copy_strings (start, " - ", end, " ", co->ico->summary, NULL);
+
+ gnome_canvas_item_new (gnome_canvas_root (canvas),
+ gnome_canvas_text_get_type (),
+ "x", 0.0,
+ "y", y,
+ "anchor", GTK_ANCHOR_NW,
+ "text", str,
+ NULL);
+
+ g_free (str);
+
+ return (y + 16); /* FIXME */
+}
+
+/* Creates the canvas items corresponding to the events in the list */
+static void
+setup_event_list (QuickView *qv, GList *event_list)
+{
+ CalendarObject *co;
+ double y;
+
+ /* If there are no events, then just put a simple label */
+
+ if (!event_list) {
+ gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (qv->canvas)),
+ gnome_canvas_text_get_type (),
+ "x", 0.0,
+ "y", 0.0,
+ "anchor", GTK_ANCHOR_NW,
+ "text", _("No appointments scheduled for this day"),
+ NULL);
+ return;
+ }
+
+ /* Create the items for all the events in the list */
+
+ y = 0.0;
+
+ for (; event_list; event_list = event_list->next) {
+ co = event_list->data;
+ y = create_items_for_event (qv, co, y);
+ }
+
+ /* Set the scrolling region to fit all the items */
+
+ gnome_canvas_set_scroll_region (GNOME_CANVAS (qv->canvas),
+ 0.0, 0.0,
+ 300.0, y); /* FIXME: figure out reasonable sizes */
+
+ gnome_canvas_set_size (GNOME_CANVAS (qv->canvas), 300, y);
+}
+
+GtkWidget *
+quick_view_new (GnomeCalendar *calendar, char *title, GList *event_list)
+{
+ QuickView *qv;
+ GtkWidget *w;
+
+ g_return_val_if_fail (calendar != NULL, NULL);
+ g_return_val_if_fail (GNOME_IS_CALENDAR (calendar), NULL);
+
+ qv = gtk_type_new (quick_view_get_type ());
+ qv->calendar = calendar;
+
+ /* Create base widgets for the popup window */
+
+ w = gtk_frame_new (title);
+ gtk_container_add (GTK_CONTAINER (qv), w);
+ gtk_widget_show (w);
+
+ gtk_widget_push_visual (gdk_imlib_get_visual ());
+ gtk_widget_push_colormap (gdk_imlib_get_colormap ());
+
+ qv->canvas = gnome_canvas_new ();
+
+ gtk_widget_pop_colormap ();
+ gtk_widget_pop_visual ();
+
+ gtk_signal_connect (GTK_OBJECT (qv->canvas), "button_release_event",
+ (GtkSignalFunc) button_release,
+ qv);
+
+ gtk_container_add (GTK_CONTAINER (w), qv->canvas);
+ gtk_widget_show (qv->canvas);
+
+ /* Set up the event list */
+
+ setup_event_list (qv, event_list);
+
+ return GTK_WIDGET (qv);
+}
+
+void
+quick_view_do_popup (QuickView *qv, GdkEventButton *event)
+{
+ g_return_if_fail (qv != NULL);
+ g_return_if_fail (IS_QUICK_VIEW (qv));
+ g_return_if_fail (event != NULL);
+
+ /* Pop up the window */
+
+ gtk_widget_show (GTK_WIDGET (qv));
+ gtk_grab_add (GTK_WIDGET (qv));
+
+ gdk_pointer_grab (GTK_WIDGET (qv)->window,
+ TRUE,
+ GDK_BUTTON_RELEASE_MASK,
+ NULL,
+ NULL,
+ event->time);
+
+ qv->button = event->button;
+
+ gtk_main (); /* Begin modality */
+
+ /* The button release event handler will call gtk_main_quit() */
+}
diff --git a/calendar/gui/quick-view.h b/calendar/gui/quick-view.h
new file mode 100644
index 0000000000..c6b2cf8814
--- /dev/null
+++ b/calendar/gui/quick-view.h
@@ -0,0 +1,59 @@
+/* Quick view widget for Gnomecal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <federico@nuclecu.unam.mx
+ */
+
+#ifndef QUICK_VIEW_H
+#define QUICK_VIEW_H
+
+#include <libgnome/gnome-defs.h>
+#include "gnome-cal.h"
+
+
+BEGIN_GNOME_DECLS
+
+
+#define TYPE_QUICK_VIEW (quick_view_get_type ())
+#define QUICK_VIEW(obj) (GTK_CHECK_CAST ((obj), TYPE_QUICK_VIEW, QuickView))
+#define QUICK_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_QUICK_VIEW, QuickViewClass))
+#define IS_QUICK_VIEW(obj) (GTK_CHECK_TYPE ((obj), TYPE_QUICK_VIEW))
+#define IS_QUICK_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_QUICK_VIEW))
+
+
+typedef struct _QuickView QuickView;
+typedef struct _QuickViewClass QuickViewClass;
+
+struct _QuickView {
+ GtkWindow window;
+
+ GnomeCalendar *calendar; /* The calendar we are associated to */
+
+ GtkWidget *canvas; /* The canvas that displays the contents of the quick view */
+
+ int button; /* The button that was pressed to pop up the quick view */
+};
+
+struct _QuickViewClass {
+ GtkWindowClass parent_class;
+};
+
+
+/* Standard Gtk function */
+GtkType quick_view_get_type (void);
+
+/* Creates a new quick view with the specified title and the specified event list. It is associated
+ * to the specified calendar. The event list must be a list of CalendarObject structures.
+ */
+GtkWidget *quick_view_new (GnomeCalendar *calendar, char *title, GList *event_list);
+
+/* Pops up the quick view widget modally and loops until the uses closes it by releasing the mouse
+ * button. You can destroy the quick view when this function returns.
+ */
+void quick_view_do_popup (QuickView *qv, GdkEventButton *event);
+
+
+END_GNOME_DECLS
+
+#endif
diff --git a/calendar/gui/year-view.c b/calendar/gui/year-view.c
index 2027cac398..d5710228df 100644
--- a/calendar/gui/year-view.c
+++ b/calendar/gui/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,
diff --git a/calendar/quick-view.c b/calendar/quick-view.c
new file mode 100644
index 0000000000..cbb5cfb5c0
--- /dev/null
+++ b/calendar/quick-view.c
@@ -0,0 +1,217 @@
+/* Quick view widget for Gnomecal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <federico@nuclecu.unam.mx
+ */
+
+#include <config.h>
+#include "quick-view.h"
+#include "main.h"
+
+
+static void quick_view_class_init (QuickViewClass *class);
+static void quick_view_init (QuickView *qv);
+
+
+GtkType
+quick_view_get_type (void)
+{
+ static GtkType quick_view_type = 0;
+
+ if (!quick_view_type) {
+ GtkTypeInfo quick_view_info = {
+ "QuickView",
+ sizeof (QuickView),
+ sizeof (QuickViewClass),
+ (GtkClassInitFunc) quick_view_class_init,
+ (GtkObjectInitFunc) quick_view_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ quick_view_type = gtk_type_unique (gtk_window_get_type (), &quick_view_info);
+ }
+
+ return quick_view_type;
+}
+
+static void
+quick_view_class_init (QuickViewClass *class)
+{
+}
+
+static void
+quick_view_init (QuickView *qv)
+{
+ GTK_WINDOW (qv)->type = GTK_WINDOW_POPUP;
+ gtk_window_position (GTK_WINDOW (qv), GTK_WIN_POS_MOUSE);
+}
+
+/* Handles button release events from the canvas in the quick view. When a button release is
+ * received, it pops down the quick view and calls gtk_main_quit().
+ */
+static gint
+button_release (GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ QuickView *qv;
+
+ qv = data;
+
+ if (event->button != qv->button)
+ return FALSE;
+
+ gdk_pointer_ungrab (event->time);
+ gtk_grab_remove (GTK_WIDGET (qv));
+ gtk_widget_hide (GTK_WIDGET (qv));
+
+ gtk_main_quit (); /* End modality */
+ return TRUE;
+}
+
+
+/* Creates the items corresponding to a single calendar object. Takes in the y position of the
+ * items to create and returns the y position of the next item to create.
+ */
+double
+create_items_for_event (QuickView *qv, CalendarObject *co, double y)
+{
+ GnomeCanvas *canvas;
+ char start[100], end[100];
+ struct tm start_tm, end_tm;
+ char *str;
+
+ /* FIXME: make this nice */
+
+ canvas = GNOME_CANVAS (qv->canvas);
+
+ start_tm = *localtime (&co->ev_start);
+ end_tm = *localtime (&co->ev_end);
+
+ if (am_pm_flag) {
+ strftime (start, sizeof (start), "%I:%M%p", &start_tm);
+ strftime (end, sizeof (end), "%I:%M%p", &end_tm);
+ } else {
+ strftime (start, sizeof (start), "%H:%M", &start_tm);
+ strftime (end, sizeof (end), "%H:%M", &end_tm);
+ }
+
+ str = g_copy_strings (start, " - ", end, " ", co->ico->summary, NULL);
+
+ gnome_canvas_item_new (gnome_canvas_root (canvas),
+ gnome_canvas_text_get_type (),
+ "x", 0.0,
+ "y", y,
+ "anchor", GTK_ANCHOR_NW,
+ "text", str,
+ NULL);
+
+ g_free (str);
+
+ return (y + 16); /* FIXME */
+}
+
+/* Creates the canvas items corresponding to the events in the list */
+static void
+setup_event_list (QuickView *qv, GList *event_list)
+{
+ CalendarObject *co;
+ double y;
+
+ /* If there are no events, then just put a simple label */
+
+ if (!event_list) {
+ gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (qv->canvas)),
+ gnome_canvas_text_get_type (),
+ "x", 0.0,
+ "y", 0.0,
+ "anchor", GTK_ANCHOR_NW,
+ "text", _("No appointments scheduled for this day"),
+ NULL);
+ return;
+ }
+
+ /* Create the items for all the events in the list */
+
+ y = 0.0;
+
+ for (; event_list; event_list = event_list->next) {
+ co = event_list->data;
+ y = create_items_for_event (qv, co, y);
+ }
+
+ /* Set the scrolling region to fit all the items */
+
+ gnome_canvas_set_scroll_region (GNOME_CANVAS (qv->canvas),
+ 0.0, 0.0,
+ 300.0, y); /* FIXME: figure out reasonable sizes */
+
+ gnome_canvas_set_size (GNOME_CANVAS (qv->canvas), 300, y);
+}
+
+GtkWidget *
+quick_view_new (GnomeCalendar *calendar, char *title, GList *event_list)
+{
+ QuickView *qv;
+ GtkWidget *w;
+
+ g_return_val_if_fail (calendar != NULL, NULL);
+ g_return_val_if_fail (GNOME_IS_CALENDAR (calendar), NULL);
+
+ qv = gtk_type_new (quick_view_get_type ());
+ qv->calendar = calendar;
+
+ /* Create base widgets for the popup window */
+
+ w = gtk_frame_new (title);
+ gtk_container_add (GTK_CONTAINER (qv), w);
+ gtk_widget_show (w);
+
+ gtk_widget_push_visual (gdk_imlib_get_visual ());
+ gtk_widget_push_colormap (gdk_imlib_get_colormap ());
+
+ qv->canvas = gnome_canvas_new ();
+
+ gtk_widget_pop_colormap ();
+ gtk_widget_pop_visual ();
+
+ gtk_signal_connect (GTK_OBJECT (qv->canvas), "button_release_event",
+ (GtkSignalFunc) button_release,
+ qv);
+
+ gtk_container_add (GTK_CONTAINER (w), qv->canvas);
+ gtk_widget_show (qv->canvas);
+
+ /* Set up the event list */
+
+ setup_event_list (qv, event_list);
+
+ return GTK_WIDGET (qv);
+}
+
+void
+quick_view_do_popup (QuickView *qv, GdkEventButton *event)
+{
+ g_return_if_fail (qv != NULL);
+ g_return_if_fail (IS_QUICK_VIEW (qv));
+ g_return_if_fail (event != NULL);
+
+ /* Pop up the window */
+
+ gtk_widget_show (GTK_WIDGET (qv));
+ gtk_grab_add (GTK_WIDGET (qv));
+
+ gdk_pointer_grab (GTK_WIDGET (qv)->window,
+ TRUE,
+ GDK_BUTTON_RELEASE_MASK,
+ NULL,
+ NULL,
+ event->time);
+
+ qv->button = event->button;
+
+ gtk_main (); /* Begin modality */
+
+ /* The button release event handler will call gtk_main_quit() */
+}
diff --git a/calendar/quick-view.h b/calendar/quick-view.h
new file mode 100644
index 0000000000..c6b2cf8814
--- /dev/null
+++ b/calendar/quick-view.h
@@ -0,0 +1,59 @@
+/* Quick view widget for Gnomecal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <federico@nuclecu.unam.mx
+ */
+
+#ifndef QUICK_VIEW_H
+#define QUICK_VIEW_H
+
+#include <libgnome/gnome-defs.h>
+#include "gnome-cal.h"
+
+
+BEGIN_GNOME_DECLS
+
+
+#define TYPE_QUICK_VIEW (quick_view_get_type ())
+#define QUICK_VIEW(obj) (GTK_CHECK_CAST ((obj), TYPE_QUICK_VIEW, QuickView))
+#define QUICK_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_QUICK_VIEW, QuickViewClass))
+#define IS_QUICK_VIEW(obj) (GTK_CHECK_TYPE ((obj), TYPE_QUICK_VIEW))
+#define IS_QUICK_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_QUICK_VIEW))
+
+
+typedef struct _QuickView QuickView;
+typedef struct _QuickViewClass QuickViewClass;
+
+struct _QuickView {
+ GtkWindow window;
+
+ GnomeCalendar *calendar; /* The calendar we are associated to */
+
+ GtkWidget *canvas; /* The canvas that displays the contents of the quick view */
+
+ int button; /* The button that was pressed to pop up the quick view */
+};
+
+struct _QuickViewClass {
+ GtkWindowClass parent_class;
+};
+
+
+/* Standard Gtk function */
+GtkType quick_view_get_type (void);
+
+/* Creates a new quick view with the specified title and the specified event list. It is associated
+ * to the specified calendar. The event list must be a list of CalendarObject structures.
+ */
+GtkWidget *quick_view_new (GnomeCalendar *calendar, char *title, GList *event_list);
+
+/* Pops up the quick view widget modally and loops until the uses closes it by releasing the mouse
+ * button. You can destroy the quick view when this function returns.
+ */
+void quick_view_do_popup (QuickView *qv, GdkEventButton *event);
+
+
+END_GNOME_DECLS
+
+#endif
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,
commit/x11-wm?h=gnome-3.24&id=8da77d89d6f145bb6c1caec87e994ceda35c9552'>Upgrade to 0.16.7.1.vanilla2004-08-2518-8715/+1287 * Add enlightenment-docs, it's some data files of E doc viewer.vanilla2004-08-255-0/+92 * Fix build with gcc-3.4krion2004-08-241-0/+5 * Fix build with gcc-3.4krion2004-08-231-6/+12 * This now compiles on amd64.arved2004-08-221-4/+0 * - Fix build with gcc 3.4pav2004-08-222-2/+12 * - Convert to OPTIONSpav2004-08-211-13/+4 * Update to 0.5.1.marcus2004-08-192-3/+3 * Add PORTDOCSkrion2004-08-181-0/+10 * Add peksystray, a system tray "notification area" dockapp similar to thepav2004-08-175-0/+73 * Update to verion 1.2.16krion2004-08-178-213/+7 * Use shells/bash instead of shells/bash2 for RUN_DEPENDS.vs2004-08-161-1/+1 * Do not include the package name in the comment.krion2004-08-111-2/+2 * Update MASTER_SITES and WWW: linekrion2004-08-113-7/+10 * Update to version 0.8.6krion2004-08-113-21/+17 * Update to version 1.10krion2004-08-115-72/+24 * Reset maintainer. Much thanks to Stijn for maintaining the ports so far!vs2004-08-105-5/+5 * Clean up this port:mezz2004-08-102-24/+25 * - Update to 1.2.1pav2004-08-103-320/+20 * - Update to version 9hq2004-08-092-3/+3 * fluxbox-devel will merging into fluxbox sometime later when 1.0 is released,mezz2004-08-091-1/+1 * Reset maintainer.vs2004-08-091-1/+1 * - Update to 0.9.7vs2004-08-092-5/+4 * fix build with gcc 3.4.2oliver2004-08-092-1/+11 * Fix build with gcc-3.4.2krion2004-08-084-0/+67 * Fix build with gcc-3.4.2krion2004-08-082-0/+56 * Fix build with gcc-3.4.2krion2004-08-081-0/+15 * Fix build with gcc3.4krion2004-08-071-0/+10 * Hack around a window focus problem in the new metacity. This is a messy hack,marcus2004-08-072-0/+14 * Fix build with gcc-3.4krion2004-08-043-1/+20 * Update to 2.8.2.marcus2004-08-042-5/+5 * Wmconfig port update to V1.2.0edwin2004-08-042-3/+3 * Fix build with gcc-3.4.2krion2004-08-021-0/+15 * upgrade to 20040729ijliao2004-08-024-6/+6 * Back port post gcc 3.4.2 fixup from x11-wm/boxtools.clive2004-08-011-0/+15 * Post gcc 3.4.2 fixup.clive2004-08-011-0/+15 * -Add two new knobs, WITHOUT_SLIT and WITHOUT_TOOLBAR. [1]mezz2004-07-311-21/+39 * Fix build with gcc-3.2krion2004-07-302-6/+47 * - Install internationalization supportpav2004-07-304-3/+24 * - Fix distinfopav2004-07-302-4/+4 * Move a bunch of now unique stuff out of gnomehier and intoadamw2004-07-282-1/+5 * Update to version 2.9.2krion2004-07-262-3/+3 * - Add the X_WINDOW_SYSTEM={xorg,xfree86-4,xfree86-3} variable to bsd.port.mk,anholt2004-07-245-6/+6 * Start QT2 deorbit by removing expired ports.arved2004-07-237-108/+0 * Update to 1.0.7krion2004-07-212-3/+4 * Change maintainer's mail.krion2004-07-212-6/+6 * Fix MASTER_SITESkrion2004-07-211-1/+1 * update to xfce4-4.0.6oliver2004-07-1912-13/+20 * Add orion, a window manager written in Scheme.erwin2004-07-181-0/+1 * Add orion, a window manager written in Scheme.pav2004-07-184-0/+72 * - Drop explicit dependency on XFree86-4-clients. It's not really neededpav2004-07-171-3/+1 * Update to 1.1.9krion2004-07-172-5/+4 * Install documentationvs2004-07-141-0/+10 * Fix .skippyrc-parsing (bump PORTREVISION)vs2004-07-122-0/+23 * Pet portlintkrion2004-07-111-2/+2 * Support WITHOUT_NLSkrion2004-07-112-7/+14 * Apply a big libtool patch to allow porters to use the libtool installed bymarcus2004-07-1012-12/+12 * Change email address for my ports.sem2004-07-081-1/+1 * Use the new GConf handling policy, this will be required for GNOME 2.7/2.8 ormezz2004-07-082-48/+4 * Remove the double post-install. (copy-n-paste error)mezz2004-07-041-1/+0 * Autotools cleanup. Remove autoconf257 (259), automake17 (18), andade2004-07-021-1/+1 * -Add DOCS.mezz2004-07-012-5/+18 * Update to 3.2vs2004-06-302-5/+3 * Update to version 2.9.1krion2004-06-286-104/+88 * - Switch to bz2 distfilepav2004-06-263-16/+8 * - Update to 1.1.8pav2004-06-235-39/+339 * Introduce the new maintainer Bjorn Lindstromkrion2004-06-171-1/+1 * Upgrade to v1.3.0.jkoshy2004-06-173-4/+7 * Update to version 8.mezz2004-06-172-3/+3 * Disable configure warning.krion2004-06-161-0/+1 * Note that development ceased by setting DEPRECATED.vs2004-06-151-0/+2 * Add devilspie 0.4, a window manipulation tool.thierry2004-06-155-0/+66 * - Add WITH_MULTIBYTE knobpav2004-06-054-20/+18 * Sync with new bsd.autotools.mkade2004-06-055-8/+7 * Use IGNORE instead of BROKEN.vs2004-06-021-1/+1 * - Correct the message in WITHOUT_NLS, which it's really enable by default.mezz2004-06-023-6/+84 * - Update to 20040601pav2004-06-028-38/+12 * - This port was moved to x11-themes categorypav2004-06-0237-9434/+0 * - Populate new category x11-themes with some candidates from x11-wmpav2004-06-021-8/+0 * - Populate new category x11-themes with some suitable candidatespav2004-06-021-1/+1 * - Adjust CONFLICTS to match realitypav2004-06-011-1/+1 * - Unbreak on FreeBSD 5.xpav2004-05-312-8/+12 * - Register conflicts with ion-2pav2004-05-301-0/+2 * After repocopy from x11-wm/ion, add ion-2, a tiling tabbed window managerpav2004-05-3021-692/+335 * Mark as BROKEN:vs2004-05-281-0/+2 * Register conflicts with new port x11-wm/expocity.vs2004-05-261-0/+1 * Add expocity 2.6.2, a metacity spin-off with Expose(tm)-like features.vs2004-05-266-0/+267 * - Update to version 6.p1krion2004-05-264-14/+24 * - Update to version 1.2.14krion2004-05-2413-702/+373 * - Update to version 0.2krion2004-05-244-20/+21 * - Update to version 1.23krion2004-05-222-4/+3 * Remove inclusion of "${PORTSDIR}/x11/kde3/Makefile.kde", fix PTHREAD_LIBSlofi2004-05-222-3/+17 * - Update to version 0.5.0krion2004-05-203-4/+19 * - Remove dead MASTER_SITESkrion2004-05-201-2/+1 * The gdm script installed by xfce4 port doesn't use the defaultoliver2004-05-191-5/+1 * Mark as deprecated, since it does not work with the latest API changes.linimon2004-05-181-2/+3 * Start the QT2 deorbit by marking all ports that depend non-optionalarved2004-05-171-0/+3 * Drop maintainership on most of my ports. Feel free to grab 'em if youadamw2004-05-172-2/+2 * - Add note about supported window-managers to pkg-descrkrion2004-05-171-0/+2 * Add skippy 0.4.1,krion2004-05-175-0/+55 * Update to 0.6.2.linimon2004-05-113-945/+949 * Add more MASTER_SITE.ale2004-05-092-0/+2 * Add wmi 7, a window manager designed to be like Ion and LarsWM.petef2004-05-094-0/+44 * Drop maintainership; I don't use this from day-to-day thesedays.kris2004-05-061-1/+1 * Update to 2.8.1bland2004-05-053-4/+8 * - Mark BROKEN on amd64: runaway ccpav2004-05-031-1/+7 * Add our own do-install target so we respect ${PREFIX}.petef2004-05-031-0/+6 * Update to 0.4.1.petef2004-05-023-5/+5 * -Update to 0.9.9.mezz2004-05-016-95/+147 * - Update to version 0.2krion2004-04-293-13/+15 * fix pkg-plistoliver2004-04-221-1/+1 * Update to KDE 3.2.2lofi2004-04-201-2/+2 * Enable compilation with GCC 2.X.trevor2004-04-202-7/+74 * update to 4.0.5oliver2004-04-1912-30/+36 * - Add another MASTER_SITEale2004-04-181-1/+2 * - Fix the quit dialog box by using dynamic detection of gtk versionale2004-04-182-3/+60 * Unbreak olvwm for -CURRENT.green2004-04-18