Merge branch 'main' into 'feature/save'
# Conflicts: # mainwindow.cpp # mainwindow.h # mainwindow.ui # step.h
This commit is contained in:
commit
374438a5bb
21
Undo.h
Normal file
21
Undo.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef UNDO_H
|
||||||
|
#define UNDO_H
|
||||||
|
|
||||||
|
#include <QUndoCommand>
|
||||||
|
#include <QLineEdit>
|
||||||
|
|
||||||
|
class LineEditCommand : public QUndoCommand {
|
||||||
|
public:
|
||||||
|
LineEditCommand(QLineEdit* edit, const QString& oldText, const QString& newText)
|
||||||
|
: m_edit(edit), m_oldText(oldText), m_newText(newText) {}
|
||||||
|
|
||||||
|
void undo() override { m_edit->setText(m_oldText); }
|
||||||
|
void redo() override { m_edit->setText(m_newText); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
QLineEdit* m_edit;
|
||||||
|
QString m_oldText;
|
||||||
|
QString m_newText;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // UNDO_H
|
||||||
80
data/parcours2.json
Normal file
80
data/parcours2.json
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"name": "Chemin des Saveurs",
|
||||||
|
"city": "Bourg en Bresse",
|
||||||
|
"departement": 1,
|
||||||
|
"difficulty": 3,
|
||||||
|
"duration": 3.8,
|
||||||
|
"length": 24.6,
|
||||||
|
"description": "Parcours gourmand et culturel entre ville et campagne, à la découverte des trésors cachés de Bourg en Bresse.",
|
||||||
|
"image": "data/parcours1.png",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"numero": 1,
|
||||||
|
"title": "Départ au centre-ville",
|
||||||
|
"GPS": "N 46 12.321 E 5 13.245",
|
||||||
|
"indice": "Sous la grande horloge, cherchez la plaque dorée.",
|
||||||
|
"reponse": "Horloge",
|
||||||
|
"dialogue": [
|
||||||
|
{
|
||||||
|
"personnage": "Clémentine",
|
||||||
|
"texte": "Bienvenue à tous, voici le centre historique !"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"personnage": "Léo",
|
||||||
|
"texte": "Regardez cette magnifique horloge, elle date du XIXe siècle !"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"numero": 2,
|
||||||
|
"title": "Marché couvert",
|
||||||
|
"GPS": "N 46 12.500 E 5 13.800",
|
||||||
|
"indice": "Le nombre de colonnes à l'entrée principale vous donnera la solution.",
|
||||||
|
"reponse": 6,
|
||||||
|
"dialogue": [
|
||||||
|
{
|
||||||
|
"personnage": "Aurélie",
|
||||||
|
"texte": "Ici, on trouve les meilleurs fromages de la région !"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"personnage": "Sami",
|
||||||
|
"texte": "Combien de colonnes vois-tu à l'entrée ?"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"numero": 3,
|
||||||
|
"title": "Au bord de la Reyssouze",
|
||||||
|
"GPS": "N 46 12.900 E 5 13.900",
|
||||||
|
"indice": "Sous le vieux pont de pierre, cherchez une gravure effacée.",
|
||||||
|
"reponse": "1912",
|
||||||
|
"dialogue": [
|
||||||
|
{
|
||||||
|
"personnage": "Juliette",
|
||||||
|
"texte": "La Reyssouze apporte de la fraîcheur en été."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"personnage": "Marc",
|
||||||
|
"texte": "Regarde cette inscription ancienne sur la pierre, tu arrives à la lire ?"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"numero": 4,
|
||||||
|
"title": "Arrivée à l'abbaye",
|
||||||
|
"GPS": "N 46 13.024 E 5 14.160",
|
||||||
|
"indice": "L'année inscrite au-dessus du portail principal.",
|
||||||
|
"reponse": 1655,
|
||||||
|
"dialogue": [
|
||||||
|
{
|
||||||
|
"personnage": "Claire",
|
||||||
|
"texte": "Voilà l'abbaye ! Admire l'architecture."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"personnage": "Nathalie",
|
||||||
|
"texte": "C'est ici la dernière étape. Observez bien la date !"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
148
mainwindow.cpp
148
mainwindow.cpp
@ -1,9 +1,12 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
#include "step.h"
|
||||||
|
#include "Undo.h"
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -15,8 +18,41 @@
|
|||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
, ui(new Ui::MainWindow)
|
, ui(new Ui::MainWindow)
|
||||||
|
, undoStack(new QUndoStack(this))
|
||||||
|
, Clipboard(QGuiApplication::clipboard())
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
|
||||||
|
connect(ui->titleEdit, &QLineEdit::editingFinished, this, [this]() {
|
||||||
|
static QString previousText;
|
||||||
|
QString currentText = ui->titleEdit->text();
|
||||||
|
if(previousText != currentText) {
|
||||||
|
undoStack->push(new LineEditCommand(ui->titleEdit, previousText, currentText));
|
||||||
|
previousText = currentText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->locEdit, &QLineEdit::editingFinished, this, [this]() {
|
||||||
|
static QString previousText;
|
||||||
|
QString currentText = ui->locEdit->text();
|
||||||
|
if(previousText != currentText) {
|
||||||
|
undoStack->push(new LineEditCommand(ui->locEdit, previousText, currentText));
|
||||||
|
previousText = currentText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->imagePath, &QLineEdit::editingFinished, this, [this]() {
|
||||||
|
static QString previousText;
|
||||||
|
QString currentText = ui->imagePath->text();
|
||||||
|
if(previousText != currentText) {
|
||||||
|
undoStack->push(new LineEditCommand(ui->imagePath, previousText, currentText));
|
||||||
|
previousText = currentText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->actionEditUndo, &QAction::triggered, undoStack, &QUndoStack::undo);
|
||||||
|
connect(ui->actionEditRedo, &QAction::triggered, undoStack, &QUndoStack::redo);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@ -44,7 +80,7 @@ void MainWindow::onTextChanged()
|
|||||||
textChanged = true;
|
textChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadPath()
|
void MainWindow::loadNewPath()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, "Open the file");
|
QString fileName = QFileDialog::getOpenFileName(this, "Open the file");
|
||||||
if(fileName.isEmpty()) return;
|
if(fileName.isEmpty()) return;
|
||||||
@ -58,6 +94,18 @@ void MainWindow::loadPath()
|
|||||||
Path* p = new Path(&file);
|
Path* p = new Path(&file);
|
||||||
currentPath = p;
|
currentPath = p;
|
||||||
path.append(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::loadPath(Path* p) {
|
||||||
|
|
||||||
|
QList<Step> steps = p->getStep();
|
||||||
|
|
||||||
|
|
||||||
ui->titleEdit->setText(p->getName());
|
ui->titleEdit->setText(p->getName());
|
||||||
ui->locEdit->setText(p->getCity());
|
ui->locEdit->setText(p->getCity());
|
||||||
@ -66,8 +114,36 @@ void MainWindow::loadPath()
|
|||||||
ui->durationSpin->setValue(p->getDuration());
|
ui->durationSpin->setValue(p->getDuration());
|
||||||
ui->imagePath->setText(p->getImage());
|
ui->imagePath->setText(p->getImage());
|
||||||
ui->depSpin->setValue(p->getDepartement());
|
ui->depSpin->setValue(p->getDepartement());
|
||||||
|
|
||||||
loadImage(p->getImage());
|
loadImage(p->getImage());
|
||||||
|
|
||||||
|
ui->dialogEdit->clear();
|
||||||
|
|
||||||
|
if(!steps.isEmpty()) {
|
||||||
|
Step firstStep = p->getStep().first();
|
||||||
|
ui->stepTitle->setText(firstStep.getTitle());
|
||||||
|
ui->LatitudeSpin->setValue(firstStep.getLatitude());
|
||||||
|
ui->longitudeSpin->setValue(firstStep.getLongitude());
|
||||||
|
|
||||||
|
for(int i = 0; i < firstStep.getTexte().length(); i++) {
|
||||||
|
QString q = firstStep.getPersonnage().at(i) + ": " + firstStep.getTexte().at(i);
|
||||||
|
ui->dialogEdit->appendPlainText(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->stepNumber->setValue(1);
|
||||||
|
ui->stepNumber->setSuffix("/" + QString::number(steps.length()));
|
||||||
|
ui->stepNumber->setMaximum(steps.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::loadStep(Step s) {
|
||||||
|
ui->stepTitle->setText(s.getTitle());
|
||||||
|
ui->LatitudeSpin->setValue(s.getLatitude());
|
||||||
|
ui->longitudeSpin->setValue(s.getLongitude());
|
||||||
|
|
||||||
|
for(int i = 0; i < s.getTexte().length(); i++) {
|
||||||
|
QString q = s.getPersonnage().at(i) + ": " + s.getTexte().at(i);
|
||||||
|
ui->dialogEdit->appendPlainText(q);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addNewPath()
|
void MainWindow::addNewPath()
|
||||||
@ -129,7 +205,7 @@ void MainWindow::on_pushButton_clicked()
|
|||||||
|
|
||||||
void MainWindow::on_actionOpen_triggered()
|
void MainWindow::on_actionOpen_triggered()
|
||||||
{
|
{
|
||||||
this->loadPath();
|
this->loadNewPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_toolButton_clicked()
|
void MainWindow::on_toolButton_clicked()
|
||||||
@ -139,6 +215,7 @@ void MainWindow::on_toolButton_clicked()
|
|||||||
loadImage(fileName);
|
loadImage(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::saveFile(){
|
void MainWindow::saveFile(){
|
||||||
QString fileName;
|
QString fileName;
|
||||||
if (currentFile.isEmpty()) {
|
if (currentFile.isEmpty()) {
|
||||||
@ -172,10 +249,10 @@ void MainWindow::saveFile(){
|
|||||||
stepObject["GPS"] = step.toGPSFormat();
|
stepObject["GPS"] = step.toGPSFormat();
|
||||||
stepObject["reponse"] = step.getResponse();
|
stepObject["reponse"] = step.getResponse();
|
||||||
QJsonArray dialogues;
|
QJsonArray dialogues;
|
||||||
for(int i=0; i<step.getListeDialogue().size(); i++){
|
for(int i=0; i<step.getTexte().size(); i++){
|
||||||
QJsonObject dialogueObject;
|
QJsonObject dialogueObject;
|
||||||
dialogueObject["personnage"] = step.getListePersonnage()[i];
|
dialogueObject["personnage"] = step.getPersonnage()[i];
|
||||||
dialogueObject["texte"] = step.getListeDialogue()[i];
|
dialogueObject["texte"] = step.getTexte()[i];
|
||||||
dialogues.append(dialogueObject);
|
dialogues.append(dialogueObject);
|
||||||
}
|
}
|
||||||
stepObject["dialogue"] = dialogues;
|
stepObject["dialogue"] = dialogues;
|
||||||
@ -194,3 +271,60 @@ void MainWindow::on_actionSave_triggered()
|
|||||||
this->saveFile();
|
this->saveFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionopenFile_triggered()
|
||||||
|
{
|
||||||
|
this->loadNewPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionEditCopy_triggered()
|
||||||
|
{
|
||||||
|
QWidget *focused = QApplication::focusWidget();
|
||||||
|
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||||
|
|
||||||
|
if(lineEdit) {
|
||||||
|
Clipboard->setText(lineEdit->selectedText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionEditPaste_triggered()
|
||||||
|
{
|
||||||
|
QWidget *focused = QApplication::focusWidget();
|
||||||
|
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||||
|
|
||||||
|
if(lineEdit) {
|
||||||
|
QString text = lineEdit->text();
|
||||||
|
int pos = lineEdit->cursorPosition();
|
||||||
|
text.insert(pos, Clipboard->text());
|
||||||
|
lineEdit->setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionEditCut_triggered()
|
||||||
|
{
|
||||||
|
QWidget *focused = QApplication::focusWidget();
|
||||||
|
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||||
|
|
||||||
|
if(lineEdit) {
|
||||||
|
QString text = lineEdit->text();
|
||||||
|
QString selectedText = lineEdit->selectedText();
|
||||||
|
int pos = lineEdit->selectionStart();
|
||||||
|
text.remove(pos, selectedText.length());
|
||||||
|
Clipboard->setText(selectedText);
|
||||||
|
lineEdit->setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_pathNumber_valueChanged(int arg1)
|
||||||
|
{
|
||||||
|
this->loadPath(path.at(ui->pathNumber->value()-1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_stepNumber_valueChanged(int arg1)
|
||||||
|
{
|
||||||
|
this->loadStep(currentPath->getStep().at(arg1-1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
21
mainwindow.h
21
mainwindow.h
@ -2,7 +2,8 @@
|
|||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
#include <QUndoStack>
|
||||||
|
#include <QClipboard>
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -21,7 +22,9 @@ public:
|
|||||||
void updatePathView();
|
void updatePathView();
|
||||||
void updateStepView(size_t num);
|
void updateStepView(size_t num);
|
||||||
void onTextChanged();
|
void onTextChanged();
|
||||||
void loadPath();
|
void loadNewPath();
|
||||||
|
void loadPath(Path* p);
|
||||||
|
void loadStep(Step s);
|
||||||
void addNewPath();
|
void addNewPath();
|
||||||
void addNewStep();
|
void addNewStep();
|
||||||
void exportHTMLMap();
|
void exportHTMLMap();
|
||||||
@ -36,6 +39,18 @@ private slots:
|
|||||||
|
|
||||||
void on_actionSave_triggered();
|
void on_actionSave_triggered();
|
||||||
|
|
||||||
|
void on_actionopenFile_triggered();
|
||||||
|
|
||||||
|
void on_actionEditCopy_triggered();
|
||||||
|
|
||||||
|
void on_actionEditPaste_triggered();
|
||||||
|
|
||||||
|
void on_actionEditCut_triggered();
|
||||||
|
|
||||||
|
void on_pathNumber_valueChanged(int arg1);
|
||||||
|
|
||||||
|
void on_stepNumber_valueChanged(int arg1);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
QString currentFile;
|
QString currentFile;
|
||||||
@ -43,5 +58,7 @@ private:
|
|||||||
QList<Path*> path;
|
QList<Path*> path;
|
||||||
Path* currentPath;
|
Path* currentPath;
|
||||||
void loadImage(QString fileName);
|
void loadImage(QString fileName);
|
||||||
|
QUndoStack *undoStack;
|
||||||
|
QClipboard* Clipboard;
|
||||||
};
|
};
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
185
mainwindow.ui
185
mainwindow.ui
@ -7,9 +7,21 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>626</height>
|
<height>598</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
@ -51,7 +63,7 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QSpinBox" name="spinBox">
|
<widget class="QSpinBox" name="pathNumber">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@ -60,6 +72,12 @@
|
|||||||
<height>27</height>
|
<height>27</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLineEdit" name="titleEdit">
|
<widget class="QLineEdit" name="titleEdit">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@ -280,10 +298,145 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame_2">
|
<widget class="QFrame" name="stepInformationFrame">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QWidget" name="steptitleFrame" native="true">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>781</width>
|
||||||
|
<height>45</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="stepNumber">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="stepTitle"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="addStep">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="data.qrc">
|
||||||
|
<normaloff>:/data/images/data/images/add.png</normaloff>:/data/images/data/images/add.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="stepCoordinatesFrame" native="true">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>60</y>
|
||||||
|
<width>781</width>
|
||||||
|
<height>63</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="latFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="latLbl">
|
||||||
|
<property name="text">
|
||||||
|
<string>Latitude</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="LatitudeSpin">
|
||||||
|
<property name="decimals">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>90.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="longFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="longLbl">
|
||||||
|
<property name="text">
|
||||||
|
<string>Longitude</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="longitudeSpin">
|
||||||
|
<property name="decimals">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-180.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>180.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="responseFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="responseLbl">
|
||||||
|
<property name="text">
|
||||||
|
<string>Response</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="responseSpin"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPlainTextEdit" name="dialogEdit">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>130</y>
|
||||||
|
<width>761</width>
|
||||||
|
<height>81</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -325,7 +478,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="actionNewFile"/>
|
<addaction name="actionNewFile"/>
|
||||||
<addaction name="actionNew"/>
|
<addaction name="actionopenFile"/>
|
||||||
<addaction name="actionSaveFile"/>
|
<addaction name="actionSaveFile"/>
|
||||||
<addaction name="actionSaveAsFile"/>
|
<addaction name="actionSaveAsFile"/>
|
||||||
<addaction name="actionPrintFile"/>
|
<addaction name="actionPrintFile"/>
|
||||||
@ -367,7 +520,7 @@
|
|||||||
<normaloff>:/data/images/data/images/new.png</normaloff>:/data/images/data/images/new.png</iconset>
|
<normaloff>:/data/images/data/images/new.png</normaloff>:/data/images/data/images/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>NewFile</string>
|
<string>New File</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -379,7 +532,7 @@
|
|||||||
<normaloff>:/data/images/data/images/save_as.png</normaloff>:/data/images/data/images/save_as.png</iconset>
|
<normaloff>:/data/images/data/images/save_as.png</normaloff>:/data/images/data/images/save_as.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>SaveFile</string>
|
<string>Save</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -391,7 +544,7 @@
|
|||||||
<normaloff>:/data/images/data/images/save.png</normaloff>:/data/images/data/images/save.png</iconset>
|
<normaloff>:/data/images/data/images/save.png</normaloff>:/data/images/data/images/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>SaveAsFile</string>
|
<string>Save as</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -403,7 +556,7 @@
|
|||||||
<normaloff>:/data/images/data/images/print.png</normaloff>:/data/images/data/images/print.png</iconset>
|
<normaloff>:/data/images/data/images/print.png</normaloff>:/data/images/data/images/print.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>PrintFile</string>
|
<string>Print</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -415,7 +568,7 @@
|
|||||||
<normaloff>:/data/images/data/images/copy.png</normaloff>:/data/images/data/images/copy.png</iconset>
|
<normaloff>:/data/images/data/images/copy.png</normaloff>:/data/images/data/images/copy.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditCopy</string>
|
<string>Copy</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -427,7 +580,7 @@
|
|||||||
<normaloff>:/data/images/data/images/paste.png</normaloff>:/data/images/data/images/paste.png</iconset>
|
<normaloff>:/data/images/data/images/paste.png</normaloff>:/data/images/data/images/paste.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditPaste</string>
|
<string>Paste</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -439,7 +592,7 @@
|
|||||||
<normaloff>:/data/images/data/images/cut.png</normaloff>:/data/images/data/images/cut.png</iconset>
|
<normaloff>:/data/images/data/images/cut.png</normaloff>:/data/images/data/images/cut.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditCut</string>
|
<string>Cut</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -451,7 +604,7 @@
|
|||||||
<normaloff>:/data/images/data/images/edit_undo.png</normaloff>:/data/images/data/images/edit_undo.png</iconset>
|
<normaloff>:/data/images/data/images/edit_undo.png</normaloff>:/data/images/data/images/edit_undo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditUndo</string>
|
<string>Undo</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
@ -463,19 +616,19 @@
|
|||||||
<normaloff>:/data/images/data/images/edit_redo.png</normaloff>:/data/images/data/images/edit_redo.png</iconset>
|
<normaloff>:/data/images/data/images/edit_redo.png</normaloff>:/data/images/data/images/edit_redo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditRedo</string>
|
<string>Redo</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionNew">
|
<action name="actionopenFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/new.png</normaloff>:/data/images/data/images/new.png</iconset>
|
<normaloff>:/data/images/data/images/open.png</normaloff>:/data/images/data/images/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>New</string>
|
<string>Open file</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
|
|||||||
@ -15,6 +15,7 @@ SOURCES += \
|
|||||||
path.cpp \
|
path.cpp \
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
Undo.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
step.h \
|
step.h \
|
||||||
path.h \
|
path.h \
|
||||||
|
|||||||
12
step.cpp
12
step.cpp
@ -34,6 +34,16 @@ Step::Step() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QList<QString> Step::getPersonnage() const
|
||||||
|
{
|
||||||
|
return personnage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QString> Step::getTexte() const
|
||||||
|
{
|
||||||
|
return texte;
|
||||||
|
}
|
||||||
|
|
||||||
Step::Step( QJsonObject &in)
|
Step::Step( QJsonObject &in)
|
||||||
{
|
{
|
||||||
title = in["title"].toString();
|
title = in["title"].toString();
|
||||||
@ -41,7 +51,7 @@ Step::Step( QJsonObject &in)
|
|||||||
QString gps = in["GPS"].toString();
|
QString gps = in["GPS"].toString();
|
||||||
QStringList parts = gps.split(" ", Qt::SkipEmptyParts);
|
QStringList parts = gps.split(" ", Qt::SkipEmptyParts);
|
||||||
|
|
||||||
QChar latDir = parts[0][0]; // c'est le premier QChar du QString t'as capté
|
QChar latDir = parts[0][0];
|
||||||
int latDeg = parts[1].toInt();
|
int latDeg = parts[1].toInt();
|
||||||
float latMin = parts[2].toFloat();
|
float latMin = parts[2].toFloat();
|
||||||
setLatitude(latDeg, latMin, latDir);
|
setLatitude(latDeg, latMin, latDir);
|
||||||
|
|||||||
4
step.h
4
step.h
@ -26,9 +26,9 @@ public:
|
|||||||
float getLatitude() const;
|
float getLatitude() const;
|
||||||
float getLongitude() const;
|
float getLongitude() const;
|
||||||
int getResponse() const;
|
int getResponse() const;
|
||||||
QList<QString> getListeDialogue();
|
|
||||||
QList<QString> getListePersonnage();
|
|
||||||
QString toGPSFormat();
|
QString toGPSFormat();
|
||||||
|
QList<QString> getPersonnage() const;
|
||||||
|
QList<QString> getTexte() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STEP_H
|
#endif // STEP_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user