diff --git a/ChangeLog.txt b/ChangeLog.txt index c3367696f..5eedaf2d4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -44,6 +44,7 @@ - Tool Point at distance and angle now allows negative length. - Export pattern to DXF-ASTM. - [smart-pattern/valentina#18] Auto-created Visibility Group for group operation. +- Setting scale factor for export and print. # 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 b84655a61..5e9da11b5 100644 --- a/dist/OBS_debian/debian.valentina.1 +++ b/dist/OBS_debian/debian.valentina.1 @@ -1,6 +1,6 @@ .\" Manpage for valentina. .\" Contact dismine@gmail.com to correct errors. -.TH valentina 1 "15 March, 2020" "valentina man page" +.TH valentina 1 "21 March, 2020" "valentina man page" .SH NAME Valentina \- Pattern making program. .SH SYNOPSIS @@ -213,6 +213,10 @@ The path to output destination folder. By default the directory at which the app .RB "Page top margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." .IP "-B, --bmargin " .RB "Page bottom margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." +.IP "--xscale " +.RB "Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." +.IP "--yscale " +.RB "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." .IP "--followGrainline" .RB "Order detail to follow grainline direction (" "export mode" "). .IP "--manualPriority" diff --git a/dist/debian/valentina.1 b/dist/debian/valentina.1 index b84655a61..5e9da11b5 100644 --- a/dist/debian/valentina.1 +++ b/dist/debian/valentina.1 @@ -1,6 +1,6 @@ .\" Manpage for valentina. .\" Contact dismine@gmail.com to correct errors. -.TH valentina 1 "15 March, 2020" "valentina man page" +.TH valentina 1 "21 March, 2020" "valentina man page" .SH NAME Valentina \- Pattern making program. .SH SYNOPSIS @@ -213,6 +213,10 @@ The path to output destination folder. By default the directory at which the app .RB "Page top margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." .IP "-B, --bmargin " .RB "Page bottom margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." +.IP "--xscale " +.RB "Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." +.IP "--yscale " +.RB "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." .IP "--followGrainline" .RB "Order detail to follow grainline direction (" "export mode" "). .IP "--manualPriority" diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index b58f8f33e..84a6956b0 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -408,6 +408,28 @@ bool VCommandLine::IsCSVWithHeader() const return IsOptionSet(LONG_OPTION_CSVWITHHEADER); } +//--------------------------------------------------------------------------------------------------------------------- +qreal VCommandLine::ExportXScale() const +{ + qreal xs = 0; + if (IsOptionSet(LONG_OPTION_EXPXSCALE)) + { + xs = OptionValue(LONG_OPTION_EXPXSCALE).toDouble(); + } + return xs; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VCommandLine::ExportYScale() const +{ + qreal ys = 0; + if (IsOptionSet(LONG_OPTION_EXPYSCALE)) + { + ys = OptionValue(LONG_OPTION_EXPYSCALE).toDouble(); + } + return ys; +} + //--------------------------------------------------------------------------------------------------------------------- QString VCommandLine::OptExportSuchDetails() const { @@ -664,6 +686,12 @@ void VCommandLine::InitCommandLineOptions() translate("VCommandLine", "Page bottom margin in current units like 3.0 (export mode). If not set will be " "used value from default printer. Or 0 if none printers was found."), translate("VCommandLine", "The bottom margin")}, + {LONG_OPTION_EXPXSCALE, + translate("VCommandLine", "Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode)."), + translate("VCommandLine", "Horizontal scale")}, + {LONG_OPTION_EXPYSCALE, + translate("VCommandLine", "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode)."), + translate("VCommandLine", "Vertical scale")}, //================================================================================================================= {LONG_OPTION_FOLLOW_GRAINLINE, translate("VCommandLine", "Order detail to follow grainline direction (export mode).")}, diff --git a/src/app/valentina/core/vcmdexport.h b/src/app/valentina/core/vcmdexport.h index a89f0bf4c..b4b8057b7 100644 --- a/src/app/valentina/core/vcmdexport.h +++ b/src/app/valentina/core/vcmdexport.h @@ -88,6 +88,9 @@ public: bool IsExportOnlyDetails() const; bool IsCSVWithHeader() const; + qreal ExportXScale() const; + qreal ExportYScale() const; + //@brief returns the piece name regex or empty string if not set QString OptExportSuchDetails() const; diff --git a/src/app/valentina/dialogs/dialoglayoutscale.cpp b/src/app/valentina/dialogs/dialoglayoutscale.cpp new file mode 100644 index 000000000..256c66f14 --- /dev/null +++ b/src/app/valentina/dialogs/dialoglayoutscale.cpp @@ -0,0 +1,214 @@ +/************************************************************************ + ** + ** @file dialoglayoutscale.cpp + ** @author Roman Telezhynskyi + ** @date 21 3, 2020 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentina project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2020 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "dialoglayoutscale.h" +#include "ui_dialoglayoutscale.h" +#include "../core/vapplication.h" +#include "../vmisc/vsettings.h" + +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutScale::DialogLayoutScale(bool printTiled, QWidget *parent) + :QDialog(parent), + ui(new Ui::DialogLayoutScale) +{ + ui->setupUi(this); + + qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c()); + + QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); + SCASSERT(bOk != nullptr) + connect(bOk, &QPushButton::clicked, this, &DialogLayoutScale::Save); + + if (not printTiled) + { + ui->groupBoxMargins->setVisible(false); + } + + connect(ui->toolButtonScaleConnected, &QToolButton::clicked, this, &DialogLayoutScale::ToggleScaleConnection); + + connect(ui->doubleSpinBoxHorizontalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutScale::HorizontalScaleChanged); + connect(ui->doubleSpinBoxVerticalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutScale::VerticalScaleChanged); + + ReadSettings(); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutScale::~DialogLayoutScale() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::SetTiledMargins(QMarginsF margins) +{ + // read Margins top, right, bottom, left + margins = UnitConvertor(margins, Unit::Mm, qApp->patternUnit()); + + ui->doubleSpinBoxLeftField->setValue(margins.left()); + ui->doubleSpinBoxTopField->setValue(margins.top()); + ui->doubleSpinBoxRightField->setValue(margins.right()); + ui->doubleSpinBoxBottomField->setValue(margins.bottom()); +} + +//--------------------------------------------------------------------------------------------------------------------- +QMarginsF DialogLayoutScale::GetTiledMargins() const +{ + QMarginsF margins = QMarginsF( + ui->doubleSpinBoxLeftField->value(), + ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), + ui->doubleSpinBoxBottomField->value() + ); + + return UnitConvertor(margins, qApp->patternUnit(), Unit::Mm); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::SetXScale(qreal scale) +{ + ui->doubleSpinBoxHorizontalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogLayoutScale::GetXScale() const +{ + return ui->doubleSpinBoxHorizontalScale->value() / 100.; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::SetYScale(qreal scale) +{ + ui->doubleSpinBoxVerticalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogLayoutScale::GetYScale() const +{ + return ui->doubleSpinBoxVerticalScale->value() / 100.; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setFixedSize(size()); + + isInitialized = true;//first show windows are held +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::Save() +{ + WriteSettings(); + + accept(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::ToggleScaleConnection() +{ + m_scaleConnected = not m_scaleConnected; + + QIcon icon; + icon.addFile(m_scaleConnected ? QStringLiteral(":/icon/32x32/link.png") + : QStringLiteral(":/icon/32x32/broken_link.png")); + ui->toolButtonScaleConnected->setIcon(icon); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::HorizontalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxVerticalScale->blockSignals(true); + ui->doubleSpinBoxVerticalScale->setValue(d); + ui->doubleSpinBoxVerticalScale->blockSignals(false); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::VerticalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxHorizontalScale->blockSignals(true); + ui->doubleSpinBoxHorizontalScale->setValue(d); + ui->doubleSpinBoxHorizontalScale->blockSignals(false); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::ReadSettings() +{ + VSettings *settings = qApp->ValentinaSettings(); + const Unit unit = qApp->patternUnit(); + + // read Margins top, right, bottom, left + const QMarginsF margins = settings->GetTiledPDFMargins(unit); + + ui->doubleSpinBoxLeftField->setValue(margins.left()); + ui->doubleSpinBoxTopField->setValue(margins.top()); + ui->doubleSpinBoxRightField->setValue(margins.right()); + ui->doubleSpinBoxBottomField->setValue(margins.bottom()); + + ui->doubleSpinBoxLeftField->setSuffix(UnitsToStr(unit, true)); + ui->doubleSpinBoxTopField->setSuffix(UnitsToStr(unit, true)); + ui->doubleSpinBoxRightField->setSuffix(UnitsToStr(unit, true)); + ui->doubleSpinBoxBottomField->setSuffix(UnitsToStr(unit, true)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::WriteSettings() const +{ + VSettings *settings = qApp->ValentinaSettings(); + const Unit unit = qApp->patternUnit(); + + // write Margins top, right, bottom, left + QMarginsF margins = QMarginsF( + ui->doubleSpinBoxLeftField->value(), + ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), + ui->doubleSpinBoxBottomField->value() + ); + settings->SetTiledPDFMargins(margins,unit); +} diff --git a/src/app/valentina/dialogs/dialoglayoutscale.h b/src/app/valentina/dialogs/dialoglayoutscale.h new file mode 100644 index 000000000..757f9c6e6 --- /dev/null +++ b/src/app/valentina/dialogs/dialoglayoutscale.h @@ -0,0 +1,74 @@ +/************************************************************************ + ** + ** @file dialoglayoutscale.h + ** @author Roman Telezhynskyi + ** @date 21 3, 2020 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentina project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2020 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ +#ifndef DIALOGLAYOUTSCALE_H +#define DIALOGLAYOUTSCALE_H + +#include + +namespace Ui +{ + class DialogLayoutScale; +} + +class DialogLayoutScale : public QDialog +{ + Q_OBJECT + +public: + explicit DialogLayoutScale(bool printTiled, QWidget *parent = nullptr); + ~DialogLayoutScale(); + + void SetTiledMargins(QMarginsF margins); + QMarginsF GetTiledMargins() const; + + void SetXScale(qreal scale); + qreal GetXScale() const; + + void SetYScale(qreal scale); + qreal GetYScale() const; + +protected: + virtual void showEvent(QShowEvent *event) override; + +private slots: + void Save(); + void ToggleScaleConnection(); + void HorizontalScaleChanged(double d); + void VerticalScaleChanged(double d); + +private: + Q_DISABLE_COPY(DialogLayoutScale) + Ui::DialogLayoutScale *ui; + bool isInitialized{false}; + bool m_scaleConnected{true}; + + void ReadSettings(); + void WriteSettings() const; +}; + +#endif // DIALOGLAYOUTSCALE_H diff --git a/src/app/valentina/dialogs/dialoglayoutscale.ui b/src/app/valentina/dialogs/dialoglayoutscale.ui new file mode 100644 index 000000000..6a0c99c37 --- /dev/null +++ b/src/app/valentina/dialogs/dialoglayoutscale.ui @@ -0,0 +1,334 @@ + + + DialogLayoutScale + + + + 0 + 0 + 404 + 211 + + + + Layout scale + + + + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + + + + + + + true + + + Margins + + + false + + + + + + + 0 + 0 + + + + Left: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + 0 + 0 + + + + Right: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + 0 + 0 + + + + Top: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + 0 + 0 + + + + Bottom: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + + + + + Scale + + + + + + + + Horizontal: + + + + + + + Vertical: + + + + + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + + + 1 + + + 0 + + + 0 + + + + + + 10 + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + ... + + + + :/icon/32x32/link.png:/icon/32x32/link.png + + + + 32 + 32 + + + + QToolButton::DelayedPopup + + + + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + DialogLayoutScale + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogLayoutScale + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/app/valentina/dialogs/dialogs.h b/src/app/valentina/dialogs/dialogs.h index 122665410..2ca4e9ca3 100644 --- a/src/app/valentina/dialogs/dialogs.h +++ b/src/app/valentina/dialogs/dialogs.h @@ -36,5 +36,6 @@ #include "dialogaboutapp.h" #include "dialogpreferences.h" #include "dialogfinalmeasurements.h" +#include "dialoglayoutscale.h" #endif // DIALOGS_H diff --git a/src/app/valentina/dialogs/dialogs.pri b/src/app/valentina/dialogs/dialogs.pri index 2bb72de56..af53d7952 100644 --- a/src/app/valentina/dialogs/dialogs.pri +++ b/src/app/valentina/dialogs/dialogs.pri @@ -2,6 +2,7 @@ # This need for corect working file translations.pro HEADERS += \ + $$PWD/dialoglayoutscale.h \ $$PWD/dialogs.h \ $$PWD/dialogincrements.h \ $$PWD/dialoghistory.h \ @@ -26,6 +27,7 @@ HEADERS += \ SOURCES += \ $$PWD/dialogincrements.cpp \ $$PWD/dialoghistory.cpp \ + $$PWD/dialoglayoutscale.cpp \ $$PWD/dialogpatternproperties.cpp \ $$PWD/dialognewpattern.cpp \ $$PWD/dialogaboutapp.cpp \ @@ -47,6 +49,7 @@ SOURCES += \ FORMS += \ $$PWD/dialogincrements.ui \ $$PWD/dialoghistory.ui \ + $$PWD/dialoglayoutscale.ui \ $$PWD/dialogpatternproperties.ui \ $$PWD/dialognewpattern.ui \ $$PWD/dialogaboutapp.ui \ diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index f04ce78de..ecac7451b 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -151,26 +151,15 @@ DialogSaveLayout::DialogSaveLayout(int count, Draw mode, const QString &fileName InitTemplates(ui->comboBoxTemplates); + connect(ui->toolButtonScaleConnected, &QToolButton::clicked, this, &DialogSaveLayout::ToggleScaleConnection); + + connect(ui->doubleSpinBoxHorizontalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogSaveLayout::HorizontalScaleChanged); + connect(ui->doubleSpinBoxVerticalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogSaveLayout::VerticalScaleChanged); + ReadSettings(); - // connect for the template drop down box of the tiled pds - connect(ui->comboBoxTemplates, QOverload::of(&QComboBox::currentIndexChanged), - this, &DialogSaveLayout::WriteSettings); - - // connects for the margins of the tiled pdf - connect(ui->doubleSpinBoxLeftField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - connect(ui->doubleSpinBoxTopField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - connect(ui->doubleSpinBoxRightField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - connect(ui->doubleSpinBoxBottomField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - - // connects for the orientation buttons for the tiled pdf - connect(ui->toolButtonPortrait, &QToolButton::toggled, this, &DialogSaveLayout::WriteSettings); - connect(ui->toolButtonLandscape, &QToolButton::toggled, this, &DialogSaveLayout::WriteSettings); - ShowExample();//Show example for current format. } @@ -520,6 +509,8 @@ LayoutExportFormats DialogSaveLayout::Format() const //--------------------------------------------------------------------------------------------------------------------- void DialogSaveLayout::Save() { + WriteSettings(); + for (int i=0; i < count; ++i) { const QString name = Path()+'/'+FileName()+QString::number(i+1)+ExportFormatSuffix(Format()); @@ -623,6 +614,39 @@ void DialogSaveLayout::ShowExample() } } +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::ToggleScaleConnection() +{ + m_scaleConnected = not m_scaleConnected; + + QIcon icon; + icon.addFile(m_scaleConnected ? QStringLiteral(":/icon/32x32/link.png") + : QStringLiteral(":/icon/32x32/broken_link.png")); + ui->toolButtonScaleConnected->setIcon(icon); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::HorizontalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxVerticalScale->blockSignals(true); + ui->doubleSpinBoxVerticalScale->setValue(d); + ui->doubleSpinBoxVerticalScale->blockSignals(false); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::VerticalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxHorizontalScale->blockSignals(true); + ui->doubleSpinBoxHorizontalScale->setValue(d); + ui->doubleSpinBoxHorizontalScale->blockSignals(false); + } +} + //--------------------------------------------------------------------------------------------------------------------- bool DialogSaveLayout::IsTextAsPaths() const { @@ -719,6 +743,30 @@ PageOrientation DialogSaveLayout::GetTiledPageOrientation() const } } +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::SetXScale(qreal scale) +{ + ui->doubleSpinBoxHorizontalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogSaveLayout::GetXScale() const +{ + return ui->doubleSpinBoxHorizontalScale->value() / 100.; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::SetYScale(qreal scale) +{ + ui->doubleSpinBoxVerticalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogSaveLayout::GetYScale() const +{ + return ui->doubleSpinBoxVerticalScale->value() / 100.; +} + //--------------------------------------------------------------------------------------------------------------------- void DialogSaveLayout::showEvent(QShowEvent *event) { diff --git a/src/app/valentina/dialogs/dialogsavelayout.h b/src/app/valentina/dialogs/dialogsavelayout.h index 462c2330e..8f6d480f7 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.h +++ b/src/app/valentina/dialogs/dialogsavelayout.h @@ -86,6 +86,12 @@ public: void SetTiledPageOrientation(PageOrientation orientation); PageOrientation GetTiledPageOrientation() const; + void SetXScale(qreal scale); + qreal GetXScale() const; + + void SetYScale(qreal scale); + qreal GetYScale() const; + protected: virtual void showEvent(QShowEvent *event) override; void InitTemplates(QComboBox *comboBoxTemplates); @@ -94,6 +100,9 @@ private slots: void Save(); void PathChanged(const QString &text); void ShowExample(); + void ToggleScaleConnection(); + void HorizontalScaleChanged(double d); + void VerticalScaleChanged(double d); private: Q_DISABLE_COPY(DialogSaveLayout) Ui::DialogSaveLAyout *ui; @@ -101,6 +110,7 @@ private: bool isInitialized; Draw m_mode; bool m_tiledExportMode; + bool m_scaleConnected{true}; static bool havePdf; static bool tested; diff --git a/src/app/valentina/dialogs/dialogsavelayout.ui b/src/app/valentina/dialogs/dialogsavelayout.ui index c9440ace0..b86e47a78 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.ui +++ b/src/app/valentina/dialogs/dialogsavelayout.ui @@ -6,8 +6,8 @@ 0 0 - 719 - 314 + 493 + 391 @@ -17,20 +17,20 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - - - - - Path: - - - - + + + + + + Path: + + + - + 0 0 @@ -46,7 +46,7 @@ - + 0 0 @@ -61,44 +61,229 @@ - - - - File format: - - + + + + + + + 0 + 0 + + + + File format: + + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - - - 0 - 0 - - - + + + + + + Options + + + + + + false + + + Binary form + + + + + + + true + + + Text as paths + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Scale + + + + + + + + Horizontal: + + + + + + + Vertical: + + + + + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + + + 1 + + + 0 + + + 0 + + + + + + 10 + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + ... + + + + :/icon/32x32/link.png:/icon/32x32/link.png + + + + 32 + 32 + + + + QToolButton::DelayedPopup + + + + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + + + + + + + - - - - false - - - Binary form - - - - - - - true - - - Text as paths - - - - + @@ -148,6 +333,9 @@ cm + + 0.100000000000000 + @@ -164,6 +352,9 @@ cm + + 0.100000000000000 + @@ -204,6 +395,9 @@ cm + + 0.100000000000000 + @@ -224,6 +418,9 @@ cm + + 0.100000000000000 + @@ -239,79 +436,75 @@ Paper format - - - - - + + + + + Templates: + + + + + + + + + + Orientation: + + + + + + + - Templates: + ... + + + + :/icon/16x16/portrait.png:/icon/16x16/portrait.png + + + true + + + true + + + true - - - - - + + - Orientation: + ... + + + + :/icon/16x16/landscape.png:/icon/16x16/landscape.png + + + true + + + true - - - - - - ... - - - - :/icon/16x16/portrait.png:/icon/16x16/portrait.png - - - true - - - true - - - true - - - - - - - ... - - - - :/icon/16x16/landscape.png:/icon/16x16/landscape.png - - - true - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + Qt::Horizontal + + + + 40 + 20 + + + @@ -320,19 +513,28 @@ - - - - File name: - - - - + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + File name: + + + - + 0 0 @@ -347,6 +549,12 @@ + + + 0 + 0 + + 130 @@ -363,7 +571,7 @@ - + Qt::Horizontal diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 00eca97a4..8dc9b5c75 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -5527,6 +5527,8 @@ bool MainWindow::DoExport(const VCommandLinePtr &expParams) m_dialogSaveLayout->SelectFormat(static_cast(expParams->OptExportType())); m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF()); m_dialogSaveLayout->SetTextAsPaths(expParams->IsTextAsPaths()); + m_dialogSaveLayout->SetXScale(expParams->ExportXScale()); + m_dialogSaveLayout->SetYScale(expParams->ExportYScale()); if (static_cast(expParams->OptExportType()) == LayoutExportFormats::PDFTiled) { @@ -5562,6 +5564,8 @@ bool MainWindow::DoExport(const VCommandLinePtr &expParams) m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath()); m_dialogSaveLayout->SelectFormat(static_cast(expParams->OptExportType())); m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF()); + m_dialogSaveLayout->SetXScale(expParams->ExportXScale()); + m_dialogSaveLayout->SetYScale(expParams->ExportYScale()); if (static_cast(expParams->OptExportType()) == LayoutExportFormats::PDFTiled) { diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 74c946e94..7eac97fc7 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -41,6 +41,7 @@ #include "../vlayout/vlayoutgenerator.h" #include "dialogs/dialoglayoutprogress.h" #include "dialogs/dialogsavelayout.h" +#include "dialogs/dialoglayoutscale.h" #include "../vlayout/vposter.h" #include "../vpatterndb/floatItemData/vpiecelabeldata.h" #include "../vpatterndb/floatItemData/vpatternlabeldata.h" @@ -868,7 +869,9 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer) auto *paper = qgraphicsitem_cast(papers.at(i)); if (paper) { - *poster += posterazor->Calc(paper->rect().toRect(), i, orientation); + QRectF paperRect = paper->rect(); + QSizeF image(paperRect.width() * m_xscale, paperRect.height() * m_yscale); + *poster += posterazor->Calc(image.toSize(), i, orientation); } } @@ -1213,8 +1216,8 @@ void MainWindowsNoGUI::SvgFile(const QString &name, QGraphicsRectItem *paper, QG const QRectF r = paper->rect(); QSvgGenerator generator; generator.setFileName(name); - generator.setSize(QSize(qFloor(r.width() + margins.left() + margins.right()), - qFloor(r.height() + margins.top() + margins.bottom()))); + generator.setSize(QSize(qFloor(r.width() * m_dialogSaveLayout->GetXScale() + margins.left() + margins.right()), + qFloor(r.height() * m_dialogSaveLayout->GetYScale() + margins.top() + margins.bottom()))); generator.setViewBox(QRectF(0, 0, r.width() + margins.left() + margins.right(), r.height() + margins.top() + margins.bottom())); generator.setTitle(tr("Pattern")); @@ -1226,6 +1229,7 @@ void MainWindowsNoGUI::SvgFile(const QString &name, QGraphicsRectItem *paper, QG painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen(QPen(Qt::black, qApp->Settings()->WidthHairLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); scene->render(&painter, r, r, Qt::IgnoreAspectRatio); painter.end(); } @@ -1240,8 +1244,8 @@ void MainWindowsNoGUI::PngFile(const QString &name, QGraphicsRectItem *paper, QG { const QRectF r = paper->rect(); // Create the image with the exact size of the shrunk scene - QImage image(QSize(qFloor(r.width() + margins.left() + margins.right()), - qFloor(r.height() + margins.top() + margins.bottom())), + QImage image(QSize(qFloor(r.width() * m_dialogSaveLayout->GetXScale() + margins.left() + margins.right()), + qFloor(r.height() * m_dialogSaveLayout->GetYScale() + margins.top() + margins.bottom())), QImage::Format_ARGB32); image.fill(Qt::white); QPainter painter(&image); @@ -1249,6 +1253,7 @@ void MainWindowsNoGUI::PngFile(const QString &name, QGraphicsRectItem *paper, QG painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); scene->render(&painter, r, r, Qt::IgnoreAspectRatio); image.save(name); } @@ -1271,9 +1276,11 @@ void MainWindowsNoGUI::PdfFile(const QString &name, QGraphicsRectItem *paper, QG printer.setResolution(static_cast(PrintDPI)); printer.setOrientation(QPrinter::Portrait); printer.setFullPage(ignorePrinterFields); - if (not printer.setPageSize(QPageSize(QSizeF(FromPixel(r.width() + margins.left() + margins.right(), Unit::Mm), - FromPixel(r.height() + margins.top() + margins.bottom(), Unit::Mm)), - QPageSize::Millimeter))) + + qreal width = FromPixel(r.width() * m_dialogSaveLayout->GetXScale() + margins.left() + margins.right(), Unit::Mm); + qreal height = FromPixel(r.height() * m_dialogSaveLayout->GetYScale() + margins.top() + margins.bottom(), Unit::Mm); + + if (not printer.setPageSize(QPageSize(QSizeF(width, height), QPageSize::Millimeter))) { qWarning() << tr("Cannot set printer page size"); } @@ -1298,6 +1305,7 @@ void MainWindowsNoGUI::PdfFile(const QString &name, QGraphicsRectItem *paper, QG painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); scene->render(&painter, r, r, Qt::IgnoreAspectRatio); painter.end(); } @@ -1323,6 +1331,9 @@ void MainWindowsNoGUI::PdfTiledFile(const QString &name) qWarning()<GetXScale(); + m_yscale = m_dialogSaveLayout->GetYScale(); + printer.setOutputFileName(name); printer.setResolution(static_cast(PrintDPI)); PrintPages(&printer); @@ -1421,13 +1432,18 @@ void MainWindowsNoGUI::FlatDxfFile(const QString &name, int version, bool binary PrepareTextForDXF(endStringPlaceholder, details); VDxfPaintDevice generator; generator.setFileName(name); - generator.setSize(paper->rect().size().toSize()); + + const QRectF r = paper->rect(); + generator.setSize(QSize(qFloor(r.width() * m_dialogSaveLayout->GetXScale()), + qFloor(r.height() * m_dialogSaveLayout->GetYScale()))); + generator.setResolution(PrintDPI); generator.SetVersion(static_cast(version)); generator.SetBinaryFormat(binary); generator.setInsunits(VarInsunits::Millimeters);// Decided to always use mm. See issue #745 QPainter painter; + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); if (painter.begin(&generator)) { scene->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); @@ -1442,11 +1458,14 @@ void MainWindowsNoGUI::AAMADxfFile(const QString &name, int version, bool binary { VDxfPaintDevice generator; generator.setFileName(name); - generator.setSize(size); + generator.setSize(QSize(qCeil(size.width() * m_dialogSaveLayout->GetXScale()), + qCeil(size.height() * m_dialogSaveLayout->GetYScale()))); generator.setResolution(PrintDPI); generator.SetVersion(static_cast(version)); generator.SetBinaryFormat(binary); generator.setInsunits(VarInsunits::Millimeters);// Decided to always use mm. See issue #745 + generator.SetXScale(m_dialogSaveLayout->GetXScale()); + generator.SetYScale(m_dialogSaveLayout->GetYScale()); generator.ExportToAAMA(details); } @@ -1461,6 +1480,8 @@ void MainWindowsNoGUI::ASTMDxfFile(const QString &name, int version, bool binary generator.SetVersion(static_cast(version)); generator.SetBinaryFormat(binary); generator.setInsunits(VarInsunits::Millimeters);// Decided to always use mm. See issue #745 + generator.SetXScale(m_dialogSaveLayout->GetXScale()); + generator.SetYScale(m_dialogSaveLayout->GetYScale()); generator.ExportToASTM(details); } @@ -1477,6 +1498,17 @@ void MainWindowsNoGUI::PreparePaper(int index) const shadows.at(index)->setVisible(false); paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen));// border } + + QTransform matrix; + matrix.scale(m_xscale, m_yscale); + + QList paperDetails = details.at(index); + for (auto detail : paperDetails) + { + QTransform m = detail->transform(); + m *= matrix; + detail->setTransform(m); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1491,6 +1523,17 @@ void MainWindowsNoGUI::RestorePaper(int index) const scenes.at(index)->setBackgroundBrush(brush); shadows.at(index)->setVisible(true); } + + QTransform matrix; + matrix.scale(1./m_xscale, 1./m_yscale); + + QList paperDetails = details.at(index); + for (auto detail : paperDetails) + { + QTransform m = detail->transform(); + m *= matrix; + detail->setTransform(m); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1581,8 +1624,19 @@ void MainWindowsNoGUI::PrintPreview() return; } + { + DialogLayoutScale layoutScale(isTiled, this); + layoutScale.SetXScale(1); + layoutScale.SetYScale(1); + layoutScale.exec(); + + m_xscale = layoutScale.GetXScale(); + m_yscale = layoutScale.GetYScale(); + } + SetPrinterSettings(printer.data(), PrintType::PrintPreview); printer->setResolution(static_cast(PrintDPI)); + // display print preview dialog QPrintPreviewDialog preview(printer.data()); connect(&preview, &QPrintPreviewDialog::paintRequested, this, &MainWindowsNoGUI::PrintPages); @@ -1613,6 +1667,16 @@ void MainWindowsNoGUI::LayoutPrint() return; } + { + DialogLayoutScale layoutScale(isTiled, this); + layoutScale.SetXScale(1); + layoutScale.SetYScale(1); + layoutScale.exec(); + + m_xscale = layoutScale.GetXScale(); + m_yscale = layoutScale.GetYScale(); + } + SetPrinterSettings(printer.data(), PrintType::PrintNative); QPrintDialog dialog(printer.data(), this ); // If only user couldn't change page margins we could use method setMinMax(); diff --git a/src/app/valentina/mainwindowsnogui.h b/src/app/valentina/mainwindowsnogui.h index 1137d725b..77a69eb86 100644 --- a/src/app/valentina/mainwindowsnogui.h +++ b/src/app/valentina/mainwindowsnogui.h @@ -162,6 +162,9 @@ private: QString layoutPrinterName; + qreal m_xscale{1}; + qreal m_yscale{1}; + static QList CreateShadows(const QList &papers); static QList CreateScenes(const QList &papers, const QList &shadows, diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index bec63c1c8..f023ea186 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -587,6 +587,30 @@ void VDxfEngine::setInsunits(const VarInsunits &var) varInsunits = var; } +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfEngine::GetXScale() const +{ + return m_xscale; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::SetXScale(const qreal &xscale) +{ + m_xscale = xscale; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfEngine::GetYScale() const +{ + return m_yscale; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::SetYScale(const qreal &yscale) +{ + m_yscale = yscale; +} + //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wswitch-default") @@ -642,7 +666,7 @@ bool VDxfEngine::ExportToAAMA(const QVector &details) ExportStyleSystemText(input, details); - for(auto &detail : details) + for(auto detail : details) { dx_ifaceBlock *detailBlock = new dx_ifaceBlock(); @@ -655,6 +679,8 @@ bool VDxfEngine::ExportToAAMA(const QVector &details) detailBlock->name = blockName.toStdString(); detailBlock->layer = '1'; + detail.Scale(m_xscale, m_yscale); + ExportAAMAOutline(detailBlock, detail); ExportAAMADraw(detailBlock, detail); ExportAAMAIntcut(detailBlock, detail); @@ -775,7 +801,7 @@ void VDxfEngine::ExportPieceText(dx_ifaceBlock *detailBlock, const VLayoutPiece for (int i = 0; i < list.size(); ++i) { - QPointF pos(startPos.x(), startPos.y() - ToPixel(AAMATextHeight, varInsunits)*(list.size() - i-1)); + QPointF pos(startPos.x(), startPos.y() - ToPixel(AAMATextHeight * m_yscale, varInsunits)*(list.size() - i-1)); detailBlock->ent.push_back(AAMAText(pos, list.at(i), QChar('1'))); } } @@ -790,7 +816,8 @@ void VDxfEngine::ExportStyleSystemText(const QSharedPointer &input, co { for (int j = 0; j < strings.size(); ++j) { - QPointF pos(0, getSize().height() - ToPixel(AAMATextHeight, varInsunits)*(strings.size() - j-1)); + QPointF pos(0, getSize().height() - + ToPixel(AAMATextHeight * m_yscale, varInsunits)*(strings.size() - j-1)); input->AddEntity(AAMAText(pos, strings.at(j), QChar('1'))); } return; @@ -840,7 +867,7 @@ bool VDxfEngine::ExportToASTM(const QVector &details) ExportStyleSystemText(input, details); - for(auto &detail : details) + for(auto detail : details) { dx_ifaceBlock *detailBlock = new dx_ifaceBlock(); @@ -853,6 +880,8 @@ bool VDxfEngine::ExportToASTM(const QVector &details) detailBlock->name = blockName.toStdString(); detailBlock->layer = '1'; + detail.Scale(m_xscale, m_yscale); + ExportASTMPieceBoundary(detailBlock, detail); ExportASTMSewLine(detailBlock, detail); ExportASTMInternalLine(detailBlock, detail); diff --git a/src/libs/vdxf/vdxfengine.h b/src/libs/vdxf/vdxfengine.h index 945f965de..de1e8d0bf 100644 --- a/src/libs/vdxf/vdxfengine.h +++ b/src/libs/vdxf/vdxfengine.h @@ -92,6 +92,12 @@ public: void setMeasurement(const VarMeasurement &var); void setInsunits(const VarInsunits &var); + qreal GetXScale() const; + void SetXScale(const qreal &xscale); + + qreal GetYScale() const; + void SetYScale(const qreal &yscale); + private: Q_DISABLE_COPY(VDxfEngine) QSize size; @@ -104,6 +110,8 @@ private: VarMeasurement varMeasurement; VarInsunits varInsunits; DRW_Text *textBuffer; + qreal m_xscale{1}; + qreal m_yscale{1}; Q_REQUIRED_RESULT double FromPixel(double pix, const VarInsunits &unit) const; Q_REQUIRED_RESULT double ToPixel(double val, const VarInsunits &unit) const; diff --git a/src/libs/vdxf/vdxfpaintdevice.cpp b/src/libs/vdxf/vdxfpaintdevice.cpp index d425e98e5..23622d211 100644 --- a/src/libs/vdxf/vdxfpaintdevice.cpp +++ b/src/libs/vdxf/vdxfpaintdevice.cpp @@ -162,6 +162,40 @@ void VDxfPaintDevice::setInsunits(const VarInsunits &var) engine->setInsunits(var); } +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfPaintDevice::GetXScale() const +{ + return engine->GetYScale(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfPaintDevice::SetXScale(const qreal &xscale) +{ + if (engine->isActive()) + { + qWarning("VDxfPaintDevice::SetXScale(), cannot set x scale while Dxf is being generated"); + return; + } + engine->SetXScale(xscale); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfPaintDevice::GetYScale() const +{ + return engine->GetXScale(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfPaintDevice::SetYScale(const qreal &yscale) +{ + if (engine->isActive()) + { + qWarning("VDxfPaintDevice::SetYScale(), cannot set y scale while Dxf is being generated"); + return; + } + engine->SetYScale(yscale); +} + //--------------------------------------------------------------------------------------------------------------------- bool VDxfPaintDevice::ExportToAAMA(const QVector &details) const { diff --git a/src/libs/vdxf/vdxfpaintdevice.h b/src/libs/vdxf/vdxfpaintdevice.h index 1488da069..a78f762f8 100644 --- a/src/libs/vdxf/vdxfpaintdevice.h +++ b/src/libs/vdxf/vdxfpaintdevice.h @@ -66,6 +66,12 @@ public: void setMeasurement(const VarMeasurement &var); void setInsunits(const VarInsunits &var); + qreal GetXScale() const; + void SetXScale(const qreal &xscale); + + qreal GetYScale() const; + void SetYScale(const qreal &yscale); + bool ExportToAAMA(const QVector &details) const; bool ExportToASTM(const QVector &details) const; diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index a0d959641..7d4fbb5cb 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -830,6 +830,14 @@ void VLayoutPiece::Translate(qreal dx, qreal dy) d->matrix *= m; } +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPiece::Scale(qreal sx, qreal sy) +{ + QTransform m; + m.scale(sx, sy); + d->matrix *= m; +} + //--------------------------------------------------------------------------------------------------------------------- void VLayoutPiece::Rotate(const QPointF &originPoint, qreal degrees) { diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h index f0471e84f..509bf18ac 100644 --- a/src/libs/vlayout/vlayoutpiece.h +++ b/src/libs/vlayout/vlayoutpiece.h @@ -126,6 +126,7 @@ public: void SetMirror(bool value); void Translate(qreal dx, qreal dy); + void Scale(qreal sx, qreal sy); void Rotate(const QPointF &originPoint, qreal degrees); void Mirror(const QLineF &edge); void Mirror(); diff --git a/src/libs/vmisc/commandoptions.cpp b/src/libs/vmisc/commandoptions.cpp index 1a2eefe37..47e637f5b 100644 --- a/src/libs/vmisc/commandoptions.cpp +++ b/src/libs/vmisc/commandoptions.cpp @@ -53,6 +53,8 @@ const QString LONG_OPTION_BINARYDXF = QStringLiteral("bdxf"); const QString LONG_OPTION_TEXT2PATHS = QStringLiteral("text2paths"); const QString LONG_OPTION_EXPORTONLYDETAILS = QStringLiteral("exportOnlyDetails"); const QString LONG_OPTION_EXPORTSUCHDETAILS = QStringLiteral("exportSuchDetails"); +const QString LONG_OPTION_EXPXSCALE = QStringLiteral("xscale"); +const QString LONG_OPTION_EXPYSCALE = QStringLiteral("yscale"); const QString LONG_OPTION_CROP_LENGTH = QStringLiteral("crop"); const QString SINGLE_OPTION_CROP_LENGTH = QStringLiteral("c"); @@ -153,6 +155,8 @@ QStringList AllKeys() LONG_OPTION_TEXT2PATHS, LONG_OPTION_EXPORTONLYDETAILS, LONG_OPTION_EXPORTSUCHDETAILS, + LONG_OPTION_EXPXSCALE, + LONG_OPTION_EXPYSCALE, LONG_OPTION_CROP_LENGTH, SINGLE_OPTION_CROP_LENGTH, LONG_OPTION_CROP_WIDTH, LONG_OPTION_UNITE, SINGLE_OPTION_UNITE, diff --git a/src/libs/vmisc/commandoptions.h b/src/libs/vmisc/commandoptions.h index cd8c57ed5..1f4758455 100644 --- a/src/libs/vmisc/commandoptions.h +++ b/src/libs/vmisc/commandoptions.h @@ -50,6 +50,8 @@ extern const QString LONG_OPTION_BINARYDXF; extern const QString LONG_OPTION_TEXT2PATHS; extern const QString LONG_OPTION_EXPORTONLYDETAILS; extern const QString LONG_OPTION_EXPORTSUCHDETAILS; +extern const QString LONG_OPTION_EXPXSCALE; +extern const QString LONG_OPTION_EXPYSCALE; extern const QString LONG_OPTION_CROP_LENGTH; extern const QString SINGLE_OPTION_CROP_LENGTH; diff --git a/src/libs/vmisc/share/resources/icon.qrc b/src/libs/vmisc/share/resources/icon.qrc index ebd7ae48f..f4cff9ed5 100644 --- a/src/libs/vmisc/share/resources/icon.qrc +++ b/src/libs/vmisc/share/resources/icon.qrc @@ -85,5 +85,9 @@ icon/32x32/font_preferences.png icon/24x24/font_preferences@2x.png icon/24x24/font_preferences.png + icon/32x32/broken_link.png + icon/32x32/broken_link@2x.png + icon/32x32/link.png + icon/32x32/link@2x.png diff --git a/src/libs/vmisc/share/resources/icon/32x32/broken_link.png b/src/libs/vmisc/share/resources/icon/32x32/broken_link.png new file mode 100644 index 000000000..e9eda1311 Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/broken_link.png differ diff --git a/src/libs/vmisc/share/resources/icon/32x32/broken_link@2x.png b/src/libs/vmisc/share/resources/icon/32x32/broken_link@2x.png new file mode 100644 index 000000000..7c709416c Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/broken_link@2x.png differ diff --git a/src/libs/vmisc/share/resources/icon/32x32/link.png b/src/libs/vmisc/share/resources/icon/32x32/link.png new file mode 100644 index 000000000..2b227e48e Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/link.png differ diff --git a/src/libs/vmisc/share/resources/icon/32x32/link@2x.png b/src/libs/vmisc/share/resources/icon/32x32/link@2x.png new file mode 100644 index 000000000..46527dab9 Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/link@2x.png differ