diff --git a/gui/src/Catalogue/CatalogueEventsModel.cpp b/gui/src/Catalogue/CatalogueEventsModel.cpp index c26ce1e..ad78d41 100644 --- a/gui/src/Catalogue/CatalogueEventsModel.cpp +++ b/gui/src/Catalogue/CatalogueEventsModel.cpp @@ -34,9 +34,9 @@ struct CatalogueEventsModel::CatalogueEventsModelPrivate { case Column::Name: return event->getName(); case Column::TStart: - return "Oo"; // DateUtils::dateTime(event->getTStart()); + return DateUtils::dateTime(event->getTStart()); case Column::TEnd: - return "oO"; // DateUtils::dateTime(event->getTEnd()); + return DateUtils::dateTime(event->getTEnd()); case Column::Product: { auto eventProductsIt = m_EventProducts.find(event.get()); if (eventProductsIt != m_EventProducts.cend()) { @@ -337,8 +337,8 @@ QMimeData *CatalogueEventsModel::mimeData(const QModelIndexList &indexes) const if (isFirst) { isFirst = false; - // firstTimeRange.m_TStart = event->getTStart(); - // firstTimeRange.m_TEnd = event->getTEnd(); + firstTimeRange.m_TStart = event->getTStart(); + firstTimeRange.m_TEnd = event->getTEnd(); } } else if (type == ItemType::EventProduct) { diff --git a/gui/src/Catalogue/CatalogueEventsWidget.cpp b/gui/src/Catalogue/CatalogueEventsWidget.cpp index a55c568..410d933 100644 --- a/gui/src/Catalogue/CatalogueEventsWidget.cpp +++ b/gui/src/Catalogue/CatalogueEventsWidget.cpp @@ -137,27 +137,29 @@ struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate { if (selectedRows.count() == 1) { auto event = m_Model->getEvent(selectedRows.first()); - if (m_VisualizationWidget) { - if (auto tab = m_VisualizationWidget->currentTabWidget()) { - - for (auto zoneName : m_ZonesForTimeMode) { - if (auto zone = tab->getZoneWithName(zoneName)) { - SqpRange eventRange; - // eventRange.m_TStart = event->getTStart(); - // eventRange.m_TEnd = event->getTEnd(); - zone->setZoneRange(eventRange); + if (event) { + if (m_VisualizationWidget) { + if (auto tab = m_VisualizationWidget->currentTabWidget()) { + + for (auto zoneName : m_ZonesForTimeMode) { + if (auto zone = tab->getZoneWithName(zoneName)) { + SqpRange eventRange; + eventRange.m_TStart = event->getTStart(); + eventRange.m_TEnd = event->getTEnd(); + zone->setZoneRange(eventRange); + } } } + else { + qCWarning(LOG_CatalogueEventsWidget()) + << "updateTimeZone: no tab found in the visualization"; + } } else { qCWarning(LOG_CatalogueEventsWidget()) - << "updateTimeZone: no tab found in the visualization"; + << "updateTimeZone: visualization widget not found"; } } - else { - qCWarning(LOG_CatalogueEventsWidget()) - << "updateTimeZone: visualization widget not found"; - } } else { qCWarning(LOG_CatalogueEventsWidget()) diff --git a/gui/src/Catalogue/CatalogueInspectorWidget.cpp b/gui/src/Catalogue/CatalogueInspectorWidget.cpp index b448acc..3c6b730 100644 --- a/gui/src/Catalogue/CatalogueInspectorWidget.cpp +++ b/gui/src/Catalogue/CatalogueInspectorWidget.cpp @@ -127,8 +127,8 @@ void CatalogueInspectorWidget::setEvent(const std::shared_ptr &event) ui->dateTimeEventTStart->setEnabled(false); ui->dateTimeEventTEnd->setEnabled(false); - // ui->dateTimeEventTStart->setDateTime(DateUtils::dateTime(event->getTStart())); - // ui->dateTimeEventTEnd->setDateTime(DateUtils::dateTime(event->getTEnd())); + ui->dateTimeEventTStart->setDateTime(DateUtils::dateTime(event->getTStart())); + ui->dateTimeEventTEnd->setDateTime(DateUtils::dateTime(event->getTEnd())); blockSignals(false); }