1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 03:37:47 +00:00

Use KConfig's own class instead of "proxying" it with LauncherSettings

This will make it trivial to add more settings in the future.
This commit is contained in:
Joshua Goins 2025-03-17 18:03:10 -04:00
parent 7095eeef3f
commit 799b718818
16 changed files with 117 additions and 458 deletions

View file

@ -47,7 +47,6 @@ target_sources(astra_static PRIVATE
include/gameinstaller.h include/gameinstaller.h
include/headline.h include/headline.h
include/launchercore.h include/launchercore.h
include/launchersettings.h
include/patcher.h include/patcher.h
include/processlogger.h include/processlogger.h
include/sapphirelogin.h include/sapphirelogin.h
@ -64,7 +63,6 @@ target_sources(astra_static PRIVATE
src/headline.cpp src/headline.cpp
src/gameinstaller.cpp src/gameinstaller.cpp
src/launchercore.cpp src/launchercore.cpp
src/launchersettings.cpp
src/account.cpp src/account.cpp
src/processwatcher.cpp src/processwatcher.cpp
src/profilemanager.cpp src/profilemanager.cpp
@ -92,9 +90,9 @@ target_link_libraries(astra_static PUBLIC
QCoro::Core QCoro::Core
QCoro::Network QCoro::Network
QCoro::Qml) QCoro::Qml)
kconfig_target_kcfg_file(astra_static FILE config.kcfg CLASS_NAME Config MUTATORS GENERATE_PROPERTIES GENERATE_MOC DEFAULT_VALUE_GETTERS PARENT_IN_CONSTRUCTOR) kconfig_target_kcfg_file(astra_static FILE config.kcfg CLASS_NAME Config MUTATORS GENERATE_PROPERTIES GENERATE_MOC DEFAULT_VALUE_GETTERS PARENT_IN_CONSTRUCTOR QML_REGISTRATION QML_UNCREATABLE)
kconfig_target_kcfg_file(astra_static FILE accountconfig.kcfg CLASS_NAME AccountConfig MUTATORS GENERATE_PROPERTIES GENERATE_MOC DEFAULT_VALUE_GETTERS PARENT_IN_CONSTRUCTOR) kconfig_target_kcfg_file(astra_static FILE accountconfig.kcfg CLASS_NAME AccountConfig MUTATORS GENERATE_PROPERTIES GENERATE_MOC DEFAULT_VALUE_GETTERS PARENT_IN_CONSTRUCTOR QML_REGISTRATION QML_UNCREATABLE)
kconfig_target_kcfg_file(astra_static FILE profileconfig.kcfg CLASS_NAME ProfileConfig MUTATORS GENERATE_PROPERTIES GENERATE_MOC DEFAULT_VALUE_GETTERS PARENT_IN_CONSTRUCTOR) kconfig_target_kcfg_file(astra_static FILE profileconfig.kcfg CLASS_NAME ProfileConfig MUTATORS GENERATE_PROPERTIES GENERATE_MOC DEFAULT_VALUE_GETTERS PARENT_IN_CONSTRUCTOR QML_REGISTRATION QML_UNCREATABLE)
target_include_directories(astra_static PUBLIC include ${CMAKE_BINARY_DIR}) target_include_directories(astra_static PUBLIC include ${CMAKE_BINARY_DIR})
if (NOT MSVC) if (NOT MSVC)

View file

@ -8,8 +8,8 @@
#include <qcorotask.h> #include <qcorotask.h>
#include "accountmanager.h" #include "accountmanager.h"
#include "config.h"
#include "headline.h" #include "headline.h"
#include "launchersettings.h"
#include "profile.h" #include "profile.h"
#include "profilemanager.h" #include "profilemanager.h"
#include "steamapi.h" #include "steamapi.h"
@ -63,7 +63,7 @@ class LauncherCore : public QObject
Q_PROPERTY(bool isSteam READ isSteam CONSTANT) Q_PROPERTY(bool isSteam READ isSteam CONSTANT)
Q_PROPERTY(bool isSteamDeck READ isSteamDeck CONSTANT) Q_PROPERTY(bool isSteamDeck READ isSteamDeck CONSTANT)
Q_PROPERTY(bool isWindows READ isWindows CONSTANT) Q_PROPERTY(bool isWindows READ isWindows CONSTANT)
Q_PROPERTY(LauncherSettings *settings READ settings CONSTANT) Q_PROPERTY(Config *config READ config CONSTANT)
Q_PROPERTY(ProfileManager *profileManager READ profileManager CONSTANT) Q_PROPERTY(ProfileManager *profileManager READ profileManager CONSTANT)
Q_PROPERTY(AccountManager *accountManager READ accountManager CONSTANT) Q_PROPERTY(AccountManager *accountManager READ accountManager CONSTANT)
Q_PROPERTY(Headline *headline READ headline NOTIFY newsChanged) Q_PROPERTY(Headline *headline READ headline NOTIFY newsChanged)
@ -77,6 +77,7 @@ class LauncherCore : public QObject
public: public:
LauncherCore(); LauncherCore();
~LauncherCore() override;
/// Initializes the Steamworks API. /// Initializes the Steamworks API.
void initializeSteam(); void initializeSteam();
@ -128,7 +129,7 @@ public:
[[nodiscard]] Q_INVOKABLE bool supportsSync() const; [[nodiscard]] Q_INVOKABLE bool supportsSync() const;
[[nodiscard]] QNetworkAccessManager *mgr(); [[nodiscard]] QNetworkAccessManager *mgr();
[[nodiscard]] LauncherSettings *settings(); [[nodiscard]] Config *config() const;
[[nodiscard]] ProfileManager *profileManager(); [[nodiscard]] ProfileManager *profileManager();
[[nodiscard]] AccountManager *accountManager(); [[nodiscard]] AccountManager *accountManager();
[[nodiscard]] Headline *headline() const; [[nodiscard]] Headline *headline() const;
@ -175,6 +176,8 @@ private:
/// Tell the system we can allow the screen to turn off /// Tell the system we can allow the screen to turn off
void uninhibitSleep(); void uninhibitSleep();
QString currentProfileId() const;
SteamAPI *m_steamApi = nullptr; SteamAPI *m_steamApi = nullptr;
bool m_loadingFinished = false; bool m_loadingFinished = false;
@ -187,7 +190,7 @@ private:
QNetworkAccessManager *m_mgr = nullptr; QNetworkAccessManager *m_mgr = nullptr;
Headline *m_headline = nullptr; Headline *m_headline = nullptr;
LauncherSettings *m_settings = nullptr; Config *m_config = nullptr;
GameRunner *m_runner = nullptr; GameRunner *m_runner = nullptr;
QString m_cachedLogoImage; QString m_cachedLogoImage;

View file

@ -1,105 +0,0 @@
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QtQml>
#include "config.h"
#include "profile.h"
class LauncherSettings : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("Use LauncherCore.settings")
Q_PROPERTY(bool closeWhenLaunched READ closeWhenLaunched WRITE setCloseWhenLaunched NOTIFY closeWhenLaunchedChanged)
Q_PROPERTY(bool showDevTools READ showDevTools WRITE setShowDevTools NOTIFY showDevToolsChanged)
Q_PROPERTY(bool keepPatches READ keepPatches WRITE setKeepPatches NOTIFY keepPatchesChanged)
Q_PROPERTY(QString dalamudDistribServer READ dalamudDistribServer WRITE setDalamudDistribServer NOTIFY dalamudDistribServerChanged)
Q_PROPERTY(QString squareEnixServer READ squareEnixServer WRITE setSquareEnixServer NOTIFY squareEnixServerChanged)
Q_PROPERTY(QString squareEnixLoginServer READ squareEnixLoginServer WRITE setSquareEnixLoginServer NOTIFY squareEnixLoginServerChanged)
Q_PROPERTY(QString mainServer READ mainServer WRITE setMainServer NOTIFY mainServerChanged)
Q_PROPERTY(QString preferredProtocol READ preferredProtocol WRITE setPreferredProtocol NOTIFY preferredProtocolChanged)
Q_PROPERTY(QString screenshotDir READ screenshotDir WRITE setScreenshotDir NOTIFY screenshotDirChanged)
Q_PROPERTY(bool argumentsEncrypted READ argumentsEncrypted WRITE setArgumentsEncrypted NOTIFY encryptedArgumentsChanged)
Q_PROPERTY(bool enableRenderDocCapture READ enableRenderDocCapture WRITE setEnableRenderDocCapture NOTIFY enableRenderDocCaptureChanged)
Q_PROPERTY(bool enableSync READ enableSync WRITE setEnableSync NOTIFY enableSyncChanged)
Q_PROPERTY(QString customGameServer READ customGameServer WRITE setCustomGameServer NOTIFY customGameServerChanged)
Q_PROPERTY(int customGameServerPort READ customGameServerPort WRITE setCustomGameServerPort NOTIFY customGameServerPortChanged)
public:
explicit LauncherSettings(QObject *parent = nullptr);
[[nodiscard]] bool closeWhenLaunched() const;
void setCloseWhenLaunched(bool value);
[[nodiscard]] bool showDevTools() const;
void setShowDevTools(bool value);
[[nodiscard]] bool keepPatches() const;
void setKeepPatches(bool value);
[[nodiscard]] QString dalamudDistribServer() const;
void setDalamudDistribServer(const QString &value);
Q_INVOKABLE QString defaultDalamudDistribServer() const;
[[nodiscard]] QString squareEnixServer() const;
void setSquareEnixServer(const QString &value);
Q_INVOKABLE QString defaultSquareEnixServer() const;
[[nodiscard]] QString squareEnixLoginServer() const;
void setSquareEnixLoginServer(const QString &value);
Q_INVOKABLE QString defaultSquareEnixLoginServer() const;
[[nodiscard]] QString mainServer() const;
void setMainServer(const QString &value);
Q_INVOKABLE QString defaultMainServer() const;
[[nodiscard]] QString preferredProtocol() const;
void setPreferredProtocol(const QString &value);
Q_INVOKABLE QString defaultPreferredProtocol() const;
[[nodiscard]] QString screenshotDir() const;
void setScreenshotDir(const QString &value);
[[nodiscard]] bool argumentsEncrypted() const;
void setArgumentsEncrypted(bool value);
[[nodiscard]] bool enableRenderDocCapture() const;
void setEnableRenderDocCapture(bool value);
[[nodiscard]] QString currentProfile() const;
void setCurrentProfile(const QString &value);
[[nodiscard]] bool enableSync() const;
void setEnableSync(bool enabled);
[[nodiscard]] QString customGameServer() const;
void setCustomGameServer(const QString &value);
[[nodiscard]] int customGameServerPort() const;
void setCustomGameServerPort(int port);
Config *config();
Q_SIGNALS:
void closeWhenLaunchedChanged();
void showDevToolsChanged();
void keepPatchesChanged();
void dalamudDistribServerChanged();
void squareEnixServerChanged();
void squareEnixLoginServerChanged();
void mainServerChanged();
void preferredProtocolChanged();
void screenshotDirChanged();
void encryptedArgumentsChanged();
void enableRenderDocCaptureChanged();
void enableSyncChanged();
void customGameServerChanged();
void customGameServerPortChanged();
private:
Config *m_config = nullptr;
};

View file

@ -399,8 +399,8 @@ QCoro::Task<bool> AssetUpdater::installRuntime()
QUrl AssetUpdater::dalamudVersionManifestUrl() const QUrl AssetUpdater::dalamudVersionManifestUrl() const
{ {
QUrl url; QUrl url;
url.setScheme(launcher.settings()->preferredProtocol()); url.setScheme(launcher.config()->preferredProtocol());
url.setHost(launcher.settings()->dalamudDistribServer()); url.setHost(launcher.config()->dalamudDistribServer());
url.setPath(QStringLiteral("/Dalamud/Release/VersionInfo")); url.setPath(QStringLiteral("/Dalamud/Release/VersionInfo"));
return url; return url;
@ -409,8 +409,8 @@ QUrl AssetUpdater::dalamudVersionManifestUrl() const
QUrl AssetUpdater::dalamudAssetManifestUrl() const QUrl AssetUpdater::dalamudAssetManifestUrl() const
{ {
QUrl url; QUrl url;
url.setScheme(launcher.settings()->preferredProtocol()); url.setScheme(launcher.config()->preferredProtocol());
url.setHost(launcher.settings()->dalamudDistribServer()); url.setHost(launcher.config()->dalamudDistribServer());
url.setPath(QStringLiteral("/Dalamud/Asset/Meta")); url.setPath(QStringLiteral("/Dalamud/Asset/Meta"));
return url; return url;
@ -419,8 +419,8 @@ QUrl AssetUpdater::dalamudAssetManifestUrl() const
QUrl AssetUpdater::dotnetRuntimePackageUrl(const QString &version) const QUrl AssetUpdater::dotnetRuntimePackageUrl(const QString &version) const
{ {
QUrl url; QUrl url;
url.setScheme(launcher.settings()->preferredProtocol()); url.setScheme(launcher.config()->preferredProtocol());
url.setHost(launcher.settings()->dalamudDistribServer()); url.setHost(launcher.config()->dalamudDistribServer());
url.setPath(QStringLiteral("/Dalamud/Release/Runtime/DotNet/%1").arg(version)); url.setPath(QStringLiteral("/Dalamud/Release/Runtime/DotNet/%1").arg(version));
return url; return url;
@ -429,8 +429,8 @@ QUrl AssetUpdater::dotnetRuntimePackageUrl(const QString &version) const
QUrl AssetUpdater::dotnetDesktopPackageUrl(const QString &version) const QUrl AssetUpdater::dotnetDesktopPackageUrl(const QString &version) const
{ {
QUrl url; QUrl url;
url.setScheme(launcher.settings()->preferredProtocol()); url.setScheme(launcher.config()->preferredProtocol());
url.setHost(launcher.settings()->dalamudDistribServer()); url.setHost(launcher.config()->dalamudDistribServer());
url.setPath(QStringLiteral("/Dalamud/Release/Runtime/WindowsDesktop/%1").arg(version)); url.setPath(QStringLiteral("/Dalamud/Release/Runtime/WindowsDesktop/%1").arg(version));
return url; return url;
@ -454,4 +454,4 @@ bool AssetUpdater::extractZip(const QString &filePath, const QString &directory)
return true; return true;
} }
#include "moc_assetupdater.cpp" #include "moc_assetupdater.cpp"

View file

@ -22,7 +22,7 @@ CharacterSync::CharacterSync(Account &account, LauncherCore &launcher, QObject *
QCoro::Task<bool> CharacterSync::sync(const bool initialSync) QCoro::Task<bool> CharacterSync::sync(const bool initialSync)
{ {
if (!launcher.settings()->enableSync()) { if (!launcher.config()->enableSync()) {
co_return true; co_return true;
} }

View file

@ -241,14 +241,14 @@ QString GameRunner::getGameArgs(const Profile &profile, const std::optional<Logi
} }
} }
const QString argFormat = !profile.isBenchmark() && m_launcher.settings()->argumentsEncrypted() ? QStringLiteral(" /%1 =%2") : QStringLiteral(" %1=%2"); const QString argFormat = !profile.isBenchmark() && m_launcher.config()->encryptArguments() ? QStringLiteral(" /%1 =%2") : QStringLiteral(" %1=%2");
QString argJoined; QString argJoined;
for (const auto &[key, value] : gameArgs) { for (const auto &[key, value] : gameArgs) {
argJoined += argFormat.arg(key, value); argJoined += argFormat.arg(key, value);
} }
return !profile.isBenchmark() && m_launcher.settings()->argumentsEncrypted() ? encryptGameArg(argJoined) : argJoined; return !profile.isBenchmark() && m_launcher.config()->encryptArguments() ? encryptGameArg(argJoined) : argJoined;
} }
void GameRunner::launchExecutable(const Profile &profile, QProcess *process, const QStringList &args, bool isGame, bool needsRegistrySetup) void GameRunner::launchExecutable(const Profile &profile, QProcess *process, const QStringList &args, bool isGame, bool needsRegistrySetup)
@ -322,7 +322,7 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
} }
#endif #endif
if (m_launcher.settings()->enableRenderDocCapture()) { if (m_launcher.config()->enableRenderDocCapture()) {
env.insert(QStringLiteral("VK_LAYER_RENDERDOC_Capture"), QStringLiteral("VK_LAYER_RENDERDOC_Capture")); env.insert(QStringLiteral("VK_LAYER_RENDERDOC_Capture"), QStringLiteral("VK_LAYER_RENDERDOC_Capture"));
env.insert(QStringLiteral("ENABLE_VULKAN_RENDERDOC_CAPTURE"), QString::number(1)); env.insert(QStringLiteral("ENABLE_VULKAN_RENDERDOC_CAPTURE"), QString::number(1));
} }

View file

@ -38,7 +38,7 @@ using namespace Qt::StringLiterals;
LauncherCore::LauncherCore() LauncherCore::LauncherCore()
: QObject() : QObject()
{ {
m_settings = new LauncherSettings(this); m_config = new Config(KSharedConfig::openConfig(QStringLiteral("astrarc"), KConfig::SimpleConfig, QStandardPaths::AppConfigLocation), this);
m_mgr = new QNetworkAccessManager(this); m_mgr = new QNetworkAccessManager(this);
m_sapphireLogin = new SapphireLogin(*this, this); m_sapphireLogin = new SapphireLogin(*this, this);
m_squareEnixLogin = new SquareEnixLogin(*this, this); m_squareEnixLogin = new SquareEnixLogin(*this, this);
@ -66,7 +66,7 @@ LauncherCore::LauncherCore()
} }
// set default profile, if found // set default profile, if found
if (const auto profile = m_profileManager->getProfileByUUID(m_settings->currentProfile())) { if (const auto profile = m_profileManager->getProfileByUUID(currentProfileId())) {
setCurrentProfile(profile); setCurrentProfile(profile);
} }
@ -74,6 +74,11 @@ LauncherCore::LauncherCore()
Q_EMIT loadingFinished(); Q_EMIT loadingFinished();
} }
LauncherCore::~LauncherCore()
{
m_config->save();
}
void LauncherCore::initializeSteam() void LauncherCore::initializeSteam()
{ {
m_steamApi = new SteamAPI(this); m_steamApi = new SteamAPI(this);
@ -179,8 +184,8 @@ void LauncherCore::fetchAvatar(Account *account)
qDebug(ASTRA_LOG) << "Did not find lodestone character " << account->lodestoneId() << " in cache, fetching from Lodestone."; qDebug(ASTRA_LOG) << "Did not find lodestone character " << account->lodestoneId() << " in cache, fetching from Lodestone.";
QUrl url; QUrl url;
url.setScheme(settings()->preferredProtocol()); url.setScheme(config()->preferredProtocol());
url.setHost(QStringLiteral("na.%1").arg(settings()->mainServer())); // TODO: NA isnt the only thing in the world... url.setHost(QStringLiteral("na.%1").arg(config()->mainServer())); // TODO: NA isnt the only thing in the world...
url.setPath(QStringLiteral("/lodestone/character/%1").arg(account->lodestoneId())); url.setPath(QStringLiteral("/lodestone/character/%1").arg(account->lodestoneId()));
const QNetworkRequest request(url); const QNetworkRequest request(url);
@ -301,37 +306,40 @@ void LauncherCore::setCurrentProfile(const Profile *profile)
const int newIndex = m_profileManager->getProfileIndex(profile->uuid()); const int newIndex = m_profileManager->getProfileIndex(profile->uuid());
if (newIndex != m_currentProfileIndex) { if (newIndex != m_currentProfileIndex) {
m_currentProfileIndex = newIndex; m_currentProfileIndex = newIndex;
m_settings->setCurrentProfile(profile->uuid());
m_settings->config()->save(); auto stateConfig = KSharedConfig::openStateConfig();
stateConfig->group(QStringLiteral("General")).writeEntry(QStringLiteral("CurrentProfile"), profile->uuid());
stateConfig->sync();
Q_EMIT currentProfileChanged(); Q_EMIT currentProfileChanged();
} }
} }
[[nodiscard]] QString LauncherCore::autoLoginProfileName() const [[nodiscard]] QString LauncherCore::autoLoginProfileName() const
{ {
return m_settings->config()->autoLoginProfile(); return config()->autoLoginProfile();
} }
[[nodiscard]] Profile *LauncherCore::autoLoginProfile() const [[nodiscard]] Profile *LauncherCore::autoLoginProfile() const
{ {
if (m_settings->config()->autoLoginProfile().isEmpty()) { if (config()->autoLoginProfile().isEmpty()) {
return nullptr; return nullptr;
} }
return m_profileManager->getProfileByUUID(m_settings->config()->autoLoginProfile()); return m_profileManager->getProfileByUUID(config()->autoLoginProfile());
} }
void LauncherCore::setAutoLoginProfile(const Profile *profile) void LauncherCore::setAutoLoginProfile(const Profile *profile)
{ {
if (profile != nullptr) { if (profile != nullptr) {
auto uuid = profile->uuid(); auto uuid = profile->uuid();
if (uuid != m_settings->config()->autoLoginProfile()) { if (uuid != config()->autoLoginProfile()) {
m_settings->config()->setAutoLoginProfile(uuid); config()->setAutoLoginProfile(uuid);
} }
} else { } else {
m_settings->config()->setAutoLoginProfile({}); config()->setAutoLoginProfile({});
} }
m_settings->config()->save(); config()->save();
Q_EMIT autoLoginProfileChanged(); Q_EMIT autoLoginProfileChanged();
} }
@ -357,7 +365,7 @@ void LauncherCore::setupIgnoreSSL(QNetworkReply *reply)
{ {
Q_ASSERT(reply != nullptr); Q_ASSERT(reply != nullptr);
if (m_settings->preferredProtocol() == QStringLiteral("http")) { if (config()->preferredProtocol() == QStringLiteral("http")) {
connect(reply, &QNetworkReply::sslErrors, this, [reply](const QList<QSslError> &errors) { connect(reply, &QNetworkReply::sslErrors, this, [reply](const QList<QSslError> &errors) {
reply->ignoreSslErrors(errors); reply->ignoreSslErrors(errors);
}); });
@ -412,9 +420,9 @@ QNetworkAccessManager *LauncherCore::mgr()
return m_mgr; return m_mgr;
} }
LauncherSettings *LauncherCore::settings() Config *LauncherCore::config() const
{ {
return m_settings; return m_config;
} }
ProfileManager *LauncherCore::profileManager() ProfileManager *LauncherCore::profileManager()
@ -495,8 +503,8 @@ QCoro::Task<> LauncherCore::fetchNews()
query.addQueryItem(QStringLiteral("media"), QStringLiteral("pcapp")); query.addQueryItem(QStringLiteral("media"), QStringLiteral("pcapp"));
QUrl headlineUrl; QUrl headlineUrl;
headlineUrl.setScheme(m_settings->preferredProtocol()); headlineUrl.setScheme(config()->preferredProtocol());
headlineUrl.setHost(QStringLiteral("frontier.%1").arg(m_settings->squareEnixServer())); headlineUrl.setHost(QStringLiteral("frontier.%1").arg(config()->squareEnixServer()));
headlineUrl.setPath(QStringLiteral("/news/headline.json")); headlineUrl.setPath(QStringLiteral("/news/headline.json"));
headlineUrl.setQuery(query); headlineUrl.setQuery(query);
@ -514,8 +522,8 @@ QCoro::Task<> LauncherCore::fetchNews()
co_await headlineReply; co_await headlineReply;
QUrl bannerUrl; QUrl bannerUrl;
bannerUrl.setScheme(m_settings->preferredProtocol()); bannerUrl.setScheme(config()->preferredProtocol());
bannerUrl.setHost(QStringLiteral("frontier.%1").arg(m_settings->squareEnixServer())); bannerUrl.setHost(QStringLiteral("frontier.%1").arg(config()->squareEnixServer()));
bannerUrl.setPath(QStringLiteral("/v2/topics/%1/banner.json").arg(QStringLiteral("en-us"))); bannerUrl.setPath(QStringLiteral("/v2/topics/%1/banner.json").arg(QStringLiteral("en-us")));
bannerUrl.setQuery(query); bannerUrl.setQuery(query);
@ -586,7 +594,7 @@ QCoro::Task<> LauncherCore::handleGameExit(const Profile *profile)
#ifdef BUILD_SYNC #ifdef BUILD_SYNC
// TODO: once we have Steam API support we can tell Steam to delay putting the Deck to sleep until our upload is complete // TODO: once we have Steam API support we can tell Steam to delay putting the Deck to sleep until our upload is complete
if (m_settings->enableSync()) { if (config()->enableSync()) {
Q_EMIT showWindow(); Q_EMIT showWindow();
qCDebug(ASTRA_LOG) << "Game closed! Uploading character data..."; qCDebug(ASTRA_LOG) << "Game closed! Uploading character data...";
@ -600,7 +608,7 @@ QCoro::Task<> LauncherCore::handleGameExit(const Profile *profile)
} }
#endif #endif
// Otherwise, quit when everything is finished. // Otherwise, quit when everything is finished.
if (m_settings->closeWhenLaunched()) { if (config()->closeWhenLaunched()) {
QCoreApplication::exit(); QCoreApplication::exit();
} }
@ -625,7 +633,7 @@ void LauncherCore::updateConfig(const Account *account)
// Ensure that the opening cutscene movie never plays, since it's broken in most versions of Wine // Ensure that the opening cutscene movie never plays, since it's broken in most versions of Wine
physis_cfg_set_value(cfgFile, "CutsceneMovieOpening", "1"); physis_cfg_set_value(cfgFile, "CutsceneMovieOpening", "1");
const auto screenshotDir = settings()->screenshotDir(); const auto screenshotDir = config()->screenshotDir();
Utility::createPathIfNeeded(screenshotDir); Utility::createPathIfNeeded(screenshotDir);
const auto screenshotDirWin = Utility::toWindowsPath(screenshotDir); const auto screenshotDirWin = Utility::toWindowsPath(screenshotDir);
@ -678,4 +686,9 @@ void LauncherCore::uninhibitSleep()
#endif #endif
} }
QString LauncherCore::currentProfileId() const
{
return KSharedConfig::openStateConfig()->group(QStringLiteral("General")).readEntry(QStringLiteral("CurrentProfile"));
}
#include "moc_launchercore.cpp" #include "moc_launchercore.cpp"

View file

@ -1,250 +0,0 @@
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "launchersettings.h"
LauncherSettings::LauncherSettings(QObject *parent)
: QObject(parent)
{
m_config = new Config(KSharedConfig::openConfig(QStringLiteral("astrarc"), KConfig::SimpleConfig, QStandardPaths::AppConfigLocation));
}
bool LauncherSettings::closeWhenLaunched() const
{
return m_config->closeWhenLaunched();
}
void LauncherSettings::setCloseWhenLaunched(const bool value)
{
if (value != m_config->closeWhenLaunched()) {
m_config->setCloseWhenLaunched(value);
m_config->save();
Q_EMIT closeWhenLaunchedChanged();
}
}
bool LauncherSettings::showDevTools() const
{
return m_config->showDevTools();
}
void LauncherSettings::setShowDevTools(const bool value)
{
if (value != m_config->showDevTools()) {
m_config->setShowDevTools(value);
m_config->save();
Q_EMIT showDevToolsChanged();
}
}
bool LauncherSettings::keepPatches() const
{
return m_config->keepPatches();
}
void LauncherSettings::setKeepPatches(const bool value)
{
if (value != m_config->keepPatches()) {
m_config->setKeepPatches(value);
m_config->save();
Q_EMIT keepPatchesChanged();
}
}
QString LauncherSettings::dalamudDistribServer() const
{
return m_config->dalamudDistribServer();
}
void LauncherSettings::setDalamudDistribServer(const QString &value)
{
if (value != m_config->dalamudDistribServer()) {
m_config->setDalamudDistribServer(value);
m_config->save();
Q_EMIT dalamudDistribServerChanged();
}
}
QString LauncherSettings::defaultDalamudDistribServer() const
{
return m_config->defaultDalamudDistribServerValue();
}
QString LauncherSettings::squareEnixServer() const
{
return m_config->squareEnixServer();
}
void LauncherSettings::setSquareEnixServer(const QString &value)
{
if (value != m_config->squareEnixServer()) {
m_config->setSquareEnixServer(value);
m_config->save();
Q_EMIT squareEnixServerChanged();
}
}
QString LauncherSettings::defaultSquareEnixServer() const
{
return m_config->defaultSquareEnixServerValue();
}
QString LauncherSettings::squareEnixLoginServer() const
{
return m_config->squareEnixLoginServer();
}
void LauncherSettings::setSquareEnixLoginServer(const QString &value)
{
if (value != m_config->squareEnixLoginServer()) {
m_config->setSquareEnixLoginServer(value);
m_config->save();
Q_EMIT squareEnixLoginServerChanged();
}
}
QString LauncherSettings::defaultSquareEnixLoginServer() const
{
return m_config->defaultSquareEnixLoginServerValue();
}
QString LauncherSettings::mainServer() const
{
return m_config->mainServer();
}
void LauncherSettings::setMainServer(const QString &value)
{
if (value != m_config->mainServer()) {
m_config->setMainServer(value);
m_config->save();
Q_EMIT mainServerChanged();
}
}
QString LauncherSettings::defaultMainServer() const
{
return m_config->defaultMainServerValue();
}
QString LauncherSettings::preferredProtocol() const
{
return m_config->preferredProtocol();
}
void LauncherSettings::setPreferredProtocol(const QString &value)
{
if (value != m_config->preferredProtocol()) {
m_config->setPreferredProtocol(value);
m_config->save();
Q_EMIT preferredProtocolChanged();
}
}
QString LauncherSettings::defaultPreferredProtocol() const
{
return m_config->defaultPreferredProtocolValue();
}
QString LauncherSettings::screenshotDir() const
{
return m_config->screenshotDir();
}
void LauncherSettings::setScreenshotDir(const QString &value)
{
if (value != m_config->screenshotDir()) {
m_config->setScreenshotDir(value);
m_config->save();
Q_EMIT screenshotDirChanged();
}
}
bool LauncherSettings::argumentsEncrypted() const
{
return m_config->encryptArguments();
}
void LauncherSettings::setArgumentsEncrypted(const bool value)
{
if (m_config->encryptArguments() != value) {
m_config->setEncryptArguments(value);
m_config->save();
Q_EMIT encryptedArgumentsChanged();
}
}
bool LauncherSettings::enableRenderDocCapture() const
{
return m_config->enableRenderDocCapture();
}
void LauncherSettings::setEnableRenderDocCapture(const bool value)
{
if (m_config->enableRenderDocCapture() != value) {
m_config->setEnableRenderDocCapture(value);
m_config->save();
Q_EMIT enableRenderDocCaptureChanged();
}
}
QString LauncherSettings::currentProfile() const
{
return KSharedConfig::openStateConfig()->group(QStringLiteral("General")).readEntry(QStringLiteral("CurrentProfile"));
}
void LauncherSettings::setCurrentProfile(const QString &value)
{
auto stateConfig = KSharedConfig::openStateConfig();
stateConfig->group(QStringLiteral("General")).writeEntry(QStringLiteral("CurrentProfile"), value);
stateConfig->sync();
}
bool LauncherSettings::enableSync() const
{
return m_config->enableSync();
}
void LauncherSettings::setEnableSync(const bool enabled)
{
if (m_config->enableSync() != enabled) {
m_config->setEnableSync(enabled);
m_config->save();
Q_EMIT enableSyncChanged();
}
}
QString LauncherSettings::customGameServer() const
{
return m_config->customGameServer();
}
void LauncherSettings::setCustomGameServer(const QString &value)
{
if (m_config->customGameServer() != value) {
m_config->setCustomGameServer(value);
m_config->save();
Q_EMIT customGameServerChanged();
}
}
int LauncherSettings::customGameServerPort() const
{
return m_config->customGameServerPort();
}
void LauncherSettings::setCustomGameServerPort(const int port)
{
if (m_config->customGameServerPort() != port) {
m_config->setCustomGameServerPort(port);
m_config->save();
Q_EMIT customGameServerPortChanged();
}
}
Config *LauncherSettings::config()
{
return m_config;
}
#include "moc_launchersettings.cpp"

View file

@ -271,7 +271,7 @@ void Patcher::processPatch(const QueuedPatch &patch)
Utility::writeVersion(verFilePath, patch.version); Utility::writeVersion(verFilePath, patch.version);
if (!m_launcher.settings()->keepPatches()) { if (!m_launcher.config()->keepPatches()) {
QFile::remove(patch.path); QFile::remove(patch.path);
} }
} }

View file

@ -72,10 +72,10 @@ QCoro::Task<std::optional<LoginAuth>> SquareEnixLogin::login(LoginInformation *i
} }
// Inject custom game server if set // Inject custom game server if set
if (!m_launcher.settings()->customGameServer().isEmpty()) { if (!m_launcher.config()->customGameServer().isEmpty()) {
m_auth.frontierHost = m_launcher.settings()->customGameServer(); m_auth.frontierHost = m_launcher.config()->customGameServer();
m_auth.lobbyHost = m_launcher.settings()->customGameServer(); m_auth.lobbyHost = m_launcher.config()->customGameServer();
m_auth.lobbyHostPort = m_launcher.settings()->customGameServerPort(); m_auth.lobbyHostPort = m_launcher.config()->customGameServerPort();
} }
co_return m_auth; co_return m_auth;
@ -87,8 +87,8 @@ QCoro::Task<bool> SquareEnixLogin::checkGateStatus() const
qInfo(ASTRA_LOG) << "Checking if the gate is open..."; qInfo(ASTRA_LOG) << "Checking if the gate is open...";
QUrl url; QUrl url;
url.setScheme(m_launcher.settings()->preferredProtocol()); url.setScheme(m_launcher.config()->preferredProtocol());
url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.settings()->squareEnixServer())); url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.config()->squareEnixServer()));
url.setPath(QStringLiteral("/worldStatus/gate_status.json")); url.setPath(QStringLiteral("/worldStatus/gate_status.json"));
url.setQuery(QString::number(QDateTime::currentMSecsSinceEpoch())); url.setQuery(QString::number(QDateTime::currentMSecsSinceEpoch()));
@ -128,8 +128,8 @@ QCoro::Task<bool> SquareEnixLogin::checkLoginStatus() const
qInfo(ASTRA_LOG) << "Checking if login is open..."; qInfo(ASTRA_LOG) << "Checking if login is open...";
QUrl url; QUrl url;
url.setScheme(m_launcher.settings()->preferredProtocol()); url.setScheme(m_launcher.config()->preferredProtocol());
url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.settings()->squareEnixServer())); url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.config()->squareEnixServer()));
url.setPath(QStringLiteral("/worldStatus/login_status.json")); url.setPath(QStringLiteral("/worldStatus/login_status.json"));
url.setQuery(QString::number(QDateTime::currentMSecsSinceEpoch())); url.setQuery(QString::number(QDateTime::currentMSecsSinceEpoch()));
@ -171,7 +171,7 @@ QCoro::Task<bool> SquareEnixLogin::checkBootUpdates()
QUrl url; QUrl url;
url.setScheme(QStringLiteral("http")); url.setScheme(QStringLiteral("http"));
url.setHost(QStringLiteral("patch-bootver.%1").arg(m_launcher.settings()->squareEnixServer())); url.setHost(QStringLiteral("patch-bootver.%1").arg(m_launcher.config()->squareEnixServer()));
url.setPath(QStringLiteral("/http/%1/%2/%3/").arg(platform, bootUpdateChannel, m_info->profile->bootVersion())); url.setPath(QStringLiteral("/http/%1/%2/%3/").arg(platform, bootUpdateChannel, m_info->profile->bootVersion()));
url.setQuery(query); url.setQuery(query);
@ -182,7 +182,7 @@ QCoro::Task<bool> SquareEnixLogin::checkBootUpdates()
request.setHeader(QNetworkRequest::KnownHeaders::UserAgentHeader, patchUserAgent); request.setHeader(QNetworkRequest::KnownHeaders::UserAgentHeader, patchUserAgent);
} }
request.setRawHeader(QByteArrayLiteral("Host"), QStringLiteral("patch-bootver.%1").arg(m_launcher.settings()->squareEnixServer()).toUtf8()); request.setRawHeader(QByteArrayLiteral("Host"), QStringLiteral("patch-bootver.%1").arg(m_launcher.config()->squareEnixServer()).toUtf8());
Utility::printRequest(QStringLiteral("GET"), request); Utility::printRequest(QStringLiteral("GET"), request);
const auto reply = m_launcher.mgr()->get(request); const auto reply = m_launcher.mgr()->get(request);
@ -239,8 +239,8 @@ QCoro::Task<std::optional<SquareEnixLogin::StoredInfo>> SquareEnixLogin::getStor
} }
QUrl url; QUrl url;
url.setScheme(m_launcher.settings()->preferredProtocol()); url.setScheme(m_launcher.config()->preferredProtocol());
url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.settings()->squareEnixLoginServer())); url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.config()->squareEnixLoginServer()));
url.setPath(QStringLiteral("/oauth/ffxivarr/login/top")); url.setPath(QStringLiteral("/oauth/ffxivarr/login/top"));
url.setQuery(query); url.setQuery(query);
@ -297,8 +297,8 @@ QCoro::Task<bool> SquareEnixLogin::loginOAuth()
postData.addQueryItem(QStringLiteral("otppw"), m_info->oneTimePassword); postData.addQueryItem(QStringLiteral("otppw"), m_info->oneTimePassword);
QUrl url; QUrl url;
url.setScheme(m_launcher.settings()->preferredProtocol()); url.setScheme(m_launcher.config()->preferredProtocol());
url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.settings()->squareEnixLoginServer())); url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.config()->squareEnixLoginServer()));
url.setPath(QStringLiteral("/oauth/ffxivarr/login/login.send")); url.setPath(QStringLiteral("/oauth/ffxivarr/login/login.send"));
QNetworkRequest request(url); QNetworkRequest request(url);
@ -358,8 +358,8 @@ QCoro::Task<bool> SquareEnixLogin::registerSession()
qInfo(ASTRA_LOG) << "Registering the session..."; qInfo(ASTRA_LOG) << "Registering the session...";
QUrl url; QUrl url;
url.setScheme(m_launcher.settings()->preferredProtocol()); url.setScheme(m_launcher.config()->preferredProtocol());
url.setHost(QStringLiteral("patch-gamever.%1").arg(m_launcher.settings()->squareEnixServer())); url.setHost(QStringLiteral("patch-gamever.%1").arg(m_launcher.config()->squareEnixServer()));
url.setPath(QStringLiteral("/http/%1/%2/%3/%4").arg(platform, gameUpdateChannel, m_info->profile->baseGameVersion(), m_SID)); url.setPath(QStringLiteral("/http/%1/%2/%3/%4").arg(platform, gameUpdateChannel, m_info->profile->baseGameVersion(), m_SID));
auto request = QNetworkRequest(url); auto request = QNetworkRequest(url);

View file

@ -105,7 +105,7 @@ Kirigami.ApplicationWindow {
} }
function onSuccessfulLaunch(): void { function onSuccessfulLaunch(): void {
if (LauncherCore.settings.closeWhenLaunched) { if (LauncherCore.config.closeWhenLaunched) {
appWindow.hide(); appWindow.hide();
} else { } else {
appWindow.checkSetup(); appWindow.checkSetup();
@ -113,7 +113,7 @@ Kirigami.ApplicationWindow {
} }
function onGameClosed(): void { function onGameClosed(): void {
if (!LauncherCore.settings.closeWhenLaunched) { if (!LauncherCore.config.closeWhenLaunched) {
appWindow.checkSetup(); appWindow.checkSetup();
} }
} }

View file

@ -28,8 +28,8 @@ FormCard.FormCardPage {
text: i18n("Keep Patches") text: i18n("Keep Patches")
description: i18n("Do not delete patches after they're used. Astra will not download patch data, if found.") description: i18n("Do not delete patches after they're used. Astra will not download patch data, if found.")
checked: LauncherCore.settings.keepPatches checked: LauncherCore.config.keepPatches
onCheckedChanged: LauncherCore.settings.keepPatches = checked onCheckedChanged: LauncherCore.config.keepPatches = checked
} }
} }
@ -59,8 +59,8 @@ FormCard.FormCardPage {
text: i18n("Encrypt Game Arguments") text: i18n("Encrypt Game Arguments")
description: i18n("Disable encryption if you want to inspect the raw arguments passed to the game.") description: i18n("Disable encryption if you want to inspect the raw arguments passed to the game.")
checked: LauncherCore.settings.argumentsEncrypted checked: LauncherCore.config.argumentsEncrypted
onCheckedChanged: LauncherCore.settings.argumentsEncrypted = checked onCheckedChanged: LauncherCore.config.argumentsEncrypted = checked
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -73,8 +73,8 @@ FormCard.FormCardPage {
text: i18n("Allow RenderDoc Capture") text: i18n("Allow RenderDoc Capture")
description: i18n("Inject the RenderDoc capture layer.") description: i18n("Inject the RenderDoc capture layer.")
checked: LauncherCore.settings.enableRenderDocCapture checked: LauncherCore.config.enableRenderDocCapture
onCheckedChanged: LauncherCore.settings.enableRenderDocCapture = checked onCheckedChanged: LauncherCore.config.enableRenderDocCapture = checked
} }
} }
@ -91,11 +91,11 @@ FormCard.FormCardPage {
text: i18n("Reset to Defaults") text: i18n("Reset to Defaults")
onClicked: { onClicked: {
preferredProtocolDelegate.text = LauncherCore.settings.defaultPreferredProtocol(); preferredProtocolDelegate.text = LauncherCore.config.defaultPreferredProtocol();
dalamudServerDelegate.text = LauncherCore.settings.defaultDalamudDistribServer(); dalamudServerDelegate.text = LauncherCore.config.defaultDalamudDistribServer();
squareMainServerDelegate.text = LauncherCore.settings.defaultSquareEnixServer(); squareMainServerDelegate.text = LauncherCore.config.defaultSquareEnixServer();
loginServerDelegate.text = LauncherCore.settings.defaultSquareEnixLoginServer(); loginServerDelegate.text = LauncherCore.config.defaultSquareEnixLoginServer();
mainServerDelegate.text = LauncherCore.settings.defaultMainServer(); mainServerDelegate.text = LauncherCore.config.defaultMainServer();
} }
} }
@ -125,8 +125,8 @@ FormCard.FormCardPage {
id: preferredProtocolDelegate id: preferredProtocolDelegate
label: i18n("Preferred Protocol") label: i18n("Preferred Protocol")
text: LauncherCore.settings.preferredProtocol text: LauncherCore.config.preferredProtocol
onTextChanged: LauncherCore.settings.preferredProtocol = text onTextChanged: LauncherCore.config.preferredProtocol = text
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -138,8 +138,8 @@ FormCard.FormCardPage {
id: dalamudServerDelegate id: dalamudServerDelegate
label: i18n("Dalamud Distribution Server") label: i18n("Dalamud Distribution Server")
text: LauncherCore.settings.dalamudDistribServer text: LauncherCore.config.dalamudDistribServer
onTextChanged: LauncherCore.settings.dalamudDistribServer = text onTextChanged: LauncherCore.config.dalamudDistribServer = text
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -151,8 +151,8 @@ FormCard.FormCardPage {
id: squareMainServerDelegate id: squareMainServerDelegate
label: i18n("SE Main Server (ffxiv.com)") label: i18n("SE Main Server (ffxiv.com)")
text: LauncherCore.settings.squareEnixServer text: LauncherCore.config.squareEnixServer
onTextChanged: LauncherCore.settings.squareEnixServer = text onTextChanged: LauncherCore.config.squareEnixServer = text
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -164,8 +164,8 @@ FormCard.FormCardPage {
id: loginServerDelegate id: loginServerDelegate
label: i18n("SE Login Server (square-enix.com)") label: i18n("SE Login Server (square-enix.com)")
text: LauncherCore.settings.squareEnixLoginServer text: LauncherCore.config.squareEnixLoginServer
onTextChanged: LauncherCore.settings.squareEnixLoginServer = text onTextChanged: LauncherCore.config.squareEnixLoginServer = text
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -177,8 +177,8 @@ FormCard.FormCardPage {
id: mainServerDelegate id: mainServerDelegate
label: i18n("Main Server (finalfantasyxiv.com)") label: i18n("Main Server (finalfantasyxiv.com)")
text: LauncherCore.settings.mainServer text: LauncherCore.config.mainServer
onTextChanged: LauncherCore.settings.mainServer = text onTextChanged: LauncherCore.config.mainServer = text
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -190,8 +190,8 @@ FormCard.FormCardPage {
id: gameServerDelegate id: gameServerDelegate
label: i18n("Game Server (leave blank for default)") label: i18n("Game Server (leave blank for default)")
text: LauncherCore.settings.customGameServer text: LauncherCore.config.customGameServer
onTextChanged: LauncherCore.settings.customGameServer = text onTextChanged: LauncherCore.config.customGameServer = text
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -203,8 +203,8 @@ FormCard.FormCardPage {
id: gameServerPortDelegate id: gameServerPortDelegate
label: i18n("Game Server Port") label: i18n("Game Server Port")
value: LauncherCore.settings.customGameServerPort value: LauncherCore.config.customGameServerPort
onValueChanged: LauncherCore.settings.customGameServerPort = value onValueChanged: LauncherCore.config.customGameServerPort = value
from: 1 from: 1
to: 999999 to: 999999
} }

View file

@ -25,8 +25,8 @@ FormCard.FormCardPage {
id: closeAstraDelegate id: closeAstraDelegate
text: i18n("Hide Astra when game is launched") text: i18n("Hide Astra when game is launched")
checked: LauncherCore.settings.closeWhenLaunched checked: LauncherCore.config.closeWhenLaunched
onCheckedChanged: LauncherCore.settings.closeWhenLaunched = checked onCheckedChanged: LauncherCore.config.closeWhenLaunched = checked
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -39,8 +39,8 @@ FormCard.FormCardPage {
text: i18n("Show Developer Settings") text: i18n("Show Developer Settings")
description: i18n("Enable settings that are useful for developers and tinkerers.") description: i18n("Enable settings that are useful for developers and tinkerers.")
checked: LauncherCore.settings.showDevTools checked: LauncherCore.config.showDevTools
onCheckedChanged: LauncherCore.settings.showDevTools = checked onCheckedChanged: LauncherCore.config.showDevTools = checked
} }
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
@ -52,9 +52,9 @@ FormCard.FormCardPage {
id: screenshotsPathDelegate id: screenshotsPathDelegate
text: i18n("Screenshots Folder") text: i18n("Screenshots Folder")
folder: LauncherCore.settings.screenshotDir folder: LauncherCore.config.screenshotDir
onAccepted: (folder) => LauncherCore.settings.screenshotDir = folder onAccepted: (folder) => LauncherCore.config.screenshotDir = folder
} }
} }

View file

@ -256,7 +256,7 @@ FormCard.FormCardPage {
id: dalamudChannelDelegate id: dalamudChannelDelegate
text: i18n("Update Channel") text: i18n("Update Channel")
model: LauncherCore.settings.showDevTools ? [i18n("Stable"), i18n("Staging"), i18n("Local")] : [i18n("Stable"), i18n("Staging")] model: LauncherCore.config.showDevTools ? [i18n("Stable"), i18n("Staging"), i18n("Local")] : [i18n("Stable"), i18n("Staging")]
currentIndex: page.profile.dalamudChannel currentIndex: page.profile.dalamudChannel
onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex
enabled: page.profile.dalamudEnabled enabled: page.profile.dalamudEnabled
@ -265,13 +265,13 @@ FormCard.FormCardPage {
FormCard.FormDelegateSeparator { FormCard.FormDelegateSeparator {
above: dalamudChannelDelegate above: dalamudChannelDelegate
below: dalamudInjectDelegate below: dalamudInjectDelegate
visible: LauncherCore.settings.showDevTools visible: LauncherCore.config.showDevTools
} }
FormCard.FormComboBoxDelegate { FormCard.FormComboBoxDelegate {
id: dalamudInjectDelegate id: dalamudInjectDelegate
visible: LauncherCore.settings.showDevTools visible: LauncherCore.config.showDevTools
text: i18n("Injection Method") text: i18n("Injection Method")
description: "It shouldn't be nessecary to change this setting, unless you're running into issues injecting Dalamud." description: "It shouldn't be nessecary to change this setting, unless you're running into issues injecting Dalamud."
model: ["Entrypoint", "DLL Injection"] model: ["Entrypoint", "DLL Injection"]
@ -288,7 +288,7 @@ FormCard.FormCardPage {
FormCard.FormSpinBoxDelegate { FormCard.FormSpinBoxDelegate {
id: dalamudDelayDelegate id: dalamudDelayDelegate
visible: LauncherCore.settings.showDevTools visible: LauncherCore.config.showDevTools
label: i18n("Injection Delay") label: i18n("Injection Delay")
value: page.profile.dalamudInjectDelay value: page.profile.dalamudInjectDelay
onValueChanged: page.profile.dalamudInjectDelay = value onValueChanged: page.profile.dalamudInjectDelay = value

View file

@ -67,7 +67,7 @@ KirigamiSettings.CategorizedSettings {
text: i18n("Developer Settings") text: i18n("Developer Settings")
icon.name: "preferences-others-symbolic" icon.name: "preferences-others-symbolic"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/DeveloperSettings.qml") page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/DeveloperSettings.qml")
visible: LauncherCore.settings.showDevTools visible: LauncherCore.config.showDevTools
}, },
KirigamiSettings.SettingAction { KirigamiSettings.SettingAction {
actionName: "about" actionName: "about"

View file

@ -38,8 +38,8 @@ FormCard.FormCardPage {
text: i18n("Enable Sync") text: i18n("Enable Sync")
description: i18n("Syncing will occur before login, and after the game exits.") description: i18n("Syncing will occur before login, and after the game exits.")
checked: LauncherCore.settings.enableSync checked: LauncherCore.config.enableSync
onCheckedChanged: LauncherCore.settings.enableSync = checked onCheckedChanged: LauncherCore.config.enableSync = checked
} }
} }
@ -50,7 +50,7 @@ FormCard.FormCardPage {
Layout.topMargin: Kirigami.Units.largeSpacing Layout.topMargin: Kirigami.Units.largeSpacing
visible: !LauncherCore.syncManager.connected visible: !LauncherCore.syncManager.connected
enabled: LauncherCore.settings.enableSync enabled: LauncherCore.config.enableSync
FormCard.FormTextFieldDelegate { FormCard.FormTextFieldDelegate {
id: usernameDelegate id: usernameDelegate