summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorheiko tietze <tietze.heiko@gmail.com>2019-03-05 15:08:53 +0100
committerHeiko Tietze <tietze.heiko@gmail.com>2019-03-14 16:03:23 +0100
commit044fa501e95dcac8120767996dfb7ba8f25a703f (patch)
treef099c36335e7a6d200b0cfa21c0506cfb546aa76 /sw
parentff4ebd8c7df3d6aa7f0e3798635e6a461cfd936d (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 Change-Id: Ia06b8f2513d98fbdb1971477cf7b7127595d338c Reviewed-on: https://gerrit.libreoffice.org/68846 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/strings.hrc10
-rw-r--r--sw/source/core/view/printdata.cxx41
2 files changed, 29 insertions, 22 deletions
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index fe4ab39acd33..1a3e7bcabb83 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -603,11 +603,11 @@
#define STR_PRINTOPTUI_BROCHURE NC_("STR_PRINTOPTUI_BROCHURE", "Broch~ure")
#define STR_PRINTOPTUI_LEFT_SCRIPT NC_("STR_PRINTOPTUI_LEFT_SCRIPT", "Left-to-right script")
#define STR_PRINTOPTUI_RIGHT_SCRIPT NC_("STR_PRINTOPTUI_RIGHT_SCRIPT", "Right-to-left script")
-#define STR_PRINTOPTUI_PRINTALLPAGES NC_("STR_PRINTOPTUI_PRINTALLPAGES", "Print all pages")
-#define STR_PRINTOPTUI_PRINTPAGES NC_("STR_PRINTOPTUI_PRINTPAGES", "Print pages")
-#define STR_PRINTOPTUI_PRINTEVENPAGES NC_("STR_PRINTOPTUI_PRINTEVENPAGES", "Print even pages")
-#define STR_PRINTOPTUI_PRINTODDPAGES NC_("STR_PRINTOPTUI_PRINTODDPAGES", "Print odd pages")
-#define STR_PRINTOPTUI_PRINTSELECTION NC_("STR_PRINTOPTUI_PRINTSELECTION", "Print selection")
+#define STR_PRINTOPTUI_PRINTALLPAGES NC_("STR_PRINTOPTUI_PRINTALLPAGES", "All ~Pages")
+#define STR_PRINTOPTUI_PRINTPAGES NC_("STR_PRINTOPTUI_PRINTPAGES", "Pa~ges:")
+#define STR_PRINTOPTUI_PRINTEVENPAGES NC_("STR_PRINTOPTUI_PRINTEVENPAGES", "~Even pages")
+#define STR_PRINTOPTUI_PRINTODDPAGES NC_("STR_PRINTOPTUI_PRINTODDPAGES", "~Odd pages")
+#define STR_PRINTOPTUI_PRINTSELECTION NC_("STR_PRINTOPTUI_PRINTSELECTION", "~Selection")
#define STR_PRINTOPTUI_PLACE_MARGINS NC_("STR_PRINTOPTUI_PLACE_MARGINS", "Place in margins")
#define STR_FORMULA_CALC NC_("STR_FORMULA_CALC", "Functions")
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 4accad10eec9..44f34d1e2a5f 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -275,27 +275,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 );