Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
better popup
Browse files Browse the repository at this point in the history
  • Loading branch information
thjazi39 committed May 11, 2020
1 parent c143faf commit 5e1cc9f
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 20 deletions.
21 changes: 21 additions & 0 deletions res/html/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<h3>Contexte</h3>
<p>Ce projet à été réalisé dans le cadre de notre 3<sup>eme</sup> année
d'informatique à <a href="https://www.univ-smb.fr"> l'université Savoie Mont-blanc</a>.</p>
<h4>Contacts :</h4>
<ul>
<li>Thomas Ballasi :
<a href="mailto:[email protected]">[email protected]</a>
</li>
<li>Dorian Burgun :
<a href="mailto:[email protected]">[email protected]</a>
</li>
<li>Tristan Delapierre :
<a href="mailto:[email protected]">[email protected]</a>
</li>
<li>Tiemen Duvillard :
<a href="mailto:[email protected]">[email protected]</a>
</li>
<li>Faisal Salhi :
<a href="mailto:[email protected]">[email protected]</a>
</li>
</ul>
4 changes: 4 additions & 0 deletions res/html/doc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h3>Aging's documentation :</h3>
<p> Documentation génerée par DOxygen :
<a href='http://93.7.113.241/aging/index.html'>http://93.7.113.241/aging/index.html</a></p>

52 changes: 52 additions & 0 deletions res/html/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<h3>Help</h3>
<p>Ce programme permet de calculer les évolutions du jeu de la vie selon 2 algorithmes.</p>


<table>
<caption style="text-align: center; "><b>Aging's Shortcut :</b></caption>
<tr>
<td>Play/pause </td><td> -> </td><td> Key_Space </td>
</tr>
<tr>
<td>Onestep </td><td> -> </td><td> Key_P </td>
</tr>
<tr>
<td>Increase speed </td><td> -> </td><td> CTRL + Key_Plus </td>
</tr>
<tr>
<td>Decrease speed </td><td> -> </td><td> CTRL + Key_Minus </td>
</tr>
<tr>
<td>Fit patern </td><td> -> </td><td> Key_F </td>
</tr>
<tr>
<td>Zoom in </td><td> -> </td><td> Key_Plus </td>
</tr>
<tr>
<td>Zoom out </td><td> -> </td><td> Key_Minus </td>
</tr>
<tr>
<td>New file </td><td> -> </td><td> CTRL + Key_N </td>
</tr>
<tr>
<td>Open file </td><td> -> </td><td> CTRL + Key_O </td>
</tr>
<tr>
<td>Save file </td><td> -> </td><td> CTRL + Key_S </td>
</tr>
<tr>
<td>Quit </td><td> -> </td><td> CTRL + Key_Q </td>
</tr>
<tr>
<td>Move up </td><td> -> </td><td> Key_Up or Key_Z </td>
</tr>
<tr>
<td>Move down </td><td> -> </td><td> Key_Down or Key_S </td>
</tr>
<tr>
<td>Move left </td><td> -> </td><td> Key_Left or Key_Q </td>
</tr>
<tr>
<td>Move right </td><td> -> </td><td> Key_Right or Key_D </td>
</tr>
</table>
6 changes: 6 additions & 0 deletions res/html/licence.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h3>GNU GENERAL PUBLIC LICENSE</h3>

<p>Version 3, 29 June 2007 Copyright (C) 2007
Free Software Foundation, Inc. <a href="http://fsf.org/">http://fsf.org/</a></p>
<p>Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
20 changes: 20 additions & 0 deletions shortcut.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Aging's Shortcut :
Play/pause -> Key_Space
OneStep -> Key_P
increase_speed -> CTRL + Key_Plus
decrease_speed -> CTRL + Key_Minus
fit_patern -> Key_F
zoom_In -> Key_Plus
zoom_Out -> Key_Minus
new_file -> CTRL + Key_N
open_file -> CTRL + Key_O
save_file -> CTRL + Key_S
act_quit -> CTRL + Key_Q
move_up -> Key_Z
move_up -> Key_Up
move_down -> Key_S
move_down -> Key_Down
move_left -> Key_Q
move_left -> Key_Left
move_right -> Key_D
move_right -> Key_Right
50 changes: 30 additions & 20 deletions src/ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <ui/MainWindow.h>
#include <logic/NaiveUniverse/NaiveUniverse.h>

#include <QFile>
#include <QTextStream>
#include <QButtonGroup>
#include <QColorDialog>
#include <QFileDialog>
Expand Down Expand Up @@ -495,43 +497,51 @@ void MainWindow::action_darkTheme() {
}

void MainWindow::action_help() {
QFile file("../res/html/help.html");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { return; }
QString text;
QTextStream in(&file);
while (!in.atEnd()) { text += in.readLine(); }
QMessageBox msgBox;
msgBox.setWindowTitle("Help");
std::string s;
s += "Ce programme permet de calculer l'evolution d'une grille ";
s += "du jeu de la vie selon 2 algorithmes.";
msgBox.setText(s.c_str());
msgBox.setTextFormat(Qt::RichText);
msgBox.setText(text);
msgBox.exec();
}
void MainWindow::action_documentation() {
QFile file("../res/html/doc.html");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { return; }
QString text;
QTextStream in(&file);
while (!in.atEnd()) { text += in.readLine(); }
QMessageBox msgBox;
msgBox.setWindowTitle("Documentation");
std::string s;
s += "Aging's documentation : ";
s += "http://93.7.113.241/aging/index.html";
msgBox.setText(s.c_str());
msgBox.setTextFormat(Qt::RichText);
msgBox.setText(text);
msgBox.exec();
}
void MainWindow::action_licence() {
QFile file("../res/html/licence.html");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { return; }
QString text;
QTextStream in(&file);
while (!in.atEnd()) { text += in.readLine(); }
QMessageBox msgBox;
msgBox.setWindowTitle("Licence");
// msgBox.setTextFormat(Qt::TextFormat::AlignHCenter);
std::string s;
s += "GNU GENERAL PUBLIC LICENSE\n";
s += "Version 3, 29 June 2007 ";
s += "Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n";
s += "Everyone is permitted to copy and distribute verbatim copies ";
s += "of this license document, but changing it is not allowed.";
msgBox.setText(s.c_str());
msgBox.setTextFormat(Qt::RichText);
msgBox.setText(text);
msgBox.exec();
}
void MainWindow::action_about() {
QFile file("../res/html/about.html");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { return; }
QString text;
QTextStream in(&file);
while (!in.atEnd()) { text += in.readLine(); }
QMessageBox msgBox;
msgBox.setWindowTitle("About");
std::string s;
s += "Ce projet à été réalisé dans le cadre de notre 3eme année ";
s += "d'informatique à l'université Savoie Mont-blanc.";
msgBox.setText(s.c_str());
msgBox.setTextFormat(Qt::RichText);
msgBox.setText(text);
msgBox.exec();
}

Expand Down

0 comments on commit 5e1cc9f

Please sign in to comment.