vcl/inc/printdlg.hxx           |    3 +--
 vcl/source/window/printdlg.cxx |   24 ++++++++++++++++--------
 2 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 0504e7d9ff618d7e1aab3ad8b250d8c2483bf17d
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Thu Nov 26 10:52:04 2020 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Thu Nov 26 13:25:05 2020 +0100

    Fix "single print jobs" function in print dlg
    
    Did not work at all
    
    Change-Id: I388ce579691a1e7ad2eff8420c2f8b6b3e939ef0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106665
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 1832e6da35b5..60839b07382f 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -99,7 +99,7 @@ namespace vcl
 
         bool isPrintToFile() const;
         bool isCollate() const;
-        bool isSingleJobs() const { return mbSingleJobs; };
+        bool isSingleJobs() const;
         bool hasPreview() const;
 
         void setPaperSizes();
@@ -204,7 +204,6 @@ namespace vcl
         Size                                    maFirstPageSize;
 
         bool                                    mbShowLayoutFrame;
-        bool                                    mbSingleJobs;
 
         Paper                                   mePaper;
 
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index d9a7504bae76..6ea1182f2b7e 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -549,7 +549,6 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const 
std::shared_ptr<PrinterC
     , mnCachedPages( 0 )
     , mbCollateAlwaysOff(false)
     , mbShowLayoutFrame( true )
-    , mbSingleJobs( false )
     , maUpdatePreviewIdle("Print Dialog Update Preview Idle")
     , maUpdatePreviewNoCacheIdle("Print Dialog Update Preview (no cache) Idle")
 {
@@ -656,6 +655,7 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const 
std::shared_ptr<PrinterC
     // setup toggle hdl
     mxReverseOrderBox->connect_toggled( LINK( this, PrintDialog, ToggleHdl ) );
     mxCollateBox->connect_toggled( LINK( this, PrintDialog, ToggleHdl ) );
+    mxSingleJobsBox->connect_toggled( LINK( this, PrintDialog, ToggleHdl ) );
     mxPagesBtn->connect_toggled( LINK( this, PrintDialog, ToggleHdl ) );
 
     // setup select hdl
@@ -739,8 +739,8 @@ void PrintDialog::storeToSettings()
 
     pItem->setValue( "PrintDialog",
                      "CollateSingleJobs",
-                     mbSingleJobs ? OUString("true") :
-                                    OUString("false") );
+                     mxSingleJobsBox->get_active() ? OUString("true") :
+                                                     OUString("false") );
 
     pItem->setValue( "PrintDialog",
                      "HasPreview",
@@ -794,10 +794,7 @@ void PrintDialog::readFromSettings()
     // collate single jobs
     aValue = pItem->getValue( "PrintDialog",
                               "CollateSingleJobs" );
-    if ( aValue.equalsIgnoreAsciiCase("true") )
-        mbSingleJobs = true;
-    else
-        mbSingleJobs = false;
+    mxSingleJobsBox->set_active(aValue.equalsIgnoreAsciiCase("true"));
 
     // preview box
     aValue = pItem->getValue( "PrintDialog",
@@ -1009,9 +1006,15 @@ void PrintDialog::setPaperOrientation( Orientation 
eOrientation )
 void PrintDialog::checkControlDependencies()
 {
     if (mxCopyCountField->get_value() > 1)
+    {
         mxCollateBox->set_sensitive( !mbCollateAlwaysOff );
+        mxSingleJobsBox->set_sensitive( mxCollateBox->get_active() );
+    }
     else
+    {
         mxCollateBox->set_sensitive( false );
+        mxSingleJobsBox->set_sensitive( false );
+    }
 
     OUString aImg(mxCollateBox->get_active() ? OUString(SV_PRINT_COLLATE_BMP) 
: OUString(SV_PRINT_NOCOLLATE_BMP));
 
@@ -1746,6 +1749,11 @@ bool PrintDialog::isCollate() const
     return mxCopyCountField->get_value() > 1 && mxCollateBox->get_active();
 }
 
+bool PrintDialog::isSingleJobs() const
+{
+    return mxSingleJobsBox->get_active();
+}
+
 bool PrintDialog::hasPreview() const
 {
     return mxPreviewBox->get_active();
@@ -1846,7 +1854,7 @@ IMPL_LINK(PrintDialog, ClickHdl, weld::Button&, rButton, 
void)
     }
     else if( &rButton == mxSingleJobsBox.get() )
     {
-        maPController->setValue( "SingleJob",
+        maPController->setValue( "SinglePrintJobs",
                                  makeAny( isSingleJobs() ) );
         checkControlDependencies();
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to