diff options
Diffstat (limited to 'composer')
-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; |