aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser-factory.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-02-07 11:25:28 +0800
committerChris Lahey <clahey@src.gnome.org>2001-02-07 11:25:28 +0800
commit71c965734eb20a39456ecc7c6f87052059cd23d4 (patch)
tree9de2181c8139c9357080ec9a92bb3ee224cee7bb /mail/folder-browser-factory.c
parent8c88be844bdfd12b93c5977f69ae51fdb14cc459 (diff)
downloadgsoc2013-evolution-71c965734eb20a39456ecc7c6f87052059cd23d4.tar.gz
gsoc2013-evolution-71c965734eb20a39456ecc7c6f87052059cd23d4.tar.zst
gsoc2013-evolution-71c965734eb20a39456ecc7c6f87052059cd23d4.zip
Added libmenus.la.
2001-02-06 Christopher James Lahey <clahey@ximian.com> * Makefile.am (evolution_mail_LDADD): Added libmenus.la. * folder-browser-factory.c (control_activate): Added GalView menus here. * message-list.c, message-list.h (message_list_get_layout): Made message_list_get_layout export. svn path=/trunk/; revision=8041
Diffstat (limited to 'mail/folder-browser-factory.c')
-rw-r--r--mail/folder-browser-factory.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c
index e04ddf7aef..32d5bd11d4 100644
--- a/mail/folder-browser-factory.c
+++ b/mail/folder-browser-factory.c
@@ -20,6 +20,11 @@
#include <gal/util/e-util.h>
#include <gal/widgets/e-gui-utils.h>
+#include "widgets/menus/gal-view-menus.h"
+
+#include <gal/menus/gal-view-factory-etable.h>
+#include <gal/menus/gal-view-etable.h>
+
#include "folder-browser-factory.h"
#include "folder-browser.h"
@@ -151,6 +156,53 @@ update_pixmaps (BonoboUIComponent *uic)
}
static void
+display_view(GalViewCollection *collection,
+ GalView *view,
+ gpointer data)
+{
+ FolderBrowser *fb = data;
+ if (GAL_IS_VIEW_ETABLE(view)) {
+ e_table_set_state_object(e_table_scrolled_get_table(E_TABLE_SCROLLED(fb->message_list)), GAL_VIEW_ETABLE(view)->state);
+ }
+}
+
+static void
+folder_browser_setup_menus (FolderBrowser *fb,
+ BonoboUIComponent *uic)
+{
+ GalViewCollection *collection;
+ GalViewMenus *views;
+ GalViewFactory *factory;
+ ETableSpecification *spec;
+ char *spec_string;
+
+ collection = gal_view_collection_new();
+ /* FIXME: Memory leak. */
+ gal_view_collection_set_storage_directories(collection,
+ EVOLUTION_DATADIR "/evolution/views/mail/",
+ gnome_util_prepend_user_home("/evolution/views/mail/"));
+
+ spec_string = message_list_get_layout(fb->message_list);
+ spec = e_table_specification_new();
+ e_table_specification_load_from_string(spec, spec_string);
+ g_free(spec_string);
+
+ 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, fb);
+ /* gtk_object_sink(GTK_OBJECT(views)); */
+
+ gtk_object_sink(GTK_OBJECT(collection));
+}
+
+static void
control_activate (BonoboControl *control,
BonoboUIComponent *uic,
FolderBrowser *fb)
@@ -197,6 +249,8 @@ control_activate (BonoboControl *control,
bonobo_ui_component_add_listener (uic, "ViewSource",
folder_browser_toggle_view_source,
folder_browser);
+
+ folder_browser_setup_menus (fb, uic);
update_pixmaps (uic);