##// END OF EJS Templates
Updates model after an event has been created through the colored zone
Updates model after an event has been created through the colored zone

File last commit:

r1286:073d4af7c849
r1286:073d4af7c849
Show More
CatalogueExplorer.cpp
113 lines | 3.9 KiB | text/x-c | CppLexer
/ gui / src / Catalogue / CatalogueExplorer.cpp
Adds the new CatalogueExplorer dialog
r1128 #include "Catalogue/CatalogueExplorer.h"
#include "ui_CatalogueExplorer.h"
Zone actions to create a new event
r1195 #include <Catalogue/CatalogueActionManager.h>
Adaptation to last version of catalogue controller
r1196 #include <Catalogue/CatalogueController.h>
#include <SqpApplication.h>
Retrieves zone names from the visualization
r1169 #include <Visualization/VisualizationWidget.h>
Display catalogues and events with CatalogueAPI
r1162 #include <DBCatalogue.h>
#include <DBEvent.h>
Retrieves zone names from the visualization
r1169 struct CatalogueExplorer::CatalogueExplorerPrivate {
Zone actions to create a new event
r1195 CatalogueActionManager m_ActionManager;
Updates model after an event has been created through the colored zone
r1286
CatalogueExplorerPrivate(CatalogueExplorer *catalogueExplorer)
: m_ActionManager(catalogueExplorer)
{
}
Retrieves zone names from the visualization
r1169 };
Adds the new CatalogueExplorer dialog
r1128 CatalogueExplorer::CatalogueExplorer(QWidget *parent)
Fix window flags of the catalogue gui
r1135 : QDialog(parent, Qt::Dialog | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint),
Retrieves zone names from the visualization
r1169 ui(new Ui::CatalogueExplorer),
Updates model after an event has been created through the colored zone
r1286 impl{spimpl::make_unique_impl<CatalogueExplorerPrivate>(this)}
Adds the new CatalogueExplorer dialog
r1128 {
ui->setupUi(this);
Basic interactions
r1138
Zone actions to create a new event
r1195 impl->m_ActionManager.installSelectionZoneActions();
Multi selection of catalogues
r1165 connect(ui->catalogues, &CatalogueSideBarWidget::catalogueSelected, [this](auto catalogues) {
if (catalogues.count() == 1) {
ui->inspector->setCatalogue(catalogues.first());
}
else {
ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty);
}
ui->events->populateWithCatalogues(catalogues);
Basic interactions
r1138 });
Multi selection of catalogues
r1165 connect(ui->catalogues, &CatalogueSideBarWidget::databaseSelected, [this](auto databases) {
ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty);
});
connect(ui->catalogues, &CatalogueSideBarWidget::trashSelected,
[this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); });
Displays all events
r1192 connect(ui->catalogues, &CatalogueSideBarWidget::allEventsSelected, [this]() {
ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty);
ui->events->populateWithAllEvents();
});
Multi selection of catalogues
r1165
connect(ui->catalogues, &CatalogueSideBarWidget::selectionCleared,
[this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); });
Manage inspector with multiple events selected
r1164 connect(ui->events, &CatalogueEventsWidget::eventsSelected, [this](auto events) {
if (events.count() == 1) {
ui->inspector->setEvent(events.first());
}
else {
ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty);
}
});
Edition of catalogues from the inspector
r1180
Edition of event products via the inspector
r1183 connect(ui->events, &CatalogueEventsWidget::eventProductsSelected, [this](auto eventProducts) {
if (eventProducts.count() == 1) {
ui->inspector->setEventProduct(eventProducts.first().first,
eventProducts.first().second);
}
else {
ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty);
}
});
connect(ui->events, &CatalogueEventsWidget::selectionCleared,
[this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); });
Adaptation to last version of catalogue controller
r1196 connect(ui->inspector, &CatalogueInspectorWidget::catalogueUpdated, [this](auto catalogue) {
sqpApp->catalogueController().updateCatalogue(catalogue);
ui->catalogues->setCatalogueChanges(catalogue, true);
});
Edition of events from the inspector
r1181
Adaptation to last version of catalogue controller
r1196 connect(ui->inspector, &CatalogueInspectorWidget::eventUpdated, [this](auto event) {
sqpApp->catalogueController().updateEvent(event);
ui->events->setEventChanges(event, true);
});
Edition of event products via the inspector
r1183
connect(ui->inspector, &CatalogueInspectorWidget::eventProductUpdated,
Add init of DisplayedEvent. Add save on EventProduct modif
r1281 [this](auto event, auto eventProduct) {
sqpApp->catalogueController().updateEventProduct(eventProduct);
ui->events->setEventChanges(event, true);
});
Adds the new CatalogueExplorer dialog
r1128 }
CatalogueExplorer::~CatalogueExplorer()
{
delete ui;
}
Retrieves zone names from the visualization
r1169
void CatalogueExplorer::setVisualizationWidget(VisualizationWidget *visualization)
{
ui->events->setVisualizationWidget(visualization);
}
Updates model after an event has been created through the colored zone
r1286
CatalogueEventsWidget &CatalogueExplorer::eventsWidget() const
{
return *ui->events;
}
CatalogueSideBarWidget &CatalogueExplorer::sideBarWidget() const
{
return *ui->catalogues;
}