#include "Catalogue/CatalogueInspectorWidget.h" #include "ui_CatalogueInspectorWidget.h" #include #include #include #include CatalogueInspectorWidget::CatalogueInspectorWidget(QWidget *parent) : QWidget(parent), ui(new Ui::CatalogueInspectorWidget) { ui->setupUi(this); showPage(Page::Empty); } CatalogueInspectorWidget::~CatalogueInspectorWidget() { delete ui; } void CatalogueInspectorWidget::showPage(CatalogueInspectorWidget::Page page) { ui->stackedWidget->setCurrentIndex(static_cast(page)); } CatalogueInspectorWidget::Page CatalogueInspectorWidget::currentPage() const { return static_cast(ui->stackedWidget->currentIndex()); } void CatalogueInspectorWidget::setEvent(const std::shared_ptr &event) { showPage(Page::EventProperties); ui->leEventName->setText(event->getName()); ui->leEventMission->setText(event->getMission()); ui->leEventProduct->setText(event->getProduct()); QString tagList; auto tags = event->getTags(); for (auto tag : tags) { tagList += tag.getName(); tagList += ' '; } ui->leEventTags->setText(tagList); ui->dateTimeEventTStart->setDateTime(DateUtils::dateTime(event->getTStart())); ui->dateTimeEventTEnd->setDateTime(DateUtils::dateTime(event->getTEnd())); } void CatalogueInspectorWidget::setCatalogue(const std::shared_ptr &catalogue) { showPage(Page::CatalogueProperties); ui->leCatalogueName->setText(catalogue->getName()); ui->leCatalogueAuthor->setText(catalogue->getAuthor()); }