From 18813ccd8f4367ac98348f08e183d858cfe963f5 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 10 Aug 2010 21:17:40 +0100 Subject: Defer the load / creation of configuration UI with changes to e_preferences_window to take factory callbacks and store a reference to the shell. - This makes start-up substantially faster, particularly on Atom (eg.). Remove a number of idle handlers used to create these UIs in the first instance, cleaning the code. --- modules/calendar/e-cal-shell-backend.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'modules/calendar/e-cal-shell-backend.c') diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index cab1f2fa3d..8861a82cf3 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -441,26 +441,6 @@ cal_shell_backend_init_importers (void) e_import_class_add_importer (import_class, importer, NULL, NULL); } -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 ( - E_PREFERENCES_WINDOW (preferences_window), - "calendar-and-tasks", - "preferences-calendar-and-tasks", - _("Calendar and Tasks"), - calendar_prefs_dialog_new (shell), - 600); - - return FALSE; -} - static gboolean cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend, const gchar *uri) @@ -696,6 +676,7 @@ cal_shell_backend_constructed (GObject *object) { EShell *shell; EShellBackend *shell_backend; + GtkWidget *preferences_window; shell_backend = E_SHELL_BACKEND (object); shell = e_shell_backend_get_shell (shell_backend); @@ -716,9 +697,16 @@ cal_shell_backend_constructed (GObject *object) e_cal_shell_backend_init_settings (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); + /* Setup preference widget factories */ + preferences_window = e_shell_get_preferences_window (shell); + + e_preferences_window_add_page ( + E_PREFERENCES_WINDOW (preferences_window), + "calendar-and-tasks", + "preferences-calendar-and-tasks", + _("Calendar and Tasks"), + calendar_prefs_dialog_new, + 600); } static void -- cgit