diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-01 00:53:52 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-01 00:53:52 +0800 |
commit | f5991437c3e620708f1701310bd1e67b40ca3b42 (patch) | |
tree | b8fbe876e5c5eb0dd0e96d6505aabe898b09c6fb /modules/calendar | |
parent | cd0112576878cb5de3930835ff09f1562e9f5c10 (diff) | |
download | gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.gz 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/calendar')
-rw-r--r-- | modules/calendar/e-cal-config-hook.c | 8 | ||||
-rw-r--r-- | modules/calendar/e-cal-event-hook.c | 10 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 13 |
3 files changed, 20 insertions, 11 deletions
diff --git a/modules/calendar/e-cal-config-hook.c b/modules/calendar/e-cal-config-hook.c index 4a0522460c..e3d9678168 100644 --- a/modules/calendar/e-cal-config-hook.c +++ b/modules/calendar/e-cal-config-hook.c @@ -35,11 +35,15 @@ static const EConfigHookTargetMap targets[] = { }; static void -cal_config_hook_class_init (EPluginHookClass *class) +cal_config_hook_class_init (EConfigHookClass *class) { + EPluginHookClass *plugin_hook_class; gint ii; - class->id = "org.gnome.evolution.calendar.config:1.0"; + plugin_hook_class = E_PLUGIN_HOOK_CLASS (class); + plugin_hook_class->id = "org.gnome.evolution.calendar.config:1.0"; + + class->config_class = g_type_class_ref (e_cal_config_get_type ()); for (ii = 0; targets[ii].type != NULL; ii++) e_config_hook_class_add_target_map ( diff --git a/modules/calendar/e-cal-event-hook.c b/modules/calendar/e-cal-event-hook.c index b263727107..d90162ded7 100644 --- a/modules/calendar/e-cal-event-hook.c +++ b/modules/calendar/e-cal-event-hook.c @@ -35,15 +35,15 @@ static const EEventHookTargetMap targets[] = { }; static void -cal_event_hook_class_init (EPluginHookClass *class) +cal_event_hook_class_init (EEventHookClass *class) { - EEventHookClass *event_hook_class; + EPluginHookClass *plugin_hook_class; gint ii; - event_hook_class = (EEventHookClass *) class; - event_hook_class->event = (EEvent *) e_cal_event_peek (); + plugin_hook_class = E_PLUGIN_HOOK_CLASS (class); + plugin_hook_class->id = "org.gnome.evolution.calendar.events:1.0"; - class->id = "org.gnome.evolution.calendar.events:1.0"; + class->event = (EEvent *) e_cal_event_peek (); for (ii = 0; targets[ii].type != NULL; ii++) e_event_hook_class_add_target_map ( diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 5149574323..6511d0e453 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -523,11 +523,13 @@ cal_shell_backend_init_importers (void) e_import_class_add_importer (import_class, importer, NULL, NULL); } -static void +static gboolean cal_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 ( @@ -537,6 +539,8 @@ cal_shell_backend_init_preferences (EShell *shell) _("Calendar and Tasks"), calendar_prefs_dialog_new (shell), 600); + + return FALSE; } static gboolean @@ -770,10 +774,11 @@ cal_shell_backend_constructed (GObject *object) cal_shell_backend_init_importers (); - /* Initialize settings before initializing preferences, - * since the preferences bind to the shell settings. */ e_cal_shell_backend_init_settings (shell); - cal_shell_backend_init_preferences (shell); + + /* Initialize preferences after the main loop starts so + * that all EPlugins and EPluginHooks are loaded first. */ + g_idle_add ((GSourceFunc) cal_shell_backend_init_preferences, shell); } static void |