diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-10-27 18:02:35 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-12-20 12:32:54 +0100 |
commit | 75fc4934c3aafcd83d9bbee63d8d24cbddae8ea0 (patch) | |
tree | c889e396c55dfc8ac0bff3846c522094f6eadcb8 /vcl/unx | |
parent | ed8435ac4cdd2970e7d467f5e122b9c007526407 (diff) |
tdf#79077: copy 'paper from printer setup' toggle
into printer properties dialog, it is rather badly accessible
(almost invisible) in File > Print > Options tabpage
Change-Id: I18d538a20dc207c359ae1e7c2c914a68daf58f31
Reviewed-on: https://gerrit.libreoffice.org/43956
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/print/prtsetup.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/generic/print/prtsetup.hxx | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/vcl/unx/generic/print/prtsetup.cxx b/vcl/unx/generic/print/prtsetup.cxx index 3faddbf3e7b8..dc667fbc9825 100644 --- a/vcl/unx/generic/print/prtsetup.cxx +++ b/vcl/unx/generic/print/prtsetup.cxx @@ -152,6 +152,7 @@ RTSPaperPage::RTSPaperPage(RTSDialog* pParent) : TabPage(pParent->m_pTabControl, "PrinterPaperPage", "vcl/ui/printerpaperpage.ui") , m_pParent( pParent ) { + get(m_pCbFromSetup, "papersizefromsetup"); get(m_pPaperText, "paperft"); get(m_pPaperBox, "paperlb"); get(m_pOrientBox, "orientlb"); @@ -164,6 +165,8 @@ RTSPaperPage::RTSPaperPage(RTSDialog* pParent) m_pOrientBox->SetSelectHdl( LINK( this, RTSPaperPage, SelectHdl ) ); m_pDuplexBox->SetSelectHdl( LINK( this, RTSPaperPage, SelectHdl ) ); m_pSlotBox->SetSelectHdl( LINK( this, RTSPaperPage, SelectHdl ) ); + m_pCbFromSetup->SetToggleHdl( LINK( this, RTSPaperPage, CheckBoxHdl ) ); + sal_Int32 nPos = 0; @@ -189,6 +192,7 @@ void RTSPaperPage::dispose() { m_pParent.clear(); m_pPaperText.clear(); + m_pCbFromSetup.clear(); m_pPaperBox.clear(); m_pOrientBox.clear(); m_pDuplexText.clear(); @@ -242,9 +246,11 @@ 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 - if (!m_pParent->m_aJobData.m_bPapersizeFromSetup) + else { m_pPaperBox->Enable( false ); m_pOrientBox->Enable( false ); @@ -283,6 +289,14 @@ IMPL_LINK( RTSPaperPage, SelectHdl, ListBox&, rBox, void ) m_pParent->SetDataModified( true ); } +IMPL_LINK( RTSPaperPage, CheckBoxHdl, CheckBox&, /*cBox*/, void ) +{ + bool bFromSetup = m_pCbFromSetup->IsChecked(); + m_pParent->m_aJobData.m_bPapersizeFromSetup = bFromSetup; + m_pPaperBox->Enable( bFromSetup ); + m_pOrientBox->Enable( bFromSetup ); + m_pParent->SetDataModified( true ); +} /* * RTSDevicePage */ diff --git a/vcl/unx/generic/print/prtsetup.hxx b/vcl/unx/generic/print/prtsetup.hxx index ff4d3fb01df7..924d4c54b27f 100644 --- a/vcl/unx/generic/print/prtsetup.hxx +++ b/vcl/unx/generic/print/prtsetup.hxx @@ -78,6 +78,8 @@ class RTSPaperPage : public TabPage { VclPtr<RTSDialog> m_pParent; + VclPtr<CheckBox> m_pCbFromSetup; + VclPtr<FixedText> m_pPaperText; VclPtr<ListBox> m_pPaperBox; @@ -90,6 +92,7 @@ class RTSPaperPage : public TabPage VclPtr<ListBox> m_pSlotBox; DECL_LINK( SelectHdl, ListBox&, void ); + DECL_LINK( CheckBoxHdl, CheckBox&, void ); public: explicit RTSPaperPage( RTSDialog* ); virtual ~RTSPaperPage() override; |