From 0b3f4388197d0e18cb2d20fed3fc296836da288b Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 9 Mar 2022 08:08:03 -0500 Subject: [PATCH] Add a dedicated "Configure Profiles" menu item --- include/settingswindow.h | 2 +- src/launcherwindow.cpp | 12 +++++++++++- src/settingswindow.cpp | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/settingswindow.h b/include/settingswindow.h index 1679e32..f5385e3 100644 --- a/include/settingswindow.h +++ b/include/settingswindow.h @@ -14,7 +14,7 @@ struct ProfileSettings; class SettingsWindow : public QDialog { public: - SettingsWindow(LauncherWindow& window, LauncherCore& core, QWidget* parent = nullptr); + SettingsWindow(int defaultTab, LauncherWindow& window, LauncherCore& core, QWidget* parent = nullptr); public slots: void reloadControls(); diff --git a/src/launcherwindow.cpp b/src/launcherwindow.cpp index 1044f59..f5b9551 100644 --- a/src/launcherwindow.cpp +++ b/src/launcherwindow.cpp @@ -50,12 +50,22 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo QAction* settingsAction = fileMenu->addAction("Configure Astra..."); settingsAction->setIcon(QIcon::fromTheme("settings")); connect(settingsAction, &QAction::triggered, [=] { - auto window = new SettingsWindow(*this, this->core, this); + auto window = new SettingsWindow(0, *this, this->core, this); + connect(&this->core, &LauncherCore::settingsChanged, window, &SettingsWindow::reloadControls); + window->show(); + }); + + QAction* profilesAction = fileMenu->addAction("Configure Profiles..."); + profilesAction->setIcon(QIcon::fromTheme("settings")); + connect(profilesAction, &QAction::triggered, [=] { + auto window = new SettingsWindow(1, *this, this->core, this); connect(&this->core, &LauncherCore::settingsChanged, window, &SettingsWindow::reloadControls); window->show(); }); #if defined(Q_OS_MAC) || defined(Q_OS_LINUX) + fileMenu->addSeparator(); + QAction* wineCfg = fileMenu->addAction("Configure Wine..."); wineCfg->setIcon(QIcon::fromTheme("settings")); connect(wineCfg, &QAction::triggered, [=] { diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index f7e8285..a676445 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -16,7 +16,7 @@ #include "launcherwindow.h" #include "gamescopesettingswindow.h" -SettingsWindow::SettingsWindow(LauncherWindow& window, LauncherCore& core, QWidget* parent) : core(core), window(window), QDialog(parent) { +SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherCore& core, QWidget* parent) : core(core), window(window), QDialog(parent) { setWindowTitle("Settings"); setWindowModality(Qt::WindowModality::ApplicationModal); @@ -377,6 +377,8 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, LauncherCore& core, QWidg dalamudBoxLayout->addRow("Dalamud Asset Version", dalamudAssetVersionLabel); } + tabWidget->setCurrentIndex(defaultTab); + reloadControls(); }