Commit 347a917c authored by Paolo Bacchilega's avatar Paolo Bacchilega

show the 'open destination' dialog only when using --notify

and only for the last extracted archive
parent a9d76503
......@@ -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), C_("Window title", "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), C_("Window title", "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));
......@@ -604,13 +604,16 @@ fr_application_command_line (GApplication *application,
fr_window_batch_new (FR_WINDOW (window), C_("Window title", "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);
}
......
......@@ -9819,7 +9819,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);
......@@ -9837,7 +9838,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,
......@@ -9850,7 +9851,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);
......@@ -9869,7 +9871,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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment