diff --git a/src/blackgui/components/settingscomponent.cpp b/src/blackgui/components/settingscomponent.cpp index e2aa2556e..f61a77c91 100644 --- a/src/blackgui/components/settingscomponent.cpp +++ b/src/blackgui/components/settingscomponent.cpp @@ -51,6 +51,15 @@ namespace BlackGui this->connect(ui->hs_SettingsGuiUserRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedUsersUpdateInterval); this->connect(ui->comp_SettingsGuiGeneral, &CSettingsGuiComponent::changedWindowsOpacity, this, &CSettingsComponent::changedWindowsOpacity); + connect(ui->pb_Advanced, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_Audio, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_Gui, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_Hotkeys, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_Network, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_Servers, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_Simulator, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_SimulatorBasics, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); + connect(ui->pb_SimulatorMessages, &QPushButton::released, this, &CSettingsComponent::ps_overviewButtonClicked); } CSettingsComponent::~CSettingsComponent() @@ -85,5 +94,20 @@ namespace BlackGui { ui->comp_SettingsGuiGeneral->setGuiOpacity(value); } + + void CSettingsComponent::ps_overviewButtonClicked() + { + const QObject *sender = QObject::sender(); + if (sender == ui->pb_Advanced) { this->setCurrentIndex(SettingTabAdvanced); return; } + if (sender == ui->pb_Audio) { this->setCurrentIndex(SettingTabAudio); return; } + if (sender == ui->pb_Gui) { this->setCurrentIndex(SettingTabGui); return; } + if (sender == ui->pb_Hotkeys) { this->setCurrentIndex(SettingTabHotkeys); return; } + if (sender == ui->pb_Network) { this->setCurrentIndex(SettingTabNetwork); return; } + if (sender == ui->pb_Servers) { this->setCurrentIndex(SettingTabServers); return; } + if (sender == ui->pb_Simulator) { this->setCurrentIndex(SettingTabSimulator); return; } + if (sender == ui->pb_SimulatorBasics) { this->setCurrentIndex(SettingTabSimulatorBasics); return; } + if (sender == ui->pb_SimulatorMessages) { this->setCurrentIndex(SettingTabSimulatorMessages); return; } + this->setCurrentIndex(SettingTabOverview); + } } } // namespace diff --git a/src/blackgui/components/settingscomponent.h b/src/blackgui/components/settingscomponent.h index 8fcb9a074..7b29955f3 100644 --- a/src/blackgui/components/settingscomponent.h +++ b/src/blackgui/components/settingscomponent.h @@ -33,15 +33,19 @@ namespace BlackGui public: //! Tabs + //! \remark needs to be in sync with tab order enum SettingTab { - SettingTabNetworkServers = 0, + SettingTabOverview = 0, + SettingTabServers, SettingTabNetwork, - SettingTabAircraftAudio, + SettingTabAudio, SettingTabSimulator, - SettingTabSimulatorBascis, + SettingTabSimulatorBasics, + SettingTabSimulatorMessages, SettingTabGui, - SettingTabHotkeys + SettingTabHotkeys, + SettingTabAdvanced }; //! Constructor @@ -82,6 +86,10 @@ namespace BlackGui //! GUI Opacity 0-100% void setGuiOpacity(double value); + private slots: + //! An overview button was clicked + void ps_overviewButtonClicked(); + private: QScopedPointer ui; }; diff --git a/src/blackgui/components/settingscomponent.ui b/src/blackgui/components/settingscomponent.ui index d7ea7f6c2..e4062cbb0 100644 --- a/src/blackgui/components/settingscomponent.ui +++ b/src/blackgui/components/settingscomponent.ui @@ -22,6 +22,76 @@ 0 + + + Overview + + + + + + Servers + + + + + + + Network + + + + + + + Audio + + + + + + + Simulator + + + + + + + Simulator (basics) + + + + + + + Simulator (messages) + + + + + + + GUI + + + + + + + Hotkeys + + + + + + + Advanced + + + + + Servers @@ -168,7 +238,7 @@ - Simulator (Basics) + Simulator (basics)