diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dlg-extract.c | 20 | ||||
-rw-r--r-- | src/fr-window.c | 15 | ||||
-rw-r--r-- | src/fr-window.h | 2 | ||||
-rw-r--r-- | src/preferences.h | 1 | ||||
-rw-r--r-- | src/ui/dlg-extract.ui | 16 |
5 files changed, 54 insertions, 0 deletions
diff --git a/src/dlg-extract.c b/src/dlg-extract.c index b85d23b..c00552d 100644 --- a/src/dlg-extract.c +++ b/src/dlg-extract.c @@ -281,11 +281,20 @@ overwrite_toggled_cb (GtkToggleButton *button, } static void +close_dialog_changed_cb (GtkToggleButton *button, + FrWindow *window) +{ + gboolean active = gtk_toggle_button_get_active (button); + fr_window_set_close_dialog (window, active); +} + +static void dlg_extract__common (FrWindow *window, GList *selected_files, char *base_dir_for_selection) { DialogData *data; + GtkWidget *button; data = g_new0 (DialogData, 1); data->builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "dlg-extract.ui"); @@ -317,6 +326,17 @@ dlg_extract__common (FrWindow *window, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("recreate_dir_checkbutton")), g_settings_get_boolean (data->settings, PREF_EXTRACT_RECREATE_FOLDERS)); + button = GET_WIDGET ("close_dialog_checkbutton"); + g_settings_bind (data->settings, + PREF_EXTRACT_CLOSE_DIALOG, + GTK_TOGGLE_BUTTON (button), + "active", + G_SETTINGS_BIND_GET); + g_signal_connect (button, + "toggled", + G_CALLBACK (close_dialog_changed_cb), + window); + /* Set the signals handlers. */ gtk_builder_add_callback_symbols (data->builder, diff --git a/src/fr-window.c b/src/fr-window.c index 7a18acf..88d8d9a 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -382,6 +382,8 @@ struct _FrWindowPrivateData { GtkWindow *load_error_parent_window; gboolean showing_error_dialog; GtkWindow *error_dialog_parent; + + gboolean close_dialog; }; /* -- fr_window_free_private_data -- */ @@ -2685,6 +2687,10 @@ open_progress_dialog_with_open_destination (FrWindow *window) display_progress_dialog (window); fr_window_progress_cb (NULL, 1.0, window); fr_window_message_cb (NULL, _("Extraction completed successfully"), window); + + if (window->priv->close_dialog) + close_progress_dialog (window, TRUE); + } static void @@ -8891,3 +8897,12 @@ fr_window_set_batch__add (FrWindow *window, NULL, NULL); } + +void +fr_window_set_close_dialog (FrWindow *window, + gboolean state) +{ + g_return_if_fail (window != NULL); + + window->priv->close_dialog = state; +} diff --git a/src/fr-window.h b/src/fr-window.h index 5606dfe..9b006a9 100644 --- a/src/fr-window.h +++ b/src/fr-window.h @@ -317,4 +317,6 @@ gboolean fr_window_file_list_drag_data_get (FrWindow *window, void fr_window_update_dialog_closed (FrWindow *window); +void fr_window_set_close_dialog (FrWindow *window, + gboolean state); #endif /* FR_WINDOW_H */ diff --git a/src/preferences.h b/src/preferences.h index fe4df4d..575ffb3 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -61,6 +61,7 @@ #define PREF_EXTRACT_OVERWRITE "overwrite" #define PREF_EXTRACT_SKIP_NEWER "skip-newer" +#define PREF_EXTRACT_CLOSE_DIALOG "close-dialog" #define PREF_EXTRACT_RECREATE_FOLDERS "recreate-folders" #define PREF_ADD_CURRENT_FOLDER "current-folder" diff --git a/src/ui/dlg-extract.ui b/src/ui/dlg-extract.ui index 3a44384..745c548 100644 --- a/src/ui/dlg-extract.ui +++ b/src/ui/dlg-extract.ui @@ -288,6 +288,22 @@ <property name="position">2</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="close_dialog_checkbutton"> + <property name="label" translatable="yes">close dialog after decompression</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> </child> </object> |