aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-01 00:53:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-01 00:53:52 +0800
commitf5991437c3e620708f1701310bd1e67b40ca3b42 (patch)
treeb8fbe876e5c5eb0dd0e96d6505aabe898b09c6fb /modules/addressbook
parentcd0112576878cb5de3930835ff09f1562e9f5c10 (diff)
downloadgsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.gz
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.bz2
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.lz
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.xz
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.zst
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.zip
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.
Diffstat (limited to 'modules/addressbook')
-rw-r--r--modules/addressbook/autocompletion-config.c18
-rw-r--r--modules/addressbook/autocompletion-config.h2
-rw-r--r--modules/addressbook/e-book-shell-backend.c30
3 files changed, 31 insertions, 19 deletions
diff --git a/modules/addressbook/autocompletion-config.c b/modules/addressbook/autocompletion-config.c
index ac6a7d1860..eb0c802196 100644
--- a/modules/addressbook/autocompletion-config.c
+++ b/modules/addressbook/autocompletion-config.c
@@ -32,7 +32,6 @@
#include "e-util/e-binding.h"
#include "e-util/e-datetime-format.h"
-#include "widgets/misc/e-preferences-window.h"
static void
source_selection_changed_cb (ESourceSelector *source_selector)
@@ -129,19 +128,18 @@ add_section (GtkWidget *container,
return widget;
}
-void
-autocompletion_config_init (EShell *shell)
+GtkWidget *
+autocompletion_config_new (EShell *shell)
{
EShellSettings *shell_settings;
ESourceList *source_list;
GtkWidget *scrolled_window;
GtkWidget *source_selector;
- GtkWidget *preferences_window;
GtkWidget *itembox;
GtkWidget *widget;
GtkWidget *vbox;
- g_return_if_fail (E_IS_SHELL (shell));
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
shell_settings = e_shell_get_shell_settings (shell);
@@ -190,13 +188,5 @@ autocompletion_config_init (EShell *shell)
initialize_selection (E_SOURCE_SELECTOR (source_selector));
- preferences_window = e_shell_get_preferences_window (shell);
-
- e_preferences_window_add_page (
- E_PREFERENCES_WINDOW (preferences_window),
- "contacts",
- "preferences-autocompletion",
- _("Contacts"),
- vbox,
- 200);
+ return vbox;
}
diff --git a/modules/addressbook/autocompletion-config.h b/modules/addressbook/autocompletion-config.h
index 5769bdce9d..7f94a07ab9 100644
--- a/modules/addressbook/autocompletion-config.h
+++ b/modules/addressbook/autocompletion-config.h
@@ -30,7 +30,7 @@
G_BEGIN_DECLS
-void autocompletion_config_init (EShell *shell);
+GtkWidget * autocompletion_config_new (EShell *shell);
G_END_DECLS
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 <libedataserver/e-source.h>
#include <libedataserver/e-source-group.h>
+#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"
@@ -359,6 +360,26 @@ static GtkActionEntry source_entries[] = {
};
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