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);
|
||||
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){
|
||||
|
||||
@@ -42,7 +42,6 @@ public slots:
|
||||
void deaSlot();
|
||||
void shellSlot();
|
||||
|
||||
void stopClicked();
|
||||
};
|
||||
|
||||
#endif // TRAINING_H
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -22,6 +22,7 @@ private:
|
||||
Ui::WindowsSettings *ui;
|
||||
string currentDateTime();
|
||||
DataBase *db;
|
||||
int rennId;
|
||||
public slots:
|
||||
void SaveDauerSlot();
|
||||
void AbbrechenSlot();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_18" stretch="0,2,1">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="1,1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="1,1,0">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_13">
|
||||
<property name="title">
|
||||
@@ -53,6 +53,18 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user