diff options
author | heiko tietze <tietze.heiko@gmail.com> | 2019-03-05 15:08:53 +0100 |
---|---|---|
committer | Aron Budea <aron.budea@collabora.com> | 2019-09-26 18:56:45 +0200 |
commit | 2501aeb5de92fe357eb71ed64cca20f394390398 (patch) | |
tree | 61bf651fe2424e14c57576b2afd198e8e048e4e3 /sw/source | |
parent | 6decbdcd4323ff594d5bf59a68574b2dedde423c (diff) |
Resolves tdf#122707 - Replace listbox for print range by radio buttons
Some changes to the ui file (GtkGrid, alignment, radio buttons),
setChoiceRadiosControlOpt() instead of *list
Labels adjusted accordingly
Patch partially reverts I62bd9affc9e065d7afcc60296a72eae4612b0ddd
Reviewed-on: https://gerrit.libreoffice.org/68846
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
(cherry picked from commit 044fa501e95dcac8120767996dfb7ba8f25a703f)
Change-Id: Ia06b8f2513d98fbdb1971477cf7b7127595d338c
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/view/printdata.cxx | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 649f5fac7cec..fb7a62daf04b 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -274,27 +274,34 @@ SwPrintUIOptions::SwPrintUIOptions( // create a choice for the content to create const OUString aPrintRangeName( "PrintContent" ); - uno::Sequence< OUString > aChoices( 4 ); - uno::Sequence< OUString > aHelpIds( 1 ); - - aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:ListBox"; - + uno::Sequence< OUString > aChoices( 5 ); + uno::Sequence< sal_Bool > aChoicesDisabled( 5 ); + uno::Sequence< OUString > aHelpIds( 5 ); + uno::Sequence< OUString > aWidgetIds( 5 ); aChoices[0] = SwResId( STR_PRINTOPTUI_PRINTALLPAGES ); + aChoicesDisabled[0] = false; + aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0"; + aWidgetIds[0] = "rbAllPages"; aChoices[1] = SwResId( STR_PRINTOPTUI_PRINTPAGES ); + aChoicesDisabled[1] = false; + aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1"; + aWidgetIds[1] = "rbRangePages"; aChoices[2] = SwResId( STR_PRINTOPTUI_PRINTEVENPAGES ); + aChoicesDisabled[2] = false; //better disable for 1 page only + aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2"; + aWidgetIds[2] = "rbEvenPages"; aChoices[3] = SwResId( STR_PRINTOPTUI_PRINTODDPAGES ); - if ( bHasSelection ) - { - aChoices.realloc( 5 ); - aChoices[4] = SwResId( STR_PRINTOPTUI_PRINTSELECTION ); - } - - m_aUIProperties[ nIdx++ ].Value = setChoiceListControlOpt( "printpagesbox", - OUString(), - aHelpIds, - aPrintRangeName, - aChoices, - 0 /* always default to 'All pages' */ ); + aChoicesDisabled[3] = false; //better disable for 1 page only + aHelpIds[3] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:3"; + aWidgetIds[3] = "rbOddPages"; + aChoices[4] = SwResId( STR_PRINTOPTUI_PRINTSELECTION ); + aChoicesDisabled[4] = !bHasSelection; + aHelpIds[4] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:4"; + aWidgetIds[4] = "rbRangeSelection"; + m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(), + aHelpIds, aPrintRangeName, + aChoices, 0 /* always default to 'All pages' */, + aChoicesDisabled); // show an Edit dependent on "Pages" selected vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, true ); |