10 #include <QToolButton>
13 #include "ui_settingscomponent.h"
20 using namespace swift::misc::network;
21 using namespace swift::misc::aviation;
22 using namespace swift::misc::audio;
23 using namespace swift::misc::physical_quantities;
24 using namespace swift::misc::input;
25 using namespace swift::misc::simulation;
26 using namespace swift::misc::simulation::settings;
29 using namespace swift::config;
33 CSettingsComponent::CSettingsComponent(QWidget *parent) : QTabWidget(parent), ui(new Ui::
CSettingsComponent)
37 this->tabBar()->setExpanding(
false);
38 this->tabBar()->setUsesScrollButtons(
true);
39 this->setCurrentIndex(0);
40 ui->comp_DataLoadOverview->showVisibleDbRefreshButtons(CBuildConfig::isDebugBuild() ||
42 ui->comp_DataLoadOverview->showVisibleLoadAllButtons(
false,
false,
false);
46 connect(ui->pb_Advanced, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
47 connect(ui->pb_Audio, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
48 connect(ui->pb_Gui, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
49 connect(ui->pb_Hotkeys, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
50 connect(ui->pb_Network, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
51 connect(ui->pb_Servers, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
52 connect(ui->pb_Simulator, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
53 connect(ui->pb_SimulatorBasics, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
54 connect(ui->pb_SimulatorMessages, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
55 connect(ui->pb_Matching, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
56 connect(ui->pb_DataLoadAndCaches, &QPushButton::released,
this, &CSettingsComponent::onOverviewButtonClicked);
64 return ui->comp_SettingsSimulatorBasics->getSimulatorSettings(simulator);
69 this->setCurrentIndex(
static_cast<int>(tab));
76 void CSettingsComponent::onOverviewButtonClicked()
78 const QObject *sender = QObject::sender();
79 if (sender == ui->pb_Advanced)
81 this->setCurrentIndex(SettingTabAdvanced);
84 if (sender == ui->pb_Audio)
86 this->setCurrentIndex(SettingTabAudio);
89 if (sender == ui->pb_Gui)
91 this->setCurrentIndex(SettingTabGui);
94 if (sender == ui->pb_Hotkeys)
96 this->setCurrentIndex(SettingTabHotkeys);
99 if (sender == ui->pb_Network)
101 this->setCurrentIndex(SettingTabNetwork);
104 if (sender == ui->pb_Servers)
106 this->setCurrentIndex(SettingTabServers);
109 if (sender == ui->pb_Simulator)
111 this->setCurrentIndex(SettingTabSimulator);
114 if (sender == ui->pb_SimulatorBasics)
116 this->setCurrentIndex(SettingTabSimulatorBasics);
119 if (sender == ui->pb_DataLoadAndCaches)
121 this->setCurrentIndex(SettingTabDataAndCaches);
124 if (sender == ui->pb_SimulatorMessages)
126 this->setCurrentIndex(SettingTabSimulatorMessages);
129 if (sender == ui->pb_Matching)
131 this->setCurrentIndex(SettingTabMatching);
134 this->setCurrentIndex(SettingTabOverview);
bool isDeveloperFlagSet() const
Running with dev.flag?
swift::misc::simulation::settings::CSpecializedSimulatorSettings getSimulatorSettings(const swift::misc::simulation::CSimulatorInfo &simulator) const
Settings for given simulator.
void setSettingsOverviewTab()
Set the overview tab.
void setGuiOpacity(double value)
GUI Opacity 0-100%.
~CSettingsComponent()
Destructor.
void setTab(SettingTab tab)
Set the tab.
void changedWindowsOpacity(int opacity)
Change the windows opacity 0..100.
void changedWindowsOpacity(int opacity)
Change the windows opacity 0..100.
Simple hardcoded info about the corresponding simulator.
Allows to have specific utility functions for each simulator.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Backend services of the swift project, like dealing with the network or the simulators.
High level reusable GUI components.
Free functions in swift::misc.