mirror of
https://github.com/redstrate/Astra.git
synced 2025-06-08 15:07:45 +00:00
Implement saving profile settings
This commit is contained in:
parent
48c4bd10c4
commit
30fed295e4
3 changed files with 14 additions and 0 deletions
|
@ -39,6 +39,7 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window
|
||||||
getCurrentProfile().name = nameEdit->text();
|
getCurrentProfile().name = nameEdit->text();
|
||||||
|
|
||||||
reloadControls();
|
reloadControls();
|
||||||
|
this->window.saveSettings();
|
||||||
});
|
});
|
||||||
mainLayout->addWidget(nameEdit, 2, 0);
|
mainLayout->addWidget(nameEdit, 2, 0);
|
||||||
|
|
||||||
|
@ -55,6 +56,7 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window
|
||||||
|
|
||||||
connect(directXCombo, &QComboBox::currentIndexChanged, [=](int index) {
|
connect(directXCombo, &QComboBox::currentIndexChanged, [=](int index) {
|
||||||
getCurrentProfile().useDX9 = directXCombo->currentIndex() == 1;
|
getCurrentProfile().useDX9 = directXCombo->currentIndex() == 1;
|
||||||
|
this->window.saveSettings();
|
||||||
});
|
});
|
||||||
|
|
||||||
auto currentGameDirectory = new QLabel(window.currentProfile().gamePath);
|
auto currentGameDirectory = new QLabel(window.currentProfile().gamePath);
|
||||||
|
|
|
@ -185,6 +185,7 @@ void LauncherWindow::readInitialInformation() {
|
||||||
profile.bootVersion = readVersion(profile.gamePath + "/boot/ffxivboot.ver");
|
profile.bootVersion = readVersion(profile.gamePath + "/boot/ffxivboot.ver");
|
||||||
profile.gameVersion = readVersion(profile.gamePath + "/game/ffxivgame.ver");
|
profile.gameVersion = readVersion(profile.gamePath + "/game/ffxivgame.ver");
|
||||||
|
|
||||||
|
profile.useDX9 = settings.value("useDX9", false).toBool();
|
||||||
profile.useEsync = settings.value("useEsync", false).toBool();
|
profile.useEsync = settings.value("useEsync", false).toBool();
|
||||||
profile.useGamemode = settings.value("useGamemode", false).toBool();
|
profile.useGamemode = settings.value("useGamemode", false).toBool();
|
||||||
profile.useGamescope = settings.value("useGamescope", false).toBool();
|
profile.useGamescope = settings.value("useGamescope", false).toBool();
|
||||||
|
@ -397,3 +398,13 @@ int LauncherWindow::addProfile() {
|
||||||
|
|
||||||
return profileSettings.size() - 1;
|
return profileSettings.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LauncherWindow::saveSettings() {
|
||||||
|
for(auto profile : profileSettings) {
|
||||||
|
settings.beginGroup(profile.name);
|
||||||
|
|
||||||
|
settings.setValue("useDX9", profile.useDX9);
|
||||||
|
|
||||||
|
settings.endGroup();
|
||||||
|
}
|
||||||
|
}
|
|
@ -64,6 +64,7 @@ public:
|
||||||
void setSSL(QNetworkRequest& request);
|
void setSSL(QNetworkRequest& request);
|
||||||
QString readVersion(QString path);
|
QString readVersion(QString path);
|
||||||
void readInitialInformation();
|
void readInitialInformation();
|
||||||
|
void saveSettings();
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue