mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 23:50:05 +00:00 
			
		
		
		
	Revert "save radar toolbox dock's visibility on exit"
This reverts commit 3789845a36.
			
			
This commit is contained in:
		
							parent
							
								
									a94dc82c1f
								
							
						
					
					
						commit
						f1bc8d2b13
					
				
					 3 changed files with 1 additions and 30 deletions
				
			
		|  | @ -277,13 +277,10 @@ MainWindow::MainWindow(QWidget* parent) : | |||
| 
 | ||||
|    ui->radarSitePresetsButton->setVisible(!radarSitePresets.empty()); | ||||
| 
 | ||||
|    auto& uiSettings = settings::UiSettings::Instance(); | ||||
|    // Configure Alert Dock
 | ||||
|    bool alertDockVisible_ = uiSettings.alert_dock_visible().GetValue(); | ||||
|    p->alertDockWidget_ = new ui::AlertDockWidget(this); | ||||
|    p->alertDockWidget_->setVisible(false); | ||||
|    addDockWidget(Qt::BottomDockWidgetArea, p->alertDockWidget_); | ||||
|    p->alertDockWidget_->setVisible(alertDockVisible_); | ||||
| 
 | ||||
|    // GPS Info Dialog
 | ||||
|    p->gpsInfoDialog_ = new ui::GpsInfoDialog(this); | ||||
|  | @ -293,24 +290,10 @@ MainWindow::MainWindow(QWidget* parent) : | |||
|                               ui->radarToolboxDock->toggleViewAction()); | ||||
|    ui->radarToolboxDock->toggleViewAction()->setText(tr("Radar &Toolbox")); | ||||
|    ui->actionRadarToolbox->setVisible(false); | ||||
|    ui->radarToolboxDock->setVisible( | ||||
|       uiSettings.radar_toolbox_dock_visible().GetValue()); | ||||
| 
 | ||||
|    // Update dock setting on visiblity change.
 | ||||
|    connect(ui->radarToolboxDock->toggleViewAction(), | ||||
|            &QAction::triggered, | ||||
|            this, | ||||
|            [](bool checked) | ||||
|            { | ||||
|               settings::UiSettings::Instance() | ||||
|                  .radar_toolbox_dock_visible() | ||||
|                  .StageValue(checked); | ||||
|            }); | ||||
| 
 | ||||
|    ui->menuView->insertAction(ui->actionAlerts, | ||||
|                               p->alertDockWidget_->toggleViewAction()); | ||||
|    p->alertDockWidget_->toggleViewAction()->setText(tr("&Alerts")); | ||||
|    ui->actionAlerts->setVisible(false); | ||||
| 
 | ||||
|    ui->menuDebug->menuAction()->setVisible( | ||||
|       settings::GeneralSettings::Instance().debug_enabled().GetValue()); | ||||
|  | @ -837,6 +820,7 @@ void MainWindowImpl::ConfigureUiSettings() | |||
|    mapSettingsGroup_->SetExpanded( | ||||
|       uiSettings.map_settings_expanded().GetValue()); | ||||
|    timelineGroup_->SetExpanded(uiSettings.timeline_expanded().GetValue()); | ||||
|    alertDockWidget_->setVisible(uiSettings.alert_dock_visible().GetValue()); | ||||
| 
 | ||||
|    connect(level2ProductsGroup_, | ||||
|            &ui::CollapsibleGroup::StateChanged, | ||||
|  |  | |||
|  | @ -19,7 +19,6 @@ public: | |||
|       level3ProductsExpanded_.SetDefault(true); | ||||
|       mapSettingsExpanded_.SetDefault(true); | ||||
|       timelineExpanded_.SetDefault(true); | ||||
|       radarToolboxDockVisible_.SetDefault(true); | ||||
|       mainUIState_.SetDefault(""); | ||||
|    } | ||||
| 
 | ||||
|  | @ -30,7 +29,6 @@ public: | |||
|    SettingsVariable<bool> level3ProductsExpanded_ {"level3_products_expanded"}; | ||||
|    SettingsVariable<bool> mapSettingsExpanded_ {"map_settings_expanded"}; | ||||
|    SettingsVariable<bool> timelineExpanded_ {"timeline_expanded"}; | ||||
|    SettingsVariable<bool> radarToolboxDockVisible_ {"radar_toolbox_dock_visible"}; | ||||
|    SettingsVariable<std::string> mainUIState_ {"main_ui_state"}; | ||||
| }; | ||||
| 
 | ||||
|  | @ -42,7 +40,6 @@ UiSettings::UiSettings() : | |||
|                       &p->level3ProductsExpanded_, | ||||
|                       &p->mapSettingsExpanded_, | ||||
|                       &p->timelineExpanded_, | ||||
|                       &p->radarToolboxDockVisible_, | ||||
|                       &p->mainUIState_}); | ||||
|    SetDefaults(); | ||||
| } | ||||
|  | @ -76,18 +73,11 @@ SettingsVariable<bool>& UiSettings::timeline_expanded() const | |||
|    return p->timelineExpanded_; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| SettingsVariable<bool>& UiSettings::radar_toolbox_dock_visible() const | ||||
| { | ||||
|    return p->radarToolboxDockVisible_; | ||||
| } | ||||
| 
 | ||||
| SettingsVariable<std::string>& UiSettings::main_ui_state() const | ||||
| { | ||||
|    return p->mainUIState_; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| bool UiSettings::Shutdown() | ||||
| { | ||||
|    bool dataChanged = false; | ||||
|  | @ -98,7 +88,6 @@ bool UiSettings::Shutdown() | |||
|    dataChanged |= p->level3ProductsExpanded_.Commit(); | ||||
|    dataChanged |= p->mapSettingsExpanded_.Commit(); | ||||
|    dataChanged |= p->timelineExpanded_.Commit(); | ||||
|    dataChanged |= p->radarToolboxDockVisible_.Commit(); | ||||
|    dataChanged |= p->mainUIState_.Commit(); | ||||
| 
 | ||||
|    return dataChanged; | ||||
|  | @ -117,7 +106,6 @@ bool operator==(const UiSettings& lhs, const UiSettings& rhs) | |||
|            lhs.p->level3ProductsExpanded_ == rhs.p->level3ProductsExpanded_ && | ||||
|            lhs.p->mapSettingsExpanded_ == rhs.p->mapSettingsExpanded_ && | ||||
|            lhs.p->timelineExpanded_ == rhs.p->timelineExpanded_ && | ||||
|            lhs.p->radarToolboxDockVisible_ == rhs.p->radarToolboxDockVisible_ && | ||||
|            lhs.p->mainUIState_ == rhs.p->mainUIState_); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,7 +32,6 @@ public: | |||
|    SettingsVariable<bool>& level3_products_expanded() const; | ||||
|    SettingsVariable<bool>& map_settings_expanded() const; | ||||
|    SettingsVariable<bool>& timeline_expanded() const; | ||||
|    SettingsVariable<bool>& radar_toolbox_dock_visible() const; | ||||
|    SettingsVariable<std::string>& main_ui_state() const; | ||||
| 
 | ||||
|    bool Shutdown(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak