diff --git a/training.cpp b/training.cpp
index 7911629..59a0447 100644
--- a/training.cpp
+++ b/training.cpp
@@ -38,7 +38,6 @@ Training::Training(QWidget *parent, DataBase *db) :
QShortcut *shortcut = new QShortcut(QKeySequence("Ctrl+Q"), this);
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(close()));
-
}
void Training::prepareNextRace(){
this->firstTimeShell = true;
@@ -58,13 +57,6 @@ void Training::prepareNextRace(){
this->started = false;
}
-void Training::stopClicked(){
- cout << "Shortcut" << endl;
-}
-
-
-
-
void Training::shellSlot(){
if(started && !paused && !this->finished){
if(firstTimeShell){
diff --git a/training.h b/training.h
index 950d81c..2b77fd2 100644
--- a/training.h
+++ b/training.h
@@ -42,7 +42,6 @@ public slots:
void deaSlot();
void shellSlot();
- void stopClicked();
};
#endif // TRAINING_H
diff --git a/windowssettings.cpp b/windowssettings.cpp
index 61214ad..e540d04 100644
--- a/windowssettings.cpp
+++ b/windowssettings.cpp
@@ -57,6 +57,10 @@ WindowsSettings::WindowsSettings(DataBase *db, QWidget *parent) :
res = db->getData(statement, 2);
this->ui->leRenndauer->setText(res[0][0]);
this->ui->lEMinRundenzeit->setText(res[0][1]);
+ statement = "SELECT id, minimumroundtime FROM rennen order by id DESC limit 1";
+ res = this->db->getData(statement, 2);
+ this->rennId = res[0][0].toInt();
+ this->ui->lEMinRundenzeitAktRennen->setText(res[0][1]);
}
void WindowsSettings::AbbrechenSlot(){
@@ -64,7 +68,11 @@ void WindowsSettings::AbbrechenSlot(){
delete this;
}
void WindowsSettings::SaveDauerSlot(){
- string statement = "update renndauer set dauer="+this->ui->leRenndauer->text().toStdString()+", mindestrundendauer="+this->ui->lEMinRundenzeit->text().toStdString()+" where id like 1";
+ string statement = "update renndauer set dauer="+this->ui->leRenndauer->text().toStdString()+
+ ", mindestrundendauer="+this->ui->lEMinRundenzeit->text().toStdString()+" where id like 1";
+ this->db->setData(statement);
+ statement = "update rennen set minimumroundtime="+this->ui->lEMinRundenzeitAktRennen->text().toStdString()+
+ " where id like "+QString::number(this->rennId).toStdString();
this->db->setData(statement);
}
void WindowsSettings::SaveDauerAndExitSlot(){
diff --git a/windowssettings.h b/windowssettings.h
index 2c19efa..123ebe2 100644
--- a/windowssettings.h
+++ b/windowssettings.h
@@ -22,6 +22,7 @@ private:
Ui::WindowsSettings *ui;
string currentDateTime();
DataBase *db;
+ int rennId;
public slots:
void SaveDauerSlot();
void AbbrechenSlot();
diff --git a/windowssettings.ui b/windowssettings.ui
index 392b07c..f66b035 100644
--- a/windowssettings.ui
+++ b/windowssettings.ui
@@ -28,7 +28,7 @@
-
-
-
+
-
@@ -53,6 +53,18 @@
+ -
+
+
+ Mindestrundenzeit aktuelles Rennen
+
+
+
-
+
+
+
+
+
-