Kaydet (Commit) 044fa501 authored tarafından heiko tietze's avatar heiko tietze Kaydeden (comit) Heiko Tietze

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: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
üst ff4ebd8c
......@@ -98,10 +98,10 @@
#define RID_STR_DLGIMP_MISMATCH_TITLE NC_("RID_STR_DLGIMP_MISMATCH_TITLE", "Dialog Import - Language Mismatch")
#define RID_STR_DLGIMP_MISMATCH_TEXT NC_("RID_STR_DLGIMP_MISMATCH_TEXT", "The dialog to be imported supports other languages than the target library.\n\nAdd these languages to the library to keep additional language resources provided by the dialog or omit them to stay with the current library languages.\n\nNote: For languages not supported by the dialog the resources of the dialog's default language will be used.\n ")
#define RID_STR_PRINTDLG_PAGES NC_("RID_STR_PRINTDLG_PAGES", "Pages:")
#define RID_STR_PRINTDLG_PRINTALLPAGES NC_("RID_STR_PRINTDLG_PRINTALLPAGES", "Print all pages")
#define RID_STR_PRINTDLG_PRINTPAGES NC_("RID_STR_PRINTDLG_PRINTPAGES", "Print pages")
#define RID_STR_PRINTDLG_PRINTEVENPAGES NC_("RID_STR_PRINTDLG_PRINTEVENPAGES", "Print even pages")
#define RID_STR_PRINTDLG_PRINTODDPAGES NC_("RID_STR_PRINTDLG_PRINTODDPAGES", "Print odd pages")
#define RID_STR_PRINTDLG_PRINTALLPAGES NC_("RID_STR_PRINTDLG_PRINTALLPAGES", "All ~Pages")
#define RID_STR_PRINTDLG_PRINTPAGES NC_("RID_STR_PRINTDLG_PRINTPAGES", "Pa~ges:")
#define RID_STR_PRINTDLG_PRINTEVENPAGES NC_("RID_STR_PRINTDLG_PRINTEVENPAGES", "~Even pages")
#define RID_STR_PRINTDLG_PRINTODDPAGES NC_("RID_STR_PRINTDLG_PRINTODDPAGES", "~Odd pages")
#define RID_STR_CHOOSE NC_("RID_STR_CHOOSE", "Choose")
#define RID_STR_RUN NC_("RID_STR_RUN", "Run")
#define RID_STR_RECORD NC_("RID_STR_RECORD", "~Save")
......
......@@ -42,6 +42,7 @@ Renderable::Renderable (BaseWindow* pWin)
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
aPrintRangeOpt.maGroupHint = "PrintRange" ;
aPrintRangeOpt.mbInternalOnly = true;
m_aUIProperties[0].Value = setSubgroupControlOpt("printrange",
IDEResId( RID_STR_PRINTDLG_PAGES ), OUString(), aPrintRangeOpt);
......@@ -51,10 +52,17 @@ Renderable::Renderable (BaseWindow* pWin)
IDEResId(RID_STR_PRINTDLG_PRINTPAGES),
IDEResId(RID_STR_PRINTDLG_PRINTEVENPAGES),
IDEResId(RID_STR_PRINTDLG_PRINTODDPAGES)};
const Sequence<OUString> aHelpIds{".HelpID:vcl:PrintDialog:PrintContent:ListBox"};
m_aUIProperties[1].Value = setChoiceListControlOpt( "printpagesbox", OUString(),
const Sequence<OUString> aHelpIds{".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0",
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1",
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2",
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:3"};
const Sequence<OUString> aWidgetIds{"rbAllPages",
"rbRangePages",
"rbEvenPages",
"rbOddPages"};
m_aUIProperties[1].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(),
aHelpIds, aPrintContentName,
aChoices, 0 );
aChoices, 0);
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt(aPrintContentName, 1, true);
......
......@@ -108,10 +108,10 @@
#define SCSTR_PRINTOPT_SELECTEDSHEETS NC_("SCSTR_PRINTOPT_SELECTEDSHEETS", "Print Selected Sheets")
#define SCSTR_PRINTOPT_SELECTEDCELLS NC_("SCSTR_PRINTOPT_SELECTEDCELLS", "Print Selected Cells")
#define SCSTR_PRINTOPT_FROMWHICH NC_("SCSTR_PRINTOPT_FROMWHICH", "From which:")
#define SCSTR_PRINTOPT_PRINTALLPAGES NC_("SCSTR_PRINTOPT_PRINTALLPAGES", "Print all pages")
#define SCSTR_PRINTOPT_PRINTPAGES NC_("SCSTR_PRINTOPT_PRINTPAGES", "Print pages")
#define SCSTR_PRINTOPT_PRINTEVENPAGES NC_("SCSTR_PRINTOPT_PRINTEVENPAGES", "Print even pages")
#define SCSTR_PRINTOPT_PRINTODDPAGES NC_("SCSTR_PRINTOPT_PRINTODDPAGES", "Print odd pages")
#define SCSTR_PRINTOPT_PRINTALLPAGES NC_("SCSTR_PRINTOPT_PRINTALLPAGES", "All ~Pages")
#define SCSTR_PRINTOPT_PRINTPAGES NC_("SCSTR_PRINTOPT_PRINTPAGES", "Pa~ges:")
#define SCSTR_PRINTOPT_PRINTEVENPAGES NC_("SCSTR_PRINTOPT_PRINTEVENPAGES", "~Even pages")
#define SCSTR_PRINTOPT_PRINTODDPAGES NC_("SCSTR_PRINTOPT_PRINTODDPAGES", "~Odd pages")
#define SCSTR_PRINTOPT_PRODNAME NC_("SCSTR_PRINTOPT_PRODNAME", "%PRODUCTNAME %s")
#define SCSTR_DDEDOC_NOT_LOADED NC_("SCSTR_DDEDOC_NOT_LOADED", "The following DDE source could not be updated possibly because the source document was not open. Please launch the source document and try again." )
#define SCSTR_EXTDOC_NOT_LOADED NC_("SCSTR_EXTDOC_NOT_LOADED", "The following external file could not be loaded. Data linked from this file did not get updated." )
......
......@@ -288,7 +288,7 @@ ScPrintUIOptions::ScPrintUIOptions()
ScResId( SCSTR_PRINTOPT_SELECTEDCELLS )};
uno::Sequence< OUString > aHelpIds{
".HelpID:vcl:PrintDialog:PrintContent:ListBox"};
m_aUIProperties[nIdx++].Value = setChoiceListControlOpt( "printpagesbox", OUString(),
m_aUIProperties[nIdx++].Value = setChoiceListControlOpt( "printextrabox", OUString(),
aHelpIds, "PrintContent",
aChoices, nContent );
......@@ -301,13 +301,21 @@ ScPrintUIOptions::ScPrintUIOptions()
// create a choice for the range to print
OUString aPrintRangeName( "PrintRange" );
aChoices.realloc( 4 );
aHelpIds.realloc( 1 );
aHelpIds.realloc( 4 );
uno::Sequence< OUString > aWidgetIds( 4 );
aChoices[0] = ScResId( SCSTR_PRINTOPT_PRINTALLPAGES );
aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0";
aWidgetIds[0] = "rbAllPages";
aChoices[1] = ScResId( SCSTR_PRINTOPT_PRINTPAGES );
aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1";
aWidgetIds[1] = "rbRangePages";
aChoices[2] = ScResId( SCSTR_PRINTOPT_PRINTEVENPAGES );
aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:2";
aWidgetIds[2] = "rbEvenPages";
aChoices[3] = ScResId( SCSTR_PRINTOPT_PRINTODDPAGES );
aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintRange:ListBox";
m_aUIProperties[nIdx++].Value = setChoiceListControlOpt( "printextrabox", OUString(),
aHelpIds[3] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:3";
aWidgetIds[3] = "rbOddPages";
m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(),
aHelpIds,
aPrintRangeName,
aChoices,
......
......@@ -79,20 +79,20 @@ const char* STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST[] =
const char* STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE[] =
{
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "Print all slides"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "Print slides"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "Print even slides"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "Print odd slides"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "Print selection")
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "All ~Slides"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "S~lides:"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Even slides"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Odd slides"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Selection")
};
const char* STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE[] =
{
NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "Print all pages"),
NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "Print pages"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "Print even pages"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "Print odd pages"),
NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "Print selection")
NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "All ~Pages"),
NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "~Pages:"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Even pages"),
NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Odd pages"),
NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "~Selection")
};
#endif
......
......@@ -597,7 +597,7 @@ namespace {
nPrintRange = 1;
}
}
/*
OUString aPrintRangeName( "PrintContent" );
aHelpIds.realloc( 1 );
aHelpIds[0] = ".HelpID:vcl:PrintDialog:PageContentType:ListBox";
......@@ -606,7 +606,27 @@ namespace {
mbImpress ? CreateChoice( STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE, SAL_N_ELEMENTS(STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE ) ) :
CreateChoice( STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE, SAL_N_ELEMENTS(STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE ) ),
nPrintRange ) );
*/
OUString aPrintRangeName( "PrintContent" );
aHelpIds.realloc( 5 );
aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ;
aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ;
aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ;
aHelpIds[3] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:3" ;
aHelpIds[4] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:4" ;
aWidgetIds.realloc( 5 );
aWidgetIds[0] = "rbAllPages";
aWidgetIds[1] = "rbRangePages";
aWidgetIds[2] = "rbEvenPages";
aWidgetIds[3] = "rbOddPages";
aWidgetIds[4] = "rbRangeSelection";
AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt(aWidgetIds, OUString(),
aHelpIds, aPrintRangeName,
mbImpress ? CreateChoice(STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE, SAL_N_ELEMENTS(STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE)) :
CreateChoice(STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE, SAL_N_ELEMENTS(STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE)),
nPrintRange )
);
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, true );
AddDialogControl(vcl::PrinterOptionsHelper::setEditControlOpt("pagerange", "",
......
......@@ -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")
......
......@@ -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 );
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment