mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 20:27:45 +00:00
Add a dedicated "Configure Profiles" menu item
This commit is contained in:
parent
1acd3e5a8f
commit
0b3f438819
3 changed files with 15 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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, [=] {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue