From f5991437c3e620708f1701310bd1e67b40ca3b42 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 31 Aug 2009 12:53:52 -0400 Subject: Get EConfig and EEvent hooks working again. There were a number of problems: - Walk the GType tree to find EPluginHook subclasses, instead of just registering the immediate children. - Some EConfig and EEvent subclasses were not being configured properly (particularly the mail and calendar subclasses). - Add preference window pages after the main loop starts to make sure all plugins and plugin hooks are installed first. --- modules/addressbook/e-book-shell-backend.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'modules/addressbook/e-book-shell-backend.c') diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c index f96cb0dd22..1005a6b521 100644 --- a/modules/addressbook/e-book-shell-backend.c +++ b/modules/addressbook/e-book-shell-backend.c @@ -30,10 +30,11 @@ #include #include +#include "e-util/e-import.h" #include "shell/e-shell.h" #include "shell/e-shell-window.h" +#include "widgets/misc/e-preferences-window.h" -#include "e-util/e-import.h" #include "addressbook/gui/widgets/eab-gui-util.h" #include "addressbook/gui/contact-editor/e-contact-editor.h" #include "addressbook/gui/contact-list-editor/e-contact-list-editor.h" @@ -358,6 +359,26 @@ static GtkActionEntry source_entries[] = { G_CALLBACK (action_address_book_new_cb) } }; +static gboolean +book_shell_backend_init_preferences (EShell *shell) +{ + GtkWidget *preferences_window; + + /* This is a main loop idle callback. */ + + preferences_window = e_shell_get_preferences_window (shell); + + e_preferences_window_add_page ( + E_PREFERENCES_WINDOW (preferences_window), + "contacts", + "preferences-autocompletion", + _("Contacts"), + autocompletion_config_new (shell), + 200); + + return FALSE; +} + static gboolean book_shell_backend_handle_uri_cb (EShellBackend *shell_backend, const gchar *uri) @@ -507,10 +528,11 @@ book_shell_backend_constructed (GObject *object) G_CALLBACK (book_shell_backend_window_created_cb), shell_backend); - /* Initialize settings before initializing preferences, - * since the preferences bind to the shell settings. */ e_book_shell_backend_init_settings (shell); - autocompletion_config_init (shell); + + /* Initialize preferences after the main loop starts so + * that all EPlugins and EPluginHooks are loaded first. */ + g_idle_add ((GSourceFunc) book_shell_backend_init_preferences, shell); } static void -- cgit v1.2.3