diff --git a/mainwindow.cpp b/mainwindow.cpp index 67ff713..11ca58c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -141,6 +141,7 @@ void MainWindow::loadStep(Step s) { ui->stepTitle->setText(s.getTitle()); ui->LatitudeSpin->setValue(s.getLatitude()); ui->longitudeSpin->setValue(s.getLongitude()); + ui->responseSpin->setValue(s.getResponse()); for(int i = 0; i < s.getTexte().length(); i++) { QString q = s.getPersonnage().at(i) + ": " + s.getTexte().at(i); @@ -320,6 +321,7 @@ void MainWindow::on_actionEditCut_triggered() void MainWindow::on_pathNumber_valueChanged(int arg1) { this->loadPath(path.at(ui->pathNumber->value()-1)); + currentPath = path.at(arg1-1); } @@ -328,3 +330,18 @@ void MainWindow::on_stepNumber_valueChanged(int arg1) this->loadStep(currentPath->getStep().at(arg1-1)); } + +void MainWindow::on_validateBtn_clicked() +{ + currentPath->setName(ui->titleEdit->text()); + currentPath->setCity(ui->locEdit->text()); + currentPath->setImage(ui->imagePath->text()); + currentPath->setLength(ui->lengthSpin->value()); + currentPath->setDifficulty(ui->diffSpin->value()); + currentPath->setDuration(ui->durationSpin->value()); + + currentPath->getStep()[ui->stepNumber->value()-1].setTitle(ui->stepTitle->text()); + currentPath->getStep()[ui->stepNumber->value()-1].setResponse(ui->responseSpin->value()); + +} + diff --git a/mainwindow.h b/mainwindow.h index 1472ed3..1415193 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -51,6 +51,8 @@ private slots: void on_stepNumber_valueChanged(int arg1); + void on_validateBtn_clicked(); + private: Ui::MainWindow *ui; QString currentFile; diff --git a/mainwindow.ui b/mainwindow.ui index 4aa46f1..bc8e24e 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 800 - 598 + 868 @@ -26,10 +26,22 @@ MainWindow + + + 0 + 30 + + + + + 0 + 0 + + 800 - 521 + 1000 @@ -54,6 +66,12 @@ + + + 0 + 0 + + 16777215 @@ -63,225 +81,228 @@ QFrame::NoFrame - - - - 10 - 20 - 45 - 27 - - - - 1 - - - 1 - - - - - - 60 - 20 - 391 - 26 - - - - - - - 10 - 60 - 441 - 45 - - - - - 0 - - - 0 - - - - - Localisation - - - - - - - - - - 1 - - - - - - - - - 470 - 20 - 281 - 191 - - - - - - - true - - - - - - 0 - 110 - 451 - 63 - - - - - 0 - - - 0 - - - - - - - - Difficulty + + + + + + + + + + + 1 + + + 1 + + + + + + + + + + + + + + 0 - - - - - - /5 + + 0 - - 5 + + + + Localisation + + + + + + + + + + + + + + + + + 0 - - - - - - - - - - - - Duration + + 0 - - - - - - h + + + + + 0 + + + 0 + + + + + Difficulty + + + + + + + /5 + + + 5 + + + + + + + + + + + 0 + + + 0 + + + + + Duration + + + + + + + h + + + 1 + + + 0.100000000000000 + + + + + + + + + + + 0 + + + 0 + + + + + Length + + + + + + + Km + + + 1 + + + 500.000000000000000 + + + 0.100000000000000 + + + + + + + + + + + + + + 9 - - 1 + + 0 - - 0.100000000000000 - - - - - - - - - - - - - Length - - - - - - - Km - - - 1 - - - 500.000000000000000 - - - 0.100000000000000 - - - - - - - - - - - - 0 - 180 - 451 - 44 - - - - - 9 - - - 0 - - - - - Image - - - - - - - - - - ... - - - - :/data/images/data/images/add.png:/data/images/data/images/add.png - - - - - - - Select Image File - - - - - + + + + Image + + + + + + + + + + ... + + + + :/data/images/data/images/add.png:/data/images/data/images/add.png + + + + + + + Select Image File + + + + + + + + + + + + + + 300 + 0 + + + + + 16777215 + 200 + + + + + + + true + + + + @@ -300,143 +321,155 @@ - + 0 0 + + + 0 + 0 + + QFrame::NoFrame - - - - 0 - 10 - 781 - 45 - - - - - - - 1 - - - - - - - - - - ... - - - - :/data/images/data/images/add.png:/data/images/data/images/add.png - - - - - - - - - 0 - 60 - 781 - 63 - - - - - - - - - - Latitude - - - Qt::AlignmentFlag::AlignCenter - - - - - - - 6 - - - 90.000000000000000 - - - - - - - - - - - - - Longitude - - - Qt::AlignmentFlag::AlignCenter - - - - - - - 6 - - - -180.000000000000000 - - - 180.000000000000000 - - - - - - - - - - - - - Response - - - Qt::AlignmentFlag::AlignCenter - - - - - - - - - - - - - - - 10 - 130 - 761 - 81 - - - + + + + + + + + 1 + + + + + + + + + + ... + + + + :/data/images/data/images/add.png:/data/images/data/images/add.png + + + + + + + + + + + + + + + + Latitude + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 6 + + + 90.000000000000000 + + + + + + + + + + + + + Longitude + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 6 + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + + + + + + + Response + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + + + + 0 + 255 + + + + + 0 + 0 + + + + false + + + + + + + Valider + + + + @@ -458,15 +491,8 @@ - - - Edit - - - - toolBar diff --git a/path.cpp b/path.cpp index 69a46b7..d4ed62b 100644 --- a/path.cpp +++ b/path.cpp @@ -45,12 +45,45 @@ QString Path::getImage() const return image; } -QList Path::getStep() const +QList& Path::getStep() { return step; } -Path::Path(){} +void Path::setCity(const QString &newCity) +{ + city = newCity; +} + +void Path::setDepartement(int newDepartement) +{ + departement = newDepartement; +} + +void Path::setName(const QString &newName) +{ + name = newName; +} + +void Path::setDifficulty(unsigned int newDifficulty) +{ + difficulty = newDifficulty; +} + +void Path::setDuration(float newDuration) +{ + duration = newDuration; +} + +void Path::setLength(float newLength) +{ + length = newLength; +} + +void Path::setImage(const QString &newImage) +{ + image = newImage; +} Path::Path(QFile *file){ if (!file->open(QIODevice::ReadOnly)) { diff --git a/path.h b/path.h index 7eb9315..fef7334 100644 --- a/path.h +++ b/path.h @@ -28,7 +28,14 @@ public: float getDuration() const; float getLength() const; QString getImage() const; - QList getStep() const; + QList& getStep(); + void setCity(const QString &newCity); + void setDepartement(int newDepartement); + void setName(const QString &newName); + void setDifficulty(unsigned int newDifficulty); + void setDuration(float newDuration); + void setLength(float newLength); + void setImage(const QString &newImage); }; #endif // PATH_H diff --git a/step.cpp b/step.cpp index 2467887..33f9a2e 100644 --- a/step.cpp +++ b/step.cpp @@ -27,6 +27,16 @@ int Step::getResponse() const return response; } +void Step::setTitle(const QString &newTitle) +{ + title = newTitle; +} + +void Step::setResponse(int newResponse) +{ + response = newResponse; +} + Step::Step() { latitude = 0.0; longitude = 0.0; diff --git a/step.h b/step.h index fc6ffd3..05bf5b0 100644 --- a/step.h +++ b/step.h @@ -29,6 +29,8 @@ public: QString toGPSFormat(); QList getPersonnage() const; QList getTexte() const; + void setTitle(const QString &newTitle); + void setResponse(int newResponse); }; #endif // STEP_H