@@ -290,6 +290,14 void CatalogueController::saveCatalogue(std::shared_ptr<DBCatalogue> catalogue) | |||||
290 | { |
|
290 | { | |
291 | impl->saveCatalogue(catalogue, true); |
|
291 | impl->saveCatalogue(catalogue, true); | |
292 | impl->m_KeysWithChanges.remove(impl->catalogueUniqueKey(catalogue)); |
|
292 | impl->m_KeysWithChanges.remove(impl->catalogueUniqueKey(catalogue)); | |
|
293 | ||||
|
294 | // remove key of events of the catalogue | |||
|
295 | if (catalogue->getType() == CatalogueType::STATIC) { | |||
|
296 | auto events = this->retrieveEventsFromCatalogue(catalogue); | |||
|
297 | for (auto event : events) { | |||
|
298 | impl->m_KeysWithChanges.remove(impl->eventUniqueKey(event)); | |||
|
299 | } | |||
|
300 | } | |||
293 | } |
|
301 | } | |
294 |
|
302 | |||
295 | void CatalogueController::discardCatalogue(std::shared_ptr<DBCatalogue> catalogue, bool &removed) |
|
303 | void CatalogueController::discardCatalogue(std::shared_ptr<DBCatalogue> catalogue, bool &removed) |
@@ -40,6 +40,7 public: | |||||
40 |
|
40 | |||
41 | void addEvent(const std::shared_ptr<DBEvent> &event); |
|
41 | void addEvent(const std::shared_ptr<DBEvent> &event); | |
42 | void setEventChanges(const std::shared_ptr<DBEvent> &event, bool hasChanges); |
|
42 | void setEventChanges(const std::shared_ptr<DBEvent> &event, bool hasChanges); | |
|
43 | void setEventsChanges(const std::shared_ptr<DBEvent> &event, bool hasChanges); | |||
43 |
|
44 | |||
44 | QVector<std::shared_ptr<DBCatalogue> > displayedCatalogues() const; |
|
45 | QVector<std::shared_ptr<DBCatalogue> > displayedCatalogues() const; | |
45 | bool isAllEventsDisplayed() const; |
|
46 | bool isAllEventsDisplayed() const; |
@@ -24,6 +24,7 signals: | |||||
24 | void allEventsSelected(); |
|
24 | void allEventsSelected(); | |
25 | void trashSelected(); |
|
25 | void trashSelected(); | |
26 | void selectionCleared(); |
|
26 | void selectionCleared(); | |
|
27 | void catalogueSaved(const std::shared_ptr<DBCatalogue> &catalogue); | |||
27 |
|
28 | |||
28 | public: |
|
29 | public: | |
29 | explicit CatalogueSideBarWidget(QWidget *parent = 0); |
|
30 | explicit CatalogueSideBarWidget(QWidget *parent = 0); |
@@ -76,6 +76,9 CatalogueExplorer::CatalogueExplorer(QWidget *parent) | |||||
76 | ui->events->clear(); |
|
76 | ui->events->clear(); | |
77 | }); |
|
77 | }); | |
78 |
|
78 | |||
|
79 | connect(ui->catalogues, &CatalogueSideBarWidget::catalogueSaved, ui->events, | |||
|
80 | &CatalogueEventsWidget::refresh); | |||
|
81 | ||||
79 | // Updates the inspectot when something is selected in the events |
|
82 | // Updates the inspectot when something is selected in the events | |
80 | connect(ui->events, &CatalogueEventsWidget::eventsSelected, [this](auto events) { |
|
83 | connect(ui->events, &CatalogueEventsWidget::eventsSelected, [this](auto events) { | |
81 | if (events.count() == 1) { |
|
84 | if (events.count() == 1) { |
@@ -394,6 +394,7 void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::setHasChanges( | |||||
394 | [this, validationIndex, sideBarWidget, catalogue]() { |
|
394 | [this, validationIndex, sideBarWidget, catalogue]() { | |
395 | if (catalogue) { |
|
395 | if (catalogue) { | |
396 | sqpApp->catalogueController().saveCatalogue(catalogue); |
|
396 | sqpApp->catalogueController().saveCatalogue(catalogue); | |
|
397 | emit sideBarWidget->catalogueSaved(catalogue); | |||
397 | } |
|
398 | } | |
398 | setHasChanges(false, validationIndex, sideBarWidget); |
|
399 | setHasChanges(false, validationIndex, sideBarWidget); | |
399 | }, |
|
400 | }, |
General Comments 0
You need to be logged in to leave comments.
Login now