##// END OF EJS Templates
Some fixes
trabillard -
r1290:21b6c58e9bf1
parent child
Show More
@@ -13,6 +13,7
13 #include <Catalogue/CatalogueSideBarWidget.h>
13 #include <Catalogue/CatalogueSideBarWidget.h>
14 #include <Catalogue/CreateEventDialog.h>
14 #include <Catalogue/CreateEventDialog.h>
15
15
16 #include <CatalogueDao.h>
16 #include <DBCatalogue.h>
17 #include <DBCatalogue.h>
17 #include <DBEvent.h>
18 #include <DBEvent.h>
18 #include <DBEventProduct.h>
19 #include <DBEventProduct.h>
@@ -106,7 +107,7 void CatalogueActionManager::installSelectionZoneActions()
106 auto createEventAction = actionController.addSectionZoneAction(
107 auto createEventAction = actionController.addSectionZoneAction(
107 {QObject::tr("Catalogues")}, QObject::tr("New Event..."), [this](auto zones) {
108 {QObject::tr("Catalogues")}, QObject::tr("New Event..."), [this](auto zones) {
108 CreateEventDialog dialog(
109 CreateEventDialog dialog(
109 impl->m_CatalogueExplorer->sideBarWidget().getCatalogues("Default"));
110 impl->m_CatalogueExplorer->sideBarWidget().getCatalogues(REPOSITORY_DEFAULT));
110 dialog.hideCatalogueChoice();
111 dialog.hideCatalogueChoice();
111 if (dialog.exec() == QDialog::Accepted) {
112 if (dialog.exec() == QDialog::Accepted) {
112 impl->createEventFromZones(dialog.eventName(), zones);
113 impl->createEventFromZones(dialog.eventName(), zones);
@@ -117,7 +118,7 void CatalogueActionManager::installSelectionZoneActions()
117 auto createEventInCatalogueAction = actionController.addSectionZoneAction(
118 auto createEventInCatalogueAction = actionController.addSectionZoneAction(
118 {QObject::tr("Catalogues")}, QObject::tr("New Event in Catalogue..."), [this](auto zones) {
119 {QObject::tr("Catalogues")}, QObject::tr("New Event in Catalogue..."), [this](auto zones) {
119 CreateEventDialog dialog(
120 CreateEventDialog dialog(
120 impl->m_CatalogueExplorer->sideBarWidget().getCatalogues("Default"));
121 impl->m_CatalogueExplorer->sideBarWidget().getCatalogues(REPOSITORY_DEFAULT));
121 if (dialog.exec() == QDialog::Accepted) {
122 if (dialog.exec() == QDialog::Accepted) {
122 auto selectedCatalogue = dialog.selectedCatalogue();
123 auto selectedCatalogue = dialog.selectedCatalogue();
123 if (!selectedCatalogue) {
124 if (!selectedCatalogue) {
@@ -125,7 +126,7 void CatalogueActionManager::installSelectionZoneActions()
125 selectedCatalogue->setName(dialog.catalogueName());
126 selectedCatalogue->setName(dialog.catalogueName());
126 // sqpApp->catalogueController().addCatalogue(selectedCatalogue); TODO
127 // sqpApp->catalogueController().addCatalogue(selectedCatalogue); TODO
127 impl->m_CatalogueExplorer->sideBarWidget().addCatalogue(selectedCatalogue,
128 impl->m_CatalogueExplorer->sideBarWidget().addCatalogue(selectedCatalogue,
128 "Default");
129 REPOSITORY_DEFAULT);
129 }
130 }
130
131
131 impl->createEventFromZones(dialog.eventName(), zones, selectedCatalogue);
132 impl->createEventFromZones(dialog.eventName(), zones, selectedCatalogue);
@@ -320,19 +320,21 void CatalogueEventsWidget::setEventChanges(const std::shared_ptr<DBEvent> &even
320 auto validationIndex
320 auto validationIndex
321 = eventIndex.sibling(eventIndex.row(), (int)CatalogueEventsModel::Column::Validation);
321 = eventIndex.sibling(eventIndex.row(), (int)CatalogueEventsModel::Column::Validation);
322
322
323 if (hasChanges) {
323 if (validationIndex.isValid()) {
324 if (ui->treeView->indexWidget(validationIndex) == nullptr) {
324 if (hasChanges) {
325 auto widget = CatalogueExplorerHelper::buildValidationWidget(
325 if (ui->treeView->indexWidget(validationIndex) == nullptr) {
326 ui->treeView,
326 auto widget = CatalogueExplorerHelper::buildValidationWidget(
327 [this, event]() {
327 ui->treeView,
328 sqpApp->catalogueController().saveEvent(event);
328 [this, event]() {
329 setEventChanges(event, false);
329 sqpApp->catalogueController().saveEvent(event);
330 },
330 setEventChanges(event, false);
331 [this, event]() { setEventChanges(event, false); });
331 },
332 ui->treeView->setIndexWidget(validationIndex, widget);
332 [this, event]() { setEventChanges(event, false); });
333 }
333 ui->treeView->setIndexWidget(validationIndex, widget);
334 }
334
335
335 impl->m_Model->setEventHasChanges(event, hasChanges);
336 impl->m_Model->setEventHasChanges(event, hasChanges);
337 }
336 }
338 }
337 else {
339 else {
338 qCWarning(LOG_CatalogueEventsWidget())
340 qCWarning(LOG_CatalogueEventsWidget())
@@ -225,7 +225,8 void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::configureTreeWidget(
225 {
225 {
226 auto allEventsItem = new CatalogueTextTreeItem{QIcon{":/icones/allEvents.png"}, "All Events",
226 auto allEventsItem = new CatalogueTextTreeItem{QIcon{":/icones/allEvents.png"}, "All Events",
227 ALL_EVENT_ITEM_TYPE};
227 ALL_EVENT_ITEM_TYPE};
228 m_TreeModel->addTopLevelItem(allEventsItem);
228 auto allEventIndex = m_TreeModel->addTopLevelItem(allEventsItem);
229 treeView->setCurrentIndex(allEventIndex);
229
230
230 auto trashItem
231 auto trashItem
231 = new CatalogueTextTreeItem{QIcon{":/icones/trash.png"}, "Trash", TRASH_ITEM_TYPE};
232 = new CatalogueTextTreeItem{QIcon{":/icones/trash.png"}, "Trash", TRASH_ITEM_TYPE};
General Comments 3
Under Review
author

Auto status change to "Under Review"

Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now