CatalogueExplorer.cpp
50 lines
| 1.7 KiB
| text/x-c
|
CppLexer
r1093 | #include "Catalogue/CatalogueExplorer.h" | |||
#include "ui_CatalogueExplorer.h" | ||||
r1129 | #include <DBCatalogue.h> | |||
#include <DBEvent.h> | ||||
r1093 | CatalogueExplorer::CatalogueExplorer(QWidget *parent) | |||
r1100 | : QDialog(parent, Qt::Dialog | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), | |||
ui(new Ui::CatalogueExplorer) | ||||
r1093 | { | |||
ui->setupUi(this); | ||||
r1103 | ||||
r1132 | 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); | ||||
r1103 | }); | |||
r1132 | 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); }); | ||||
connect(ui->catalogues, &CatalogueSideBarWidget::allEventsSelected, | ||||
[this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); }); | ||||
connect(ui->catalogues, &CatalogueSideBarWidget::selectionCleared, | ||||
[this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); }); | ||||
r1131 | connect(ui->events, &CatalogueEventsWidget::eventsSelected, [this](auto events) { | |||
if (events.count() == 1) { | ||||
ui->inspector->setEvent(events.first()); | ||||
} | ||||
else { | ||||
ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); | ||||
} | ||||
}); | ||||
r1093 | } | |||
CatalogueExplorer::~CatalogueExplorer() | ||||
{ | ||||
delete ui; | ||||
} | ||||