##// END OF EJS Templates
Display catalogues and events with CatalogueAPI
Display catalogues and events with CatalogueAPI

File last commit:

r1129:9abcd350a712
r1129:9abcd350a712
Show More
CatalogueInspectorWidget.cpp
56 lines | 1.6 KiB | text/x-c | CppLexer
/ gui / src / Catalogue / CatalogueInspectorWidget.cpp
Sub widget classes
r1095 #include "Catalogue/CatalogueInspectorWidget.h"
#include "ui_CatalogueInspectorWidget.h"
Display catalogues and events with CatalogueAPI
r1129 #include <Common/DateUtils.h>
#include <DBCatalogue.h>
#include <DBEvent.h>
#include <DBTag.h>
Sub widget classes
r1095 CatalogueInspectorWidget::CatalogueInspectorWidget(QWidget *parent)
: QWidget(parent), ui(new Ui::CatalogueInspectorWidget)
{
ui->setupUi(this);
Inspector
r1099 showPage(Page::Empty);
Sub widget classes
r1095 }
CatalogueInspectorWidget::~CatalogueInspectorWidget()
{
delete ui;
}
Inspector
r1099
void CatalogueInspectorWidget::showPage(CatalogueInspectorWidget::Page page)
{
ui->stackedWidget->setCurrentIndex(static_cast<int>(page));
}
CatalogueInspectorWidget::Page CatalogueInspectorWidget::currentPage() const
{
return static_cast<Page>(ui->stackedWidget->currentIndex());
}
Skeleton to fill the inspector with the selection
r1105
Display catalogues and events with CatalogueAPI
r1129 void CatalogueInspectorWidget::setEvent(const DBEvent &event)
Skeleton to fill the inspector with the selection
r1105 {
showPage(Page::EventProperties);
Display catalogues and events with CatalogueAPI
r1129 ui->leEventName->setText(event.getName());
ui->leEventMission->setText(event.getMission());
ui->leEventProduct->setText(event.getProduct());
QString tagList;
auto tags = const_cast<DBEvent *>(&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()));
Skeleton to fill the inspector with the selection
r1105 }
Display catalogues and events with CatalogueAPI
r1129 void CatalogueInspectorWidget::setCatalogue(const DBCatalogue &catalogue)
Skeleton to fill the inspector with the selection
r1105 {
showPage(Page::CatalogueProperties);
Display catalogues and events with CatalogueAPI
r1129 ui->leCatalogueName->setText(catalogue.getName());
ui->leCatalogueAuthor->setText(catalogue.getAuthor());
Skeleton to fill the inspector with the selection
r1105 }