From 71c965734eb20a39456ecc7c6f87052059cd23d4 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 7 Feb 2001 03:25:28 +0000 Subject: Added libmenus.la. 2001-02-06 Christopher James Lahey * 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 --- mail/ChangeLog | 10 ++++++++ mail/Makefile.am | 3 ++- mail/folder-browser-factory.c | 54 +++++++++++++++++++++++++++++++++++++++++++ mail/message-list.c | 2 +- mail/message-list.h | 2 ++ 5 files changed, 69 insertions(+), 2 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 55015025bf..a7854492ef 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2001-02-06 Christopher James Lahey + + * 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. + 2001-02-06 Iain Holmes * mail-display.c (pixbuf_gen_idle): Set the size of the icon to 24x24 diff --git a/mail/Makefile.am b/mail/Makefile.am index f37dc17f30..0cbec8d49e 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -120,11 +120,12 @@ evolution_mail_LDADD = \ $(top_builddir)/filter/libfilter.la \ $(top_builddir)/executive-summary/evolution-services/libevolution-services.la \ $(top_builddir)/shell/importer/libevolution-importer.la \ + $(top_builddir)/widgets/menus/libmenus.la \ $(BONOBO_VFS_GNOME_LIBS) \ $(EXTRA_GNOME_LIBS) \ $(GTKHTML_LIBS) \ $(THREADS_LIBS) \ - $(UNICODE_LIBS) + $(UNICODE_LIBS) evolution_mail_LDFLAGS = \ -export-dynamic 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 #include +#include "widgets/menus/gal-view-menus.h" + +#include +#include + #include "folder-browser-factory.h" #include "folder-browser.h" @@ -150,6 +155,53 @@ update_pixmaps (BonoboUIComponent *uic) set_pixmap (uic, "/Toolbar/Copy", "buttons/copy-message.png"); } +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, @@ -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); diff --git a/mail/message-list.c b/mail/message-list.c index 7ffc21aa95..f4cefc8788 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1155,7 +1155,7 @@ static char *list [] = { }; #endif -static char * +char * message_list_get_layout (MessageList *message_list) { /* Default: Status, Attachments, Priority, From, Subject, Date */ diff --git a/mail/message-list.h b/mail/message-list.h index 55971eb664..a432d50cc4 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -124,6 +124,8 @@ void message_list_hide_clear(MessageList *ml); void message_list_set_threaded(MessageList *ml, gboolean threaded); void message_list_set_search(MessageList *ml, const char *search); +char *message_list_get_layout (MessageList *message_list); + #define MESSAGE_LIST_LOCK(m, l) g_mutex_lock(((MessageList *)m)->l) #define MESSAGE_LIST_UNLOCK(m, l) g_mutex_unlock(((MessageList *)m)->l) -- cgit v1.2.3