diff options
author | Larry Ewing <lewing@ximian.com> | 2001-07-10 11:57:41 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2001-07-10 11:57:41 +0800 |
commit | c417a47019c45c3d556700ecb5e5ffb225fc0eb1 (patch) | |
tree | 4fd914e10849d62a52e94ae33cdd3e9b0e56aed8 | |
parent | d680e4010862070e48be4d9181e024c3704e0b59 (diff) | |
download | gsoc2013-evolution-c417a47019c45c3d556700ecb5e5ffb225fc0eb1.tar gsoc2013-evolution-c417a47019c45c3d556700ecb5e5ffb225fc0eb1.tar.gz gsoc2013-evolution-c417a47019c45c3d556700ecb5e5ffb225fc0eb1.tar.bz2 gsoc2013-evolution-c417a47019c45c3d556700ecb5e5ffb225fc0eb1.tar.lz gsoc2013-evolution-c417a47019c45c3d556700ecb5e5ffb225fc0eb1.tar.xz gsoc2013-evolution-c417a47019c45c3d556700ecb5e5ffb225fc0eb1.tar.zst gsoc2013-evolution-c417a47019c45c3d556700ecb5e5ffb225fc0eb1.zip |
Only ask once about recovery, assume if they want to recover one file they
2001-07-09 Larry Ewing <lewing@ximian.com>
* e-msg-composer.c (autosave_manager_query_load_orphans): Only ask
once about recovery, assume if they want to recover one file they
want to recover all of them.
svn path=/trunk/; revision=10948
-rw-r--r-- | composer/ChangeLog | 6 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 36 |
2 files changed, 25 insertions, 17 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 81ba535b24..caaba4516e 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2001-07-09 Larry Ewing <lewing@ximian.com> + + * e-msg-composer.c (autosave_manager_query_load_orphans): Only ask + once about recovery, assume if they want to recover one file they + want to recover all of them. + 2001-07-09 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (e_msg_composer_new_with_message): Use diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 57d7fc988c..2d7e06e761 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1125,9 +1125,9 @@ autosave_is_owned (AutosaveManager *am, const char *file) static void autosave_query_cb (gint reply, gpointer data) { - int *ok = data; + int *yes = data; - *ok = !reply; + *yes = !reply; } static void @@ -1138,7 +1138,7 @@ autosave_manager_query_load_orphans (AutosaveManager *am, EMsgComposer *composer struct dirent *d; GSList *match = NULL; gint len = strlen (AUTOSAVE_SEED); - gint ok; + gint load = FALSE; dir = opendir (g_get_home_dir()); if (!dir) { @@ -1158,30 +1158,32 @@ autosave_manager_query_load_orphans (AutosaveManager *am, EMsgComposer *composer */ if (stat (filename, &st) < 0 || st.st_size == 0) { unlink (filename); + g_free (filename); continue; } - - dialog = gnome_ok_cancel_dialog_parented (_("Evolution has detected an editor buffer from a previous session.\n" - "Would you like to recover this buffer?"), - autosave_query_cb, &ok, GTK_WINDOW (composer)); - - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - - if (ok) - match = g_slist_prepend (match, filename); - else - g_free (filename); - + match = g_slist_prepend (match, filename); } } + if (match != NULL) { + dialog = gnome_question_dialog_parented (_("Evolution has found unsaved files from a previous sesiion.\n" + "Would you like to attempt recovery?"), + autosave_query_cb, &load, GTK_WINDOW (composer)); + + gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + } + while (match != NULL) { GSList *next = match->next; char *filename = match->data; EMsgComposer *composer; - composer = autosave_load_draft (filename); - + if (load) { + composer = autosave_load_draft (filename); + } else { + unlink (filename); + } + g_free (filename); g_slist_free_1 (match); match = next; |