Compare commits
2 commits
715c8252d8
...
d784a26872
Author | SHA1 | Date | |
---|---|---|---|
d784a26872 | |||
fb1f0cdba7 |
3 changed files with 11 additions and 1 deletions
Binary file not shown.
Binary file not shown.
|
@ -13,7 +13,7 @@ SellerDialog::SellerDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent,
|
|||
model_ = std::make_unique<SellerModel>(market_, ui_.tableView);
|
||||
ui_.tableView->setModel(model_.get());
|
||||
ui_.tableView->setColumnHidden(0, true); // hide the uuid
|
||||
ui_.tableView->setRowHidden(0, true); // hide the special "Sonderkonto" user
|
||||
ui_.tableView->setRowHidden(0, true); // hide the special "Sonderkonto" user
|
||||
connect(ui_.newButton, &QPushButton::clicked, this, &SellerDialog::on_newButton_clicked);
|
||||
connect(ui_.deleteButton, &QPushButton::clicked, this, &SellerDialog::on_deleteButton_clicked);
|
||||
connect(model_.get(), &SellerModel::duplicateSellerNo, this,
|
||||
|
@ -24,6 +24,16 @@ SellerDialog::SellerDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent,
|
|||
|
||||
void SellerDialog::on_newButton_clicked()
|
||||
{
|
||||
// Don't allow new seller if market has already started
|
||||
if (market_->getSales().size() > 0) {
|
||||
QMessageBox(QMessageBox::Icon::Warning, "Hinweis",
|
||||
"Da die Verkaufsphase schon begonnen hat (Artikel wurden bereits verkauft) "
|
||||
"können Sie keine Verkäufer mehr hinzufügen.",
|
||||
QMessageBox::StandardButton::Ok, this)
|
||||
.exec();
|
||||
return;
|
||||
}
|
||||
|
||||
ui_.tableView->reset();
|
||||
ui_.tableView->model()->insertRows(ui_.tableView->model()->rowCount(), 1);
|
||||
ui_.tableView->scrollToBottom();
|
||||
|
|
Loading…
Reference in a new issue