Resolved issue #936. Improve list of predefined paper size formats for layout

export. Added format Tabloid.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-02-13 17:30:27 +02:00
parent 170238ede7
commit c12aeca599
6 changed files with 64 additions and 42 deletions

View File

@ -10,6 +10,7 @@
- [#929] New variable type: Separator.
- Speed optimization for switching "In layout" state.
- [#932] 2nd version V passmarks.
- [#936] Improve list of predefined paper size formats for layout export. Added format Tabloid.
# Version 0.6.2 (unreleased)
- [#903] Bug in tool Cut Spline path.

View File

@ -138,28 +138,31 @@ The path to output destination folder. By default the directory at which the app
.BR "*" " Legal = 6,"
.RE
.RS
.BR "*" " Roll 24in = 7,"
.BR "*" " Tabloid = 7,"
.RE
.RS
.BR "*" " Roll 30in = 8,"
.BR "*" " Roll 24in = 8,"
.RE
.RS
.BR "*" " Roll 36in = 9,"
.BR "*" " Roll 30in = 9,"
.RE
.RS
.BR "*" " Roll 42in = 10,"
.BR "*" " Roll 36in = 10,"
.RE
.RS
.BR "*" " Roll 44in = 11,"
.BR "*" " Roll 42in = 11,"
.RE
.RS
.BR "*" " Roll 48in = 12,"
.BR "*" " Roll 44in = 12,"
.RE
.RS
.BR "*" " Roll 62in = 13,"
.BR "*" " Roll 48in = 13,"
.RE
.RS
.BR "*" " Roll 72in = 14."
.BR "*" " Roll 62in = 14,"
.RE
.RS
.BR "*" " Roll 72in = 15."
.RE
.IP "--landscapeOrientation"
.RB "Switch page template orientation to landscape (" "export mode" "). This option has effect only for one of predefined page templates."
@ -589,7 +592,10 @@ The path to output destination folder. By default the directory at which the app
.BR "*" " Letter = 5,"
.RE
.RS
.BR "*" " Legal = 6."
.BR "*" " Legal = 6,"
.RE
.RS
.BR "*" " Tabloid = 7."
.RE
.IP "--tiledlmargin <The left margin>"
.RB "Tiled page left margin in current units like 3.0 (" "export mode" "). If not set will be used default value 1 cm."

View File

@ -138,28 +138,31 @@ The path to output destination folder. By default the directory at which the app
.BR "*" " Legal = 6,"
.RE
.RS
.BR "*" " Roll 24in = 7,"
.BR "*" " Tabloid = 7,"
.RE
.RS
.BR "*" " Roll 30in = 8,"
.BR "*" " Roll 24in = 8,"
.RE
.RS
.BR "*" " Roll 36in = 9,"
.BR "*" " Roll 30in = 9,"
.RE
.RS
.BR "*" " Roll 42in = 10,"
.BR "*" " Roll 36in = 10,"
.RE
.RS
.BR "*" " Roll 44in = 11,"
.BR "*" " Roll 42in = 11,"
.RE
.RS
.BR "*" " Roll 48in = 12,"
.BR "*" " Roll 44in = 12,"
.RE
.RS
.BR "*" " Roll 62in = 13,"
.BR "*" " Roll 48in = 13,"
.RE
.RS
.BR "*" " Roll 72in = 14."
.BR "*" " Roll 62in = 14,"
.RE
.RS
.BR "*" " Roll 72in = 15."
.RE
.IP "--landscapeOrientation"
.RB "Switch page template orientation to landscape (" "export mode" "). This option has effect only for one of predefined page templates."
@ -589,7 +592,10 @@ The path to output destination folder. By default the directory at which the app
.BR "*" " Letter = 5,"
.RE
.RS
.BR "*" " Legal = 6."
.BR "*" " Legal = 6,"
.RE
.RS
.BR "*" " Tabloid = 7."
.RE
.IP "--tiledlmargin <The left margin>"
.RB "Tiled page left margin in current units like 3.0 (" "export mode" "). If not set will be used default value 1 cm."

View File

@ -837,11 +837,11 @@ QString DialogLayoutSettings::MakeHelpTiledPdfTemplateList()
{
QString out = "\n";
for (int i = 0; i <= static_cast<int>(PaperSizeTemplate::Legal); ++i)
for (int i = 0; i <= static_cast<int>(PaperSizeTemplate::Tabloid); ++i)
{
out += "\t* "+VAbstractLayoutDialog::pageFormatNames.at(i)+" = "+ QString::number(i);
if (i < static_cast<int>(PaperSizeTemplate::Legal))
if (i < static_cast<int>(PaperSizeTemplate::Tabloid))
{
out += ",\n";
}
@ -868,9 +868,10 @@ QSizeF DialogLayoutSettings::Template()
case PaperSizeTemplate::A3:
case PaperSizeTemplate::A4:
case PaperSizeTemplate::Letter:
case PaperSizeTemplate::Legal:
case PaperSizeTemplate::Tabloid:
SetAdditionalOptions(false);
return GetTemplateSize(temp, paperUnit);
case PaperSizeTemplate::Legal:
case PaperSizeTemplate::Roll24in:
case PaperSizeTemplate::Roll30in:
case PaperSizeTemplate::Roll36in:

View File

@ -30,23 +30,26 @@
#include "../core/vapplication.h"
//must be the same order as PaperSizeTemplate constants
const VAbstractLayoutDialog::FormatsVector VAbstractLayoutDialog::pageFormatNames =
VAbstractLayoutDialog::FormatsVector () << QStringLiteral("A0")
<< QStringLiteral("A1")
<< QStringLiteral("A2")
<< QStringLiteral("A3")
<< QStringLiteral("A4")
<< QApplication::translate("VAbstractLayoutDialog", "Letter")
<< QApplication::translate("VAbstractLayoutDialog", "Legal")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 24in")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 30in")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 36in")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 42in")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 44in")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 48in")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 62in")
<< QApplication::translate("VAbstractLayoutDialog", "Roll 72in")
<< QApplication::translate("VAbstractLayoutDialog", "Custom");
const VAbstractLayoutDialog::FormatsVector VAbstractLayoutDialog::pageFormatNames
{
QStringLiteral("A0"),
QStringLiteral("A1"),
QStringLiteral("A2"),
QStringLiteral("A3"),
QStringLiteral("A4"),
QApplication::translate("VAbstractLayoutDialog", "Letter", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Legal", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Tabloid", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 24in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 30in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 36in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 42in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 44in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 48in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 62in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Roll 72in", "Paper format"),
QApplication::translate("VAbstractLayoutDialog", "Custom", "Paper format")
};
//---------------------------------------------------------------------------------------------------------------------
VAbstractLayoutDialog::VAbstractLayoutDialog(QWidget *parent)
@ -64,7 +67,7 @@ void VAbstractLayoutDialog::InitTemplates(QComboBox *comboBoxTemplates)
auto cntr = static_cast<VIndexType>(PaperSizeTemplate::A0);
for(const auto& v : pageFormatNames)
{
if (cntr <= static_cast<int>(PaperSizeTemplate::Legal))
if (cntr <= static_cast<int>(PaperSizeTemplate::Tabloid))
{
comboBoxTemplates->addItem(icoPaper, v+QChar(QChar::Space)+pdi, QVariant(cntr++));
}
@ -116,6 +119,10 @@ QSizeF VAbstractLayoutDialog::GetTemplateSize(PaperSizeTemplate tmpl, Unit unit)
width = UnitConvertor(8.5, Unit::Inch, unit);
height = UnitConvertor(14, Unit::Inch, unit);
return RoundTemplateSize(width, height, unit);
case PaperSizeTemplate::Tabloid:
width = UnitConvertor(11, Unit::Inch, unit);
height = UnitConvertor(17, Unit::Inch, unit);
return RoundTemplateSize(width, height, unit);
case PaperSizeTemplate::Roll24in:
width = UnitConvertor(24, Unit::Inch, unit);
height = UnitConvertor(QIMAGE_MAX, Unit::Px, unit);

View File

@ -44,7 +44,8 @@ public:
A4,
Letter,
Legal,
Roll24in = 7, // Be carefull when change order roll type
Tabloid,
Roll24in, // Be carefull when change order for roll types
Roll30in, // Used also for showing icon
Roll36in,
Roll42in,
@ -52,7 +53,7 @@ public:
Roll48in,
Roll62in,
Roll72in,
Custom = 15};
Custom};
explicit VAbstractLayoutDialog(QWidget *parent = nullptr);