diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-06-30 22:47:59 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-06-30 22:47:59 +0800 |
commit | 8dc6bbd250891bcef9130a789c9b74a01be7f1cb (patch) | |
tree | abf0e8555b04f6748473ac8215e26fb7d6c44d35 /shell | |
parent | 99126d46e61ce19a72acb3dd8498729b025339ec (diff) | |
download | gsoc2013-evolution-8dc6bbd250891bcef9130a789c9b74a01be7f1cb.tar gsoc2013-evolution-8dc6bbd250891bcef9130a789c9b74a01be7f1cb.tar.gz gsoc2013-evolution-8dc6bbd250891bcef9130a789c9b74a01be7f1cb.tar.bz2 gsoc2013-evolution-8dc6bbd250891bcef9130a789c9b74a01be7f1cb.tar.lz gsoc2013-evolution-8dc6bbd250891bcef9130a789c9b74a01be7f1cb.tar.xz gsoc2013-evolution-8dc6bbd250891bcef9130a789c9b74a01be7f1cb.tar.zst gsoc2013-evolution-8dc6bbd250891bcef9130a789c9b74a01be7f1cb.zip |
Get the "startup-wizard" plugin working again.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-migrate.c | 19 | ||||
-rw-r--r-- | shell/e-shell-window.c | 2 | ||||
-rw-r--r-- | shell/e-shell.c | 6 | ||||
-rw-r--r-- | shell/main.c | 18 |
4 files changed, 32 insertions, 13 deletions
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 53df4106b4..f18c84685d 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -32,6 +32,8 @@ #include "e-util/e-fsutils.h" #include "e-util/e-util.h" +#include "es-event.h" + #define GCONF_VERSION_KEY "/apps/evolution/version" #define GCONF_LAST_VERSION_KEY "/apps/evolution/last_version" @@ -195,6 +197,7 @@ fail: gboolean e_shell_migrate_attempt (EShell *shell) { + ESEvent *ese; GConfClient *client; const gchar *key; const gchar *old_data_dir; @@ -283,7 +286,7 @@ check_old: string = g_strdup_printf ( "%d.%d.%d", last_major, last_minor, last_micro); response = e_error_run ( - NULL, "shel:upgrade-remove-1-4", string, NULL); + NULL, "shell:upgrade-remove-1-4", string, NULL); g_free (string); switch (response) { @@ -319,6 +322,20 @@ check_old: gconf_client_set_string (client, key, string, NULL); g_free (string); + /** @Event: Shell attempted upgrade + * @Shell: an #EShell + * @Id: upgrade.done + * @Target: ESMenuTargetState + * + * This event is emitted whenever the shell successfully attempts + * an upgrade. + **/ + ese = es_event_peek (); + e_event_emit ( + (EEvent *) ese, "upgrade.done", + (EEventTarget *) es_event_target_new_upgrade ( + ese, curr_major, curr_minor, curr_micro)); + return TRUE; } diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index bb913f74ea..f22d30e1fd 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -23,8 +23,6 @@ #include <gconf/gconf-client.h> -#include <es-event.h> - #include <e-util/e-plugin-ui.h> #include <e-util/e-util-private.h> diff --git a/shell/e-shell.c b/shell/e-shell.c index 547432bc2d..c9e8d46317 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -525,6 +525,12 @@ shell_constructed (GObject *object) shell_load_modules (E_SHELL (object)); shell_create_backends (E_SHELL (object)); + + /* e_shell_migrate_attempt() leads to code paths that rely on + * e_shell_get_default(), so set the default shell first. */ + if (default_shell == NULL) + default_shell = g_object_ref (object); + e_shell_migrate_attempt (E_SHELL (object)); } diff --git a/shell/main.c b/shell/main.c index 438f09d7a9..7a04cee149 100644 --- a/shell/main.c +++ b/shell/main.c @@ -279,8 +279,6 @@ show_development_warning(void) gtk_widget_destroy (warning_dialog); - idle_cb (NULL); - return skip; } @@ -631,7 +629,11 @@ create_default_shell (void) g_object_unref (conf_client); - default_shell = shell; + /* EShell keeps its own reference to the first instance for use + * in e_shell_get_default(), so it's safe to unreference here. */ + g_object_unref (shell); + + g_idle_add ((GSourceFunc) idle_cb, remaining_args); } gint @@ -662,7 +664,7 @@ main (gint argc, gchar **argv) gtk_init_with_args ( &argc, &argv, _("- The Evolution PIM and Email Client"), - entries, GETTEXT_PACKAGE, &error); + entries, (gchar *) GETTEXT_PACKAGE, &error); if (error != NULL) { g_printerr ("%s\n", error->message); g_error_free (error); @@ -756,11 +758,6 @@ main (gint argc, gchar **argv) gconf_client_set_bool ( client, SKIP_WARNING_DIALOG_KEY, show_development_warning (), NULL); - else - g_idle_add ((GSourceFunc) idle_cb, remaining_args); - -#else - g_idle_add ((GSourceFunc) idle_cb, remaining_args); #endif g_object_unref (client); @@ -769,7 +766,8 @@ main (gint argc, gchar **argv) gtk_main (); - /* Emit a warning if the shell is not finalized. */ + /* Drop what should be the last reference to the shell. + * Emit a warning if references are leaking somewhere. */ g_object_unref (default_shell); if (E_IS_SHELL (default_shell)) g_warning ("Shell not finalized on exit"); |