diff options
author | zhuyaliang <15132211195@163.com> | 2023-03-24 10:44:43 +0800 |
---|---|---|
committer | Luke from DC <lukefromdc@hushmail.com> | 2023-04-05 03:17:49 +0000 |
commit | e424eb21db35129aee934aa528bddff0869b7a38 (patch) | |
tree | c345963472eea6060e50705556f04a25778b6974 /src/dlg-extract.c | |
parent | 4ee39ab04260179144ebb9ac7160df79a5b1e6fc (diff) | |
download | engrampa-e424eb21db35129aee934aa528bddff0869b7a38.tar.bz2 engrampa-e424eb21db35129aee934aa528bddff0869b7a38.tar.xz |
Extract: add the function of automatically closing the dialog box after decompression
Diffstat (limited to 'src/dlg-extract.c')
-rw-r--r-- | src/dlg-extract.c | 20 |
1 files changed, 20 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, |