From c12aeca5994094c2a1acc63f1e83a2348cd6aeb6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 13 Feb 2019 17:30:27 +0200 Subject: [PATCH] Resolved issue #936. Improve list of predefined paper size formats for layout export. Added format Tabloid. --HG-- branch : develop --- ChangeLog.txt | 1 + dist/OBS_debian/debian.valentina.1 | 24 +++++++---- dist/debian/valentina.1 | 24 +++++++---- .../dialogs/dialoglayoutsettings.cpp | 7 +-- .../dialogs/vabstractlayoutdialog.cpp | 43 +++++++++++-------- .../valentina/dialogs/vabstractlayoutdialog.h | 7 +-- 6 files changed, 64 insertions(+), 42 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0cdbcf44c..5cc781714 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -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. diff --git a/dist/OBS_debian/debian.valentina.1 b/dist/OBS_debian/debian.valentina.1 index bcedb2d0e..2f90fa425 100644 --- a/dist/OBS_debian/debian.valentina.1 +++ b/dist/OBS_debian/debian.valentina.1 @@ -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 " .RB "Tiled page left margin in current units like 3.0 (" "export mode" "). If not set will be used default value 1 cm." diff --git a/dist/debian/valentina.1 b/dist/debian/valentina.1 index bcedb2d0e..2f90fa425 100644 --- a/dist/debian/valentina.1 +++ b/dist/debian/valentina.1 @@ -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 " .RB "Tiled page left margin in current units like 3.0 (" "export mode" "). If not set will be used default value 1 cm." diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index 6ac008900..b3b71836f 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -837,11 +837,11 @@ QString DialogLayoutSettings::MakeHelpTiledPdfTemplateList() { QString out = "\n"; - for (int i = 0; i <= static_cast(PaperSizeTemplate::Legal); ++i) + for (int i = 0; i <= static_cast(PaperSizeTemplate::Tabloid); ++i) { out += "\t* "+VAbstractLayoutDialog::pageFormatNames.at(i)+" = "+ QString::number(i); - if (i < static_cast(PaperSizeTemplate::Legal)) + if (i < static_cast(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: diff --git a/src/app/valentina/dialogs/vabstractlayoutdialog.cpp b/src/app/valentina/dialogs/vabstractlayoutdialog.cpp index 40d67ea51..30bed4dbc 100644 --- a/src/app/valentina/dialogs/vabstractlayoutdialog.cpp +++ b/src/app/valentina/dialogs/vabstractlayoutdialog.cpp @@ -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(PaperSizeTemplate::A0); for(const auto& v : pageFormatNames) { - if (cntr <= static_cast(PaperSizeTemplate::Legal)) + if (cntr <= static_cast(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); diff --git a/src/app/valentina/dialogs/vabstractlayoutdialog.h b/src/app/valentina/dialogs/vabstractlayoutdialog.h index 3f1615a80..ff2948d59 100644 --- a/src/app/valentina/dialogs/vabstractlayoutdialog.h +++ b/src/app/valentina/dialogs/vabstractlayoutdialog.h @@ -44,15 +44,16 @@ public: A4, Letter, Legal, - Roll24in = 7, // Be carefull when change order roll type - Roll30in, // Used also for showing icon + Tabloid, + Roll24in, // Be carefull when change order for roll types + Roll30in, // Used also for showing icon Roll36in, Roll42in, Roll44in, Roll48in, Roll62in, Roll72in, - Custom = 15}; + Custom}; explicit VAbstractLayoutDialog(QWidget *parent = nullptr);