diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-19 00:18:42 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-19 00:18:42 +0800 |
commit | 4187293731274274e4283d9039f6e30c95578118 (patch) | |
tree | ab8ce6e6bc9316846097b827157e0f664cf57634 /shell/main.c | |
parent | 28b28bf057056d2aa28458b322319bf679608ae5 (diff) | |
download | gsoc2013-evolution-4187293731274274e4283d9039f6e30c95578118.tar.gz gsoc2013-evolution-4187293731274274e4283d9039f6e30c95578118.tar.zst gsoc2013-evolution-4187293731274274e4283d9039f6e30c95578118.zip |
Merge revisions 35993:36015 from trunk.
Adapt recent "crash recovery" changes to new architecture.
svn path=/branches/kill-bonobo/; revision=36018
Diffstat (limited to 'shell/main.c')
-rw-r--r-- | shell/main.c | 98 |
1 files changed, 4 insertions, 94 deletions
diff --git a/shell/main.c b/shell/main.c index ab15fdc3db..2af41079c4 100644 --- a/shell/main.c +++ b/shell/main.c @@ -86,10 +86,6 @@ #define SKIP_WARNING_DIALOG_KEY \ "/apps/evolution/shell/skip_warning_dialog" -#define SKIP_RECOVERY_DIALOG_KEY \ - "/apps/evolution/shell/skip_recovery_dialog" -#define RECOVERY_KEY \ - "/apps/evolution/shell/recovery" /* Command-line options. */ static gboolean start_online = FALSE; @@ -268,70 +264,6 @@ destroy_config (GConfClient *client) #endif /* DEVELOPMENT */ -static int -show_recovery_warning(void) -{ - GtkWidget *vbox; - GtkWidget *label; - GtkWidget *warning_dialog; - GtkWidget *checkbox; - GtkWidget *alignment; - gboolean skip; - char *text; - int flags = 0, response; - - warning_dialog = gtk_dialog_new (); - gtk_window_set_title (GTK_WINDOW (warning_dialog), _("Evolution Crash Detection")); - gtk_window_set_modal (GTK_WINDOW (warning_dialog), TRUE); - gtk_dialog_add_button (GTK_DIALOG (warning_dialog), _("Ig_nore"), GTK_RESPONSE_CANCEL); - gtk_dialog_add_button (GTK_DIALOG (warning_dialog), _("_Recover"), GTK_RESPONSE_OK); - - gtk_dialog_set_has_separator (GTK_DIALOG (warning_dialog), FALSE); - - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (warning_dialog)->vbox), 0); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (warning_dialog)->action_area), 12); - - vbox = gtk_vbox_new (FALSE, 12); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (warning_dialog)->vbox), vbox, - TRUE, TRUE, 0); - - text = g_strdup( - /* xgettext:no-c-format */ - _("Evolution appears to have exited unexpectedly the last time it was\n" - "run. As a precautionary measure, all preview panes will be hidden.\n" - "You can restore the preview panes from the View menu.\n")); - label = gtk_label_new (text); - g_free(text); - - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); - - gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); - - checkbox = gtk_check_button_new_with_mnemonic (_("_Do not show this message again")); - - alignment = gtk_alignment_new (0.0, 0.0, 0.0, 0.0); - - gtk_container_add (GTK_CONTAINER (alignment), checkbox); - gtk_box_pack_start (GTK_BOX (vbox), alignment, TRUE, TRUE, 0); - - gtk_widget_show_all (warning_dialog); - - response = gtk_dialog_run (GTK_DIALOG (warning_dialog)); - - if (response != GTK_RESPONSE_CANCEL) - flags = flags|(1<<1); - - skip = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)); - if (skip) - flags = flags|(1<<2); - - gtk_widget_destroy (warning_dialog); - - return flags; -} - static void open_uris (gchar **uris) { @@ -370,32 +302,6 @@ idle_cb (gchar **uris) open_uris (uris); else { EShellWindow *shell_window; - GConfClient *client = gconf_client_get_default (); - - if (gconf_client_get_bool (client, RECOVERY_KEY, NULL) && e_file_lock_exists ()) { - /* It should have crashed last time or a force-shutdown */ - gboolean skip = gconf_client_get_bool (client, SKIP_RECOVERY_DIALOG_KEY, NULL); - gboolean recover = TRUE; - if (!skip){ - int flags = show_recovery_warning (); - - gconf_client_set_bool (client, SKIP_RECOVERY_DIALOG_KEY, (flags & (1<<2)) ? TRUE : FALSE, NULL); - recover = (flags & (1<<1)) ? TRUE: FALSE; - } - - if (recover) { - /* Disable the previews */ - gconf_client_set_bool (client, "/apps/evolution/mail/display/show_preview", FALSE, NULL); - gconf_client_set_bool (client, "/apps/evolution/mail/display/safe_list", TRUE, NULL); - gconf_client_set_bool (client, "/apps/evolution/addressbook/display/show_preview", FALSE, NULL); - gconf_client_set_bool (client, "/apps/evolution/calendar/display/show_task_preview", FALSE, NULL); - } - /* Let us not delete and recreate a lock, instead reuse it. We don't use timestamps anyways */ - } else { - /* What great can we do, if lock creation fails ?*/ - e_file_lock_create (); - } - g_object_unref (client); shell_window = e_shell_create_window (); /* XXX Switch to default_component_id. */ @@ -710,5 +616,9 @@ main (int argc, char **argv) #ifdef G_OS_WIN32 link_shutdown (); #endif + + /* Indicates a clean shut down to the next session. */ + e_file_lock_destroy (); + return 0; } |