[evolution-patches] 40300, check for unsaved editor sessions at startup



This simple patch checks for unsaved files as soon as the mailer goes
interactive, rather than waiting till something starts a composer up.

It should, afaik, work even if the shell turns on/off interactivity, tho
this is untested (not sure this even happens).

Might even apply to 1.2, although its for a 1.3 bug.

 z

? mail/GNOME_Evolution_Mail.oaf
? mail/GNOME_Evolution_Mail.oafinfo
? mail/Mail-common.c
? mail/Mail-skels.c
? mail/Mail-stubs.c
? mail/Mail.h
? mail/a
? mail/a.out
? mail/bak
? mail/blah.c
? mail/blah.ps
? mail/changes.diff
? mail/conf.keys
? mail/diff
? mail/econf.h
? mail/mail-config.c.save
? mail/mail-config.evolution
? mail/mail-send-recv.c.save
? mail/message-list.c.save
? mail/ml.diff
? mail/old
? mail/out
? mail/store_change.diff
? mail/test-mt
? mail/typescript
? mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.oaf.in
? mail/importers/GNOME_Evolution_Mail_Mbox_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.oaf.in
? mail/importers/GNOME_Evolution_Mail_Outlook_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.oaf.in
? mail/importers/b
? mail/importers/elm-importer.c.new
? mail/importers/elm.ps
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.512
diff -u -3 -r1.512 ChangeLog
--- composer/ChangeLog	25 Mar 2003 15:48:48 -0000	1.512
+++ composer/ChangeLog	1 Apr 2003 06:25:01 -0000
@@ -1,3 +1,13 @@
+2003-04-01  Not Zed  <NotZed Ximian com>
+
+	** See bug #40300 & probably others.
+
+	* e-msg-composer.c (autosave_manager_query_load_orphans): make the
+	composer arg a parent arg, its only used parent the dialogue.
+	Fix caller casts.
+	(e_msg_composer_check_autosave): new function, checks for
+	autosave files, and recovers them per user instructions.
+
 2003-03-25  Dan Winship  <danw ximian com>
 
 	* e-msg-composer.c: Update for e_notice move
Index: composer/e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.374
diff -u -3 -r1.374 e-msg-composer.c
--- composer/e-msg-composer.c	25 Mar 2003 15:48:48 -0000	1.374
+++ composer/e-msg-composer.c	1 Apr 2003 06:25:03 -0000
@@ -1338,7 +1338,7 @@
 }
 
 static void
-autosave_manager_query_load_orphans (AutosaveManager *am, EMsgComposer *composer)
+autosave_manager_query_load_orphans (AutosaveManager *am, GtkWindow *parent)
 {
 	DIR *dir;
 	struct dirent *d;
@@ -1376,7 +1376,7 @@
 	if (match != NULL) {
 		GtkWidget *dialog;
 
-		dialog = gtk_message_dialog_new(GTK_WINDOW(composer),
+		dialog = gtk_message_dialog_new(parent,
 						GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
 						GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO,
 						_("Ximian Evolution has found unsaved files from a previous session.\n"
@@ -1477,7 +1477,7 @@
 		if (am->ask) {
 			/* keep recursion out of our bedrooms. */
 			am->ask = FALSE;
-			autosave_manager_query_load_orphans (am, composer);
+			autosave_manager_query_load_orphans (am, (GtkWindow *)composer);
 			am->ask = TRUE;
 		}
 	}
@@ -2941,7 +2941,6 @@
 	return new;
 }
 
-
 /**
  * e_msg_composer_new_post:
  *
@@ -4816,4 +4815,17 @@
 		return TRUE;
 	else
 		return FALSE;
+}
+
+void
+e_msg_composer_check_autosave(GtkWindow *parent)
+{
+	if (am == NULL)
+		am = autosave_manager_new();
+
+	if (am->ask) {
+		am->ask = FALSE;
+		autosave_manager_query_load_orphans (am, parent);
+		am->ask = TRUE;
+	}
 }
Index: composer/e-msg-composer.h
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.h,v
retrieving revision 1.80
diff -u -3 -r1.80 e-msg-composer.h
--- composer/e-msg-composer.h	18 Mar 2003 22:11:02 -0000	1.80
+++ composer/e-msg-composer.h	1 Apr 2003 06:25:03 -0000
@@ -205,6 +205,7 @@
 void                     e_msg_composer_drop_editor_undo                 (EMsgComposer      *composer);
 
 gboolean                 e_msg_composer_request_close_all                (void);
+void			 e_msg_composer_check_autosave			 (GtkWindow *parent);
 
 #ifdef __cplusplus
 }
Index: mail/component-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/component-factory.c,v
retrieving revision 1.320
diff -u -3 -r1.320 component-factory.c
--- mail/component-factory.c	25 Mar 2003 14:02:34 -0000	1.320
+++ mail/component-factory.c	1 Apr 2003 06:25:04 -0000
@@ -849,6 +849,10 @@
 		gulong new_view_xid, gpointer user_data)
 {
 	mail_session_set_interactive (on);
+
+	if (on)
+		/* how do we get the parent window? */
+		e_msg_composer_check_autosave(NULL);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]