From e3f412567e2c99f21f287f138e5942bcafa3c6f7 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 10 Mar 2014 17:55:51 +0200 Subject: [PATCH] Initial commit for classes working with measurements tables. --HG-- branch : feature --- .../schema/individual_measurements.xsd | 144 ++++++++++++++++++ share/tables/individual/indivindual_ru.vit | 2 + .../app/dialogindividualmeasurements.ui | 10 +- src/dialogs/app/dialogstandardmeasurements.ui | 2 +- src/dialogs/dialogs.h | 3 + src/mainwindow.cpp | 39 ++++- src/xml/vindividualmeasurements.cpp | 33 ++++ src/xml/vindividualmeasurements.h | 40 +++++ src/xml/vstandardmeasurements.cpp | 33 ++++ src/xml/vstandardmeasurements.h | 40 +++++ src/xml/xml.pri | 8 +- 11 files changed, 345 insertions(+), 9 deletions(-) create mode 100644 src/xml/vindividualmeasurements.cpp create mode 100644 src/xml/vindividualmeasurements.h create mode 100644 src/xml/vstandardmeasurements.cpp create mode 100644 src/xml/vstandardmeasurements.h diff --git a/share/resources/schema/individual_measurements.xsd b/share/resources/schema/individual_measurements.xsd index 7336ffdae..98295c417 100644 --- a/share/resources/schema/individual_measurements.xsd +++ b/share/resources/schema/individual_measurements.xsd @@ -324,6 +324,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/tables/individual/indivindual_ru.vit b/share/tables/individual/indivindual_ru.vit index 61d4e722e..9f7ee6edf 100644 --- a/share/tables/individual/indivindual_ru.vit +++ b/share/tables/individual/indivindual_ru.vit @@ -58,6 +58,8 @@ + + diff --git a/src/dialogs/app/dialogindividualmeasurements.ui b/src/dialogs/app/dialogindividualmeasurements.ui index d2fc3ea04..f82c642cc 100644 --- a/src/dialogs/app/dialogindividualmeasurements.ui +++ b/src/dialogs/app/dialogindividualmeasurements.ui @@ -19,7 +19,7 @@ - Pattern peace name + Pattern piece name @@ -54,7 +54,9 @@ ... - + + + @@ -88,7 +90,9 @@ ... - + + + diff --git a/src/dialogs/app/dialogstandardmeasurements.ui b/src/dialogs/app/dialogstandardmeasurements.ui index 241c84fb2..c8c2b2f16 100644 --- a/src/dialogs/app/dialogstandardmeasurements.ui +++ b/src/dialogs/app/dialogstandardmeasurements.ui @@ -25,7 +25,7 @@ - Pattern peace name + Pattern piece name 0 diff --git a/src/dialogs/dialogs.h b/src/dialogs/dialogs.h index 99f4ec34e..325c096a1 100644 --- a/src/dialogs/dialogs.h +++ b/src/dialogs/dialogs.h @@ -54,5 +54,8 @@ #include "app/dialogincrements.h" #include "app/configdialog.h" #include "app/dialogpatternproperties.h" +#include "app/dialogmeasurements.h" +#include "app/dialogindividualmeasurements.h" +#include "app/dialogstandardmeasurements.h" #endif // DIALOGS_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 563bbdbae..fb05be135 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -114,10 +114,43 @@ MainWindow::MainWindow(QWidget *parent) void MainWindow::ActionNewDraw() { - const QString nameDraw = PatternPieceName(QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1)); - if (nameDraw.isEmpty()) + QString nameDraw; + if (comboBoxDraws->count() == 0) { - return; + DialogMeasurements measurements(this); + measurements.exec(); + if (measurements.type() == Measurements::Standard) + { + DialogStandardMeasurements stMeasurements(this); + if (stMeasurements.exec() == QDialog::Accepted) + { + nameDraw = stMeasurements.name(); + } + else + { + return; + } + } + else + { + DialogIndividualMeasurements indMeasurements(this); + if (indMeasurements.exec() == QDialog::Accepted) + { + nameDraw = indMeasurements.name(); + } + else + { + return; + } + } + } + else + { + nameDraw = PatternPieceName(QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1)); + if (nameDraw.isEmpty()) + { + return; + } } if (doc->appendDraw(nameDraw) == false) { diff --git a/src/xml/vindividualmeasurements.cpp b/src/xml/vindividualmeasurements.cpp new file mode 100644 index 000000000..94bd3d812 --- /dev/null +++ b/src/xml/vindividualmeasurements.cpp @@ -0,0 +1,33 @@ +/************************************************************************ + ** + ** @file vindividualmeasurements.cpp + ** @author Roman Telezhinsky + ** @date 8 3, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 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 "vindividualmeasurements.h" + +VIndividualMeasurements::VIndividualMeasurements(VContainer *data):VDomDocument(data) +{ +} diff --git a/src/xml/vindividualmeasurements.h b/src/xml/vindividualmeasurements.h new file mode 100644 index 000000000..f2cf6fda6 --- /dev/null +++ b/src/xml/vindividualmeasurements.h @@ -0,0 +1,40 @@ +/************************************************************************ + ** + ** @file vindividualmeasurements.h + ** @author Roman Telezhinsky + ** @date 8 3, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 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 VINDIVIDUALMEASUREMENTS_H +#define VINDIVIDUALMEASUREMENTS_H + +#include "vdomdocument.h" + +class VIndividualMeasurements:public VDomDocument +{ +public: + VIndividualMeasurements(VContainer *data); +}; + +#endif // VINDIVIDUALMEASUREMENTS_H diff --git a/src/xml/vstandardmeasurements.cpp b/src/xml/vstandardmeasurements.cpp new file mode 100644 index 000000000..1aaf4cf46 --- /dev/null +++ b/src/xml/vstandardmeasurements.cpp @@ -0,0 +1,33 @@ +/************************************************************************ + ** + ** @file vstandardmeasurements.cpp + ** @author Roman Telezhinsky + ** @date 8 3, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 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 "vstandardmeasurements.h" + +VStandardMeasurements::VStandardMeasurements(VContainer *data):VDomDocument(data) +{ +} diff --git a/src/xml/vstandardmeasurements.h b/src/xml/vstandardmeasurements.h new file mode 100644 index 000000000..003af3625 --- /dev/null +++ b/src/xml/vstandardmeasurements.h @@ -0,0 +1,40 @@ +/************************************************************************ + ** + ** @file vstandardmeasurements.h + ** @author Roman Telezhinsky + ** @date 8 3, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 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 VSTANDARDMEASUREMENTS_H +#define VSTANDARDMEASUREMENTS_H + +#include "vdomdocument.h" + +class VStandardMeasurements:public VDomDocument +{ +public: + VStandardMeasurements(VContainer *data); +}; + +#endif // VSTANDARDMEASUREMENTS_H diff --git a/src/xml/xml.pri b/src/xml/xml.pri index 08b77844d..fd858fb2b 100644 --- a/src/xml/xml.pri +++ b/src/xml/xml.pri @@ -1,9 +1,13 @@ HEADERS += \ src/xml/vtoolrecord.h \ src/xml/vdomdocument.h \ - src/xml/vpattern.h + src/xml/vpattern.h \ + src/xml/vstandardmeasurements.h \ + src/xml/vindividualmeasurements.h SOURCES += \ src/xml/vtoolrecord.cpp \ src/xml/vdomdocument.cpp \ - src/xml/vpattern.cpp + src/xml/vpattern.cpp \ + src/xml/vstandardmeasurements.cpp \ + src/xml/vindividualmeasurements.cpp