diff --git a/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp b/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp index 40ba6c56..99f22092 100644 --- a/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp +++ b/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp @@ -1,12 +1,16 @@ #include #include +#include +#include #include #include #include +#include #include #include +#include namespace scwx { @@ -25,13 +29,17 @@ class Level3ProductsWidgetImpl : public QObject public: explicit Level3ProductsWidgetImpl(Level3ProductsWidget* self) : self_ {self}, - layout_ {new ui::FlowLayout(self)}, + layout_ {new QVBoxLayout(self)}, + productsWidget_ {new QWidget(self)}, + productsLayout_ {new ui::FlowLayout(productsWidget_)}, categoryButtons_ {}, productTiltMap_ {}, awipsProductMap_ {}, awipsProductMutex_ {} { layout_->setContentsMargins(0, 0, 0, 0); + layout_->addWidget(productsWidget_); + productsLayout_->setContentsMargins(0, 0, 0, 0); for (common::Level3ProductCategory category : common::Level3ProductCategoryIterator()) @@ -42,7 +50,7 @@ class Level3ProductsWidgetImpl : public QObject toolButton->setStatusTip( tr(common::GetLevel3CategoryDescription(category).c_str())); toolButton->setPopupMode(QToolButton::MenuButtonPopup); - layout_->addWidget(toolButton); + productsLayout_->addWidget(toolButton); categoryButtons_.push_back(toolButton); QObject::connect(toolButton, @@ -99,6 +107,26 @@ class Level3ProductsWidgetImpl : public QObject toolButton->setEnabled(false); } + + // Storm Tracking Information + QCheckBox* stiPastEnableCheckBox = new QCheckBox(); + QCheckBox* stiForecastEnableCheckBox = new QCheckBox(); + + stiPastEnableCheckBox->setText(QObject::tr("Storm Tracks (Past)")); + stiForecastEnableCheckBox->setText( + QObject::tr("Storm Tracks (Forecast)")); + + layout_->addWidget(stiPastEnableCheckBox); + layout_->addWidget(stiForecastEnableCheckBox); + + auto& productSettings = settings::ProductSettings::Instance(); + + stiPastEnabled_.SetSettingsVariable(productSettings.sti_past_enabled()); + stiForecastEnabled_.SetSettingsVariable( + productSettings.sti_forecast_enabled()); + + stiPastEnabled_.SetEditWidget(stiPastEnableCheckBox); + stiForecastEnabled_.SetEditWidget(stiForecastEnableCheckBox); } ~Level3ProductsWidgetImpl() = default; @@ -109,6 +137,8 @@ class Level3ProductsWidgetImpl : public QObject Level3ProductsWidget* self_; QLayout* layout_; + QWidget* productsWidget_; + QLayout* productsLayout_; std::list categoryButtons_; std::unordered_map> @@ -118,6 +148,9 @@ class Level3ProductsWidgetImpl : public QObject std::unordered_map awipsProductMap_; std::shared_mutex awipsProductMutex_; + + settings::SettingsInterface stiPastEnabled_ {}; + settings::SettingsInterface stiForecastEnabled_ {}; }; Level3ProductsWidget::Level3ProductsWidget(QWidget* parent) :