Compare commits
No commits in common. "4143fc2e89fedc4f4fd127714685ffc38e03c032" and "a89c624132aec944feeaeb0265acf0e5195d2b3a" have entirely different histories.
4143fc2e89
...
a89c624132
3 changed files with 3 additions and 14 deletions
|
@ -17,7 +17,6 @@ MainWindow::MainWindow()
|
||||||
&MainWindow::on_actionEditSeller_triggered);
|
&MainWindow::on_actionEditSeller_triggered);
|
||||||
connect(ui_.sellerNoEdit, &QLineEdit::returnPressed, this,
|
connect(ui_.sellerNoEdit, &QLineEdit::returnPressed, this,
|
||||||
&MainWindow::on_sellerNoEdit_checkSellerNo);
|
&MainWindow::on_sellerNoEdit_checkSellerNo);
|
||||||
connect(ui_.paidButton, &QPushButton::clicked, this, &MainWindow::on_paidButton_triggered);
|
|
||||||
|
|
||||||
marketplace_ = std::make_unique<Marketplace>();
|
marketplace_ = std::make_unique<Marketplace>();
|
||||||
marketplace_->loadFromDb();
|
marketplace_->loadFromDb();
|
||||||
|
@ -26,6 +25,7 @@ MainWindow::MainWindow()
|
||||||
BasketModel* model = new BasketModel(getMarketplace(), ui_.basketView);
|
BasketModel* model = new BasketModel(getMarketplace(), ui_.basketView);
|
||||||
ui_.basketView->setModel(model);
|
ui_.basketView->setModel(model);
|
||||||
ui_.basketView->setColumnHidden(0, true); // hide the uuid
|
ui_.basketView->setColumnHidden(0, true); // hide the uuid
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionEditSeller_triggered()
|
void MainWindow::on_actionEditSeller_triggered()
|
||||||
|
@ -44,14 +44,6 @@ void MainWindow::on_actionEditSeller_triggered()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_paidButton_triggered()
|
|
||||||
{
|
|
||||||
if (marketplace_->basketSize() > 0) {
|
|
||||||
dynamic_cast<BasketModel*>(ui_.basketView->model())->finishSale();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::on_sellerNoEdit_checkSellerNo()
|
void MainWindow::on_sellerNoEdit_checkSellerNo()
|
||||||
{
|
{
|
||||||
using std::regex, std::regex_match, std::smatch;
|
using std::regex, std::regex_match, std::smatch;
|
||||||
|
|
|
@ -17,12 +17,10 @@ class MainWindow : public QMainWindow
|
||||||
MainWindow();
|
MainWindow();
|
||||||
Marketplace* getMarketplace() { return marketplace_.get(); }
|
Marketplace* getMarketplace() { return marketplace_.get(); }
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void on_actionEditSeller_triggered();
|
void on_actionEditSeller_triggered();
|
||||||
void on_sellerNoEdit_checkSellerNo();
|
void on_sellerNoEdit_checkSellerNo();
|
||||||
void on_paidButton_triggered();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::MainWindow ui_;
|
Ui::MainWindow ui_;
|
||||||
std::unique_ptr<Marketplace> marketplace_;
|
std::unique_ptr<Marketplace> marketplace_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,8 +16,7 @@ void PriceDialog::accept()
|
||||||
{
|
{
|
||||||
if (static_cast<int>(std::round(ui_.priceSpinBox->value() * 100.0L)) % 50 != 0) {
|
if (static_cast<int>(std::round(ui_.priceSpinBox->value() * 100.0L)) % 50 != 0) {
|
||||||
QMessageBox(QMessageBox::Icon::Warning, "Falsche Preiseingabe",
|
QMessageBox(QMessageBox::Icon::Warning, "Falsche Preiseingabe",
|
||||||
"Es sind nur 0,50 Cent-Schritte erlaubt.", QMessageBox::StandardButton::Ok,
|
"Es sind 0,50 Cent-Schritte erlaubt", QMessageBox::StandardButton::Ok, this)
|
||||||
this)
|
|
||||||
.exec();
|
.exec();
|
||||||
} else {
|
} else {
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
|
|
Loading…
Reference in a new issue