Skip to content

Commit eb5f74c

Browse files
authored
Merge pull request FashionFreedom#1063 from FashionFreedom/new-measurement--file-schema
feat: New measurement file schema
2 parents f35045a + 90a59fb commit eb5f74c

File tree

167 files changed

+6332
-2648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+6332
-2648
lines changed

‎Doxyfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ EXCLUDE_PATTERNS = *.svg \
10651065
*.vit \
10661066
*.vst \
10671067
*.sm2d \
1068-
*.smin \
1068+
*.smis \
10691069
*.smms \
10701070
*.pdf \
10711071
*.png \

‎common.pri‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ defineTest(copyToDestdir) {
8383
FILE ~= s,/,\\,g
8484
DDIR ~= s,/,\\,g
8585
}
86+
message("copy:" $$quote($$FILE))
8687
QMAKE_POST_LINK += $$VCOPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
8788
}
8889

‎dist/macx/seamly2d/Info.plist‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<string>individual_size_file.icns</string>
4848
<key>LSItemContentTypes</key>
4949
<array>
50-
<string>org.seamly2dproject.smin</string>
50+
<string>org.seamly2dproject.smis</string>
5151
</array>
5252
<key>CFBundleTypeName</key>
5353
<string>SeamlyMe individual measurements</string>
@@ -104,7 +104,7 @@
104104
<key>UTTypeIconFile</key>
105105
<string>individual_size_file.icns</string>
106106
<key>UTTypeIdentifier</key>
107-
<string>org.seamly2dproject.smin</string>
107+
<string>org.seamly2dproject.smis</string>
108108
<key>UTTypeTagSpecification</key>
109109
<dict>
110110
<key>public.filename-extension</key>

‎dist/macx/seamlyme/Info.plist‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<key>UTTypeIconFile</key>
6969
<string>individual_size_file.icns</string>
7070
<key>UTTypeIdentifier</key>
71-
<string>org.seamly2dproject.smin</string>
71+
<string>org.seamly2dproject.smis</string>
7272
<key>UTTypeTagSpecification</key>
7373
<dict>
7474
<key>public.filename-extension</key>

‎src/app/samples.pri‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Keep path to all files with individual measurements we support right now
2+
INSTALL_INDIVIDUAL_MEASUREMENTS += \
3+
$${PWD}/share/samples/measurements/individual/male_shirt.smis \
4+
$${PWD}/share/samples/measurements/individual/trousers.smis
5+
6+
# Keep path to all files with multisize measurements we support right now
7+
INSTALL_MULTISIZE_MEASUREMENTS += \
8+
$${PWD}/share/samples/measurements/multisize/gost_man_ru.smms
9+
10+
# Keep path to all template files we have right now
11+
INSTALL_STANDARD_TEMPLATES += \
12+
$${PWD}/share/samples/measurements/templates/all_measurements_template.smis \
13+
$${PWD}/share/samples/measurements/templates/aldrich_women_template.smis
14+
15+
# Keep path to all patterns we provide right now
16+
INSTALL_PATTERNS += \
17+
$${PWD}/share/samples/patterns/jacket1_52-176.sm2d \
18+
$${PWD}/share/samples/patterns/jacket2_40-146.sm2d \
19+
$${PWD}/share/samples/patterns/jacket3_40-146.sm2d \
20+
$${PWD}/share/samples/patterns/jacket4_40-146.sm2d \
21+
$${PWD}/share/samples/patterns/jacket5_30-110.sm2d \
22+
$${PWD}/share/samples/patterns/jacket6_30-110.sm2d \
23+
$${PWD}/share/samples/patterns/male_shirt.sm2d \
24+
$${PWD}/share/samples/patterns/trousers.sm2d
25+
26+
# Keep path to all label templates we provide right now
27+
INSTALL_LABEL_TEMPLATES += \
28+
$${PWD}/share/labels/default_pattern_label.xml \
29+
$${PWD}/share/labels/default_piece_label.xml
30+
31+
win32
32+
{
33+
copyToDestdir($$INSTALL_INDIVIDUAL_MEASUREMENTS, $$shell_path($${OUT_PWD}/$${DESTDIR}/samples/measurements/individual))
34+
copyToDestdir($$INSTALL_MULTISIZE_MEASUREMENTS, $$shell_path($${OUT_PWD}/$${DESTDIR}/samples/measurements/multisize))
35+
copyToDestdir($$INSTALL_STANDARD_TEMPLATES, $$shell_path($${OUT_PWD}/$${DESTDIR}/samples/measurements/templates))
36+
copyToDestdir($$INSTALL_PATTERNS, $$shell_path($${OUT_PWD}/$${DESTDIR}/samples/patterns))
37+
copyToDestdir($$INSTALL_LABEL_TEMPLATES, $$shell_path($${OUT_PWD}/$${DESTDIR}/labels))
38+
}

‎src/app/seamly2d/dialogs/dialogpatternproperties.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat
189189
connect(ui->comboBoxSize, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
190190
this, DefValueChanged);
191191

192-
const bool readOnly = doc->IsReadOnly();
192+
const bool readOnly = doc->isReadOnly();
193193
ui->checkBoxPatternReadOnly->setChecked(readOnly);
194194
if (not readOnly)
195195
{

‎src/app/seamly2d/mainwindow.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6245,7 +6245,7 @@ bool MainWindow::LoadPattern(const QString &fileName, const QString& customMeasu
62456245

62466246
if (guiEnabled)
62476247
{ // No errors occurred
6248-
patternReadOnly = doc->IsReadOnly();
6248+
patternReadOnly = doc->isReadOnly();
62496249
setWidgetsEnabled(true);
62506250
setCurrentFile(fileName);
62516251
helpLabel->setText(tr("File loaded"));
@@ -6836,9 +6836,9 @@ QString MainWindow::checkPathToMeasurements(const QString &patternPath, const QS
68366836
{
68376837
MultiSizeConverter converter(filename);
68386838
QString filename = converter.Convert();
6839-
if (filename.contains(".vst"))
6839+
if (filename.contains(QLatin1String(".") + vstExt))
68406840
{
6841-
filename.replace(QString(".vst"), QString(".smms"));
6841+
filename.replace(QLatin1String(".") + vstExt, QLatin1String(".") + smmsExt);
68426842
QString error;
68436843
const bool result = measurements->SaveDocument(filename, error);
68446844
if (result)
@@ -6852,9 +6852,9 @@ QString MainWindow::checkPathToMeasurements(const QString &patternPath, const QS
68526852
{
68536853
IndividualSizeConverter converter(filename);
68546854
QString filename = converter.Convert();
6855-
if (filename.contains(".vit"))
6855+
if (filename.contains(QLatin1String(".") + vitExt))
68566856
{
6857-
filename.replace(QString(".vit"), QString(".smis"));
6857+
filename.replace(QLatin1String(".") + vitExt, QLatin1String(".") + smisExt);
68586858
QString error;
68596859
const bool result = measurements->SaveDocument(filename, error);
68606860
if (result)

‎src/app/seamly2d/mainwindowsnogui.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ void MainWindowsNoGUI::FlatDxfFile(const QString &name, int version, bool binary
11691169
generator.setFileName(name);
11701170
generator.setSize(paper->rect().size().toSize());
11711171
generator.setResolution(PrintDPI);
1172-
generator.SetVersion(static_cast<DRW::Version>(version));
1172+
generator.setVersion(static_cast<DRW::Version>(version));
11731173
generator.SetBinaryFormat(binary);
11741174
generator.setInsunits(VarInsunits::Millimeters);// Decided to always use mm. See issue #745
11751175

@@ -1190,7 +1190,7 @@ void MainWindowsNoGUI::AAMADxfFile(const QString &name, int version, bool binary
11901190
generator.setFileName(name);
11911191
generator.setSize(size);
11921192
generator.setResolution(PrintDPI);
1193-
generator.SetVersion(static_cast<DRW::Version>(version));
1193+
generator.setVersion(static_cast<DRW::Version>(version));
11941194
generator.SetBinaryFormat(binary);
11951195
generator.setInsunits(VarInsunits::Millimeters);// Decided to always use mm. See issue #745
11961196
generator.ExportToAAMA(pieces);

‎src/app/seamly2d/seamly2d.pro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ message(seamly2d.pro: Examples: $$[QT_INSTALL_EXAMPLES])
7878
# Path to resource file.
7979
win32:RC_FILE = share/resources/seamly2d.rc
8080

81-
# INSTALL_MULTISIZE_MEASUREMENTS and INSTALL_STANDARD_TEMPLATES and INSTALL_LABEL_TEMPLATES inside tables.pri
82-
include(../tables.pri)
81+
# INSTALL_MULTISIZE_MEASUREMENTS and INSTALL_STANDARD_TEMPLATES and INSTALL_LABEL_TEMPLATES inside samples.pri
82+
include(../samples.pri)
8383

8484
win32 {
8585
INSTALL_PDFTOPS += ../../../dist/win/pdftops.exe

‎src/app/seamly2d/xml/vpattern.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3879,7 +3879,7 @@ void VPattern::SetDefCustomSize(int value)
38793879
}
38803880

38813881
//---------------------------------------------------------------------------------------------------------------------
3882-
bool VPattern::IsReadOnly() const
3882+
bool VPattern::isReadOnly() const
38833883
{
38843884
const QDomElement pattern = documentElement();
38853885

0 commit comments

Comments
 (0)