aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-07-10 11:57:41 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-07-10 11:57:41 +0800
commitc417a47019c45c3d556700ecb5e5ffb225fc0eb1 (patch)
tree4fd914e10849d62a52e94ae33cdd3e9b0e56aed8 /composer/e-msg-composer.c
parentd680e4010862070e48be4d9181e024c3704e0b59 (diff)
downloadgsoc2013-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
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c36
1 files changed, 19 insertions, 17 deletions
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;