[simple-scan] Add zero second delay for multiple pages from flatbed
- From: Bartosz <bkosiorek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan] Add zero second delay for multiple pages from flatbed
- Date: Tue, 13 Oct 2020 15:15:10 +0000 (UTC)
commit 8cb16cb1e164d2506ab9dc8c9e3b76c87d2791a1
Author: Bartosz Kosiorek <gang65 poczta onet pl>
Date: Tue Jun 2 02:44:24 2020 +0200
Add zero second delay for multiple pages from flatbed
Fixes: #184
src/preferences-dialog.ui | 129 +++++++++++++++++++++++++++++++++++++++-----
src/preferences-dialog.vala | 30 +++++------
2 files changed, 131 insertions(+), 28 deletions(-)
---
diff --git a/src/preferences-dialog.ui b/src/preferences-dialog.ui
index 63d06e01..8bd7999a 100644
--- a/src/preferences-dialog.ui
+++ b/src/preferences-dialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkAdjustment" id="brightness_adjustment">
@@ -41,15 +41,30 @@
</columns>
</object>
<template class="PreferencesDialog" parent="GtkDialog">
+ <property name="can_focus">False</property>
<property name="title" translatable="yes" comments="Title of preferences dialog">Preferences</property>
<property name="resizable">False</property>
<property name="icon_name">org.gnome.SimpleScan</property>
<property name="type_hint">normal</property>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkNotebook">
<property name="visible">True</property>
@@ -58,17 +73,20 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">30</property>
<property name="orientation">vertical</property>
<property name="spacing">30</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="row_spacing">15</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="page_side_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label beside scan side combo
box">Scan _Sides</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">front_side_button</property>
@@ -85,6 +103,7 @@
<child>
<object class="GtkLabel" id="paper_size_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label beside page size combo
box">_Page Size</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">paper_size_combo</property>
@@ -101,6 +120,7 @@
<child>
<object class="GtkComboBox" id="paper_size_combo">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="model">paper_size_model</property>
</object>
@@ -112,6 +132,7 @@
<child>
<object class="GtkBox" id="scan_side_box">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkRadioButton" id="front_side_button">
@@ -122,6 +143,11 @@
<property name="active">True</property>
<property name="draw_indicator">False</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<object class="GtkRadioButton" id="back_side_button">
@@ -132,6 +158,11 @@
<property name="draw_indicator">False</property>
<property name="group">front_side_button</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
<object class="GtkRadioButton" id="both_side_button">
@@ -142,6 +173,11 @@
<property name="draw_indicator">False</property>
<property name="group">front_side_button</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
<style>
<class name="linked"/>
@@ -153,18 +189,25 @@
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="row_spacing">15</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="page_delay_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label beside page delay
scale">_Delay</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">page_delay_3s_button</property>
+ <property name="mnemonic_widget">page_delay_0s_button</property>
<property name="xalign">1</property>
<style>
<class name="dim-label"/>
@@ -178,6 +221,7 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Preferences dialog: Label above
settings for scanning multiple pages from a flatbed">Multiple pages from flatbed</property>
<property name="xalign">0</property>
<attributes>
@@ -193,38 +237,54 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
- <object class="GtkRadioButton" id="page_delay_3s_button">
- <property name="label" translatable="yes" comments="Preferences Dialog: Toggle
button to select scanning on front side of a page">3</property>
+ <object class="GtkRadioButton" id="page_delay_0s_button">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Toggle
button to select scanning on front side of a page">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="active">True</property>
<property name="draw_indicator">False</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <object class="GtkRadioButton" id="page_delay_5s_button">
- <property name="label" translatable="yes" comments="Preferences Dialog: Toggle
button to select scanning on front side of a page">5</property>
+ <object class="GtkRadioButton" id="page_delay_3s_button">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Toggle
button to select scanning on front side of a page">3</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="active">True</property>
<property name="draw_indicator">False</property>
- <property name="group">page_delay_3s_button</property>
+ <property name="group">page_delay_0s_button</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
- <object class="GtkRadioButton" id="page_delay_7s_button">
- <property name="label" translatable="yes" comments="Preferences Dialog: Toggle
button to select scanning on front side of a page">7</property>
+ <object class="GtkRadioButton" id="page_delay_6s_button">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Toggle
button to select scanning on front side of a page">6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="active">True</property>
<property name="draw_indicator">False</property>
- <property name="group">page_delay_3s_button</property>
+ <property name="group">page_delay_0s_button</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
<child>
<object class="GtkRadioButton" id="page_delay_10s_button">
@@ -234,8 +294,13 @@
<property name="receives_default">True</property>
<property name="active">True</property>
<property name="draw_indicator">False</property>
- <property name="group">page_delay_3s_button</property>
+ <property name="group">page_delay_0s_button</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
</child>
<child>
<object class="GtkRadioButton" id="page_delay_15s_button">
@@ -245,8 +310,13 @@
<property name="receives_default">True</property>
<property name="active">True</property>
<property name="draw_indicator">False</property>
- <property name="group">page_delay_3s_button</property>
+ <property name="group">page_delay_0s_button</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
</child>
<style>
<class name="linked"/>
@@ -260,6 +330,7 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label after page delay radio
buttons">Seconds</property>
<property name="use_underline">True</property>
<property name="xalign">1</property>
@@ -273,6 +344,11 @@
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
@@ -282,6 +358,7 @@
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Preferences Dialog: Tab label for
scanning settings">_Scanning</property>
<property name="use_underline">True</property>
</object>
@@ -292,17 +369,20 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">30</property>
<property name="orientation">vertical</property>
<property name="spacing">30</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="row_spacing">14</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="text_dpi_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label beside scan resolution
combo box">_Text Resolution</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">text_dpi_combo</property>
@@ -319,6 +399,7 @@
<child>
<object class="GtkLabel" id="photo_dpi_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label beside scan resolution
combo box">_Image Resolution</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">photo_dpi_combo</property>
@@ -335,6 +416,7 @@
<child>
<object class="GtkComboBox" id="text_dpi_combo">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="model">text_dpi_model</property>
</object>
@@ -346,6 +428,7 @@
<child>
<object class="GtkComboBox" id="photo_dpi_combo">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="model">photo_dpi_model</property>
</object>
@@ -355,15 +438,22 @@
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="row_spacing">15</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="brightness_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label beside brightness
scale">_Brightness</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">brightness_scale</property>
@@ -380,6 +470,7 @@
<child>
<object class="GtkLabel" id="contrast_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Label beside contrast
scale">_Contrast</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">contrast_scale</property>
@@ -420,23 +511,36 @@
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
+ <property name="position">1</property>
<property name="tab_expand">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Preferences Dialog: Tab for quality
settings">_Quality</property>
<property name="use_underline">True</property>
</object>
<packing>
+ <property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
</child>
@@ -453,4 +557,3 @@
</widgets>
</object>
</interface>
-
diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
index 06dca75c..dce34ccf 100644
--- a/src/preferences-dialog.vala
+++ b/src/preferences-dialog.vala
@@ -26,11 +26,11 @@ private class PreferencesDialog : Gtk.Dialog
[GtkChild]
private Gtk.Scale contrast_scale;
[GtkChild]
- private Gtk.RadioButton page_delay_3s_button;
+ private Gtk.RadioButton page_delay_0s_button;
[GtkChild]
- private Gtk.RadioButton page_delay_5s_button;
+ private Gtk.RadioButton page_delay_3s_button;
[GtkChild]
- private Gtk.RadioButton page_delay_7s_button;
+ private Gtk.RadioButton page_delay_6s_button;
[GtkChild]
private Gtk.RadioButton page_delay_10s_button;
[GtkChild]
@@ -130,9 +130,9 @@ private class PreferencesDialog : Gtk.Dialog
});
set_page_delay (settings.get_int ("page-delay"));
+ page_delay_0s_button.toggled.connect ((button) => { if (button.active) settings.set_int
("page-delay", 0); });
page_delay_3s_button.toggled.connect ((button) => { if (button.active) settings.set_int
("page-delay", 3000); });
- page_delay_5s_button.toggled.connect ((button) => { if (button.active) settings.set_int
("page-delay", 5000); });
- page_delay_7s_button.toggled.connect ((button) => { if (button.active) settings.set_int
("page-delay", 7000); });
+ 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); });
}
@@ -247,12 +247,12 @@ private class PreferencesDialog : Gtk.Dialog
return 15000;
else if (page_delay_10s_button.active)
return 10000;
- else if (page_delay_7s_button.active)
- return 7000;
- else if (page_delay_5s_button.active)
- return 5000;
- else
+ else if (page_delay_6s_button.active)
+ return 6000;
+ else if (page_delay_3s_button.active)
return 3000;
+ else
+ return 0;
}
public void set_page_delay (int page_delay)
@@ -261,12 +261,12 @@ private class PreferencesDialog : Gtk.Dialog
page_delay_15s_button.active = true;
else if (page_delay >= 10000)
page_delay_10s_button.active = true;
- else if (page_delay >= 7000)
- page_delay_7s_button.active = true;
- else if (page_delay >= 5000)
- page_delay_5s_button.active = true;
- else
+ else if (page_delay >= 6000)
+ page_delay_6s_button.active = true;
+ else if (page_delay >= 3000)
page_delay_3s_button.active = true;
+ else
+ page_delay_0s_button.active = true;
}
private void set_dpi_combo (Gtk.ComboBox combo, int default_dpi, int current_dpi)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]