refs #799, overview page in settings component

This commit is contained in:
Klaus Basan
2016-11-09 20:18:03 +01:00
parent 82995ab690
commit 874f477611
3 changed files with 107 additions and 5 deletions

View File

@@ -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

View File

@@ -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::CSettingsComponent> ui;
};

View File

@@ -22,6 +22,76 @@
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tb_SettingsOverview">
<attribute name="title">
<string>Overview</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pb_Servers">
<property name="text">
<string>Servers</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pb_Network">
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="pb_Audio">
<property name="text">
<string>Audio</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pb_Simulator">
<property name="text">
<string>Simulator</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pb_SimulatorBasics">
<property name="text">
<string>Simulator (basics)</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="pb_SimulatorMessages">
<property name="text">
<string>Simulator (messages)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pb_Gui">
<property name="text">
<string>GUI</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pb_Hotkeys">
<property name="text">
<string>Hotkeys</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="pb_Advanced">
<property name="text">
<string>Advanced</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tb_SettingsTrafficNetworkServers">
<attribute name="title">
<string>Servers</string>
@@ -168,7 +238,7 @@
</widget>
<widget class="QWidget" name="tb_SettingsSimulatorBasics">
<attribute name="title">
<string>Simulator (Basics)</string>
<string>Simulator (basics)</string>
</attribute>
<layout class="QVBoxLayout" name="vl_SettingsSimulatorBascis">
<property name="spacing">