From 70fce0bbb0712dc70a15c481c0b65d68a98a4ff7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 28 Jan 2009 22:28:57 +0000 Subject: When invoking Evolution with URIs on the command-line (e.g. mailto:), terminate after all the windows for those URIs have been closed. svn path=/branches/kill-bonobo/; revision=37157 --- addressbook/gui/component/e-book-shell-module.c | 44 +++++++++++++------------ 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'addressbook/gui/component/e-book-shell-module.c') diff --git a/addressbook/gui/component/e-book-shell-module.c b/addressbook/gui/component/e-book-shell-module.c index b538c59559..139f55ffd4 100644 --- a/addressbook/gui/component/e-book-shell-module.c +++ b/addressbook/gui/component/e-book-shell-module.c @@ -63,7 +63,7 @@ void e_shell_module_init (GTypeModule *type_module); static void -book_shell_module_ensure_sources (EShellModule *shell_module) +book_module_ensure_sources (EShellModule *shell_module) { /* XXX This is basically the same algorithm across all modules. * Maybe we could somehow integrate this into EShellModule? */ @@ -193,7 +193,7 @@ book_shell_module_ensure_sources (EShellModule *shell_module) } static void -book_shell_module_init_importers (void) +book_module_init_importers (void) { EImportClass *import_class; EImportImporter *importer; @@ -217,9 +217,9 @@ book_shell_module_init_importers (void) } static void -book_shell_module_book_loaded_cb (EBook *book, - EBookStatus status, - gpointer user_data) +book_module_book_loaded_cb (EBook *book, + EBookStatus status, + gpointer user_data) { EContact *contact; GtkAction *action; @@ -280,8 +280,7 @@ action_contact_new_cb (GtkAction *action, if (book == NULL) book = e_book_new_default_addressbook (NULL); - e_book_async_open ( - book, FALSE, book_shell_module_book_loaded_cb, action); + e_book_async_open (book, FALSE, book_module_book_loaded_cb, action); } static void @@ -319,21 +318,21 @@ static GtkActionEntry source_entries[] = { }; static gboolean -book_shell_module_is_busy (EShellModule *shell_module) +book_module_is_busy (EShellModule *shell_module) { return !eab_editor_request_close_all (); } static gboolean -book_shell_module_shutdown (EShellModule *shell_module) +book_module_shutdown (EShellModule *shell_module) { /* FIXME */ return TRUE; } static gboolean -book_shell_module_handle_uri (EShellModule *shell_module, - const gchar *uri) +book_module_handle_uri_cb (EShellModule *shell_module, + const gchar *uri) { EUri *euri; const gchar *cp; @@ -398,19 +397,22 @@ book_shell_module_handle_uri (EShellModule *shell_module, } static void -book_shell_module_window_created (EShellModule *shell_module, - EShellWindow *shell_window) +book_module_window_created_cb (EShellModule *shell_module, + GtkWindow *window) { const gchar *module_name; + if (!E_IS_SHELL_WINDOW (window)) + return; + module_name = G_TYPE_MODULE (shell_module)->name; e_shell_window_register_new_item_actions ( - shell_window, module_name, + E_SHELL_WINDOW (window), module_name, item_entries, G_N_ELEMENTS (item_entries)); e_shell_window_register_new_source_actions ( - shell_window, module_name, + E_SHELL_WINDOW (window), module_name, source_entries, G_N_ELEMENTS (source_entries)); } @@ -422,8 +424,8 @@ static EShellModuleInfo module_info = { MODULE_SORT_ORDER, /* Methods */ - book_shell_module_is_busy, - book_shell_module_shutdown, + book_module_is_busy, + book_module_shutdown, e_book_shell_module_migrate }; @@ -447,18 +449,18 @@ e_shell_module_init (GTypeModule *type_module) certificate_manager_config_init (); #endif - book_shell_module_init_importers (); - book_shell_module_ensure_sources (shell_module); + book_module_init_importers (); + book_module_ensure_sources (shell_module); e_plugin_hook_register_type (eab_config_get_type ()); g_signal_connect_swapped ( shell, "handle-uri", - G_CALLBACK (book_shell_module_handle_uri), shell_module); + G_CALLBACK (book_module_handle_uri_cb), shell_module); g_signal_connect_swapped ( shell, "window-created", - G_CALLBACK (book_shell_module_window_created), shell_module); + G_CALLBACK (book_module_window_created_cb), shell_module); autocompletion_config_init (); } -- cgit v1.2.3