Compare commits
13 Commits
f15583020d
...
665d789244
| Author | SHA1 | Date | |
|---|---|---|---|
| 665d789244 | |||
| 9a12e8e877 | |||
|
|
37276b5d90 | ||
|
|
2018375062 | ||
|
|
3df41e38e7 | ||
|
|
d69d10605e | ||
|
|
cf486f6e68 | ||
| 10695d0190 | |||
| 6d857c5cd5 | |||
|
|
2bf6a9397e | ||
|
|
c8e264fe18 | ||
|
|
6b24485cf0 | ||
| 4aebed6913 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,6 @@
|
||||
*.json
|
||||
*.html
|
||||
|
||||
data/HTML-exports
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
## and Ignore Qt objects and libs.
|
||||
|
||||
@ -18,6 +18,10 @@
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include "web.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
|
||||
int MainWindow::indexPath = 0;
|
||||
|
||||
@ -164,7 +168,7 @@ void MainWindow::loadStep(Step s) {
|
||||
ui->responseSpin->setValue(s.getResponse());
|
||||
|
||||
for(int i = 0; i < s.getTexte().length(); i++) {
|
||||
QString q = s.getPersonnage().at(i) + ": " + s.getTexte().at(i);
|
||||
QString q = "[" + s.getPersonnage().at(i) + "] : " + s.getTexte().at(i);
|
||||
ui->dialogEdit->appendPlainText(q);
|
||||
}
|
||||
}
|
||||
@ -195,10 +199,12 @@ void MainWindow::exportHTMLMap(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QDir dir;
|
||||
dir.mkdir("./data/HTML-exports");
|
||||
dir.mkdir("./data/HTML-exports/pages");
|
||||
|
||||
QString safeName = p->getName().simplified().replace(" ", "_");
|
||||
std::string fileName = "./pages/parcours_" + safeName.toStdString() + ".html";
|
||||
std::string fileName = "./data/HTML-exports/pages/parcours_" + safeName.toStdString() + ".html";
|
||||
std::ofstream file(fileName);
|
||||
|
||||
if (!file.is_open()) {
|
||||
@ -328,10 +334,10 @@ margin-bottom:20px;
|
||||
QString imagePath = p->getImage();
|
||||
QFileInfo fileInfo(imagePath);
|
||||
QString imageName = fileInfo.fileName();
|
||||
QString destPath = "./pages/images/" + imageName;
|
||||
QString destPath = "../data/HTML-exports/pages/images/" + imageName;
|
||||
|
||||
// Crée le dossier images s’il n’existe pas
|
||||
QDir().mkpath("./pages/images");
|
||||
QDir().mkpath("./data/HTML-exports/pages/images");
|
||||
|
||||
// Copie l’image dans le dossier pages/images
|
||||
QFile::copy(imagePath, destPath);
|
||||
@ -660,14 +666,13 @@ void MainWindow::on_pathNumber_valueChanged(int arg1)
|
||||
|
||||
void MainWindow::on_stepNumber_valueChanged(int arg1)
|
||||
{
|
||||
on_validateBtn_clicked();
|
||||
ui->dialogEdit->clear();
|
||||
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());
|
||||
@ -676,6 +681,8 @@ void MainWindow::on_validateBtn_clicked()
|
||||
this->currentPath->setDuration(ui->durationSpin->value());
|
||||
this->currentPath->getStep()[ui->stepNumber->value()-1].setTitle(ui->stepTitle->text());
|
||||
this->currentPath->getStep()[ui->stepNumber->value()-1].setResponse(ui->responseSpin->value());
|
||||
this->currentPath->getStep()[ui->stepNumber->value()-1].setLongitude(ui->longitudeSpin->value());
|
||||
this->currentPath->getStep()[ui->stepNumber->value()-1].setLatitude(ui->LatitudeSpin->value());
|
||||
this->currentPath->getStep()[ui->stepNumber->value()-1].clearPersonnages();
|
||||
this->currentPath->getStep()[ui->stepNumber->value()-1].clearTextes();
|
||||
extractDialogue();
|
||||
@ -1046,3 +1053,25 @@ void MainWindow::on_addStep_clicked()
|
||||
{
|
||||
this->addNewStep();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExit_triggered() { QApplication::quit(); }
|
||||
|
||||
|
||||
|
||||
void MainWindow::openIndexSite() {
|
||||
QString filePath = "./data/HTML-exports/index.html";
|
||||
QFileInfo fileInfo(filePath);
|
||||
|
||||
if (fileInfo.exists() && fileInfo.isFile()) {
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(fileInfo.absoluteFilePath()));
|
||||
} else {
|
||||
QMessageBox::warning(this, "Erreur", "Le fichier index.html n'existe pas.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionWeb_triggered()
|
||||
{
|
||||
this->openIndexSite();
|
||||
}
|
||||
|
||||
|
||||
@ -53,6 +53,7 @@ public:
|
||||
void newPath();
|
||||
void extractDialogue();
|
||||
bool m_handlingUndoRedo = false;
|
||||
void openIndexSite();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
@ -125,6 +126,10 @@ private slots:
|
||||
|
||||
void on_addStep_clicked();
|
||||
|
||||
void on_actionExit_triggered();
|
||||
|
||||
void on_actionWeb_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QString currentFile;
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
@ -262,7 +262,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/add.png</normaloff>:/data/images/data/images/add.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -333,7 +333,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
@ -361,7 +361,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/add.png</normaloff>:/data/images/data/images/add.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -484,7 +484,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
@ -495,6 +495,8 @@
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="actionSave_as"/>
|
||||
<addaction name="actionWeb"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuEdit">
|
||||
<property name="title">
|
||||
@ -578,110 +580,110 @@
|
||||
</action>
|
||||
<action name="actionNewFile">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/new.png</normaloff>:/data/images/data/images/new.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New File</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSaveFile">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/save_as.png</normaloff>:/data/images/data/images/save_as.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSaveAsFile">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/save.png</normaloff>:/data/images/data/images/save.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save as</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditCopy">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/copy.png</normaloff>:/data/images/data/images/copy.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditPaste">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/paste.png</normaloff>:/data/images/data/images/paste.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Paste</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditCut">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/cut.png</normaloff>:/data/images/data/images/cut.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cut</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditUndo">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/edit_undo.png</normaloff>:/data/images/data/images/edit_undo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Undo</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditRedo">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/edit_redo.png</normaloff>:/data/images/data/images/edit_redo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Redo</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionopenFile">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/open.png</normaloff>:/data/images/data/images/open.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open file</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew">
|
||||
@ -734,7 +736,7 @@
|
||||
</action>
|
||||
<action name="actionColor">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/font-color.png</normaloff>:/data/images/data/images/font-color.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -743,7 +745,7 @@
|
||||
</action>
|
||||
<action name="actionBold">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/bold.png</normaloff>:/data/images/data/images/bold.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -752,7 +754,7 @@
|
||||
</action>
|
||||
<action name="actionItalic">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/italic.png</normaloff>:/data/images/data/images/italic.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -761,7 +763,7 @@
|
||||
</action>
|
||||
<action name="actionUnderline">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/underline.png</normaloff>:/data/images/data/images/underline.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -770,7 +772,7 @@
|
||||
</action>
|
||||
<action name="actionOverline">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/overline.png</normaloff>:/data/images/data/images/overline.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -779,7 +781,7 @@
|
||||
</action>
|
||||
<action name="actionSize">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/font-size.png</normaloff>:/data/images/data/images/font-size.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -788,7 +790,7 @@
|
||||
</action>
|
||||
<action name="actionFont">
|
||||
<property name="icon">
|
||||
<iconset resource="data.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/data/images/data/images/font.png</normaloff>:/data/images/data/images/font.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -839,9 +841,20 @@
|
||||
<string>Overline</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExit">
|
||||
<property name="text">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWeb">
|
||||
<property name="text">
|
||||
<string>Web</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="data.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
BIN
pages/images/logo.png
Normal file
BIN
pages/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
8
step.cpp
8
step.cpp
@ -106,11 +106,15 @@ Step::Step( QJsonObject &in)
|
||||
texte.append(textes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Step::setLatitude(float lat) {
|
||||
latitude = lat;
|
||||
}
|
||||
|
||||
void Step::setLongitude(float lon) {
|
||||
longitude = lon;
|
||||
}
|
||||
|
||||
|
||||
void Step::setLatitude(int degree, float minute, QChar NS)
|
||||
|
||||
2
step.h
2
step.h
@ -22,6 +22,8 @@ public:
|
||||
Step(QJsonObject &in);
|
||||
void setLatitude(int degree,float minute,QChar NS);
|
||||
void setLongitude(int degree,float minute,QChar EW);
|
||||
void setLatitude(float lat);
|
||||
void setLongitude(float lon);
|
||||
QString getTitle() const;
|
||||
float getLatitude() const;
|
||||
float getLongitude() const;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user