##// END OF EJS Templates
Multi selection of catalogues
Multi selection of catalogues

File last commit:

r1165:13f4a3063503
r1165:13f4a3063503
Show More
CatalogueExplorer.cpp
50 lines | 1.7 KiB | text/x-c | CppLexer
/ gui / src / Catalogue / CatalogueExplorer.cpp
Adds the new CatalogueExplorer dialog
r1128 #include "Catalogue/CatalogueExplorer.h"
#include "ui_CatalogueExplorer.h"
Display catalogues and events with CatalogueAPI
r1162 #include <DBCatalogue.h>
#include <DBEvent.h>
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),
ui(new Ui::CatalogueExplorer)
Adds the new CatalogueExplorer dialog
r1128 {
ui->setupUi(this);
Basic interactions
r1138
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); });
connect(ui->catalogues, &CatalogueSideBarWidget::allEventsSelected,
[this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); });
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);
}
});
Adds the new CatalogueExplorer dialog
r1128 }
CatalogueExplorer::~CatalogueExplorer()
{
delete ui;
}