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 ++++++++++++----------- addressbook/gui/contact-editor/e-contact-editor.c | 6 ++++ 2 files changed, 29 insertions(+), 21 deletions(-) (limited to 'addressbook/gui') 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 (); } diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index e5686d3f76..8499e774db 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -52,6 +52,7 @@ #include "misc/e-url-entry.h" #include "e-util/e-icon-factory.h" #include "e-util/e-util-private.h" +#include "shell/e-shell.h" #include "eab-contact-merging.h" @@ -3359,6 +3360,7 @@ static void e_contact_editor_init (EContactEditor *e_contact_editor) { GladeXML *gui; + EShell *shell; GtkWidget *widget, *label; GtkEntryCompletion *completion; char *gladefile; @@ -3436,6 +3438,10 @@ e_contact_editor_init (EContactEditor *e_contact_editor) /* show window */ gtk_widget_show (e_contact_editor->app); + + /* FIXME Shell should be passed in. */ + shell = e_shell_get_default (); + e_shell_watch_window (shell, GTK_WINDOW (e_contact_editor->app)); } static void -- cgit