added first part of hiding live ranking
This commit is contained in:
@@ -28,9 +28,16 @@ using std::vector;
|
||||
WindowRace::WindowRace(DataBase * db, QWidget * parent)
|
||||
: QMainWindow(parent), ui(new Ui::WindowRace) {
|
||||
ui->setupUi(this);
|
||||
|
||||
this->ui->pBNextRace->setEnabled(false);
|
||||
this->finished = false;
|
||||
|
||||
// should be read from db
|
||||
this->enableLiveRanking = false;
|
||||
if (!this->enableLiveRanking) {
|
||||
this->ui->groupBox_15->hide();
|
||||
}
|
||||
|
||||
this->wRennlisteSeted = false;
|
||||
|
||||
this->db = db;
|
||||
@@ -177,7 +184,10 @@ WindowRace::WindowRace(DataBase * db, QWidget * parent)
|
||||
tableRaces = db->getData(statement, 4);
|
||||
this->ui->lRound->setText("1/" + QString::number(tableRaces.size()));
|
||||
// QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(close()));
|
||||
this->prepareLiveRanking();
|
||||
|
||||
if (this->enableLiveRanking) {
|
||||
this->prepareLiveRanking();
|
||||
}
|
||||
}
|
||||
|
||||
void WindowRace::prepareLiveRanking() {
|
||||
@@ -613,7 +623,9 @@ void WindowRace::shellSlot(int time, int sector) {
|
||||
ui->lWShellTime->scrollToBottom();
|
||||
ui->lWShellTime->horizontalHeader()->setSectionResizeMode(
|
||||
QHeaderView::Stretch);
|
||||
this->updateLiveRanking();
|
||||
if (this->enableLiveRanking) {
|
||||
this->updateLiveRanking();
|
||||
}
|
||||
}
|
||||
void WindowRace::deaSlot(int time, int sector) {
|
||||
if (started && !paused && !this->finished) {
|
||||
@@ -727,7 +739,9 @@ void WindowRace::deaSlot(int time, int sector) {
|
||||
ui->lWDeaTime->scrollToBottom();
|
||||
ui->lWDeaTime->horizontalHeader()->setSectionResizeMode(
|
||||
QHeaderView::Stretch);
|
||||
this->updateLiveRanking();
|
||||
if (this->enableLiveRanking) {
|
||||
this->updateLiveRanking();
|
||||
}
|
||||
}
|
||||
|
||||
long WindowRace::getMinimum(std::vector<long> a) {
|
||||
|
||||
@@ -49,6 +49,9 @@ class WindowRace : public QMainWindow {
|
||||
QString getNameDriver(QString driverId);
|
||||
QStringListModel modelRanking;
|
||||
|
||||
// need database implementation
|
||||
bool enableLiveRanking;
|
||||
|
||||
QStringList QSLRanking;
|
||||
// QStandardItemModel modelRanking;
|
||||
bool started;
|
||||
|
||||
Reference in New Issue
Block a user