##// END OF EJS Templates
Fix creation of first event
trabillard -
r1311:d6548be72d76
parent child
Show More
@@ -27,6 +27,7 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
27 27 QStringList m_ZonesForTimeMode;
28 28 QString m_ZoneForGraphMode;
29 29 QVector<std::shared_ptr<DBCatalogue> > m_DisplayedCatalogues;
30 bool m_AllEventDisplayed = false;
30 31
31 32 VisualizationWidget *m_VisualizationWidget = nullptr;
32 33
@@ -383,7 +384,7 QVector<std::shared_ptr<DBCatalogue> > CatalogueEventsWidget::displayedCatalogue
383 384
384 385 bool CatalogueEventsWidget::isAllEventsDisplayed() const
385 386 {
386 return impl->m_DisplayedCatalogues.isEmpty() && !impl->m_Model->events().isEmpty();
387 return impl->m_AllEventDisplayed;
387 388 }
388 389
389 390 bool CatalogueEventsWidget::isEventDisplayed(const std::shared_ptr<DBEvent> &event) const
@@ -395,6 +396,7 void CatalogueEventsWidget::populateWithCatalogues(
395 396 const QVector<std::shared_ptr<DBCatalogue> > &catalogues)
396 397 {
397 398 impl->m_DisplayedCatalogues = catalogues;
399 impl->m_AllEventDisplayed = false;
398 400
399 401 QSet<QUuid> eventIds;
400 402 QVector<std::shared_ptr<DBEvent> > events;
@@ -415,6 +417,7 void CatalogueEventsWidget::populateWithCatalogues(
415 417 void CatalogueEventsWidget::populateWithAllEvents()
416 418 {
417 419 impl->m_DisplayedCatalogues.clear();
420 impl->m_AllEventDisplayed = true;
418 421
419 422 auto allEvents = sqpApp->catalogueController().retrieveAllEvents();
420 423
@@ -429,15 +432,16 void CatalogueEventsWidget::populateWithAllEvents()
429 432 void CatalogueEventsWidget::clear()
430 433 {
431 434 impl->m_DisplayedCatalogues.clear();
435 impl->m_AllEventDisplayed = false;
432 436 impl->setEvents({}, this);
433 437 }
434 438
435 439 void CatalogueEventsWidget::refresh()
436 440 {
437 if (impl->m_DisplayedCatalogues.isEmpty()) {
441 if (isAllEventsDisplayed()) {
438 442 populateWithAllEvents();
439 443 }
440 else {
444 else if (!impl->m_DisplayedCatalogues.isEmpty()) {
441 445 populateWithCatalogues(impl->m_DisplayedCatalogues);
442 446 }
443 447 }
General Comments 0
You need to be logged in to leave comments. Login now