Qt: Reorder settings categories

This commit is contained in:
Connor McLaughlin 2020-01-24 14:50:51 +10:00
parent 8d4d8e44e4
commit 1cdd4e01fb
5 changed files with 20 additions and 16 deletions

View File

@ -280,8 +280,12 @@ void MainWindow::connectSignals()
connect(m_ui.actionExit, &QAction::triggered, this, &MainWindow::onExitActionTriggered); connect(m_ui.actionExit, &QAction::triggered, this, &MainWindow::onExitActionTriggered);
connect(m_ui.actionFullscreen, &QAction::triggered, this, &MainWindow::toggleFullscreen); connect(m_ui.actionFullscreen, &QAction::triggered, this, &MainWindow::toggleFullscreen);
connect(m_ui.actionSettings, &QAction::triggered, [this]() { doSettings(SettingsDialog::Category::Count); }); connect(m_ui.actionSettings, &QAction::triggered, [this]() { doSettings(SettingsDialog::Category::Count); });
connect(m_ui.actionConsoleSettings, &QAction::triggered,
[this]() { doSettings(SettingsDialog::Category::ConsoleSettings); });
connect(m_ui.actionGameListSettings, &QAction::triggered, connect(m_ui.actionGameListSettings, &QAction::triggered,
[this]() { doSettings(SettingsDialog::Category::GameListSettings); }); [this]() { doSettings(SettingsDialog::Category::GameListSettings); });
connect(m_ui.actionHotkeySettings, &QAction::triggered,
[this]() { doSettings(SettingsDialog::Category::HotkeySettings); });
connect(m_ui.actionPortSettings, &QAction::triggered, connect(m_ui.actionPortSettings, &QAction::triggered,
[this]() { doSettings(SettingsDialog::Category::PortSettings); }); [this]() { doSettings(SettingsDialog::Category::PortSettings); });
connect(m_ui.actionGPUSettings, &QAction::triggered, [this]() { doSettings(SettingsDialog::Category::GPUSettings); }); connect(m_ui.actionGPUSettings, &QAction::triggered, [this]() { doSettings(SettingsDialog::Category::GPUSettings); });

View File

@ -85,9 +85,9 @@
</property> </property>
<addaction name="actionFullscreen"/> <addaction name="actionFullscreen"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionConsoleSettings"/>
<addaction name="actionGameListSettings"/> <addaction name="actionGameListSettings"/>
<addaction name="actionHotkeySettings"/> <addaction name="actionHotkeySettings"/>
<addaction name="actionConsoleSettings"/>
<addaction name="actionPortSettings"/> <addaction name="actionPortSettings"/>
<addaction name="actionGPUSettings"/> <addaction name="actionGPUSettings"/>
<addaction name="actionAudioSettings"/> <addaction name="actionAudioSettings"/>

View File

@ -12,16 +12,16 @@ SettingsDialog::SettingsDialog(QtHostInterface* host_interface, QWidget* parent
{ {
m_ui.setupUi(this); m_ui.setupUi(this);
m_console_settings = new ConsoleSettingsWidget(host_interface, m_ui.settingsContainer);
m_game_list_settings = new GameListSettingsWidget(host_interface, m_ui.settingsContainer); m_game_list_settings = new GameListSettingsWidget(host_interface, m_ui.settingsContainer);
m_hotkey_settings = new HotkeySettingsWidget(host_interface, m_ui.settingsContainer); m_hotkey_settings = new HotkeySettingsWidget(host_interface, m_ui.settingsContainer);
m_console_settings = new ConsoleSettingsWidget(host_interface, m_ui.settingsContainer);
m_port_settings = new PortSettingsWidget(host_interface, m_ui.settingsContainer); m_port_settings = new PortSettingsWidget(host_interface, m_ui.settingsContainer);
m_gpu_settings = new GPUSettingsWidget(host_interface, m_ui.settingsContainer); m_gpu_settings = new GPUSettingsWidget(host_interface, m_ui.settingsContainer);
m_audio_settings = new QWidget(m_ui.settingsContainer); m_audio_settings = new QWidget(m_ui.settingsContainer);
m_ui.settingsContainer->insertWidget(0, m_game_list_settings); m_ui.settingsContainer->insertWidget(0, m_console_settings);
m_ui.settingsContainer->insertWidget(1, m_hotkey_settings); m_ui.settingsContainer->insertWidget(1, m_game_list_settings);
m_ui.settingsContainer->insertWidget(2, m_console_settings); m_ui.settingsContainer->insertWidget(2, m_hotkey_settings);
m_ui.settingsContainer->insertWidget(3, m_port_settings); m_ui.settingsContainer->insertWidget(3, m_port_settings);
m_ui.settingsContainer->insertWidget(4, m_gpu_settings); m_ui.settingsContainer->insertWidget(4, m_gpu_settings);
m_ui.settingsContainer->insertWidget(5, m_audio_settings); m_ui.settingsContainer->insertWidget(5, m_audio_settings);

View File

@ -18,9 +18,9 @@ class SettingsDialog : public QDialog
public: public:
enum class Category enum class Category
{ {
ConsoleSettings,
GameListSettings, GameListSettings,
HotkeySettings, HotkeySettings,
ConsoleSettings,
PortSettings, PortSettings,
GPUSettings, GPUSettings,
AudioSettings, AudioSettings,
@ -41,9 +41,9 @@ private:
QtHostInterface* m_host_interface; QtHostInterface* m_host_interface;
ConsoleSettingsWidget* m_console_settings = nullptr;
GameListSettingsWidget* m_game_list_settings = nullptr; GameListSettingsWidget* m_game_list_settings = nullptr;
HotkeySettingsWidget* m_hotkey_settings = nullptr; HotkeySettingsWidget* m_hotkey_settings = nullptr;
ConsoleSettingsWidget* m_console_settings = nullptr;
PortSettingsWidget* m_port_settings = nullptr; PortSettingsWidget* m_port_settings = nullptr;
GPUSettingsWidget* m_gpu_settings = nullptr; GPUSettingsWidget* m_gpu_settings = nullptr;
QWidget* m_audio_settings = nullptr; QWidget* m_audio_settings = nullptr;

View File

@ -40,6 +40,15 @@
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<item>
<property name="text">
<string>Console Settings</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/utilities-system-monitor.png</normaloff>:/icons/utilities-system-monitor.png</iconset>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>Game List Settings</string> <string>Game List Settings</string>
@ -58,15 +67,6 @@
<normaloff>:/icons/applications-other.png</normaloff>:/icons/applications-other.png</iconset> <normaloff>:/icons/applications-other.png</normaloff>:/icons/applications-other.png</iconset>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Console Settings</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/utilities-system-monitor.png</normaloff>:/icons/utilities-system-monitor.png</iconset>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>Port Settings</string> <string>Port Settings</string>