Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/file-roller/ChangeLog,v
retrieving revision 1.228
diff -u -r1.228 ChangeLog
--- ChangeLog	19 May 2004 13:49:11 -0000	1.228
+++ ChangeLog	24 May 2004 04:42:17 -0000
@@ -1,3 +1,10 @@
+2004-05-24  Srinath C  <sri_nathc@yahoo.com>
+
+	* src/fr-command-zip.c: do not treat error status 12 as an error
+	* src/window.c:	added a new callback function that is called when
+			an external application that has oppened a file from the archive
+			has exited.
+
 2004-05-19  Paolo Bacchilega  <paolo@localhost.localdomain>
 
 	* src/window.c (window_batch_mode_start): do not hide the main 
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/window.c,v
retrieving revision 1.86
diff -u -r1.86 window.c
--- src/window.c	19 May 2004 13:49:11 -0000	1.86
+++ src/window.c	22 May 2004 12:06:22 -0000
@@ -5226,6 +5226,65 @@
 /* -- window_open_files -- */
 
 
+ static void
+open_with_app_done(FRProcess *fr_proc,
+           FRProcError *error,
+           gpointer callback_data)
+{
+   gchar *files = NULL;
+   CommandData *cdata = NULL;
+   GList *scan = NULL;
+   GtkWidget *dialog = NULL;
+   GList *rel_paths = NULL;
+
+   cdata = callback_data;
+   for( scan = cdata->file_list; scan; scan = scan->next ) {
+       gchar *temp = files;
+      gchar *path = strdup(scan->data);
+       gchar *filename = NULL;
+
+       filename = g_strdup( path + strlen(cdata->temp_dir) + 2 );  //  remove full path
+       if(!files)
+           files = g_strdup(filename);
+       else
+          files = g_strconcat (files, ", ", filename, NULL);  //  comma separated list of filenames
+       rel_paths = g_list_append( rel_paths, filename );
+       if(!temp)
+           g_free(temp);
+       if(!path)
+           g_free(path);
+       if(!filename)
+           g_free(filename);
+  }
+  dialog = gtk_message_dialog_new( GTK_WINDOW(cdata->window->app),
+                                   GTK_DIALOG_MODAL,
+                                   GTK_MESSAGE_WARNING,
+                                   GTK_BUTTONS_OK_CANCEL,
+                                   "Files: %s may have been modified externally\n. Do you want to Update Archive?",
+                                   files );
+
+   if( gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK ) {
+       FRCommand *cmd = cdata->window->archive->command;
+       FRProcess *proc = cmd->process;
+       fr_command_uncompress(cmd);
+       fr_process_clear(proc);
+       fr_command_set_n_files ( cmd, g_list_length (rel_paths));
+       fr_command_add( cmd,
+                   rel_paths,
+                   cdata->temp_dir,
+                   TRUE,
+                   NULL,
+                   FR_COMPRESSION_NORMAL
+                );
+       fr_process_set_ignore_error( proc, TRUE );
+       fr_process_start(proc);
+       fr_command_recompress( cmd, FR_COMPRESSION_NORMAL );
+   }
+
+   gtk_widget_destroy(dialog);
+}
+
+
 static void
 open_files (FRArchive   *archive,
 	    FRAction     action, 
@@ -5261,6 +5320,10 @@
 	fr_process_end_command (proc);
 
 	command_list = g_list_prepend (command_list, cdata);
+    g_signal_connect (G_OBJECT (proc),
+             "done",
+             G_CALLBACK (open_with_app_done),
+             cdata);
 	fr_process_start (proc);
 }
 
Index: src/fr-command-zip.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-zip.c,v
retrieving revision 1.15
diff -u -r1.15 fr-command-zip.c
--- src/fr-command-zip.c	21 Feb 2004 17:33:44 -0000	1.15
+++ src/fr-command-zip.c	22 May 2004 12:06:26 -0000
@@ -394,7 +394,7 @@
 			     FRProcError *error)
 {
 	if (error->type == FR_PROC_ERROR_GENERIC) {
-		if (error->status <= 1)
+		if (error->status <= 1 || error->status == 12 )
 			error->type = FR_PROC_ERROR_NONE;
 		else if ((error->status == 82) || (error->status == 5))
 			error->type = FR_PROC_ERROR_ASK_PASSWORD;
