From d53eea370b1a53cbae519c92fa602d0e7aa5ecc8 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Tue, 15 Feb 2000 17:28:34 +0000 Subject: Add the unicode libraries as well. 2000-02-14 Miguel de Icaza * camel/providers/mbox/Makefile.am (libcamelmbox_la_LIBADD): Add the unicode libraries as well. * camel/camel-provider.c (camel_provider_register_as_module): Add error reporting here. Desire to use Solaris increases. Hair loss in the last two hours: 5,400. * camel/providers/mbox/camel-mbox-provider.c (camel_mbox_get_provider): Renamed function. * camel/camel.h: All include files use camel/ now here. * camel/providers/mbox/Makefile.am: Drop all the dynamism from Camel, and make this a standard library. * configure.in: set the UNICODE_LIBS variable here. 2000-02-14 Miguel de Icaza * folder-browser.c (folder_browser_load_folder): New routine, loads a camel folder. (folder_browser_set_uri): redo. * session.c: new file. Implements SessionStores to keep track of a Session/Store tuple. svn path=/trunk/; revision=1783 --- ChangeLog | 19 ++++++++++-- camel/camel-provider.c | 1 + camel/camel.h | 46 +++++++++++++++--------------- camel/gmime-utils.h | 2 +- camel/providers/mbox/Makefile.am | 7 +++-- camel/providers/mbox/camel-mbox-provider.c | 5 ++-- configure.in | 2 ++ e-util/Makefile.am | 4 ++- e-util/e-gui-utils.c | 10 +++++-- e-util/e-gui-utils.h | 2 +- mail/ChangeLog | 9 ++++++ mail/Makefile.am | 7 ++++- mail/folder-browser-factory.c | 2 ++ mail/folder-browser.c | 35 ++++++++++++++++++++++- mail/folder-browser.h | 2 ++ mail/main.c | 15 ++++++++-- mail/message-list.c | 15 +++++++--- tests/test11.c | 2 +- widgets/misc/e-gui-utils.c | 10 +++++-- widgets/misc/e-gui-utils.h | 2 +- 20 files changed, 149 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1b941ab8b..f8344e219b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2000-02-14 Miguel de Icaza + + * camel/providers/mbox/Makefile.am (libcamelmbox_la_LIBADD): Add + the unicode libraries as well. + + * camel/camel-provider.c (camel_provider_register_as_module): Add + error reporting here. Desire to use Solaris increases. Hair loss + in the last two hours: 5,400. + + * camel/providers/mbox/camel-mbox-provider.c + (camel_mbox_get_provider): Renamed function. + + * camel/camel.h: All include files use camel/ now here. + + * camel/providers/mbox/Makefile.am: Drop all the dynamism from + Camel, and make this a standard library. + 2000-02-15 bertrand * camel/camel-mime-part.c: include gmime-base64.h @@ -58,8 +75,6 @@ New function. Allows to get the current position of a seekable stream. - - 2000-02-14 NotZed * configure.in (EXTRA_GNOME_CFLAGS): Add libunicode to CFLAGS/LIBS. diff --git a/camel/camel-provider.c b/camel/camel-provider.c index 7328f4ca64..0cff8564a1 100644 --- a/camel/camel-provider.c +++ b/camel/camel-provider.c @@ -105,6 +105,7 @@ camel_provider_register_as_module (const gchar *module_path) new_module = g_module_open (module_path, 0); if (!new_module) { + printf ("g_module_open reports: %s\n", g_module_error ()); CAMEL_LOG_WARNING ("CamelProvider::register_as_module Unable to load module %s\n", module_path); CAMEL_LOG_FULL_DEBUG ("Leaving CamelProvider::register_as_module\n"); return NULL; diff --git a/camel/camel.h b/camel/camel.h index 0e41d32742..b3ee0dcf03 100644 --- a/camel/camel.h +++ b/camel/camel.h @@ -38,29 +38,29 @@ extern "C" { #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include gint camel_init (); diff --git a/camel/gmime-utils.h b/camel/gmime-utils.h index 2e0682fcf9..cf352cb798 100644 --- a/camel/gmime-utils.h +++ b/camel/gmime-utils.h @@ -36,7 +36,7 @@ extern "C" { #include #include -#include +#include typedef struct { diff --git a/camel/providers/mbox/Makefile.am b/camel/providers/mbox/Makefile.am index 9b5b40ff84..c89d38db94 100644 --- a/camel/providers/mbox/Makefile.am +++ b/camel/providers/mbox/Makefile.am @@ -4,8 +4,9 @@ SUBDIRS = libcamelmboxincludedir = $(includedir)/camel +providerdir = $(libdir)/evolution/camel-providers/$(VERSION) -lib_LTLIBRARIES = libcamelmbox.la +provider_LTLIBRARIES = libcamelmbox.la INCLUDES = -I.. -I$(srcdir)/.. -I$(includedir) \ -I$(top_srcdir)/intl \ @@ -30,9 +31,9 @@ libcamelmboxinclude_HEADERS = \ camel-mbox-utils.h -libcamelmbox_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) +libcamelmbox_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) #libcamelmbox_la_LIBADD = -L$(top_srcdir)/libibex -libex -libcamelmbox_la_LIBADD = $(top_srcdir)/libibex/libibex.la +libcamelmbox_la_LIBADD = $(top_srcdir)/libibex/libibex.la $(UNICODE_LIBS) EXTRA_DIST = diff --git a/camel/providers/mbox/camel-mbox-provider.c b/camel/providers/mbox/camel-mbox-provider.c index c10e42f95e..873dca0954 100644 --- a/camel/providers/mbox/camel-mbox-provider.c +++ b/camel/providers/mbox/camel-mbox-provider.c @@ -38,11 +38,12 @@ static CamelProvider _mbox_provider = { (GModule *) NULL }; - - CamelProvider * camel_provider_module_init () { _mbox_provider.object_type = camel_mbox_store_get_type(); return &_mbox_provider; } + + + diff --git a/configure.in b/configure.in index 218e8a9ad3..36b069b690 100644 --- a/configure.in +++ b/configure.in @@ -111,6 +111,8 @@ dnl libunicode checking dnl ****************************** AC_MSG_CHECKING(For libunicode) if unicode-config --libs > /dev/null 2>&1; then + UNICODE_LIBS=`unicode-config --libs` + AC_SUBST(UNICODE_LIBS) AC_MSG_RESULT(found) else AC_MSG_ERROR(libunicode not found) diff --git a/e-util/Makefile.am b/e-util/Makefile.am index f81b2da282..151b0b107f 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -12,4 +12,6 @@ libeutil_a_SOURCES = \ e-cursors.h \ e-gui-utils.c \ e-gui-utils.h \ - e-util.h + e-util.h \ + e-setup.c \ + e-setup.h diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c index 7d9f4d49d9..9387d5015d 100644 --- a/e-util/e-gui-utils.c +++ b/e-util/e-gui-utils.c @@ -14,12 +14,18 @@ #include "e-gui-utils.h" void -e_notice (GtkWindow *window, const char *type, const char *str) +e_notice (GtkWindow *window, const char *type, const char *format, ...) { GtkWidget *dialog; + va_list args; + char *str; + va_start (args, format); + str = g_strdup_vprintf (format, args); dialog = gnome_message_box_new (str, type, GNOME_STOCK_BUTTON_OK, NULL); - + va_end (args); + g_free (str); + if (window) gnome_dialog_set_parent (GNOME_DIALOG (dialog), window); diff --git a/e-util/e-gui-utils.h b/e-util/e-gui-utils.h index 95b8f0b5a1..b5518f032b 100644 --- a/e-util/e-gui-utils.h +++ b/e-util/e-gui-utils.h @@ -6,7 +6,7 @@ void e_popup_menu (GtkMenu *menu, GdkEventButton *event); void e_auto_kill_popup_menu_on_hide (GtkMenu *menu); -void e_notice (GtkWindow *window, const char *type, const char *str); +void e_notice (GtkWindow *window, const char *type, const char *format, ...); #endif /* E_GUI_UTILS_H */ diff --git a/mail/ChangeLog b/mail/ChangeLog index 40ba1fca0d..4bd326610a 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2000-02-14 Miguel de Icaza + + * folder-browser.c (folder_browser_load_folder): New routine, + loads a camel folder. + (folder_browser_set_uri): redo. + + * session.c: new file. Implements SessionStores to keep track of + a Session/Store tuple. + 2000-02-13 Matt Loper * html-stream.c (html_stream_new): Second param of gtk_html_begin diff --git a/mail/Makefile.am b/mail/Makefile.am index 36c61e427d..8132951901 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -1,10 +1,13 @@ bin_PROGRAMS = evolution-mail test-mail +providerdir = $(libdir)/evolution/camel-providers/$(VERSION) + INCLUDES = \ -DEVOLUTION_VERSION=\""$(VERSION)"\" \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ -DEVOLUTION_LOCALEDIR=\""$(datadir)/locale"\" \ + -DCAMEL_PROVIDERDIR=\""$(providerdir)"\" \ -I$(top_srcdir)/widgets \ -I$(top_srcdir)/widgets/e-text \ $(BONOBO_HTML_GNOME_CFLAGS) @@ -27,7 +30,9 @@ evolution_mail_SOURCES = \ mail-display.c \ main.c \ message-list.c \ - message-list.h + message-list.h \ + session.c \ + session.h evolution_mail_LDADD = \ ../widgets/e-table/libetable.a \ diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index fd696395b8..dc5afb79a6 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -32,6 +32,8 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) if (folder_browser == NULL) return NULL; + folder_browser_set_uri (FOLDER_BROWSER (folder_browser), "inbox"); + control = bonobo_control_new (folder_browser); if (control == NULL){ gtk_object_destroy (GTK_OBJECT (folder_browser)); diff --git a/mail/folder-browser.c b/mail/folder-browser.c index c74d49ced7..263577d6f9 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -11,6 +11,7 @@ #include #include "e-util/e-util.h" #include "folder-browser.h" +#include "session.h" #define PARENT_TYPE (gtk_table_get_type ()) @@ -27,6 +28,9 @@ folder_browser_destroy (GtkObject *object) if (folder_browser->uri) g_free (folder_browser->uri); + if (folder_browser->folder) + gtk_object_unref (GTK_OBJECT (folder_browser->folder)); + if (folder_browser->message_list) bonobo_object_unref (BONOBO_OBJECT (folder_browser->message_list)); @@ -41,14 +45,43 @@ folder_browser_class_init (GtkObjectClass *object_class) folder_browser_parent_class = gtk_type_class (PARENT_TYPE); } +static gboolean +folder_browser_load_folder (FolderBrowser *fb, const char *name) +{ + CamelFolder *new_folder; + CamelException *ex; + + ex = camel_exception_new (); + new_folder = camel_store_get_folder (default_session->store, name, ex); + + if (camel_exception_get_id (ex)){ + camel_exception_free (ex); + return FALSE; + } + camel_exception_free (ex); + + if (fb->folder) + gtk_object_unref (GTK_OBJECT (fb->folder)); + + fb->folder = new_folder; + + message_list_set_folder (fb->message_list, new_folder); + + return TRUE; +} + #define EQUAL(a,b) (strcmp (a,b) == 0) void folder_browser_set_uri (FolderBrowser *folder_browser, const char *uri) { + /* FIXME: hardcoded uri */ + if (!folder_browser_load_folder (folder_browser, "inbox")) + return; + if (folder_browser->uri) g_free (folder_browser->uri); - + folder_browser->uri = g_strdup (uri); } diff --git a/mail/folder-browser.h b/mail/folder-browser.h index 2e6fb8d1a4..f845c9f98b 100644 --- a/mail/folder-browser.h +++ b/mail/folder-browser.h @@ -22,6 +22,8 @@ typedef struct { * The current URI being displayed by the FolderBrowser */ char *uri; + CamelFolder *folder; + MessageList *message_list; GtkWidget *message_list_w; MailDisplay *mail_display; diff --git a/mail/main.c b/mail/main.c index 517d6190e2..2dceb6644e 100644 --- a/mail/main.c +++ b/mail/main.c @@ -13,12 +13,15 @@ #include "e-util/e-gui-utils.h" #include "main.h" -CORBA_Environment ev; CORBA_ORB orb; static void init_bonobo (int argc, char **argv) { + CORBA_Environment ev; + + CORBA_exception_init (&ev); + gnome_CORBA_init_with_popt_table ( "evolution-mail-component", "1.0", &argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); @@ -30,6 +33,8 @@ init_bonobo (int argc, char **argv) _("Mail Component: I could not initialize Bonobo")); exit (1); } + + CORBA_exception_free (&ev); } int @@ -38,13 +43,17 @@ main (int argc, char *argv []) bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); textdomain (PACKAGE); - CORBA_exception_init (&ev); - init_bonobo (argc, argv); + session_init (); + folder_browser_factory_init (); bonobo_main (); return 0; } + + + + diff --git a/mail/message-list.c b/mail/message-list.c index 2cb5044f6c..7c2db35b3c 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -55,18 +55,24 @@ static int ml_row_count (ETableModel *etm, void *data) { MessageList *message_list = data; - CamelException ex; - + CamelException *ex; + int v; + if (!message_list->folder) - return 1; + return 0; + + ex = camel_exception_new (); + v = camel_folder_get_message_count (message_list->folder, ex); + camel_exception_free (ex); - return camel_folder_get_message_count (message_list->folder, &ex); + return v; } static void * ml_value_at (ETableModel *etm, int col, int row, void *data) { static char buffer [10]; + switch (col){ case COL_ONLINE_STATUS: @@ -465,6 +471,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) gtk_object_ref (GTK_OBJECT (camel_folder)); + printf ("Modelo cambio!\n"); e_table_model_changed (message_list->table_model); } diff --git a/tests/test11.c b/tests/test11.c index 69b88c7ad4..cb9ff06f01 100644 --- a/tests/test11.c +++ b/tests/test11.c @@ -38,7 +38,7 @@ main (int argc, char**argv) gtk_init (&argc, &argv); camel_init (); ex = camel_exception_new (); - camel_provider_register_as_module ("/opt/gnome/lib/libcamelmbox.so.0"); + camel_provider_register_as_module ("./libcamelmbox.so.0"); session = camel_session_new (); store = camel_session_get_store (session, store_url); diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c index 7d9f4d49d9..9387d5015d 100644 --- a/widgets/misc/e-gui-utils.c +++ b/widgets/misc/e-gui-utils.c @@ -14,12 +14,18 @@ #include "e-gui-utils.h" void -e_notice (GtkWindow *window, const char *type, const char *str) +e_notice (GtkWindow *window, const char *type, const char *format, ...) { GtkWidget *dialog; + va_list args; + char *str; + va_start (args, format); + str = g_strdup_vprintf (format, args); dialog = gnome_message_box_new (str, type, GNOME_STOCK_BUTTON_OK, NULL); - + va_end (args); + g_free (str); + if (window) gnome_dialog_set_parent (GNOME_DIALOG (dialog), window); diff --git a/widgets/misc/e-gui-utils.h b/widgets/misc/e-gui-utils.h index 95b8f0b5a1..b5518f032b 100644 --- a/widgets/misc/e-gui-utils.h +++ b/widgets/misc/e-gui-utils.h @@ -6,7 +6,7 @@ void e_popup_menu (GtkMenu *menu, GdkEventButton *event); void e_auto_kill_popup_menu_on_hide (GtkMenu *menu); -void e_notice (GtkWindow *window, const char *type, const char *str); +void e_notice (GtkWindow *window, const char *type, const char *format, ...); #endif /* E_GUI_UTILS_H */ -- cgit v1.2.3