aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog13
-rw-r--r--calendar/gui/Makefile.am1
-rw-r--r--calendar/gui/e-calendar-table.c6
-rw-r--r--calendar/gui/e-calendar-table.h2
-rw-r--r--calendar/gui/e-tasks.c47
-rw-r--r--calendar/gui/e-tasks.h19
-rw-r--r--calendar/gui/tasks-control.c3
7 files changed, 82 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 589ea22f6d..43f49a9807 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,16 @@
+2001-02-13 Christopher James Lahey <clahey@ximian.com>
+
+ * gui/Makefile.am (evolution_calendar_LDADD): Added libmenus.la.
+
+ * gui/e-calendar-table.c, gui/e-calendar-table.h
+ (e_calendar_table_get_spec): Added this function.
+
+ * gui/e-tasks.c, gui/e-tasks.h (e_tasks_setup_menus): Added this
+ function.
+
+ * gui/tasks-control.c (tasks_control_activate): Call
+ e_tasks_setup_menus.
+
2001-02-13 JP Rosevear <jpr@ximian.com>
* gui/e-tasks.c (e_tasks_new_task): call task_editor_focus
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 547134d67e..432acf0676 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -123,6 +123,7 @@ evolution_calendar_LDADD = \
$(top_builddir)/libical/src/libical/libical.la \
$(top_builddir)/widgets/meeting-time-sel/libevolutionmtsel.a \
$(top_builddir)/widgets/misc/libemiscwidgets.a \
+ $(top_builddir)/widgets/menus/libmenus.la \
dialogs/libcal-dialogs.a \
$(BONOBO_HTML_GNOME_LIBS) \
$(BONOBO_VFS_GNOME_LIBS) \
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 6b063ec2cf..ba3d1dedb3 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -682,3 +682,9 @@ e_calendar_table_on_row_deleted (ETableModel *model,
being efficient. It doesn't happen often. */
e_calendar_table_apply_filter (cal_table);
}
+
+const gchar *
+e_calendar_table_get_spec (void)
+{
+ return E_CALENDAR_TABLE_SPEC;
+}
diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h
index 555ea357af..89a57552b3 100644
--- a/calendar/gui/e-calendar-table.h
+++ b/calendar/gui/e-calendar-table.h
@@ -109,6 +109,8 @@ gboolean e_calendar_table_filter_by_category (ECalendarTable *cal_table,
CalComponent *comp,
gpointer filter_data);
+const gchar *e_calendar_table_get_spec (void);
+
#ifdef __cplusplus
}
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index f098a2011b..92917d6d55 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -27,6 +27,10 @@
#include <gnome.h>
#include <gal/util/e-util.h>
#include <gal/e-table/e-table-scrolled.h>
+#include <gal/menus/gal-view-collection.h>
+#include <gal/menus/gal-view-factory-etable.h>
+#include <gal/menus/gal-view-etable.h>
+#include "widgets/menus/gal-view-menus.h"
#include "dialogs/task-editor.h"
#include "e-calendar-table.h"
#include "component-factory.h"
@@ -518,3 +522,46 @@ e_tasks_add_menu_item (gpointer key,
return FALSE;
}
+static void
+display_view(GalViewCollection *collection,
+ GalView *view,
+ gpointer data)
+{
+ ETasks *tasks = data;
+ if (GAL_IS_VIEW_ETABLE(view)) {
+ e_table_set_state_object (e_table_scrolled_get_table (E_TABLE_SCROLLED (E_CALENDAR_TABLE (tasks->priv->tasks_view)->etable)), GAL_VIEW_ETABLE (view)->state);
+ }
+}
+
+void
+e_tasks_setup_menus (ETasks *tasks,
+ BonoboUIComponent *uic)
+{
+ GalViewCollection *collection;
+ GalViewMenus *views;
+ GalViewFactory *factory;
+ ETableSpecification *spec;
+
+ collection = gal_view_collection_new();
+ /* FIXME: Memory leak. */
+ gal_view_collection_set_storage_directories (collection,
+ EVOLUTION_DATADIR "/evolution/views/tasks/",
+ gnome_util_prepend_user_home ("/evolution/views/tasks/"));
+
+ spec = e_table_specification_new ();
+ e_table_specification_load_from_string (spec, e_calendar_table_get_spec());
+
+ factory = gal_view_factory_etable_new (spec);
+ gal_view_collection_add_factory (collection, factory);
+ gtk_object_sink (GTK_OBJECT (factory));
+
+ gal_view_collection_load (collection);
+
+ views = gal_view_menus_new (collection);
+ gal_view_menus_apply (views, uic, NULL); /* This function probably needs to sink the views object. */
+ gtk_signal_connect (GTK_OBJECT (collection), "display_view",
+ display_view, tasks);
+ /* gtk_object_sink(GTK_OBJECT(views)); */
+
+ gtk_object_sink (GTK_OBJECT (collection));
+}
diff --git a/calendar/gui/e-tasks.h b/calendar/gui/e-tasks.h
index f63ac92a65..94dc8607f6 100644
--- a/calendar/gui/e-tasks.h
+++ b/calendar/gui/e-tasks.h
@@ -27,7 +27,7 @@
#define _E_TASKS_H_
#include <cal-client/cal-client.h>
-
+#include <bonobo.h>
#define E_TYPE_TASKS (e_tasks_get_type ())
#define E_TASKS(obj) (GTK_CHECK_CAST ((obj), E_TYPE_TASKS, ETasks))
@@ -52,17 +52,20 @@ struct _ETasksClass {
};
-GtkType e_tasks_get_type (void);
-GtkWidget *e_tasks_construct (ETasks *tasks);
+GtkType e_tasks_get_type (void);
+GtkWidget *e_tasks_construct (ETasks *tasks);
+
+GtkWidget *e_tasks_new (void);
-GtkWidget *e_tasks_new (void);
+gboolean e_tasks_open (ETasks *tasks,
+ char *file);
-gboolean e_tasks_open (ETasks *tasks,
- char *file);
+CalClient *e_tasks_get_cal_client (ETasks *tasks);
-CalClient *e_tasks_get_cal_client (ETasks *tasks);
+void e_tasks_new_task (ETasks *tasks);
-void e_tasks_new_task (ETasks *tasks);
+void e_tasks_setup_menus (ETasks *tasks,
+ BonoboUIComponent *uic);
#endif /* _E_TASKS_H_ */
diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c
index c93836f1fa..08b49ff306 100644
--- a/calendar/gui/tasks-control.c
+++ b/calendar/gui/tasks-control.c
@@ -180,7 +180,6 @@ static BonoboUIVerb verbs [] = {
BONOBO_UI_VERB_END
};
-
static void
tasks_control_activate (BonoboControl *control,
ETasks *tasks)
@@ -203,6 +202,8 @@ tasks_control_activate (BonoboControl *control,
"evolution-tasks.xml",
"evolution-tasks");
+ e_tasks_setup_menus(tasks, uic);
+
bonobo_ui_component_thaw (uic, NULL);
}