diff --git a/data.qrc b/data.qrc index 1ba19aa..9c654af 100644 --- a/data.qrc +++ b/data.qrc @@ -20,7 +20,4 @@ data/images/underline.png data/images/add.png - - data/parcours1.json - diff --git a/index.html b/index.html index 2b86d84..376df10 100644 --- a/index.html +++ b/index.html @@ -46,6 +46,8 @@

Liste des parcours

diff --git a/mainwindow.cpp b/mainwindow.cpp index cba0919..f937a1b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -24,7 +24,13 @@ MainWindow::MainWindow(QWidget *parent) { ui->setupUi(this); indexPath++; - currentPath = new Path(); + Path* p = new Path(); + currentPath = p; + path.append(p); + loadPath(p); + int pathCount = path.length(); + ui->pathNumber->setMaximum(pathCount); + ui->pathNumber->setSuffix("/" + QString::number(pathCount)); connect(ui->titleEdit, &QLineEdit::editingFinished, this, [this]() { @@ -505,8 +511,7 @@ void MainWindow::on_actionopenFile_triggered() this->loadNewPath(); } -void MainWindow::on_actionEditCopy_triggered() -{ +void MainWindow::copyText(){ QWidget *focused = QApplication::focusWidget(); QLineEdit* lineEdit = qobject_cast(focused); @@ -515,9 +520,12 @@ void MainWindow::on_actionEditCopy_triggered() } } - -void MainWindow::on_actionEditPaste_triggered() +void MainWindow::on_actionEditCopy_triggered() { + this->copyText(); +} + +void MainWindow::pastText(){ QWidget *focused = QApplication::focusWidget(); QLineEdit* lineEdit = qobject_cast(focused); @@ -528,10 +536,13 @@ void MainWindow::on_actionEditPaste_triggered() lineEdit->setText(text); } } - - -void MainWindow::on_actionEditCut_triggered() +void MainWindow::on_actionEditPaste_triggered() { + this->pastText(); +} + + +void MainWindow::cutText(){ QWidget *focused = QApplication::focusWidget(); QLineEdit* lineEdit = qobject_cast(focused); @@ -544,6 +555,10 @@ void MainWindow::on_actionEditCut_triggered() lineEdit->setText(text); } } +void MainWindow::on_actionEditCut_triggered() +{ + this->cutText(); +} void MainWindow::on_pathNumber_valueChanged(int arg1) @@ -648,3 +663,55 @@ void MainWindow::on_exportHTMLBtn_clicked() w.siteHtml(); } + +void MainWindow::on_actionSaveFile_triggered() +{ + this->saveFile(); +} + + +void MainWindow::on_actionSaveAsFile_triggered() +{ + this->saveAsFile(); +} + + +void MainWindow::on_actionCopy_triggered() +{ + this->copyText(); +} + + +void MainWindow::on_actionPast_triggered() +{ + this->pastText(); +} + + +void MainWindow::on_actionCut_triggered() +{ + this->cutText(); +} + +void MainWindow::newPath(){ + Path* p = new Path(); + currentPath = p; + path.append(p); + loadPath(p); + + int pathCount = path.length(); + ui->pathNumber->setMaximum(pathCount); + ui->pathNumber->setSuffix("/" + QString::number(pathCount)); + ui->pathNumber->setValue(path.indexOf(currentPath)+1); +} + +void MainWindow::on_actionNew_triggered() +{ + this->newPath(); +} + + +void MainWindow::on_actionNewFile_triggered() +{ + this->newPath(); +} diff --git a/mainwindow.h b/mainwindow.h index 6220210..72b14fa 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -36,11 +36,14 @@ public: Path *getCurrentPath() const; void setCurrentPath(Path *newCurrentPath); void saveAsFile(); - + void copyText(); + void pastText(); + void cutText(); int getIndexPath() const; void setIndexPath(int newIndexPath); void exportHTMLMap(); void saveFile(); + void newPath(); private slots: void on_pushButton_clicked(); @@ -69,6 +72,21 @@ private slots: void on_exportHTMLBtn_clicked(); + void on_actionSaveFile_triggered(); + + void on_actionSaveAsFile_triggered(); + + + void on_actionCopy_triggered(); + + void on_actionPast_triggered(); + + void on_actionCut_triggered(); + + void on_actionNew_triggered(); + + void on_actionNewFile_triggered(); + private: Ui::MainWindow *ui; QString currentFile; diff --git a/mainwindow.ui b/mainwindow.ui index b5d4729..4ce7c61 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -79,7 +79,7 @@ - QFrame::Shape::NoFrame + QFrame::NoFrame @@ -333,7 +333,7 @@ - QFrame::Shape::NoFrame + QFrame::NoFrame @@ -374,9 +374,6 @@ Latitude - - Qt::AlignmentFlag::AlignCenter - @@ -400,9 +397,6 @@ Longitude - - Qt::AlignmentFlag::AlignCenter - @@ -429,9 +423,6 @@ Response - - Qt::AlignmentFlag::AlignCenter - @@ -487,18 +478,30 @@ 0 0 800 - 23 + 21 File + + + + Edit + + + + + + + + @@ -514,7 +517,6 @@ - @@ -556,7 +558,7 @@ New File - QAction::MenuRole::NoRole + QAction::NoRole @@ -568,7 +570,7 @@ Save - QAction::MenuRole::NoRole + QAction::NoRole @@ -580,19 +582,7 @@ Save as - QAction::MenuRole::NoRole - - - - - - :/data/images/data/images/print.png:/data/images/data/images/print.png - - - Print - - - QAction::MenuRole::NoRole + QAction::NoRole @@ -604,7 +594,7 @@ Copy - QAction::MenuRole::NoRole + QAction::NoRole @@ -616,7 +606,7 @@ Paste - QAction::MenuRole::NoRole + QAction::NoRole @@ -628,7 +618,7 @@ Cut - QAction::MenuRole::NoRole + QAction::NoRole @@ -640,7 +630,7 @@ Undo - QAction::MenuRole::NoRole + QAction::NoRole @@ -652,7 +642,7 @@ Redo - QAction::MenuRole::NoRole + QAction::NoRole @@ -664,7 +654,55 @@ Open file - QAction::MenuRole::NoRole + QAction::NoRole + + + + + New path + + + Ctrl+N + + + + + Copy + + + Ctrl+C + + + + + Past + + + Ctrl+V + + + + + Cut + + + Ctrl+X + + + + + Undo + + + Ctrl+Z + + + + + Redo + + + Ctrl+Y diff --git a/pages/parcours1.html b/pages/parcours1.html index 1f7eb12..7f4959a 100644 --- a/pages/parcours1.html +++ b/pages/parcours1.html @@ -74,30 +74,26 @@
-

parcous1

+

parcous123

Ville : Bourg en bresse

Département : 0

Difficulté : 2

Durée (heures) : 2.3

Longueur (km) : 17.3

- +

Étape 1

Personnages :

  • Quentin
  • -
  • Malo

Dialogues :

-
  • ligne de dialogue 1
  • -
  • ligne de dialogue 2
  • +
    • ok c'est cool

    Étape 2

    Personnages :

    -
    • Antoine
    • -
    • Giovanni
    • +
      • Quentin

      Dialogues :

      -
      • ligne de dialogue 1
      • -
      • ligne de dialogue 2
      • +
        • ok c'est cool
@@ -110,11 +106,9 @@ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); -L.marker([45.62, -0.966517]).addTo(map).bindPopup("Étape 1
Personnages :
  • Quentin
  • Malo
Textes :
  • ligne de dialogue 1
  • ligne de dialogue 2
"); -L.marker([-44.38, 1.03348]).addTo(map).bindPopup("Étape 2
Personnages :
  • Antoine
  • Giovanni
Textes :
  • ligne de dialogue 1
  • ligne de dialogue 2
"); +L.marker([0, 0]).addTo(map).bindPopup("Étape 1
"); var latlngs = [ - [45.62, -0.966517], - [-44.38, 1.03348], + [0, 0], ]; var polyline = L.polyline(latlngs, { diff --git a/pages/parcours2.html b/pages/parcours2.html deleted file mode 100644 index 5613bda..0000000 --- a/pages/parcours2.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - Carte du parcours - - - - - -

Fiche du parcours

-
-
-
-

Chemin des

-

Ville : Bourg en Bresse

-

Département : 0

-

Difficulté : 3

-

Durée (heures) : 3.8

-

Longueur (km) : 24.6

- -

Étape 1

-

Personnages :

-
  • Clémentine
  • -
  • Léo
  • -
-

Dialogues :

-
  • Bienvenue à tous, voici le centre historique !
  • -
  • Regardez cette magnifique horloge, elle date du XIXe siècle !
  • -
-

Étape 2

-

Personnages :

-
  • Aurélie
  • -
  • Sami
  • -
-

Dialogues :

-
  • Ici, on trouve les meilleurs fromages de la région !
  • -
  • Combien de colonnes vois-tu à l'entrée ?
  • -
-

Étape 3

-

Personnages :

-
  • Juliette
  • -
  • Marc
  • -
-

Dialogues :

-
  • La Reyssouze apporte de la fraîcheur en été.
  • -
  • Regarde cette inscription ancienne sur la pierre, tu arrives à la lire ?
  • -
-

Étape 4

-

Personnages :

-
  • Claire
  • -
  • Nathalie
  • -
-

Dialogues :

-
  • Voilà l'abbaye ! Admire l'architecture.
  • -
  • C'est ici la dernière étape. Observez bien la date !
  • -
- -
-
- - - - -