diff --git a/mainwindow.cpp b/mainwindow.cpp
index ea2ff65..def8083 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -166,7 +166,12 @@ void MainWindow::addNewPath()
void MainWindow::addNewStep()
{
+ this->on_validateBtn_clicked();
+ currentPath->getStep().append(Step());
+ ui->stepNumber->setMaximum(currentPath->getStep().length());
+ ui->stepNumber->setSuffix("/" + QString::number(currentPath->getStep().length()));
}
+
void MainWindow::exportHTMLMap(int index)
{
if (index < 0 || index >= path.size()) {
@@ -513,6 +518,7 @@ void MainWindow::setCurrentPath(Path *newCurrentPath)
}
void MainWindow::saveFile(){
+ on_validateBtn_clicked();
QString fileName;
if (currentFile.isEmpty()) {
fileName = QFileDialog::getSaveFileName(this, "Save");
@@ -636,6 +642,7 @@ void MainWindow::on_actionEditCut_triggered()
void MainWindow::on_pathNumber_valueChanged(int arg1)
{
+ on_validateBtn_clicked();
this->loadPath(path.at(ui->pathNumber->value()-1));
currentPath = path.at(arg1-1);
}
@@ -643,12 +650,14 @@ void MainWindow::on_pathNumber_valueChanged(int arg1)
void MainWindow::on_stepNumber_valueChanged(int arg1)
{
+ on_validateBtn_clicked();
this->loadStep(currentPath->getStep().at(arg1-1));
}
void MainWindow::on_validateBtn_clicked()
{
+ std::cout << "ok" << std::endl;
this->currentPath->setName(ui->titleEdit->text());
this->currentPath->setCity(ui->locEdit->text());
this->currentPath->setImage(ui->imagePath->text());
@@ -902,6 +911,7 @@ void MainWindow::on_actionFont_size_triggered()
void MainWindow::saveAsFile(){
+ on_validateBtn_clicked();
QString fileName = QFileDialog::getSaveFileName(this, "Save as");
QFile file(fileName);
@@ -952,6 +962,7 @@ void MainWindow::on_actionSave_as_triggered()
void MainWindow::on_exportHTMLBtn_clicked()
{
+ on_validateBtn_clicked();
for(int i = 0; i < path.length(); i++) {
this->exportHTMLMap(i);
}
@@ -1019,3 +1030,9 @@ void MainWindow::on_actionFont_color_triggered()
{
this->setColor();
}
+
+
+void MainWindow::on_addStep_clicked()
+{
+ this->addNewStep();
+}
diff --git a/mainwindow.h b/mainwindow.h
index f7c92a3..1ad0360 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -120,9 +120,9 @@ private slots:
void on_actionNewFile_triggered();
-
void on_actionFont_color_triggered();
+ void on_addStep_clicked();
private:
Ui::MainWindow *ui;
diff --git a/mainwindow.ui b/mainwindow.ui
index 53b0b79..5c49127 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -79,7 +79,7 @@
- QFrame::NoFrame
+ QFrame::Shape::NoFrame
-
@@ -333,7 +333,7 @@
- QFrame::NoFrame
+ QFrame::Shape::NoFrame
-
@@ -341,9 +341,15 @@
-
+
+ /1
+
1
+
+ 1
+
-
@@ -478,7 +484,7 @@
0
0
800
- 21
+ 22