aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-04-23 08:26:37 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-23 08:26:37 +0800
commit017a40b429a28c7b69abee005262794dde049e15 (patch)
tree5965707d649d9577ccb1d3b32b49c3923ccee9c8 /calendar/gui
parentcfa6fa95d6f841f23469cca197757bea2e983cf4 (diff)
downloadgsoc2013-evolution-017a40b429a28c7b69abee005262794dde049e15.tar.gz
gsoc2013-evolution-017a40b429a28c7b69abee005262794dde049e15.tar.zst
gsoc2013-evolution-017a40b429a28c7b69abee005262794dde049e15.zip
Made it use popup_menu().
1998-04-22 Federico Mena Quintero <federico@nuclecu.unam.mx> * gncal-full-day.c: Made it use popup_menu(). * popup-menu.c: New file with utility functions for creating popup menus. Maybe such a thing would be useful in libgnomeui, a la gnome-app-helper? * Makefile.am (gnomecal_SOURCES): Added popup-menu.[ch] to the sources. 1998-04-21 Federico Mena Quintero <federico@nuclecu.unam.mx> * gncal-todo.c: New widget for editing TODO lists. This will be worked on a lot. * Makefile.am (gnomecal_SOURCES): Added gncal-todo.[ch] to the sources. * gncal-day-panel.c: Make it use the new TODO widget. svn path=/trunk/; revision=189
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/Makefile.am10
-rw-r--r--calendar/gui/calendar.c1
-rw-r--r--calendar/gui/gncal-day-panel.c44
-rw-r--r--calendar/gui/gncal-day-panel.h3
-rw-r--r--calendar/gui/gncal-day-view.c4
-rw-r--r--calendar/gui/gncal-full-day.c12
-rw-r--r--calendar/gui/gncal-todo.c234
-rw-r--r--calendar/gui/gncal-todo.h52
-rw-r--r--calendar/gui/main.c9
-rw-r--r--calendar/gui/main.h4
-rw-r--r--calendar/gui/popup-menu.c37
-rw-r--r--calendar/gui/popup-menu.h25
-rw-r--r--calendar/gui/prop.c2
-rw-r--r--calendar/gui/test.vcf12
-rw-r--r--calendar/gui/view-utils.c26
-rw-r--r--calendar/gui/view-utils.h9
16 files changed, 418 insertions, 66 deletions
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 61ace641f3..c0d18f5b55 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -16,6 +16,8 @@ gnomecal_SOURCES = \
calendar.h \
calobj.c \
calobj.h \
+ eventedit.c \
+ eventedit.h \
gncal-day-panel.c \
gncal-day-panel.h \
gncal-day-view.c \
@@ -24,21 +26,23 @@ gnomecal_SOURCES = \
gncal-full-day.h \
gncal-week-view.c \
gncal-week-view.h \
+ gncal-todo.c \
+ gncal-todo.h \
gncal-year-view.c \
gncal-year-view.h \
getdate.y \
gnome-cal.c \
gnome-cal.h \
main.c \
+ popup-menu.c \
+ popup-menu.h \
prop.c \
timeutil.c \
timeutil.h \
view-utils.h \
view-utils.c \
views.h \
- views.c \
- eventedit.c \
- eventedit.h
+ views.c
#gncal_SOURCES = \
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c
index d564c81a9d..f56ff082c8 100644
--- a/calendar/gui/calendar.c
+++ b/calendar/gui/calendar.c
@@ -214,6 +214,7 @@ calendar_get_todo_in_range (Calendar *cal, time_t start, time_t end, GCompareFun
{
return calendar_get_objects_in_range (cal->todo, start, end, sort_func);
}
+
GList *
calendar_get_journal_in_range (Calendar *cal, time_t start, time_t end, GCompareFunc sort_func)
{
diff --git a/calendar/gui/gncal-day-panel.c b/calendar/gui/gncal-day-panel.c
index 3cf2f57b24..26347428a6 100644
--- a/calendar/gui/gncal-day-panel.c
+++ b/calendar/gui/gncal-day-panel.c
@@ -47,13 +47,16 @@ day_view_range_activated (GncalFullDay *fullday, GncalDayPanel *dpanel)
}
static void
-full_day_mapped (GtkWidget *widget, GncalDayPanel *dpanel)
+full_day_size_allocated (GtkWidget *widget, GtkAllocation *allocation, GncalDayPanel *dpanel)
{
GtkAdjustment *adj;
+ int yoffset;
adj = gtk_scrolled_window_get_vadjustment (dpanel->fullday_sw);
- adj->value = gncal_full_day_get_day_start_yoffset (GNCAL_FULL_DAY (widget));
+ yoffset = gncal_full_day_get_day_start_yoffset (GNCAL_FULL_DAY (widget));
+
+ adj->value = adj->lower + (adj->upper - adj->lower) * (double) yoffset / allocation->height;
gtk_signal_emit_by_name (GTK_OBJECT (adj), "value_changed");
}
@@ -110,7 +113,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 0, 1, 1, 3,
+ 0, 1, 1, 4,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
@@ -124,10 +127,10 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
gtk_container_add (GTK_CONTAINER (dpanel->fullday_sw), w);
gtk_widget_show (w);
- /* When the full day widget gets mapped, we'll scroll the list to the proper initial position */
+ /* We'll scroll the list to the proper initial position */
- gtk_signal_connect (GTK_OBJECT (dpanel->fullday), "map",
- (GtkSignalFunc) full_day_mapped,
+ gtk_signal_connect (GTK_OBJECT (dpanel->fullday), "size_allocate",
+ (GtkSignalFunc) full_day_size_allocated,
dpanel);
/* Gtk calendar */
@@ -146,13 +149,23 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
0, 0);
gtk_widget_show (w);
- /* To-do */
+ /* Separator */
- w = gtk_button_new_with_label ("TODO");
- dpanel->todo_list = w;
+ w = gtk_hseparator_new ();
gtk_table_attach (GTK_TABLE (dpanel), w,
1, 2, 2, 3,
GTK_FILL | GTK_SHRINK,
+ GTK_FILL | GTK_SHRINK,
+ 0, 0);
+ gtk_widget_show (w);
+
+ /* To-do */
+
+ w = gncal_todo_new (calendar);
+ dpanel->todo = GNCAL_TODO (w);
+ gtk_table_attach (GTK_TABLE (dpanel), w,
+ 1, 2, 3, 4,
+ GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
gtk_widget_show (w);
@@ -164,13 +177,22 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
return GTK_WIDGET (dpanel);
}
+static void
+update (GncalDayPanel *dpanel, int update_fullday, iCalObject *ico, int flags)
+{
+ if (update_fullday)
+ gncal_full_day_update (dpanel->fullday, ico, flags);
+
+ gncal_todo_update (dpanel->todo, ico, flags);
+}
+
void
gncal_day_panel_update (GncalDayPanel *dpanel, iCalObject *ico, int flags)
{
g_return_if_fail (dpanel != NULL);
g_return_if_fail (GNCAL_IS_DAY_PANEL (dpanel));
- gncal_full_day_update (dpanel->fullday, ico, flags);
+ update (dpanel, TRUE, ico, flags);
}
void
@@ -195,4 +217,6 @@ gncal_day_panel_set (GncalDayPanel *dpanel, time_t start_of_day)
gtk_signal_handler_block (GTK_OBJECT (dpanel->gtk_calendar), dpanel->day_selected_id);
gtk_calendar_select_day (dpanel->gtk_calendar, tm->tm_mday);
gtk_signal_handler_unblock (GTK_OBJECT (dpanel->gtk_calendar), dpanel->day_selected_id);
+
+ update (dpanel, FALSE, NULL, 0);
}
diff --git a/calendar/gui/gncal-day-panel.h b/calendar/gui/gncal-day-panel.h
index aefbd5a3f9..8b62013ca7 100644
--- a/calendar/gui/gncal-day-panel.h
+++ b/calendar/gui/gncal-day-panel.h
@@ -15,6 +15,7 @@
#include <libgnomeui/gtkcalendar.h>
#include "gnome-cal.h"
#include "gncal-full-day.h"
+#include "gncal-todo.h"
BEGIN_GNOME_DECLS
@@ -39,7 +40,7 @@ struct _GncalDayPanel {
GncalFullDay *fullday;
GtkScrolledWindow *fullday_sw;
GtkCalendar *gtk_calendar;
- GtkWidget *todo_list;
+ GncalTodo *todo;
guint day_selected_id;
};
diff --git a/calendar/gui/gncal-day-view.c b/calendar/gui/gncal-day-view.c
index 59c11eab69..f513d65b83 100644
--- a/calendar/gui/gncal-day-view.c
+++ b/calendar/gui/gncal-day-view.c
@@ -12,6 +12,8 @@
#include "view-utils.h"
#include "main.h"
#include "eventedit.h"
+#include "popup-menu.h"
+
#define TEXT_BORDER 2
#define MIN_INFO_WIDTH 50
@@ -134,7 +136,7 @@ context_menu (GncalDayView *dayview, GdkEventButton *event)
};
main_items [0].data = dayview;
- popup_menu (main_items, 1, event->time);
+ popup_menu (main_items, 1, event);
}
static void
diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c
index 02ac1aece2..4501c95c02 100644
--- a/calendar/gui/gncal-full-day.c
+++ b/calendar/gui/gncal-full-day.c
@@ -14,6 +14,7 @@
#include "gncal-full-day.h"
#include "view-utils.h"
#include "main.h"
+#include "popup-menu.h"
#define TEXT_BORDER 2
@@ -61,6 +62,7 @@ struct drag_info {
guint32 click_time;
};
+
enum {
RANGE_ACTIVATED,
LAST_SIGNAL
@@ -347,7 +349,7 @@ delete_appointment (GtkWidget *widget, gpointer data)
}
static void
-child_popup_menu (GncalFullDay *fullday, Child *child, guint32 event_time)
+child_popup_menu (GncalFullDay *fullday, Child *child, GdkEventButton *event)
{
int sensitive;
@@ -367,7 +369,7 @@ child_popup_menu (GncalFullDay *fullday, Child *child, guint32 event_time)
child_items[0].sensitive = sensitive;
child_items[1].sensitive = sensitive;
- popup_menu (child_items, sizeof (child_items) / sizeof (child_items[0]), event_time);
+ popup_menu (child_items, sizeof (child_items) / sizeof (child_items[0]), event);
}
static void
@@ -503,7 +505,7 @@ child_button_press (GtkWidget *widget, GdkEventButton *event, gpointer data)
fullday = GNCAL_FULL_DAY (widget->parent);
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "button_press_event");
- child_popup_menu (fullday, child, event->time);
+ child_popup_menu (fullday, child, event);
return TRUE;
}
@@ -1490,7 +1492,7 @@ button_3 (GncalFullDay *fullday, GdkEventButton *event)
main_items[0].data = fullday;
- popup_menu (main_items, sizeof (main_items) / sizeof (main_items[0]), event->time);
+ popup_menu (main_items, sizeof (main_items) / sizeof (main_items[0]), event);
return TRUE;
} else {
@@ -1499,7 +1501,7 @@ button_3 (GncalFullDay *fullday, GdkEventButton *event)
if (!child || on_text)
return FALSE;
- child_popup_menu (fullday, child, event->time);
+ child_popup_menu (fullday, child, event);
return TRUE;
}
diff --git a/calendar/gui/gncal-todo.c b/calendar/gui/gncal-todo.c
new file mode 100644
index 0000000000..7b39aef35b
--- /dev/null
+++ b/calendar/gui/gncal-todo.c
@@ -0,0 +1,234 @@
+/* To-do widget for gncal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <quartic@gimp.org>
+ */
+
+#include <string.h>
+#include "gncal-todo.h"
+
+
+static void gncal_todo_init (GncalTodo *todo);
+
+
+guint
+gncal_todo_get_type (void)
+{
+ static guint todo_type = 0;
+
+ if (!todo_type) {
+ GtkTypeInfo todo_info = {
+ "GncalTodo",
+ sizeof (GncalTodo),
+ sizeof (GncalTodoClass),
+ (GtkClassInitFunc) NULL,
+ (GtkObjectInitFunc) gncal_todo_init,
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL
+ };
+
+ todo_type = gtk_type_unique (gtk_vbox_get_type (), &todo_info);
+ }
+
+ return todo_type;
+}
+
+static void
+add_todo (GncalTodo *todo)
+{
+ /* FIXME */
+}
+
+static void
+edit_todo (GncalTodo *todo)
+{
+ /* FIXME */
+}
+
+static void
+delete_todo (GncalTodo *todo)
+{
+ /* FIXME */
+}
+
+static void
+clist_row_selected (GtkCList *clist, gint row, gint column, GdkEventButton *event, GncalTodo *todo)
+{
+ if (!event)
+ return;
+
+ switch (event->button) {
+ case 1:
+ if (event->type == GDK_2BUTTON_PRESS)
+ edit_todo (todo);
+ break;
+
+ case 3:
+ /* FIXME: popup menu */
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void
+add_button_clicked (GtkWidget *widget, GncalTodo *todo)
+{
+ add_todo (todo);
+}
+
+static void
+edit_button_clicked (GtkWidget *widget, GncalTodo *todo)
+{
+ edit_todo (todo);
+}
+
+static void
+delete_button_clicked (GtkWidget *widget, GncalTodo *todo)
+{
+ delete_todo (todo);
+}
+
+static void
+gncal_todo_init (GncalTodo *todo)
+{
+ char *titles[] = { _("Done"), _("Pri"), _("Summary") };
+ GtkWidget *w;
+ GtkWidget *hbox;
+
+ gtk_box_set_spacing (GTK_BOX (todo), 4);
+
+ /* Label */
+
+ w = gtk_label_new (_("To-do list"));
+ gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (todo), w, FALSE, FALSE, 0);
+ gtk_widget_show (w);
+
+ /* Clist */
+
+ w = gtk_clist_new_with_titles (3, titles);
+ todo->clist = GTK_CLIST (w);
+
+ gtk_clist_set_column_width (todo->clist, 0, 30); /* eek */
+ gtk_clist_set_column_width (todo->clist, 1, 20); /* eek */
+ gtk_clist_set_policy (todo->clist, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_clist_set_selection_mode (todo->clist, GTK_SELECTION_BROWSE);
+
+ gtk_signal_connect (GTK_OBJECT (todo->clist), "select_row",
+ (GtkSignalFunc) clist_row_selected,
+ todo);
+
+ gtk_box_pack_start (GTK_BOX (todo), w, TRUE, TRUE, 0);
+ gtk_widget_show (w);
+
+ /* Box for buttons */
+
+ hbox = gtk_hbox_new (TRUE, 4);
+ gtk_box_pack_start (GTK_BOX (todo), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+
+ /* Add */
+
+ w = gtk_button_new_with_label (_("Add..."));
+ gtk_signal_connect (GTK_OBJECT (w), "clicked",
+ (GtkSignalFunc) add_button_clicked,
+ todo);
+ gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
+ gtk_widget_show (w);
+
+ /* Edit */
+
+ w = gtk_button_new_with_label (_("Edit..."));
+ todo->edit_button = w;
+ gtk_widget_set_sensitive (w, FALSE);
+ gtk_signal_connect (GTK_OBJECT (w), "clicked",
+ (GtkSignalFunc) edit_button_clicked,
+ todo);
+ gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
+ gtk_widget_show (w);
+
+ /* Delete */
+
+ w = gtk_button_new_with_label (_("Delete"));
+ todo->delete_button = w;
+ gtk_widget_set_sensitive (w, FALSE);
+ gtk_signal_connect (GTK_OBJECT (w), "clicked",
+ (GtkSignalFunc) delete_button_clicked,
+ todo);
+ gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
+ gtk_widget_show (w);
+}
+
+GtkWidget *
+gncal_todo_new (GnomeCalendar *calendar)
+{
+ GncalTodo *todo;
+
+ g_return_val_if_fail (calendar != NULL, NULL);
+
+ todo = gtk_type_new (gncal_todo_get_type ());
+
+ todo->calendar = calendar;
+
+ gncal_todo_update (todo, NULL, 0);
+
+ return GTK_WIDGET (todo);
+}
+
+static void
+insert_in_clist (GncalTodo *todo, iCalObject *ico)
+{
+ int i;
+ char buf[20];
+ char *text[3] = { NULL, NULL, ico->summary };
+ iCalObject *row_ico;
+
+ if (ico->priority == 0) {
+ strcpy (buf, "?"); /* undefined priority */
+ text[1] = buf;
+
+ i = gtk_clist_append (todo->clist, text);
+ } else {
+ sprintf (buf, "%d", ico->priority);
+ text[1] = buf;
+
+ /* Find proper place in clist to insert object. Objects are sorted by priority. */
+
+ for (i = 0; i < todo->clist->rows; i++) {
+ row_ico = gtk_clist_get_row_data (todo->clist, i);
+
+ if (ico->priority >= row_ico->priority)
+ break;
+ }
+
+ gtk_clist_insert (todo->clist, i, text);
+ }
+
+ /* Set the appropriate "done" icon and hook the object to the row */
+
+ gtk_clist_set_row_data (todo->clist, i, ico);
+}
+
+void
+gncal_todo_update (GncalTodo *todo, iCalObject *ico, int flags)
+{
+ GList *list;
+
+ g_return_if_fail (todo != NULL);
+ g_return_if_fail (GNCAL_IS_TODO (todo));
+
+ gtk_clist_freeze (todo->clist);
+
+ gtk_clist_clear (todo->clist);
+
+ for (list = todo->calendar->cal->todo; list; list = list->next)
+ insert_in_clist (todo, list->data);
+
+ gtk_clist_thaw (todo->clist);
+
+ gtk_widget_set_sensitive (todo->edit_button, (todo->clist->rows > 0));
+ gtk_widget_set_sensitive (todo->delete_button, (todo->clist->rows > 0));
+}
diff --git a/calendar/gui/gncal-todo.h b/calendar/gui/gncal-todo.h
new file mode 100644
index 0000000000..cb32c25421
--- /dev/null
+++ b/calendar/gui/gncal-todo.h
@@ -0,0 +1,52 @@
+/* To-do widget for gncal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <quartic@gimp.org>
+ */
+
+#ifndef GNCAL_TODO_H
+#define GNCAL_TODO_H
+
+#include <gtk/gtkclist.h>
+#include <gtk/gtkvbox.h>
+#include <libgnome/gnome-defs.h>
+#include "gnome-cal.h"
+
+
+BEGIN_GNOME_DECLS
+
+
+#define GNCAL_TODO(obj) GTK_CHECK_CAST (obj, gncal_todo_get_type (), GncalTodo)
+#define GNCAL_TODO_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gncal_todo_get_type (), GncalTodoClass)
+#define GNCAL_IS_TODO(obj) GTK_CHECK_TYPE (obj, gncal_todo_get_type ())
+
+
+typedef struct _GncalTodo GncalTodo;
+typedef struct _GncalTodoClass GncalTodoClass;
+
+struct _GncalTodo {
+ GtkVBox vbox;
+
+ GnomeCalendar *calendar; /* the calendar we are associated to */
+
+ GtkCList *clist;
+
+ GtkWidget *edit_button;
+ GtkWidget *delete_button;
+};
+
+struct _GncalTodoClass {
+ GtkVBoxClass parent_class;
+};
+
+
+guint gncal_todo_get_type (void);
+GtkWidget *gncal_todo_new (GnomeCalendar *calendar);
+
+void gncal_todo_update (GncalTodo *todo, iCalObject *ico, int flags);
+
+
+END_GNOME_DECLS
+
+#endif
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index b7e7ad0b37..f7d7838fe4 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -295,7 +295,7 @@ static GnomeUIInfo gnome_cal_file_menu [] = {
{ GNOME_APP_UI_ITEM, N_("Open calendar..."), NULL, open_calendar_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN },
- { GNOME_APP_UI_ITEM, N_("Save calendar..."), NULL, save_calendar_cmd, NULL, NULL,
+ { GNOME_APP_UI_ITEM, N_("Save calendar"), NULL, save_calendar_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE },
{ GNOME_APP_UI_ITEM, N_("Save calendar as..."), NULL, save_as_calendar_cmd, NULL, NULL,
@@ -312,7 +312,7 @@ static GnomeUIInfo gnome_cal_file_menu [] = {
};
static GnomeUIInfo gnome_cal_about_menu [] = {
- { GNOME_APP_UI_ITEM, N_("About"), NULL, about_calendar_cmd, NULL, NULL,
+ { GNOME_APP_UI_ITEM, N_("About..."), NULL, about_calendar_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT },
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_HELP ("cal"),
@@ -320,8 +320,9 @@ static GnomeUIInfo gnome_cal_about_menu [] = {
};
static GnomeUIInfo gnome_cal_edit_menu [] = {
- { GNOME_APP_UI_ITEM, N_("New appointment"), NULL, display_objedit },
- { GNOME_APP_UI_ITEM, N_("Properties"), NULL, properties, NULL, NULL,
+ { GNOME_APP_UI_ITEM, N_("New appointment..."), NULL, display_objedit },
+ GNOMEUIINFO_SEPARATOR,
+ { GNOME_APP_UI_ITEM, N_("Properties..."), NULL, properties, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PROP },
GNOMEUIINFO_END
};
diff --git a/calendar/gui/main.h b/calendar/gui/main.h
index adab317549..81605a55f6 100644
--- a/calendar/gui/main.h
+++ b/calendar/gui/main.h
@@ -1,3 +1,5 @@
+#ifndef MAIN_H
+#define MAIN_H
extern int day_begin, day_end;
extern char *user_name;
@@ -5,3 +7,5 @@ extern int am_pm_flag;
void properties (void);
void day_range_changed (void);
+
+#endif
diff --git a/calendar/gui/popup-menu.c b/calendar/gui/popup-menu.c
new file mode 100644
index 0000000000..3686183146
--- /dev/null
+++ b/calendar/gui/popup-menu.c
@@ -0,0 +1,37 @@
+/* Popup menu utilities for gncal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <quartic@gimp.org>
+ */
+
+#include <config.h>
+#include <gnome.h>
+#include "popup-menu.h"
+
+
+void
+popup_menu (struct menu_item *items, int nitems, GdkEventButton *event)
+{
+ GtkWidget *menu;
+ GtkWidget *item;
+ int i;
+
+ menu = gtk_menu_new (); /* FIXME: this baby is never freed */
+
+ for (i = 0; i < nitems; i++) {
+ if (items[i].text) {
+ item = gtk_menu_item_new_with_label (_(items[i].text));
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ items[i].callback,
+ items[i].data);
+ gtk_widget_set_sensitive (item, items[i].sensitive);
+ } else
+ item = gtk_menu_item_new ();
+
+ gtk_widget_show (item);
+ gtk_menu_append (GTK_MENU (menu), item);
+ }
+
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time);
+}
diff --git a/calendar/gui/popup-menu.h b/calendar/gui/popup-menu.h
new file mode 100644
index 0000000000..a4590dbb98
--- /dev/null
+++ b/calendar/gui/popup-menu.h
@@ -0,0 +1,25 @@
+/* Popup menu utilities for gncal
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena <quartic@gimp.org>
+ */
+
+#ifndef POPUP_MENU_H
+#define POPUP_MENU_H
+
+#include <gdk/gdktypes.h>
+#include <gtk/gtksignal.h>
+
+
+struct menu_item {
+ char *text;
+ GtkSignalFunc callback;
+ gpointer data;
+ int sensitive;
+};
+
+void popup_menu (struct menu_item *items, int nitems, GdkEventButton *event);
+
+
+#endif
diff --git a/calendar/gui/prop.c b/calendar/gui/prop.c
index 717c875086..8032e919f1 100644
--- a/calendar/gui/prop.c
+++ b/calendar/gui/prop.c
@@ -87,7 +87,7 @@ toggled ()
void
properties (void)
{
- GtkWidget *t, *f, *l, *ds, *de;
+ GtkWidget *t, *l, *ds, *de;
GtkWidget *r2;
if (prop_win)
diff --git a/calendar/gui/test.vcf b/calendar/gui/test.vcf
index f2910c50d8..4010e70457 100644
--- a/calendar/gui/test.vcf
+++ b/calendar/gui/test.vcf
@@ -3,7 +3,7 @@ BEGIN:VCALENDAR
PRODID:-//K Desktop Environment//NONSGML KOrganizer//EN
TZ:-05
VERSION:1.0
-BEGIN:VEVENT
+BEGIN:VTODO
DCREATED:19980402T023552
UID:KOrganizer - 1804289383
SEQUENCE:1
@@ -19,7 +19,7 @@ RRULE:W1 WE TH FR SU #10
RELATED-TO:0
X-PILOTID:0
X-PILOTSTAT:0
-END:VEVENT
+END:VTODO
BEGIN:VEVENT
DCREATED:19980402T023552
@@ -39,7 +39,7 @@ X-PILOTID:0
X-PILOTSTAT:0
END:VEVENT
-BEGIN:VEVENT
+BEGIN:VTODO
DCREATED:19980402T023552
UID:KOrganizer - 1804289383
SEQUENCE:1
@@ -55,7 +55,7 @@ RRULE:W1 #4
RELATED-TO:0
X-PILOTID:0
X-PILOTSTAT:0
-END:VEVENT
+END:VTODO
BEGIN:VEVENT
DCREATED:19980402T023552
@@ -75,7 +75,7 @@ X-PILOTID:0
X-PILOTSTAT:0
END:VEVENT
-BEGIN:VEVENT
+BEGIN:VTODO
DCREATED:19980402T023558
UID:KOrganizer - 846930886
SEQUENCE:1
@@ -90,7 +90,7 @@ TRANSP:0
RELATED-TO:0
X-PILOTID:0
X-PILOTSTAT:0
-END:VEVENT
+END:VTODO
BEGIN:VEVENT
DCREATED:19980402T023558
diff --git a/calendar/gui/view-utils.c b/calendar/gui/view-utils.c
index e8b78deeca..1571c2f31e 100644
--- a/calendar/gui/view-utils.c
+++ b/calendar/gui/view-utils.c
@@ -124,29 +124,3 @@ view_utils_draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectang
rect->x, rect->y,
rect->width, rect->height);
}
-
-void
-popup_menu (struct menu_item *items, int nitems, guint32 time)
-{
- GtkWidget *menu;
- GtkWidget *item;
- int i;
-
- menu = gtk_menu_new (); /* FIXME: this baby is never freed */
-
- for (i = 0; i < nitems; i++) {
- if (items[i].text) {
- item = gtk_menu_item_new_with_label (_(items[i].text));
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- items[i].callback,
- items[i].data);
- gtk_widget_set_sensitive (item, items[i].sensitive);
- } else
- item = gtk_menu_item_new ();
-
- gtk_widget_show (item);
- gtk_menu_append (GTK_MENU (menu), item);
- }
-
- gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, time);
-}
diff --git a/calendar/gui/view-utils.h b/calendar/gui/view-utils.h
index f351b4885d..a1876b6032 100644
--- a/calendar/gui/view-utils.h
+++ b/calendar/gui/view-utils.h
@@ -25,13 +25,4 @@ void view_utils_draw_events (GtkWidget *widget, GdkWindow *window, GdkGC *gc, Gd
void view_utils_draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow);
-struct menu_item {
- char *text;
- GtkSignalFunc callback;
- gpointer data;
- int sensitive;
-};
-
-void popup_menu (struct menu_item *items, int nitems, guint32 time);
-
#endif