summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2018-08-28 07:53:43 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2018-08-28 22:32:27 +0200
commit89c4a0a60a711c67fa1e63c0fedf950265b84b3d (patch)
tree372d9c72283dd4047873a8f28a5b354e4723cc03
parentb50e03fd9b56bcedf1dcc7ccfd16b223e39271bc (diff)
tdf#119556 Sync "Use only paper size from printer preferences"
Since commit ee6dad51150fd53d19f882edfefa879e18f9897d, the "Use only paper size from printer settings" is shown at two places in the print dialog 1) in the "Options" tab 2) in the "Properties" -> "Paper" tab This makes the setting being correctly updated in the UI in 1) as well if changed in 2). The other way around was already working previously. Change-Id: I41d29a11b4e1695a4b2f676b8d7a9c01e4abde3e Reviewed-on: https://gerrit.libreoffice.org/59581 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit 571df3ede6f09c945c4cdfd37f34ef760b6b1af2) Reviewed-on: https://gerrit.libreoffice.org/59729 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--vcl/inc/printdlg.hxx1
-rw-r--r--vcl/source/window/printdlg.cxx9
-rw-r--r--vcl/uiconfig/ui/printdialog.ui4
3 files changed, 12 insertions, 2 deletions
diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index b16d91cad1f6..750254700293 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -233,6 +233,7 @@ namespace vcl
DECL_LINK( ToggleHdl, CheckBox&, void );
DECL_LINK( ToggleRadioHdl, RadioButton&, void );
DECL_LINK( ModifyHdl, Edit&, void );
+ DECL_LINK( ActivatePageHdl, TabControl *, void);
DECL_LINK( UIOption_CheckHdl, CheckBox&, void );
DECL_LINK( UIOption_RadioHdl, RadioButton&, void );
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 084763fa934b..b59bfc17dfe3 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -723,6 +723,7 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const std::shared_ptr<PrinterC
// set a select handler
maJobPage.mpPrinters->SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) );
+ mpTabCtrl->SetActivatePageHdl( LINK( this, PrintDialog, ActivatePageHdl ) );
// setup sizes for N-Up
Size aNupSize( maPController->getPrinter()->PixelToLogic(
@@ -1751,6 +1752,14 @@ IMPL_LINK( PrintDialog, ModifyHdl, Edit&, rEdit, void )
}
}
+IMPL_LINK( PrintDialog, ActivatePageHdl, TabControl *, pTabCtrl, void )
+{
+ const sal_uInt16 id = pTabCtrl->GetCurPageId();
+ if (pTabCtrl->GetPageName(id) == "optionstab" ) {
+ maOptionsPage.mpPapersizeFromSetup->Check( maPController->getPapersizeFromSetup() );
+ }
+}
+
PropertyValue* PrintDialog::getValueForWindow( vcl::Window* i_pWindow ) const
{
PropertyValue* pVal = nullptr;
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index b2308cf2f5b9..2a6641250130 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -1517,10 +1517,10 @@
</packing>
</child>
<child type="tab">
- <object class="GtkLabel" id="label20">
+ <object class="GtkLabel" id="optionstab">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="printdialog|label20">Options</property>
+ <property name="label" translatable="yes" context="printdialog|optionstab">Options</property>
</object>
<packing>
<property name="position">3</property>