diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-12-21 23:09:33 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-12-22 09:23:37 +0100 |
commit | 2113282cf957943d08999e7c7071a76734cf2c00 (patch) | |
tree | 7661f7428bddb12fd1c2410e662a3b7638114458 /vcl | |
parent | 1c70d20fcb3a0e8a0e9752b0e3ee45532da8f72a (diff) |
tdf#79077: Mildly improved user experience
Change-Id: I3cf63d06c3c238ed936a8dd0287cfbe02e8e39be
Reviewed-on: https://gerrit.libreoffice.org/46936
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/jobset.h | 6 | ||||
-rw-r--r-- | vcl/inc/printerinfomanager.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/jobset.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 5 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 4 | ||||
-rw-r--r-- | vcl/uiconfig/ui/printerpaperpage.ui | 5 | ||||
-rw-r--r-- | vcl/unx/generic/print/genprnpsp.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/generic/print/prtsetup.cxx | 29 | ||||
-rw-r--r-- | vcl/unx/generic/print/prtsetup.hxx | 1 |
9 files changed, 45 insertions, 14 deletions
diff --git a/vcl/inc/jobset.h b/vcl/inc/jobset.h index 5ff4c38e9a24..af9fec49084f 100644 --- a/vcl/inc/jobset.h +++ b/vcl/inc/jobset.h @@ -44,6 +44,9 @@ private: sal_uInt32 mnDriverDataLen; //< length of system specific data sal_uInt8* mpDriverData; //< system specific data (will be streamed a byte block) bool mbPapersizeFromSetup; + // setup mode + PrinterSetupMode meSetupMode; + // TODO: orig paper size std::unordered_map< OUString, OUString > maValueMap; public: @@ -89,6 +92,9 @@ public: bool GetPapersizeFromSetup() const { return mbPapersizeFromSetup; } void SetPapersizeFromSetup(bool bPapersizeFromSetup); + PrinterSetupMode GetPrinterSetupMode() const { return meSetupMode; } + void SetPrinterSetupMode(PrinterSetupMode eMode); + const std::unordered_map< OUString, OUString >& GetValueMap() const { return maValueMap; } void SetValueMap(const OUString& rKey, const OUString& rValue); diff --git a/vcl/inc/printerinfomanager.hxx b/vcl/inc/printerinfomanager.hxx index d820cfcc6057..0cb01f155075 100644 --- a/vcl/inc/printerinfomanager.hxx +++ b/vcl/inc/printerinfomanager.hxx @@ -27,6 +27,7 @@ #include <vcl/dllapi.h> #include <vcl/jobdata.hxx> +#include <vcl/prntypes.hxx> #include <osl/file.hxx> #include "unx/helper.hxx" @@ -52,6 +53,7 @@ struct PrinterInfo : JobData // a list of special features separated by ',' not used by psprint // but assigned from the outside (currently for "fax","pdf=","autoqueue","external_dialog") OUString m_aFeatures; + PrinterSetupMode meSetupMode; PrinterInfo() : JobData() diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index 782fe81c959e..d126a8b16f9a 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -60,6 +60,7 @@ ImplJobSetup::ImplJobSetup() mnDriverDataLen = 0; mpDriverData = nullptr; mbPapersizeFromSetup = false; + meSetupMode = PrinterSetupMode::DocumentGlobal; } ImplJobSetup::ImplJobSetup( const ImplJobSetup& rJobSetup ) : @@ -150,6 +151,11 @@ void ImplJobSetup::SetPapersizeFromSetup(bool bPapersizeFromSetup) mbPapersizeFromSetup = bPapersizeFromSetup; } +void ImplJobSetup::SetPrinterSetupMode(PrinterSetupMode eMode) +{ + meSetupMode = eMode; +} + void ImplJobSetup::SetValueMap( const OUString& rKey, const OUString& rValue ) { maValueMap [ rKey ] = rValue; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index b360ebc58088..db9eafd1546d 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1055,7 +1055,7 @@ bool Printer::SetJobSetup( const JobSetup& rSetup ) return false; } -bool Printer::Setup( vcl::Window* pWindow ) +bool Printer::Setup( vcl::Window* pWindow, PrinterSetupMode eMode ) { if ( IsDisplayPrinter() ) return false; @@ -1065,6 +1065,9 @@ bool Printer::Setup( vcl::Window* pWindow ) JobSetup aJobSetup = maJobSetup; ImplJobSetup& rData = aJobSetup.ImplGetData(); + rData.SetPrinterSetupMode( eMode ); + // TODO: orig page size + SalFrame* pFrame; if ( !pWindow ) pWindow = ImplGetDefaultWindow(); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index ce4738e33746..43485921e7b0 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -807,13 +807,13 @@ bool PrinterController::setupPrinter( vcl::Window* i_pParent ) // whatever happens to be the current page // (but only if the printer config has changed, otherwise // don't override printer page auto-detection - tdf#91362) - if (getPrinterModified()) + if (getPrinterModified() || getPapersizeFromSetup()) { resetPaperToLastConfigured(); } // call driver setup - bRet = xPrinter->Setup( i_pParent ); + bRet = xPrinter->Setup( i_pParent, PrinterSetupMode::SingleJob ); SAL_WARN_IF(xPrinter != mpImplData->mxPrinter, "vcl.gdi", "Printer changed underneath us during setup"); xPrinter = mpImplData->mxPrinter; diff --git a/vcl/uiconfig/ui/printerpaperpage.ui b/vcl/uiconfig/ui/printerpaperpage.ui index c8d834a1e1e5..42c956a0a74c 100644 --- a/vcl/uiconfig/ui/printerpaperpage.ui +++ b/vcl/uiconfig/ui/printerpaperpage.ui @@ -26,10 +26,10 @@ </packing> </child> <child> - <object class="GtkLabel" id="label4"> + <object class="GtkLabel" id="orientft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes" context="printerpaperpage|label4">_Orientation:</property> + <property name="label" translatable="yes" context="printerpaperpage|orientft">_Orientation:</property> <property name="use_underline">True</property> <property name="xalign">1</property> </object> @@ -111,7 +111,6 @@ <child> <object class="GtkCheckButton" id="papersizefromsetup"> <property name="label" translatable="yes" context="printerpaperpage|papersizefromsetup">Use only paper size from printer preferences</property> - <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="draw_indicator">True</property> diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index 7dd74f0396fc..63013b1188b4 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -554,6 +554,7 @@ bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) JobData::constructFromStreamBuffer( pJobSetup->GetDriverData(), pJobSetup->GetDriverDataLen(), aInfo ); } aInfo.m_bPapersizeFromSetup = pJobSetup->GetPapersizeFromSetup(); + aInfo.meSetupMode = pJobSetup->GetPrinterSetupMode(); if (SetupPrinterDriver(aInfo)) { diff --git a/vcl/unx/generic/print/prtsetup.cxx b/vcl/unx/generic/print/prtsetup.cxx index dc667fbc9825..49489099158e 100644 --- a/vcl/unx/generic/print/prtsetup.cxx +++ b/vcl/unx/generic/print/prtsetup.cxx @@ -130,6 +130,10 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton, void ) // orientation m_aJobData.m_eOrientation = m_pPaperPage->getOrientation() == 0 ? orientation::Portrait : orientation::Landscape; + // assume use of paper size from printer setup if the user + // got here via File > Printer Settings ... + m_aJobData.m_bPapersizeFromSetup = + ( m_aJobData.meSetupMode == PrinterSetupMode::DocumentGlobal ); } if( m_pDevicePage ) { @@ -155,6 +159,7 @@ RTSPaperPage::RTSPaperPage(RTSDialog* pParent) get(m_pCbFromSetup, "papersizefromsetup"); get(m_pPaperText, "paperft"); get(m_pPaperBox, "paperlb"); + get(m_pOrientText, "orientft"); get(m_pOrientBox, "orientlb"); get(m_pDuplexText, "duplexft"); get(m_pDuplexBox, "duplexlb"); @@ -191,9 +196,10 @@ RTSPaperPage::~RTSPaperPage() void RTSPaperPage::dispose() { m_pParent.clear(); - m_pPaperText.clear(); m_pCbFromSetup.clear(); + m_pPaperText.clear(); m_pPaperBox.clear(); + m_pOrientText.clear(); m_pOrientBox.clear(); m_pDuplexText.clear(); m_pDuplexBox.clear(); @@ -246,14 +252,21 @@ void RTSPaperPage::update() m_pSlotBox->Enable( false ); } - if ( m_pParent->m_aJobData.m_bPapersizeFromSetup ) - m_pCbFromSetup->Check( m_pParent->m_aJobData.m_bPapersizeFromSetup ); - // disable those, unless user wants to use papersize from printer prefs - // as they have no influence on what's going to be printed anyway - else + if ( m_pParent->m_aJobData.meSetupMode == PrinterSetupMode::SingleJob ) { - m_pPaperBox->Enable( false ); - m_pOrientBox->Enable( false ); + m_pCbFromSetup->Show(); + + if ( m_pParent->m_aJobData.m_bPapersizeFromSetup ) + m_pCbFromSetup->Check( m_pParent->m_aJobData.m_bPapersizeFromSetup ); + // disable those, unless user wants to use papersize from printer prefs + // as they have no influence on what's going to be printed anyway + else + { + m_pPaperText->Enable( false ); + m_pPaperBox->Enable( false ); + m_pOrientText->Enable( false ); + m_pOrientBox->Enable( false ); + } } } diff --git a/vcl/unx/generic/print/prtsetup.hxx b/vcl/unx/generic/print/prtsetup.hxx index 924d4c54b27f..3d6ae8d792d6 100644 --- a/vcl/unx/generic/print/prtsetup.hxx +++ b/vcl/unx/generic/print/prtsetup.hxx @@ -83,6 +83,7 @@ class RTSPaperPage : public TabPage VclPtr<FixedText> m_pPaperText; VclPtr<ListBox> m_pPaperBox; + VclPtr<FixedText> m_pOrientText; VclPtr<ListBox> m_pOrientBox; VclPtr<FixedText> m_pDuplexText; |