commit d3f990763ebb3383b2242e1112da314ea9971736
Author: Paolo Bacchilega <paobac@src.gnome.org>
Date:   Sat Feb 18 09:24:18 2017 +0100

    show the 'open destination' dialog only when using --notify
    
    and only for the last extracted archive

diff --git a/src/fr-application.c b/src/fr-application.c
index ad00f2d..8dd172e 100644
--- a/src/fr-application.c
+++ b/src/fr-application.c
@@ -296,7 +296,7 @@ handle_method_call (GDBusConnection       *connection,
 		g_signal_connect (window, "ready", G_CALLBACK (window_ready_cb), invocation);
 
 		fr_window_batch_new (FR_WINDOW (window), _("Extract archive"));
-		fr_window_batch__extract (FR_WINDOW (window), archive, destination);
+		fr_window_batch__extract (FR_WINDOW (window), archive, destination, use_progress_dialog);
 		fr_window_batch_append_action (FR_WINDOW (window), FR_BATCH_ACTION_QUIT, NULL, NULL);
 		fr_window_batch_start (FR_WINDOW (window));
 
@@ -322,7 +322,7 @@ handle_method_call (GDBusConnection       *connection,
 		g_signal_connect (window, "ready", G_CALLBACK (window_ready_cb), invocation);
 
 		fr_window_batch_new (FR_WINDOW (window), _("Extract archive"));
-		fr_window_batch__extract_here (FR_WINDOW (window), archive);
+		fr_window_batch__extract_here (FR_WINDOW (window), archive, use_progress_dialog);
 		fr_window_batch_append_action (FR_WINDOW (window), FR_BATCH_ACTION_QUIT, NULL, NULL);
 		fr_window_batch_start (FR_WINDOW (window));
 
@@ -596,13 +596,16 @@ fr_application_command_line (GApplication            *application,
 
 		fr_window_batch_new (FR_WINDOW (window), _("Extract archive"));
 		while ((archive = remaining_args[i++]) != NULL) {
-			GFile *file;
+			GFile    *file;
+			gboolean  last_archive;
 
 			file = g_application_command_line_create_file_for_arg (command_line, archive);
+			last_archive = (remaining_args[i] == NULL);
+
 			if (arg_extract_here == 1)
-				fr_window_batch__extract_here (FR_WINDOW (window), file);
+				fr_window_batch__extract_here (FR_WINDOW (window), file, arg_notify && last_archive);
 			else
-				fr_window_batch__extract (FR_WINDOW (window), file, extraction_destination);
+				fr_window_batch__extract (FR_WINDOW (window), file, extraction_destination, arg_notify && last_archive);
 
 			g_object_unref (file);
 		}
diff --git a/src/fr-window.c b/src/fr-window.c
index bf75902..432e1a6 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -9810,7 +9810,8 @@ fr_window_batch_get_title (FrWindow *window)
 
 void
 fr_window_batch__extract_here (FrWindow *window,
-			       GFile    *archive)
+			       GFile    *archive,
+			       gboolean  ask_to_open_destination)
 {
 	g_return_if_fail (window != NULL);
 	g_return_if_fail (archive != NULL);
@@ -9828,7 +9829,7 @@ fr_window_batch__extract_here (FrWindow *window,
 							 FALSE,
 							 FR_OVERWRITE_ASK,
 							 FALSE,
-							 _fr_window_get_ask_to_open_destination (window),
+							 ask_to_open_destination,
 							 TRUE),
 				       (GFreeFunc) extract_data_free);
 	fr_window_batch_append_action (window,
@@ -9841,7 +9842,8 @@ fr_window_batch__extract_here (FrWindow *window,
 void
 fr_window_batch__extract (FrWindow  *window,
 			  GFile     *archive,
-			  GFile     *destination)
+			  GFile     *destination,
+			  gboolean   ask_to_open_destination)
 {
 	g_return_if_fail (window != NULL);
 	g_return_if_fail (archive != NULL);
@@ -9860,7 +9862,7 @@ fr_window_batch__extract (FrWindow  *window,
 								 FALSE,
 								 FR_OVERWRITE_ASK,
 								 FALSE,
-								 _fr_window_get_ask_to_open_destination (window),
+								 ask_to_open_destination,
 								 FALSE),
 					       (GFreeFunc) extract_data_free);
 	else
diff --git a/src/fr-window.h b/src/fr-window.h
index 4ea0f4e..7bbffec 100644
--- a/src/fr-window.h
+++ b/src/fr-window.h
@@ -306,10 +306,12 @@ void            fr_window_batch_resume                 (FrWindow      *window);
 gboolean        fr_window_is_batch_mode                (FrWindow      *window);
 void            fr_window_batch__extract               (FrWindow      *window,
 						        GFile         *archive,
-						        GFile         *destination);
+						        GFile         *destination,
+							gboolean       ask_to_open_destination);
 void            fr_window_batch__extract_here          (FrWindow      *window,
-							GFile         *archive);
-void            fr_window_batch__add_files               (FrWindow      *window,
+							GFile         *archive,
+							gboolean       ask_to_open_destination);
+void            fr_window_batch__add_files             (FrWindow      *window,
 							GFile         *archive,
 						        GList         *file_list);
 void            fr_window_destroy_with_error_dialog    (FrWindow      *window);
