Show information dialog about outdated database file

This commit is contained in:
Martin Brodbeck 2019-10-04 15:50:13 +02:00
parent a33b9896b3
commit 57bfe3af62
5 changed files with 19 additions and 4 deletions

View file

@ -35,7 +35,13 @@ MainWindow::MainWindow()
ui_.setupUi(this);
marketplace_ = std::make_unique<Marketplace>();
marketplace_->loadFromDb();
Database::InitResult res = marketplace_->loadFromDb();
if (res == Database::InitResult::OUTDATED_REPLACED) {
QMessageBox(QMessageBox::Icon::Information, "Datenbankinformation",
"Es wurde eine <b>veraltete</b> Datenbankdatei erkannt.<br />Diese wurde "
"umbenannt und eine <b>neue</b> Datei wurde erstellt.")
.exec();
}
statusBar()->showMessage("Gespeicherte Daten wurden geladen.", STATUSBAR_TIMEOUT);
BasketModel* model = new BasketModel(getMarketplace(), ui_.basketView);