diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-02-14 09:31:15 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-02-14 09:31:15 +0800 |
commit | 95bf4f0c42a162f24c1a3c267c70b33425007374 (patch) | |
tree | b8b481c02b22b67f314413d675235650efd10beb /calendar/gui/e-tasks.c | |
parent | ed519da4de52d20def1bea7191af7bdb1c57ef90 (diff) | |
download | gsoc2013-evolution-95bf4f0c42a162f24c1a3c267c70b33425007374.tar.gz gsoc2013-evolution-95bf4f0c42a162f24c1a3c267c70b33425007374.tar.zst gsoc2013-evolution-95bf4f0c42a162f24c1a3c267c70b33425007374.zip |
Added libmenus.la.
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.
svn path=/trunk/; revision=8219
Diffstat (limited to 'calendar/gui/e-tasks.c')
-rw-r--r-- | calendar/gui/e-tasks.c | 47 |
1 files changed, 47 insertions, 0 deletions
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)); +} |