mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Make remember username/password checkboxes functional again
This commit is contained in:
parent
221fda6e95
commit
0b5d6ee182
3 changed files with 27 additions and 4 deletions
|
@ -95,12 +95,18 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window
|
||||||
//lobbyServerURL->setText(savedLobbyURL);
|
//lobbyServerURL->setText(savedLobbyURL);
|
||||||
loginBoxLayout->addRow("Lobby URL", lobbyServerURL);
|
loginBoxLayout->addRow("Lobby URL", lobbyServerURL);
|
||||||
|
|
||||||
auto rememberUsernameBox = new QCheckBox();
|
rememberUsernameBox = new QCheckBox();
|
||||||
//rememberUsernameBox->setChecked(shouldRememberUsername);
|
connect(rememberUsernameBox, &QCheckBox::stateChanged, [=](int) {
|
||||||
|
getCurrentProfile().rememberUsername = rememberUsernameBox->isChecked();
|
||||||
|
this->window.saveSettings();
|
||||||
|
});
|
||||||
loginBoxLayout->addRow("Remember Username?", rememberUsernameBox);
|
loginBoxLayout->addRow("Remember Username?", rememberUsernameBox);
|
||||||
|
|
||||||
auto rememberPasswordBox = new QCheckBox();
|
rememberPasswordBox = new QCheckBox();
|
||||||
//rememberPasswordBox->setChecked(shouldRememberPassword);
|
connect(rememberPasswordBox, &QCheckBox::stateChanged, [=](int) {
|
||||||
|
getCurrentProfile().rememberPassword = rememberPasswordBox->isChecked();
|
||||||
|
this->window.saveSettings();
|
||||||
|
});
|
||||||
loginBoxLayout->addRow("Remember Password?", rememberPasswordBox);
|
loginBoxLayout->addRow("Remember Password?", rememberPasswordBox);
|
||||||
|
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
|
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
|
||||||
|
@ -244,6 +250,8 @@ void SettingsWindow::reloadControls() {
|
||||||
ProfileSettings& profile = window.getProfile(profileWidget->currentRow());
|
ProfileSettings& profile = window.getProfile(profileWidget->currentRow());
|
||||||
nameEdit->setText(profile.name);
|
nameEdit->setText(profile.name);
|
||||||
directXCombo->setCurrentIndex(profile.useDX9 ? 1 : 0);
|
directXCombo->setCurrentIndex(profile.useDX9 ? 1 : 0);
|
||||||
|
rememberUsernameBox->setChecked(profile.rememberUsername);
|
||||||
|
rememberPasswordBox->setChecked(profile.rememberPassword);
|
||||||
|
|
||||||
currentlyReloadingControls = false;
|
currentlyReloadingControls = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QCheckBox>
|
||||||
|
|
||||||
class LauncherWindow;
|
class LauncherWindow;
|
||||||
struct ProfileSettings;
|
struct ProfileSettings;
|
||||||
|
@ -23,6 +24,7 @@ private:
|
||||||
|
|
||||||
QLineEdit* nameEdit = nullptr;
|
QLineEdit* nameEdit = nullptr;
|
||||||
QComboBox* directXCombo = nullptr;
|
QComboBox* directXCombo = nullptr;
|
||||||
|
QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr;
|
||||||
|
|
||||||
bool currentlyReloadingControls = false;
|
bool currentlyReloadingControls = false;
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,9 @@ 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.rememberUsername = settings.value("rememberUsername", false).toBool();
|
||||||
|
profile.rememberPassword = settings.value("rememberPassword", false).toBool();
|
||||||
|
|
||||||
profile.useDX9 = settings.value("useDX9", false).toBool();
|
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();
|
||||||
|
@ -262,6 +265,10 @@ LauncherWindow::LauncherWindow(QWidget* parent) :
|
||||||
layout->addRow("Username", usernameEdit);
|
layout->addRow("Username", usernameEdit);
|
||||||
|
|
||||||
rememberUsernameBox = new QCheckBox();
|
rememberUsernameBox = new QCheckBox();
|
||||||
|
connect(rememberUsernameBox, &QCheckBox::stateChanged, [=](int) {
|
||||||
|
currentProfile().rememberUsername = rememberUsernameBox->isChecked();
|
||||||
|
saveSettings();
|
||||||
|
});
|
||||||
layout->addRow("Remember Username?", rememberUsernameBox);
|
layout->addRow("Remember Username?", rememberUsernameBox);
|
||||||
|
|
||||||
passwordEdit = new QLineEdit();
|
passwordEdit = new QLineEdit();
|
||||||
|
@ -269,6 +276,10 @@ LauncherWindow::LauncherWindow(QWidget* parent) :
|
||||||
layout->addRow("Password", passwordEdit);
|
layout->addRow("Password", passwordEdit);
|
||||||
|
|
||||||
rememberPasswordBox = new QCheckBox();
|
rememberPasswordBox = new QCheckBox();
|
||||||
|
connect(rememberPasswordBox, &QCheckBox::stateChanged, [=](int) {
|
||||||
|
currentProfile().rememberPassword = rememberPasswordBox->isChecked();
|
||||||
|
saveSettings();
|
||||||
|
});
|
||||||
layout->addRow("Remember Password?", rememberPasswordBox);
|
layout->addRow("Remember Password?", rememberPasswordBox);
|
||||||
|
|
||||||
otpEdit = new QLineEdit();
|
otpEdit = new QLineEdit();
|
||||||
|
@ -370,6 +381,8 @@ void LauncherWindow::saveSettings() {
|
||||||
settings.beginGroup(profile.name);
|
settings.beginGroup(profile.name);
|
||||||
|
|
||||||
settings.setValue("useDX9", profile.useDX9);
|
settings.setValue("useDX9", profile.useDX9);
|
||||||
|
settings.setValue("rememberUsername", profile.rememberUsername);
|
||||||
|
settings.setValue("rememberPassword", profile.rememberPassword);
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue