From 1011a9f1238c50ec8cfd717d81b2bb3b1eeb6c88 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Fri, 20 Jun 2025 16:51:11 +0200 Subject: [PATCH] Fix issues --- index.html | 2 +- main.cpp | 5 ++- mainwindow.cpp | 19 ++++++++++-- mainwindow.h | 2 +- pages/parcours1.html | 24 +++++++-------- pages/parcours2.html | 72 +++++++++++++++++++++++++++----------------- step.cpp | 11 ------- step.h | 1 + 8 files changed, 81 insertions(+), 55 deletions(-) diff --git a/index.html b/index.html index 5af9ae0..5895d48 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@

Liste des parcours

diff --git a/main.cpp b/main.cpp index 31154c4..a0d1a0e 100644 --- a/main.cpp +++ b/main.cpp @@ -9,9 +9,12 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; - w.loadAndExportPaths(); + QStringList fichiers = {"data/parcours1.json", "data/parcours2.json"}; + w.loadAndExportPaths(fichiers); Web u(w.getPath()); u.siteHtml(); + w.show(); + return a.exec(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 47b40a9..628928a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -403,7 +403,6 @@ void MainWindow::on_toolButton_clicked() loadImage(fileName); } -<<<<<<< mainwindow.cpp int MainWindow::getIndexPath() const { return indexPath; @@ -442,7 +441,7 @@ Path *MainWindow::getCurrentPath() const void MainWindow::setCurrentPath(Path *newCurrentPath) { currentPath = newCurrentPath; -======= +} void MainWindow::saveFile(){ QString fileName; @@ -571,3 +570,19 @@ void MainWindow::on_validateBtn_clicked() } +void MainWindow::loadAndExportPaths(QStringList fichiers) { + + + for (const QString& nomFichier : fichiers) { + QFile* f = new QFile(nomFichier); + + Path* p = new Path(f); + path.append(p); + } + + int exportIndex = 1; + for (Path* p : path) { + currentPath = p; + exportHTMLMap(exportIndex++); + } +} diff --git a/mainwindow.h b/mainwindow.h index 84ff04c..191d6f7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -28,7 +28,7 @@ public: void addNewPath(); void addNewStep(); void exportHTMLMap(int index); - void loadAndExportPaths(); + void loadAndExportPaths(QStringList fichiers); QString getCurrentFile() const; void setCurrentFile(const QString &newCurrentFile); QList getPath() const; diff --git a/pages/parcours1.html b/pages/parcours1.html index dc728a4..8fee53f 100644 --- a/pages/parcours1.html +++ b/pages/parcours1.html @@ -22,7 +22,7 @@ border: 1px solid #aaa; } #fiche { -padding-right:20px; + padding-right:20px; width: 40%; max-height: 600px; overflow-y: auto; @@ -33,19 +33,19 @@ padding-right:20px; border-radius: 5%; } #fiche ul { - padding-left: 20px; - list-style-type: disc; - overflow-wrap: break-word; - word-wrap: break-word; - word-break: break-word; - white-space: normal; - max-width: 90%; + padding-left: 20px; + list-style-type: disc; + overflow-wrap: break-word; + word-wrap: break-word; + word-break: break-word; + white-space: normal; + max-width: 90%; } -#fiche li { - white-space: normal; - overflow-wrap: break-word; -} + #fiche li { + white-space: normal; + overflow-wrap: break-word; + } body h1 { display:flex; align-items:center; diff --git a/pages/parcours2.html b/pages/parcours2.html index fcc03ee..0049325 100644 --- a/pages/parcours2.html +++ b/pages/parcours2.html @@ -22,7 +22,7 @@ border: 1px solid #aaa; } #fiche { -padding-right:20px; + padding-right:20px; width: 40%; max-height: 600px; overflow-y: auto; @@ -33,19 +33,19 @@ padding-right:20px; border-radius: 5%; } #fiche ul { - padding-left: 20px; - list-style-type: disc; - overflow-wrap: break-word; - word-wrap: break-word; - word-break: break-word; - white-space: normal; - max-width: 90%; + padding-left: 20px; + list-style-type: disc; + overflow-wrap: break-word; + word-wrap: break-word; + word-break: break-word; + white-space: normal; + max-width: 90%; } -#fiche li { - white-space: normal; - overflow-wrap: break-word; -} + #fiche li { + white-space: normal; + overflow-wrap: break-word; + } body h1 { display:flex; align-items:center; @@ -74,30 +74,48 @@ padding-right:20px;
-

parcours2

-

Ville : Paris

-

Département : 1

-

Difficulté : 2

-

Durée (heures) : 2.3

-

Longueur (km) : 17.3

- +

Chemin des

+

Ville : Bourg en Bresse

+

Département : 0

+

Difficulté : 3

+

Durée (heures) : 3.8

+

Longueur (km) : 24.6

+

Étape 1

Personnages :

-
  • Quentin
  • -
  • Malo
  • +
    • Clémentine
    • +
    • Léo

    Dialogues :

    -
    • ligne de dialogue 1 HJDDDZJJJJJJJJJJJJJJJJJJJDBJBDJZBZJDBJ
    • -
    • ligne de dialogue 2BDJJHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHBDHDBHBZHVZDHVHVHEDHJVHVDHEDJD
    • +
      • Bienvenue à tous, voici le centre historique !
      • +
      • Regardez cette magnifique horloge, elle date du XIXe siècle !

      Étape 2

      Personnages :

      -
      • Antoine
      • -
      • Giovanni
      • +
        • Aurélie
        • +
        • Sami

        Dialogues :

        -
        • ligne de dialogue 1
        • -
        • ligne de dialogue 2
        • +
          • 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 !
diff --git a/step.cpp b/step.cpp index c8aaa5a..419f676 100644 --- a/step.cpp +++ b/step.cpp @@ -63,17 +63,6 @@ Step::Step() { response = 0; } - -QList Step::getPersonnage() const -{ - return personnage; -} - -QList Step::getTexte() const -{ - return texte; -} - Step::Step( QJsonObject &in) { title = in["title"].toString(); diff --git a/step.h b/step.h index e0ed2aa..eb2bc9e 100644 --- a/step.h +++ b/step.h @@ -32,6 +32,7 @@ public: void setResponse(int newResponse); void setPersonnage(const QList &newPersonnage); void setTexte(const QList &newTexte); + QString toGPSFormat(); }; #endif // STEP_H