Package: gscan2pdf
Version: 2.11.0-1
Severity: wishlist
Tags: upstream patch

Hi,

in current gscan2pdf the first tab of the scan dialog looks overloaded.

The attached patch, which is based against upstream's 2.12.0, fixes this
issue by moving the Post-processing options to a tab on their own.

Please consider including this patch for inclusion in one of the future
versions of gscan2pdf.

Best
PEter


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-6-amd64 (SMP w/12 CPU threads)
Kernel taint flags: TAINT_CRAP
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gscan2pdf depends on:
ii  imagemagick                            8:6.9.11.60+dfsg-1
ii  imagemagick-6.q16 [imagemagick]        8:6.9.11.60+dfsg-1
ii  libconfig-general-perl                 2.63-1
ii  libdate-calc-perl                      6.4-1.1
ii  libfilesys-df-perl                     0.92-6+b6
ii  libgoocanvas2-perl                     0.06-2
ii  libgtk3-imageview-perl                 6-1
ii  libgtk3-perl                           0.038-1
ii  libgtk3-simplelist-perl                0.21-1
ii  libhtml-parser-perl                    3.75-1+b1
ii  libimage-magick-perl                   8:6.9.11.60+dfsg-1
ii  libimage-sane-perl                     5-1+b1
ii  liblist-moreutils-perl                 0.430-2
ii  liblocale-codes-perl                   3.66-1
ii  liblocale-gettext-perl                 1.07-4+b1
ii  liblog-log4perl-perl                   1.54-1
ii  libossp-uuid-perl [libdata-uuid-perl]  1.6.2-1.5+b9
ii  libpdf-builder-perl                    3.021-2
ii  libproc-processtable-perl              0.59-2+b1
ii  libreadonly-perl                       2.050-3
ii  librsvg2-common                        2.50.3+dfsg-1
ii  libset-intspan-perl                    1.19-1.1
ii  libtiff-tools                          4.2.0-1
ii  libtry-tiny-perl                       0.30-1
hi  sane-utils                             1.0.31-4pm1

Versions of packages gscan2pdf recommends:
ii  djvulibre-bin       3.5.28-1
ii  gocr                0.52-3
ii  pdftk-java [pdftk]  3.2.2-1
ii  tesseract-ocr       4.1.1-2.1
ii  unpaper             6.1-2+b2
ii  xdg-utils           1.1.3-4

gscan2pdf suggests no packages.

-- no debconf information
>From c968dd7560acc5a92c52e4c8de4366f3737c772f Mon Sep 17 00:00:00 2001
From: Peter Marschall <pe...@adpm.de>
Date: Sat, 4 Mar 2017 13:57:30 +0100
Subject: [PATCH] Scan dialog: Post-processing as separate tab

Un-clutter the first tab of the Scan dialog by moving
the post-procesing options to their own separate tab.

Besides making the scan page a lot clearer, and thus easier/quicker
to grasp, this change also makes using gscan2pdf's Scan dialog easier
on smaller screens (like e.g. on my Lenovo X121e).

Signed-off-by: Peter Marschall <pe...@adpm.de>
---
 bin/gscan2pdf                           | 13 +++++++------
 lib/Gscan2pdf/Dialog/Scan/CLI.pm        |  6 +++---
 lib/Gscan2pdf/Dialog/Scan/Image_Sane.pm |  4 ++--
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/bin/gscan2pdf b/bin/gscan2pdf
index a4548999..31e3581a 100755
--- a/bin/gscan2pdf
+++ b/bin/gscan2pdf
@@ -4561,15 +4561,14 @@ sub add_postprocessing_ocr {
 sub add_postprocessing_options {
     my ($self) = @_;
 
-    # pick up the vbox inside the scrolled window, not the main content area
-    my $vbox = $self->{vbox};
+    my $scwin = Gtk3::ScrolledWindow->new;
+
+    $self->{notebook}->append_page( $scwin, Gtk3::Label->new( __( 
'Post-processing' ) ) );
+    $scwin->set_policy( 'automatic', 'automatic' );
 
-    # Frame for post-processing
-    my $framep = Gtk3::Frame->new( __('Post-processing') );
-    $vbox->pack_start( $framep, FALSE, FALSE, 0 );
     my $vboxp = Gtk3::VBox->new;
     $vboxp->set_border_width( $self->style_get('content-area-border') );
-    $framep->add($vboxp);
+    $scwin->add_with_viewport($vboxp);
 
     # Rotate
     my ( $rotate, $side, $side2, $rbutton, $r2button, $comboboxr, $comboboxr2 )
@@ -4705,6 +4704,8 @@ sub add_postprocessing_options {
         }
     );
 
+    #$self->{notebook}->get_nth_page(1)->show_all;
+
     return;
 }
 
diff --git a/lib/Gscan2pdf/Dialog/Scan/CLI.pm b/lib/Gscan2pdf/Dialog/Scan/CLI.pm
index b00fd929..c1081439 100644
--- a/lib/Gscan2pdf/Dialog/Scan/CLI.pm
+++ b/lib/Gscan2pdf/Dialog/Scan/CLI.pm
@@ -210,7 +210,7 @@ sub scan_options {
     $self->set( 'cursor', 'wait' );
 
     # Remove any existing pages
-    while ( $self->{notebook}->get_n_pages > 1 ) {
+    while ( $self->{notebook}->get_n_pages > 2 ) {
         $self->{notebook}->remove_page($LAST_PAGE);
     }
 
@@ -517,7 +517,7 @@ sub _update_option_visibility {
     my ( $self, $options, $visible_options, $hboxp ) = @_;
 
     # Show all notebook tabs
-    for ( 1 .. $self->{notebook}->get_n_pages - 1 ) {
+    for ( 2 .. $self->{notebook}->get_n_pages - 1 ) {
         $self->{notebook}->get_nth_page($_)->show_all;
     }
 
@@ -597,7 +597,7 @@ sub _find_visible_group {
     }
     return $self->{option_widgets}{ $options->{array}[$option_number]->{name} }
       if ( $option_number > 0 );
-    return $self->{notebook}->get_nth_page(1);
+    return $self->{notebook}->get_nth_page(2);
 }
 
 # Update the sane option in the thread
diff --git a/lib/Gscan2pdf/Dialog/Scan/Image_Sane.pm 
b/lib/Gscan2pdf/Dialog/Scan/Image_Sane.pm
index 076611d7..1660a92d 100644
--- a/lib/Gscan2pdf/Dialog/Scan/Image_Sane.pm
+++ b/lib/Gscan2pdf/Dialog/Scan/Image_Sane.pm
@@ -126,7 +126,7 @@ sub scan_options {
     my ($self) = @_;
 
     # Remove any existing pages
-    while ( $self->{notebook}->get_n_pages > 1 ) {
+    while ( $self->{notebook}->get_n_pages > 2 ) {
         $self->{notebook}->remove_page($LAST_PAGE);
     }
 
@@ -372,7 +372,7 @@ sub _initialise_options {    ## no critic 
(ProhibitExcessComplexity)
     }
 
     # Show new pages
-    for ( 1 .. $self->{notebook}->get_n_pages - 1 ) {
+    for ( 2 .. $self->{notebook}->get_n_pages - 1 ) {
         $self->{notebook}->get_nth_page($_)->show_all;
     }
 
-- 
2.30.2

Reply via email to