added possiblity to change minimumtime from undriven races
This commit is contained in:
@@ -38,7 +38,6 @@ Training::Training(QWidget *parent, DataBase *db) :
|
|||||||
|
|
||||||
QShortcut *shortcut = new QShortcut(QKeySequence("Ctrl+Q"), this);
|
QShortcut *shortcut = new QShortcut(QKeySequence("Ctrl+Q"), this);
|
||||||
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(close()));
|
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(close()));
|
||||||
|
|
||||||
}
|
}
|
||||||
void Training::prepareNextRace(){
|
void Training::prepareNextRace(){
|
||||||
this->firstTimeShell = true;
|
this->firstTimeShell = true;
|
||||||
@@ -58,13 +57,6 @@ void Training::prepareNextRace(){
|
|||||||
this->started = false;
|
this->started = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Training::stopClicked(){
|
|
||||||
cout << "Shortcut" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Training::shellSlot(){
|
void Training::shellSlot(){
|
||||||
if(started && !paused && !this->finished){
|
if(started && !paused && !this->finished){
|
||||||
if(firstTimeShell){
|
if(firstTimeShell){
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ public slots:
|
|||||||
void deaSlot();
|
void deaSlot();
|
||||||
void shellSlot();
|
void shellSlot();
|
||||||
|
|
||||||
void stopClicked();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TRAINING_H
|
#endif // TRAINING_H
|
||||||
|
|||||||
+9
-1
@@ -57,6 +57,10 @@ WindowsSettings::WindowsSettings(DataBase *db, QWidget *parent) :
|
|||||||
res = db->getData(statement, 2);
|
res = db->getData(statement, 2);
|
||||||
this->ui->leRenndauer->setText(res[0][0]);
|
this->ui->leRenndauer->setText(res[0][0]);
|
||||||
this->ui->lEMinRundenzeit->setText(res[0][1]);
|
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(){
|
void WindowsSettings::AbbrechenSlot(){
|
||||||
@@ -64,7 +68,11 @@ void WindowsSettings::AbbrechenSlot(){
|
|||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
void WindowsSettings::SaveDauerSlot(){
|
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);
|
this->db->setData(statement);
|
||||||
}
|
}
|
||||||
void WindowsSettings::SaveDauerAndExitSlot(){
|
void WindowsSettings::SaveDauerAndExitSlot(){
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ private:
|
|||||||
Ui::WindowsSettings *ui;
|
Ui::WindowsSettings *ui;
|
||||||
string currentDateTime();
|
string currentDateTime();
|
||||||
DataBase *db;
|
DataBase *db;
|
||||||
|
int rennId;
|
||||||
public slots:
|
public slots:
|
||||||
void SaveDauerSlot();
|
void SaveDauerSlot();
|
||||||
void AbbrechenSlot();
|
void AbbrechenSlot();
|
||||||
|
|||||||
+13
-1
@@ -28,7 +28,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_18" stretch="0,2,1">
|
<layout class="QVBoxLayout" name="verticalLayout_18" stretch="0,2,1">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="1,1">
|
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="1,1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_13">
|
<widget class="QGroupBox" name="groupBox_13">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -53,6 +53,18 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_15">
|
||||||
|
<property name="title">
|
||||||
|
<string>Mindestrundenzeit aktuelles Rennen</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_21">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lEMinRundenzeitAktRennen"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
Reference in New Issue
Block a user