@@ -384,16 +384,29 CatalogueEventsWidget::CatalogueEventsWidget(QWidget *parent) | |||
|
384 | 384 | |
|
385 | 385 | if (!events.isEmpty() && eventProducts.isEmpty()) { |
|
386 | 386 | |
|
387 | if (QMessageBox::warning(this, tr("Remove Event(s)"), | |
|
387 | auto canRemoveEvent | |
|
388 | = !this->isAllEventsDisplayed() | |
|
389 | || (QMessageBox::warning( | |
|
390 | this, tr("Remove Event(s)"), | |
|
388 | 391 |
|
|
389 | 392 |
|
|
390 | 393 |
|
|
391 |
== QMessageBox::Yes) |
|
|
394 | == QMessageBox::Yes); | |
|
392 | 395 | |
|
396 | if (canRemoveEvent) { | |
|
393 | 397 | for (auto event : events) { |
|
394 | sqpApp->catalogueController().removeEvent(event); | |
|
398 | if (this->isAllEventsDisplayed()) { | |
|
395 | 399 | impl->removeEvent(event, ui->treeView); |
|
396 | 400 | } |
|
401 | else { | |
|
402 | for (auto catalogue : this->displayedCatalogues()) { | |
|
403 | catalogue->removeEvent(event->getUniqId()); | |
|
404 | sqpApp->catalogueController().updateCatalogue(catalogue); | |
|
405 | } | |
|
406 | } | |
|
407 | impl->m_Model->removeEvent(event); | |
|
408 | } | |
|
409 | ||
|
397 | 410 | |
|
398 | 411 | emit this->eventsRemoved(events); |
|
399 | 412 | } |
General Comments 0
You need to be logged in to leave comments.
Login now