diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 1cf383c..e3c6683 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -40,7 +40,7 @@ MainWindow::MainWindow() QMessageBox(QMessageBox::Icon::Information, "Datenbankinformation", "Es wurde eine veraltete Datenbankdatei erkannt.
Diese wurde " "umbenannt und eine neue Datei wurde erstellt.") - .exec(); + .exec(); } statusBar()->showMessage("Gespeicherte Daten wurden geladen.", STATUSBAR_TIMEOUT); @@ -63,7 +63,7 @@ MainWindow::MainWindow() QMessageBox(QMessageBox::Icon::Warning, "Sind Sie sicher?", "Möchten Sie wirklich alle gespeicherten Daten verwerfen?", QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, this) - .exec(); + .exec(); if (dlgResult == QMessageBox::No) return; @@ -126,9 +126,7 @@ MainWindow::MainWindow() "SOFTWARE ODER SONSTIGER VERWENDUNG DER SOFTWARE ENTSTANDEN."); QMessageBox::information(this, "Lizenzinformation", licenseText); }); - connect(ui_.reportAction, &QAction::triggered, this, [=]() { - ReportDialog(this).exec(); - }); + connect(ui_.reportAction, &QAction::triggered, this, [=]() { ReportDialog(this).exec(); }); connect(ui_.configAction, &QAction::triggered, this, [=]() { int result = SettingsDialog(this).exec(); if (result == QDialog::Accepted) { @@ -300,7 +298,7 @@ void MainWindow::onGivenSpinBoxValueChanged(double value) } void MainWindow::onBasketViewSelectionChanged(const QItemSelection& selected, - [[maybe_unused]] const QItemSelection& deselected) + [[maybe_unused]] const QItemSelection& deselected) { if (selected.size() > 0) { ui_.cancelArticleButton->setEnabled(true); @@ -310,7 +308,7 @@ void MainWindow::onBasketViewSelectionChanged(const QItemSelection& selected, } void MainWindow::onSalesViewSelectionChanged(const QItemSelection& selected, - [[maybe_unused]] const QItemSelection& deselected) + [[maybe_unused]] const QItemSelection& deselected) { if (selected.size() > 0) { ui_.cancelSaleButton->setEnabled(true); @@ -335,7 +333,7 @@ void MainWindow::onCancelArticleButtonClicked([[maybe_unused]] bool checked) QMessageBox(QMessageBox::Icon::Warning, "Sind Sie sicher?", "Möchten Sie wirklich den Artikel stornieren?", QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, this) - .exec(); + .exec(); if (dlgResult == QMessageBox::No) return; @@ -361,7 +359,7 @@ void MainWindow::onCancelSaleButtonClicked([[maybe_unused]] bool checked) QMessageBox(QMessageBox::Icon::Warning, "Sind Sie sicher?", "Möchten Sie wirklich aus abgeschlossenen Verkäufen stornieren?", QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, this) - .exec(); + .exec(); if (dlgResult == QMessageBox::No) return; @@ -424,7 +422,7 @@ void MainWindow::onCancelAllArticlesButtonClicked([[maybe_unused]] bool checked) QMessageBox(QMessageBox::Icon::Warning, "Sind Sie sicher?", "Möchten Sie wirklich *alle* Artikel des aktuellen Einkaufs stornieren?", QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, this) - .exec(); + .exec(); if (dlgResult == QMessageBox::No) return; @@ -434,19 +432,17 @@ void MainWindow::onCancelAllArticlesButtonClicked([[maybe_unused]] bool checked) ui_.sellerNoEdit->setFocus(); } -void MainWindow::onAboutQt() { - QMessageBox::aboutQt(this); -} +void MainWindow::onAboutQt() { QMessageBox::aboutQt(this); } void MainWindow::onAbout() { QMessageBox::about( this, "Über", QString("

KIMA2 - Version ") + PROJECT_VERSION + - "

" - "

KIMA2 ist ein kleines Kassenprogramm für Kindersachenmärkte.

" - "

Copyright © Martin Brodbeck <info@rustysoft.de>

"); + "

" + "

KIMA2 ist ein kleines Kassenprogramm für Kindersachenmärkte.

" + "

Copyright © Martin Brodbeck <info@rustysoft.de>

"); } void MainWindow::onImportSellerExcelActionTriggered() @@ -455,13 +451,13 @@ void MainWindow::onImportSellerExcelActionTriggered() QMessageBox(QMessageBox::Icon::Information, "Import nicht möglich", "Der Import ist nicht möglich, da schon Verkäufe getätigt wurden.", QMessageBox::StandardButton::Ok, this) - .exec(); + .exec(); return; } auto filename = QFileDialog::getOpenFileName( - this, "Verkäufer importieren", QString(), - "Alle unterstützte Dateien (*.xlsx *.csv);;Excel Dateien (*.xlsx);;CSV Dateien (*.csv)"); + this, "Verkäufer importieren", QString(), + "Alle unterstützte Dateien (*.xlsx *.csv);;Excel Dateien (*.xlsx);;CSV Dateien (*.csv)"); if (filename.isEmpty()) return; @@ -474,16 +470,7 @@ void MainWindow::onImportSellerExcelActionTriggered() std::size_t numImported{}; if (case_insensitive_match(filePath.extension().string(), std::string(".xlsx"))) { - try { - numImported = ExcelReader::readSellersFromFile(filePath, marketplace_.get()); - } catch (const std::exception& e) { - QMessageBox(QMessageBox::Icon::Critical, "Fehler beim Importieren", - "Beim Import aus der Excel-Datei ist ein Fehler aufgetreten. " - "Sie könnten ggf. versuchen, die Daten aus einer .csv Datei zu imporieren.", - QMessageBox::StandardButton::Ok, this).exec(); - std::cerr << e.what() << std::endl; - return; - } + numImported = ExcelReader::readSellersFromFile(filePath, marketplace_.get()); } else { numImported = CsvReader::readSellersFromFile(filePath, marketplace_.get()); } @@ -496,7 +483,7 @@ void MainWindow::onImportSellerExcelActionTriggered() << " Verkäufer importiert."; QMessageBox(QMessageBox::Icon::Information, "Verkäufer erfolgreich importiert", msg.str().c_str(), QMessageBox::StandardButton::Ok, this) - .exec(); + .exec(); } void MainWindow::onImportSellerJsonActionTriggered() @@ -505,12 +492,12 @@ void MainWindow::onImportSellerJsonActionTriggered() QMessageBox(QMessageBox::Icon::Information, "Import nicht möglich", "Der Import ist nicht möglich, da schon Verkäufe getätigt wurden.", QMessageBox::StandardButton::Ok, this) - .exec(); + .exec(); return; } auto filename = QFileDialog::getOpenFileName(this, "Verkäufer importieren", QString(), - "JSON Dateien (*.json)"); + "JSON Dateien (*.json)"); if (filename.isEmpty()) return; @@ -532,13 +519,13 @@ void MainWindow::onImportSellerJsonActionTriggered() << " Verkäufer importiert."; QMessageBox(QMessageBox::Icon::Information, "Verkäufer erfolgreich importiert", msg.str().c_str(), QMessageBox::StandardButton::Ok, this) - .exec(); + .exec(); } void MainWindow::onExportSellerJsonActionTriggered() { auto filename = QFileDialog::getSaveFileName( - this, "Verkäufer exportieren", QString("kima2_verkaeufer.json"), "JSON Dateien (*.json)"); + this, "Verkäufer exportieren", QString("kima2_verkaeufer.json"), "JSON Dateien (*.json)"); if (filename.isEmpty()) return; @@ -557,9 +544,9 @@ void MainWindow::onExportSalesJsonActionTriggered() QSettings settings; auto filename = QFileDialog::getSaveFileName( - this, "Umsätze/Transaktionen exportieren", - QString("kima2_umsaetze_kasse") + settings.value("global/cashPointNo").toString() + ".json", - "JSON Dateien (*.json)"); + this, "Umsätze/Transaktionen exportieren", + QString("kima2_umsaetze_kasse") + settings.value("global/cashPointNo").toString() + ".json", + "JSON Dateien (*.json)"); if (filename.isEmpty()) return; @@ -579,7 +566,7 @@ void MainWindow::onImportSalesJsonActionTriggered() QSettings settings; auto filename = QFileDialog::getOpenFileName(this, "Umsätze/Transaktionen importieren", - QString(), "JSON Dateien (*.json)"); + QString(), "JSON Dateien (*.json)"); if (filename.isEmpty()) return; @@ -597,7 +584,7 @@ void MainWindow::onImportSalesJsonActionTriggered() } catch (std::runtime_error& err) { QMessageBox(QMessageBox::Icon::Warning, "Import nicht möglich", err.what(), QMessageBox::Ok, this) - .exec(); + .exec(); } setSaleModel(); updateStatLabel(); diff --git a/subprojects/csv-parser b/subprojects/csv-parser index 6c91e84..e4a899d 160000 --- a/subprojects/csv-parser +++ b/subprojects/csv-parser @@ -1 +1 @@ -Subproject commit 6c91e845320e907658fa5192f6884d1fcbbf3ad9 +Subproject commit e4a899dcafcfa14e448348e9b3c8c06d7697dbf8 diff --git a/subprojects/singleapplication/singleapplication.git b/subprojects/singleapplication/singleapplication.git index e93c12a..e18babe 160000 --- a/subprojects/singleapplication/singleapplication.git +++ b/subprojects/singleapplication/singleapplication.git @@ -1 +1 @@ -Subproject commit e93c12ab69a25fcaa963416f0e348d3269263190 +Subproject commit e18babe5598d53a9e51ac9263d5b62ea2c3276e6