summaryrefslogtreecommitdiff
path: root/src/preferences-dialog.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-03-20 09:13:50 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-03-20 09:13:50 +0100
commitaafaa7c3ff1f88dadbad34559adab7b35be8542b (patch)
tree11f3ff35af220dd659d42e5f87d29b5d5ca073cb /src/preferences-dialog.vala
parent055f6f3e01bb718bfdd61331e1b13b0cdba6d718 (diff)
parente01ac9786891513c1cb628ca0a0374436057cc3b (diff)
Merge branch 'release/debian/42.0-1'debian/42.0-1
Diffstat (limited to 'src/preferences-dialog.vala')
-rw-r--r--src/preferences-dialog.vala35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
index 8d992ab..02bbaf8 100644
--- a/src/preferences-dialog.vala
+++ b/src/preferences-dialog.vala
@@ -51,6 +51,14 @@ private class PreferencesDialog : Hdy.PreferencesWindow
private unowned Gtk.Adjustment brightness_adjustment;
[GtkChild]
private unowned Gtk.Adjustment contrast_adjustment;
+ [GtkChild]
+ private unowned Gtk.Switch postproc_enable_switch;
+ [GtkChild]
+ private unowned Gtk.Entry postproc_script_entry;
+ [GtkChild]
+ private unowned Gtk.Entry postproc_args_entry;
+ [GtkChild]
+ private unowned Gtk.Switch postproc_keep_original_switch;
public PreferencesDialog (Settings settings)
{
@@ -133,6 +141,33 @@ private class PreferencesDialog : Hdy.PreferencesWindow
page_delay_6s_button.toggled.connect ((button) => { if (button.active) settings.set_int ("page-delay", 6000); });
page_delay_10s_button.toggled.connect ((button) => { if (button.active) settings.set_int ("page-delay", 10000); });
page_delay_15s_button.toggled.connect ((button) => { if (button.active) settings.set_int ("page-delay", 15000); });
+
+ // Postprocessing settings
+ var postproc_enabled = settings.get_boolean ("postproc-enabled");
+ postproc_enable_switch.set_state(postproc_enabled);
+ toggle_postproc_visibility (postproc_enabled);
+ postproc_enable_switch.state_set.connect ((is_active) => { toggle_postproc_visibility (is_active);
+ settings.set_boolean("postproc-enabled", is_active);
+ return true; });
+
+ var postproc_script = settings.get_string("postproc-script");
+ postproc_script_entry.set_text(postproc_script);
+ postproc_script_entry.changed.connect (() => { settings.set_string("postproc-script", postproc_script_entry.get_text()); });
+
+ var postproc_arguments = settings.get_string("postproc-arguments");
+ postproc_args_entry.set_text(postproc_arguments);
+ postproc_args_entry.changed.connect (() => { settings.set_string("postproc-arguments", postproc_args_entry.get_text()); });
+
+ var postproc_keep_original = settings.get_boolean ("postproc-keep-original");
+ postproc_keep_original_switch.set_state(postproc_keep_original);
+ postproc_keep_original_switch.state_set.connect ((is_active) => { settings.set_boolean("postproc-keep-original", is_active);
+ return true; });
+ }
+
+ private void toggle_postproc_visibility(bool enabled) {
+ postproc_script_entry.get_parent ().get_parent ().get_parent ().get_parent ().set_visible(enabled);
+ postproc_args_entry.get_parent ().get_parent ().get_parent ().get_parent ().set_visible(enabled);
+ postproc_keep_original_switch.get_parent ().get_parent ().get_parent ().get_parent ().set_visible(enabled);
}
private void set_page_side (ScanSide page_side)