From cb9f029c0ffff69a036ccf6ae4863461844cc195 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 10 Apr 2023 13:17:01 +0300 Subject: [PATCH] New key --noGrainline. #163 --- dist/OBS_debian/debian.valentina.1 | 2 ++ dist/OBS_debian/debian.valentina.install | 1 + dist/debian/valentina.1 | 2 ++ src/app/valentina/core/vcmdexport.cpp | 7 +++++++ src/app/valentina/core/vcmdexport.h | 1 + src/app/valentina/mainwindow.cpp | 2 ++ src/libs/vmisc/commandoptions.cpp | 2 ++ src/libs/vmisc/commandoptions.h | 1 + 8 files changed, 18 insertions(+) diff --git a/dist/OBS_debian/debian.valentina.1 b/dist/OBS_debian/debian.valentina.1 index 9f5efa2b7..0849aeb10 100644 --- a/dist/OBS_debian/debian.valentina.1 +++ b/dist/OBS_debian/debian.valentina.1 @@ -136,6 +136,8 @@ The path to output destination folder. By default the directory at which the app .RE .IP "--bdxf" .RB "Export dxf in binary form." +.IP "--noGrainline" +.RB "Show/hide grainline when export layout." .IP "--text2paths" .RB "Export text as paths." .IP "--exportOnlyDetails" diff --git a/dist/OBS_debian/debian.valentina.install b/dist/OBS_debian/debian.valentina.install index a933781e9..4734c7908 100644 --- a/dist/OBS_debian/debian.valentina.install +++ b/dist/OBS_debian/debian.valentina.install @@ -16,3 +16,4 @@ usr/share/icons/hicolor/256x256/mimetypes/* usr/share/icons/hicolor/512x512/apps/* usr/share/icons/hicolor/512x512/mimetypes/* usr/share/applications/* +usr/share/metainfo/* diff --git a/dist/debian/valentina.1 b/dist/debian/valentina.1 index 9f5efa2b7..0849aeb10 100755 --- a/dist/debian/valentina.1 +++ b/dist/debian/valentina.1 @@ -136,6 +136,8 @@ The path to output destination folder. By default the directory at which the app .RE .IP "--bdxf" .RB "Export dxf in binary form." +.IP "--noGrainline" +.RB "Show/hide grainline when export layout." .IP "--text2paths" .RB "Export text as paths." .IP "--exportOnlyDetails" diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index 26044e89c..9fc083ec0 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -328,6 +328,12 @@ auto VCommandLine::IsBinaryDXF() const -> bool return IsOptionSet(LONG_OPTION_BINARYDXF); } +//--------------------------------------------------------------------------------------------------------------------- +auto VCommandLine::IsNoGrainline() const -> bool +{ + return IsOptionSet(LONG_OPTION_NOGRAINLINE); +} + //--------------------------------------------------------------------------------------------------------------------- auto VCommandLine::IsTextAsPaths() const -> bool { @@ -621,6 +627,7 @@ void VCommandLine::InitCommandLineOptions() DialogSaveLayout::MakeHelpFormatList(), translate("VCommandLine", "Format number"), QChar('0')}, {LONG_OPTION_BINARYDXF, translate("VCommandLine", "Export dxf in binary form.")}, + {LONG_OPTION_NOGRAINLINE, translate("VCommandLine", "Show/hide grainline when export layout.")}, {LONG_OPTION_TEXT2PATHS, translate("VCommandLine", "Export text as paths.")}, {LONG_OPTION_EXPORTONLYDETAILS, translate("VCommandLine", "Export only details. Export details as they positioned in the details mode. Any " diff --git a/src/app/valentina/core/vcmdexport.h b/src/app/valentina/core/vcmdexport.h index 4d72c782d..4923f8a98 100644 --- a/src/app/valentina/core/vcmdexport.h +++ b/src/app/valentina/core/vcmdexport.h @@ -83,6 +83,7 @@ public: auto OptExportType() const -> int; auto IsBinaryDXF() const -> bool; + auto IsNoGrainline() const -> bool; auto IsTextAsPaths() const -> bool; auto IsExportOnlyDetails() const -> bool; auto IsCSVWithHeader() const -> bool; diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 7bdab8f8a..bb87581a2 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -6655,6 +6655,7 @@ auto MainWindow::DoExport(const VCommandLinePtr &expParams) -> bool m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath()); m_dialogSaveLayout->SelectFormat(static_cast(expParams->OptExportType())); m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF()); + m_dialogSaveLayout->SetShowGrainline(!expParams->IsNoGrainline()); m_dialogSaveLayout->SetTextAsPaths(expParams->IsTextAsPaths()); m_dialogSaveLayout->SetXScale(expParams->ExportXScale()); m_dialogSaveLayout->SetYScale(expParams->ExportYScale()); @@ -6693,6 +6694,7 @@ auto MainWindow::DoExport(const VCommandLinePtr &expParams) -> bool m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath()); m_dialogSaveLayout->SelectFormat(static_cast(expParams->OptExportType())); m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF()); + m_dialogSaveLayout->SetShowGrainline(!expParams->IsNoGrainline()); m_dialogSaveLayout->SetXScale(expParams->ExportXScale()); m_dialogSaveLayout->SetYScale(expParams->ExportYScale()); diff --git a/src/libs/vmisc/commandoptions.cpp b/src/libs/vmisc/commandoptions.cpp index c60948dee..939eb009f 100644 --- a/src/libs/vmisc/commandoptions.cpp +++ b/src/libs/vmisc/commandoptions.cpp @@ -48,6 +48,7 @@ const QString LONG_OPTION_EXP2FORMAT = QStringLiteral("format"); const QString SINGLE_OPTION_EXP2FORMAT = QStringLiteral("f"); const QString LONG_OPTION_BINARYDXF = QStringLiteral("bdxf"); +const QString LONG_OPTION_NOGRAINLINE = QStringLiteral("noGrainline"); // NOLINT const QString LONG_OPTION_TEXT2PATHS = QStringLiteral("text2paths"); const QString LONG_OPTION_EXPORTONLYDETAILS = QStringLiteral("exportOnlyDetails"); const QString LONG_OPTION_EXPORTSUCHDETAILS = QStringLiteral("exportSuchDetails"); @@ -149,6 +150,7 @@ QStringList AllKeys() LONG_OPTION_PAGETEMPLATE, SINGLE_OPTION_PAGETEMPLATE, LONG_OPTION_EXP2FORMAT, SINGLE_OPTION_EXP2FORMAT, LONG_OPTION_BINARYDXF, + LONG_OPTION_NOGRAINLINE, LONG_OPTION_TEXT2PATHS, LONG_OPTION_EXPORTONLYDETAILS, LONG_OPTION_EXPORTSUCHDETAILS, diff --git a/src/libs/vmisc/commandoptions.h b/src/libs/vmisc/commandoptions.h index 3589f9d6c..fe62c128f 100644 --- a/src/libs/vmisc/commandoptions.h +++ b/src/libs/vmisc/commandoptions.h @@ -47,6 +47,7 @@ extern const QString LONG_OPTION_EXP2FORMAT; extern const QString SINGLE_OPTION_EXP2FORMAT; extern const QString LONG_OPTION_BINARYDXF; +extern const QString LONG_OPTION_NOGRAINLINE; extern const QString LONG_OPTION_TEXT2PATHS; extern const QString LONG_OPTION_EXPORTONLYDETAILS; extern const QString LONG_OPTION_EXPORTSUCHDETAILS;