Unverified Commit 9de7e6dd authored by Merwane Bouri's avatar Merwane Bouri
Browse files

Correction Bouton Play/Pause

parent d4e87f28
Pipeline #79526 passed with stages
in 16 seconds
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<item> <item>
<widget class="QPushButton" name="playPauseButton"> <widget class="QPushButton" name="playPauseButton">
<property name="text"> <property name="text">
<string>Pause</string> <string>Play</string>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -794,11 +794,11 @@ void MainWindow::on_playPauseButton_clicked() ...@@ -794,11 +794,11 @@ void MainWindow::on_playPauseButton_clicked()
{ {
if(timer->isActive()) { if(timer->isActive()) {
//Pause //Pause
ui->playPauseButton->setText("Pause"); ui->playPauseButton->setText("Play");
timer->stop(); timer->stop();
} else { } else {
//Play //Play
ui->playPauseButton->setText("play"); ui->playPauseButton->setText("Pause");
int frequence = ui->simSpeedSpinbox->value(); int frequence = ui->simSpeedSpinbox->value();
if(frequence == 0) { if(frequence == 0) {
QMessageBox::critical(this, "Impossible de démarrer", "Impossible de lancer la simulation à une vitesse nulle."); QMessageBox::critical(this, "Impossible de démarrer", "Impossible de lancer la simulation à une vitesse nulle.");
...@@ -815,6 +815,7 @@ void MainWindow::on_resetButton_clicked() { ...@@ -815,6 +815,7 @@ void MainWindow::on_resetButton_clicked() {
if(timer->isActive()) { if(timer->isActive()) {
timer->stop(); timer->stop();
} }
ui->playPauseButton->setText("Play");
simulation.reset(); simulation.reset();
ui->grid_view->copy_grid(simulation.getGrid()); ui->grid_view->copy_grid(simulation.getGrid());
ui->stepsPeriodLabel->setText(QString::number(simulation.getPeriod())+" steps"); ui->stepsPeriodLabel->setText(QString::number(simulation.getPeriod())+" steps");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment