diff options
-rw-r--r-- | vcl/uiconfig/ui/printerpaperpage.ui | 30 | ||||
-rw-r--r-- | vcl/unx/generic/print/prtsetup.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/generic/print/prtsetup.hxx | 3 |
3 files changed, 40 insertions, 9 deletions
diff --git a/vcl/uiconfig/ui/printerpaperpage.ui b/vcl/uiconfig/ui/printerpaperpage.ui index dc6b044b006b..847191b1613f 100644 --- a/vcl/uiconfig/ui/printerpaperpage.ui +++ b/vcl/uiconfig/ui/printerpaperpage.ui @@ -22,7 +22,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="top_attach">1</property> </packing> </child> <child> @@ -35,7 +35,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">2</property> </packing> </child> <child> @@ -48,7 +48,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -61,7 +61,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -71,7 +71,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="top_attach">1</property> </packing> </child> <child> @@ -85,7 +85,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="top_attach">2</property> </packing> </child> <child> @@ -95,7 +95,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -105,7 +105,21 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="papersizefromsetup"> + <property name="label" translatable="yes">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> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">2</property> </packing> </child> </object> diff --git a/vcl/unx/generic/print/prtsetup.cxx b/vcl/unx/generic/print/prtsetup.cxx index 0bea78b66c8f..310e35fe6497 100644 --- a/vcl/unx/generic/print/prtsetup.cxx +++ b/vcl/unx/generic/print/prtsetup.cxx @@ -163,6 +163,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"); @@ -175,6 +176,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; @@ -200,6 +203,7 @@ void RTSPaperPage::dispose() { m_pParent.clear(); m_pPaperText.clear(); + m_pCbFromSetup.clear(); m_pPaperBox.clear(); m_pOrientBox.clear(); m_pDuplexText.clear(); @@ -253,9 +257,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 ); @@ -294,6 +300,14 @@ IMPL_LINK_TYPED( RTSPaperPage, SelectHdl, ListBox&, rBox, void ) m_pParent->SetDataModified( true ); } +IMPL_LINK_TYPED( 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 3d02468658d7..a0c5958c3aaa 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_TYPED( SelectHdl, ListBox&, void ); + DECL_LINK_TYPED( CheckBoxHdl, CheckBox&, void ); public: explicit RTSPaperPage( RTSDialog* ); virtual ~RTSPaperPage(); |