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:
parent
7095eeef3f
commit
799b718818
16 changed files with 117 additions and 458 deletions
|
@ -47,7 +47,6 @@ target_sources(astra_static PRIVATE
|
|||
include/gameinstaller.h
|
||||
include/headline.h
|
||||
include/launchercore.h
|
||||
include/launchersettings.h
|
||||
include/patcher.h
|
||||
include/processlogger.h
|
||||
include/sapphirelogin.h
|
||||
|
@ -64,7 +63,6 @@ target_sources(astra_static PRIVATE
|
|||
src/headline.cpp
|
||||
src/gameinstaller.cpp
|
||||
src/launchercore.cpp
|
||||
src/launchersettings.cpp
|
||||
src/account.cpp
|
||||
src/processwatcher.cpp
|
||||
src/profilemanager.cpp
|
||||
|
@ -92,9 +90,9 @@ target_link_libraries(astra_static PUBLIC
|
|||
QCoro::Core
|
||||
QCoro::Network
|
||||
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 accountconfig.kcfg CLASS_NAME AccountConfig 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)
|
||||
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 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 QML_REGISTRATION QML_UNCREATABLE)
|
||||
target_include_directories(astra_static PUBLIC include ${CMAKE_BINARY_DIR})
|
||||
|
||||
if (NOT MSVC)
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include <qcorotask.h>
|
||||
|
||||
#include "accountmanager.h"
|
||||
#include "config.h"
|
||||
#include "headline.h"
|
||||
#include "launchersettings.h"
|
||||
#include "profile.h"
|
||||
#include "profilemanager.h"
|
||||
#include "steamapi.h"
|
||||
|
@ -63,7 +63,7 @@ class LauncherCore : public QObject
|
|||
Q_PROPERTY(bool isSteam READ isSteam CONSTANT)
|
||||
Q_PROPERTY(bool isSteamDeck READ isSteamDeck 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(AccountManager *accountManager READ accountManager CONSTANT)
|
||||
Q_PROPERTY(Headline *headline READ headline NOTIFY newsChanged)
|
||||
|
@ -77,6 +77,7 @@ class LauncherCore : public QObject
|
|||
|
||||
public:
|
||||
LauncherCore();
|
||||
~LauncherCore() override;
|
||||
|
||||
/// Initializes the Steamworks API.
|
||||
void initializeSteam();
|
||||
|
@ -128,7 +129,7 @@ public:
|
|||
[[nodiscard]] Q_INVOKABLE bool supportsSync() const;
|
||||
|
||||
[[nodiscard]] QNetworkAccessManager *mgr();
|
||||
[[nodiscard]] LauncherSettings *settings();
|
||||
[[nodiscard]] Config *config() const;
|
||||
[[nodiscard]] ProfileManager *profileManager();
|
||||
[[nodiscard]] AccountManager *accountManager();
|
||||
[[nodiscard]] Headline *headline() const;
|
||||
|
@ -175,6 +176,8 @@ private:
|
|||
/// Tell the system we can allow the screen to turn off
|
||||
void uninhibitSleep();
|
||||
|
||||
QString currentProfileId() const;
|
||||
|
||||
SteamAPI *m_steamApi = nullptr;
|
||||
|
||||
bool m_loadingFinished = false;
|
||||
|
@ -187,7 +190,7 @@ private:
|
|||
|
||||
QNetworkAccessManager *m_mgr = nullptr;
|
||||
Headline *m_headline = nullptr;
|
||||
LauncherSettings *m_settings = nullptr;
|
||||
Config *m_config = nullptr;
|
||||
GameRunner *m_runner = nullptr;
|
||||
QString m_cachedLogoImage;
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
|
@ -399,8 +399,8 @@ QCoro::Task<bool> AssetUpdater::installRuntime()
|
|||
QUrl AssetUpdater::dalamudVersionManifestUrl() const
|
||||
{
|
||||
QUrl url;
|
||||
url.setScheme(launcher.settings()->preferredProtocol());
|
||||
url.setHost(launcher.settings()->dalamudDistribServer());
|
||||
url.setScheme(launcher.config()->preferredProtocol());
|
||||
url.setHost(launcher.config()->dalamudDistribServer());
|
||||
url.setPath(QStringLiteral("/Dalamud/Release/VersionInfo"));
|
||||
|
||||
return url;
|
||||
|
@ -409,8 +409,8 @@ QUrl AssetUpdater::dalamudVersionManifestUrl() const
|
|||
QUrl AssetUpdater::dalamudAssetManifestUrl() const
|
||||
{
|
||||
QUrl url;
|
||||
url.setScheme(launcher.settings()->preferredProtocol());
|
||||
url.setHost(launcher.settings()->dalamudDistribServer());
|
||||
url.setScheme(launcher.config()->preferredProtocol());
|
||||
url.setHost(launcher.config()->dalamudDistribServer());
|
||||
url.setPath(QStringLiteral("/Dalamud/Asset/Meta"));
|
||||
|
||||
return url;
|
||||
|
@ -419,8 +419,8 @@ QUrl AssetUpdater::dalamudAssetManifestUrl() const
|
|||
QUrl AssetUpdater::dotnetRuntimePackageUrl(const QString &version) const
|
||||
{
|
||||
QUrl url;
|
||||
url.setScheme(launcher.settings()->preferredProtocol());
|
||||
url.setHost(launcher.settings()->dalamudDistribServer());
|
||||
url.setScheme(launcher.config()->preferredProtocol());
|
||||
url.setHost(launcher.config()->dalamudDistribServer());
|
||||
url.setPath(QStringLiteral("/Dalamud/Release/Runtime/DotNet/%1").arg(version));
|
||||
|
||||
return url;
|
||||
|
@ -429,8 +429,8 @@ QUrl AssetUpdater::dotnetRuntimePackageUrl(const QString &version) const
|
|||
QUrl AssetUpdater::dotnetDesktopPackageUrl(const QString &version) const
|
||||
{
|
||||
QUrl url;
|
||||
url.setScheme(launcher.settings()->preferredProtocol());
|
||||
url.setHost(launcher.settings()->dalamudDistribServer());
|
||||
url.setScheme(launcher.config()->preferredProtocol());
|
||||
url.setHost(launcher.config()->dalamudDistribServer());
|
||||
url.setPath(QStringLiteral("/Dalamud/Release/Runtime/WindowsDesktop/%1").arg(version));
|
||||
|
||||
return url;
|
||||
|
@ -454,4 +454,4 @@ bool AssetUpdater::extractZip(const QString &filePath, const QString &directory)
|
|||
return true;
|
||||
}
|
||||
|
||||
#include "moc_assetupdater.cpp"
|
||||
#include "moc_assetupdater.cpp"
|
||||
|
|
|
@ -22,7 +22,7 @@ CharacterSync::CharacterSync(Account &account, LauncherCore &launcher, QObject *
|
|||
|
||||
QCoro::Task<bool> CharacterSync::sync(const bool initialSync)
|
||||
{
|
||||
if (!launcher.settings()->enableSync()) {
|
||||
if (!launcher.config()->enableSync()) {
|
||||
co_return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
for (const auto &[key, value] : gameArgs) {
|
||||
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)
|
||||
|
@ -322,7 +322,7 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
|
|||
}
|
||||
#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("ENABLE_VULKAN_RENDERDOC_CAPTURE"), QString::number(1));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace Qt::StringLiterals;
|
|||
LauncherCore::LauncherCore()
|
||||
: 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_sapphireLogin = new SapphireLogin(*this, this);
|
||||
m_squareEnixLogin = new SquareEnixLogin(*this, this);
|
||||
|
@ -66,7 +66,7 @@ LauncherCore::LauncherCore()
|
|||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,11 @@ LauncherCore::LauncherCore()
|
|||
Q_EMIT loadingFinished();
|
||||
}
|
||||
|
||||
LauncherCore::~LauncherCore()
|
||||
{
|
||||
m_config->save();
|
||||
}
|
||||
|
||||
void LauncherCore::initializeSteam()
|
||||
{
|
||||
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.";
|
||||
|
||||
QUrl url;
|
||||
url.setScheme(settings()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("na.%1").arg(settings()->mainServer())); // TODO: NA isnt the only thing in the world...
|
||||
url.setScheme(config()->preferredProtocol());
|
||||
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()));
|
||||
|
||||
const QNetworkRequest request(url);
|
||||
|
@ -301,37 +306,40 @@ void LauncherCore::setCurrentProfile(const Profile *profile)
|
|||
const int newIndex = m_profileManager->getProfileIndex(profile->uuid());
|
||||
if (newIndex != m_currentProfileIndex) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] QString LauncherCore::autoLoginProfileName() const
|
||||
{
|
||||
return m_settings->config()->autoLoginProfile();
|
||||
return config()->autoLoginProfile();
|
||||
}
|
||||
|
||||
[[nodiscard]] Profile *LauncherCore::autoLoginProfile() const
|
||||
{
|
||||
if (m_settings->config()->autoLoginProfile().isEmpty()) {
|
||||
if (config()->autoLoginProfile().isEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return m_profileManager->getProfileByUUID(m_settings->config()->autoLoginProfile());
|
||||
return m_profileManager->getProfileByUUID(config()->autoLoginProfile());
|
||||
}
|
||||
|
||||
void LauncherCore::setAutoLoginProfile(const Profile *profile)
|
||||
{
|
||||
if (profile != nullptr) {
|
||||
auto uuid = profile->uuid();
|
||||
if (uuid != m_settings->config()->autoLoginProfile()) {
|
||||
m_settings->config()->setAutoLoginProfile(uuid);
|
||||
if (uuid != config()->autoLoginProfile()) {
|
||||
config()->setAutoLoginProfile(uuid);
|
||||
}
|
||||
} else {
|
||||
m_settings->config()->setAutoLoginProfile({});
|
||||
config()->setAutoLoginProfile({});
|
||||
}
|
||||
|
||||
m_settings->config()->save();
|
||||
config()->save();
|
||||
Q_EMIT autoLoginProfileChanged();
|
||||
}
|
||||
|
||||
|
@ -357,7 +365,7 @@ void LauncherCore::setupIgnoreSSL(QNetworkReply *reply)
|
|||
{
|
||||
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) {
|
||||
reply->ignoreSslErrors(errors);
|
||||
});
|
||||
|
@ -412,9 +420,9 @@ QNetworkAccessManager *LauncherCore::mgr()
|
|||
return m_mgr;
|
||||
}
|
||||
|
||||
LauncherSettings *LauncherCore::settings()
|
||||
Config *LauncherCore::config() const
|
||||
{
|
||||
return m_settings;
|
||||
return m_config;
|
||||
}
|
||||
|
||||
ProfileManager *LauncherCore::profileManager()
|
||||
|
@ -495,8 +503,8 @@ QCoro::Task<> LauncherCore::fetchNews()
|
|||
query.addQueryItem(QStringLiteral("media"), QStringLiteral("pcapp"));
|
||||
|
||||
QUrl headlineUrl;
|
||||
headlineUrl.setScheme(m_settings->preferredProtocol());
|
||||
headlineUrl.setHost(QStringLiteral("frontier.%1").arg(m_settings->squareEnixServer()));
|
||||
headlineUrl.setScheme(config()->preferredProtocol());
|
||||
headlineUrl.setHost(QStringLiteral("frontier.%1").arg(config()->squareEnixServer()));
|
||||
headlineUrl.setPath(QStringLiteral("/news/headline.json"));
|
||||
headlineUrl.setQuery(query);
|
||||
|
||||
|
@ -514,8 +522,8 @@ QCoro::Task<> LauncherCore::fetchNews()
|
|||
co_await headlineReply;
|
||||
|
||||
QUrl bannerUrl;
|
||||
bannerUrl.setScheme(m_settings->preferredProtocol());
|
||||
bannerUrl.setHost(QStringLiteral("frontier.%1").arg(m_settings->squareEnixServer()));
|
||||
bannerUrl.setScheme(config()->preferredProtocol());
|
||||
bannerUrl.setHost(QStringLiteral("frontier.%1").arg(config()->squareEnixServer()));
|
||||
bannerUrl.setPath(QStringLiteral("/v2/topics/%1/banner.json").arg(QStringLiteral("en-us")));
|
||||
bannerUrl.setQuery(query);
|
||||
|
||||
|
@ -586,7 +594,7 @@ QCoro::Task<> LauncherCore::handleGameExit(const Profile *profile)
|
|||
|
||||
#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
|
||||
if (m_settings->enableSync()) {
|
||||
if (config()->enableSync()) {
|
||||
Q_EMIT showWindow();
|
||||
|
||||
qCDebug(ASTRA_LOG) << "Game closed! Uploading character data...";
|
||||
|
@ -600,7 +608,7 @@ QCoro::Task<> LauncherCore::handleGameExit(const Profile *profile)
|
|||
}
|
||||
#endif
|
||||
// Otherwise, quit when everything is finished.
|
||||
if (m_settings->closeWhenLaunched()) {
|
||||
if (config()->closeWhenLaunched()) {
|
||||
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
|
||||
physis_cfg_set_value(cfgFile, "CutsceneMovieOpening", "1");
|
||||
|
||||
const auto screenshotDir = settings()->screenshotDir();
|
||||
const auto screenshotDir = config()->screenshotDir();
|
||||
Utility::createPathIfNeeded(screenshotDir);
|
||||
|
||||
const auto screenshotDirWin = Utility::toWindowsPath(screenshotDir);
|
||||
|
@ -678,4 +686,9 @@ void LauncherCore::uninhibitSleep()
|
|||
#endif
|
||||
}
|
||||
|
||||
QString LauncherCore::currentProfileId() const
|
||||
{
|
||||
return KSharedConfig::openStateConfig()->group(QStringLiteral("General")).readEntry(QStringLiteral("CurrentProfile"));
|
||||
}
|
||||
|
||||
#include "moc_launchercore.cpp"
|
||||
|
|
|
@ -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"
|
|
@ -271,7 +271,7 @@ void Patcher::processPatch(const QueuedPatch &patch)
|
|||
|
||||
Utility::writeVersion(verFilePath, patch.version);
|
||||
|
||||
if (!m_launcher.settings()->keepPatches()) {
|
||||
if (!m_launcher.config()->keepPatches()) {
|
||||
QFile::remove(patch.path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,10 +72,10 @@ QCoro::Task<std::optional<LoginAuth>> SquareEnixLogin::login(LoginInformation *i
|
|||
}
|
||||
|
||||
// Inject custom game server if set
|
||||
if (!m_launcher.settings()->customGameServer().isEmpty()) {
|
||||
m_auth.frontierHost = m_launcher.settings()->customGameServer();
|
||||
m_auth.lobbyHost = m_launcher.settings()->customGameServer();
|
||||
m_auth.lobbyHostPort = m_launcher.settings()->customGameServerPort();
|
||||
if (!m_launcher.config()->customGameServer().isEmpty()) {
|
||||
m_auth.frontierHost = m_launcher.config()->customGameServer();
|
||||
m_auth.lobbyHost = m_launcher.config()->customGameServer();
|
||||
m_auth.lobbyHostPort = m_launcher.config()->customGameServerPort();
|
||||
}
|
||||
|
||||
co_return m_auth;
|
||||
|
@ -87,8 +87,8 @@ QCoro::Task<bool> SquareEnixLogin::checkGateStatus() const
|
|||
qInfo(ASTRA_LOG) << "Checking if the gate is open...";
|
||||
|
||||
QUrl url;
|
||||
url.setScheme(m_launcher.settings()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.settings()->squareEnixServer()));
|
||||
url.setScheme(m_launcher.config()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.config()->squareEnixServer()));
|
||||
url.setPath(QStringLiteral("/worldStatus/gate_status.json"));
|
||||
url.setQuery(QString::number(QDateTime::currentMSecsSinceEpoch()));
|
||||
|
||||
|
@ -128,8 +128,8 @@ QCoro::Task<bool> SquareEnixLogin::checkLoginStatus() const
|
|||
qInfo(ASTRA_LOG) << "Checking if login is open...";
|
||||
|
||||
QUrl url;
|
||||
url.setScheme(m_launcher.settings()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.settings()->squareEnixServer()));
|
||||
url.setScheme(m_launcher.config()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("frontier.%1").arg(m_launcher.config()->squareEnixServer()));
|
||||
url.setPath(QStringLiteral("/worldStatus/login_status.json"));
|
||||
url.setQuery(QString::number(QDateTime::currentMSecsSinceEpoch()));
|
||||
|
||||
|
@ -171,7 +171,7 @@ QCoro::Task<bool> SquareEnixLogin::checkBootUpdates()
|
|||
|
||||
QUrl url;
|
||||
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.setQuery(query);
|
||||
|
||||
|
@ -182,7 +182,7 @@ QCoro::Task<bool> SquareEnixLogin::checkBootUpdates()
|
|||
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);
|
||||
|
||||
const auto reply = m_launcher.mgr()->get(request);
|
||||
|
@ -239,8 +239,8 @@ QCoro::Task<std::optional<SquareEnixLogin::StoredInfo>> SquareEnixLogin::getStor
|
|||
}
|
||||
|
||||
QUrl url;
|
||||
url.setScheme(m_launcher.settings()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.settings()->squareEnixLoginServer()));
|
||||
url.setScheme(m_launcher.config()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.config()->squareEnixLoginServer()));
|
||||
url.setPath(QStringLiteral("/oauth/ffxivarr/login/top"));
|
||||
url.setQuery(query);
|
||||
|
||||
|
@ -297,8 +297,8 @@ QCoro::Task<bool> SquareEnixLogin::loginOAuth()
|
|||
postData.addQueryItem(QStringLiteral("otppw"), m_info->oneTimePassword);
|
||||
|
||||
QUrl url;
|
||||
url.setScheme(m_launcher.settings()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.settings()->squareEnixLoginServer()));
|
||||
url.setScheme(m_launcher.config()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("ffxiv-login.%1").arg(m_launcher.config()->squareEnixLoginServer()));
|
||||
url.setPath(QStringLiteral("/oauth/ffxivarr/login/login.send"));
|
||||
|
||||
QNetworkRequest request(url);
|
||||
|
@ -358,8 +358,8 @@ QCoro::Task<bool> SquareEnixLogin::registerSession()
|
|||
qInfo(ASTRA_LOG) << "Registering the session...";
|
||||
|
||||
QUrl url;
|
||||
url.setScheme(m_launcher.settings()->preferredProtocol());
|
||||
url.setHost(QStringLiteral("patch-gamever.%1").arg(m_launcher.settings()->squareEnixServer()));
|
||||
url.setScheme(m_launcher.config()->preferredProtocol());
|
||||
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));
|
||||
|
||||
auto request = QNetworkRequest(url);
|
||||
|
|
|
@ -105,7 +105,7 @@ Kirigami.ApplicationWindow {
|
|||
}
|
||||
|
||||
function onSuccessfulLaunch(): void {
|
||||
if (LauncherCore.settings.closeWhenLaunched) {
|
||||
if (LauncherCore.config.closeWhenLaunched) {
|
||||
appWindow.hide();
|
||||
} else {
|
||||
appWindow.checkSetup();
|
||||
|
@ -113,7 +113,7 @@ Kirigami.ApplicationWindow {
|
|||
}
|
||||
|
||||
function onGameClosed(): void {
|
||||
if (!LauncherCore.settings.closeWhenLaunched) {
|
||||
if (!LauncherCore.config.closeWhenLaunched) {
|
||||
appWindow.checkSetup();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ FormCard.FormCardPage {
|
|||
|
||||
text: i18n("Keep Patches")
|
||||
description: i18n("Do not delete patches after they're used. Astra will not download patch data, if found.")
|
||||
checked: LauncherCore.settings.keepPatches
|
||||
onCheckedChanged: LauncherCore.settings.keepPatches = checked
|
||||
checked: LauncherCore.config.keepPatches
|
||||
onCheckedChanged: LauncherCore.config.keepPatches = checked
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,8 +59,8 @@ FormCard.FormCardPage {
|
|||
|
||||
text: i18n("Encrypt Game Arguments")
|
||||
description: i18n("Disable encryption if you want to inspect the raw arguments passed to the game.")
|
||||
checked: LauncherCore.settings.argumentsEncrypted
|
||||
onCheckedChanged: LauncherCore.settings.argumentsEncrypted = checked
|
||||
checked: LauncherCore.config.argumentsEncrypted
|
||||
onCheckedChanged: LauncherCore.config.argumentsEncrypted = checked
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -73,8 +73,8 @@ FormCard.FormCardPage {
|
|||
|
||||
text: i18n("Allow RenderDoc Capture")
|
||||
description: i18n("Inject the RenderDoc capture layer.")
|
||||
checked: LauncherCore.settings.enableRenderDocCapture
|
||||
onCheckedChanged: LauncherCore.settings.enableRenderDocCapture = checked
|
||||
checked: LauncherCore.config.enableRenderDocCapture
|
||||
onCheckedChanged: LauncherCore.config.enableRenderDocCapture = checked
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,11 +91,11 @@ FormCard.FormCardPage {
|
|||
text: i18n("Reset to Defaults")
|
||||
|
||||
onClicked: {
|
||||
preferredProtocolDelegate.text = LauncherCore.settings.defaultPreferredProtocol();
|
||||
dalamudServerDelegate.text = LauncherCore.settings.defaultDalamudDistribServer();
|
||||
squareMainServerDelegate.text = LauncherCore.settings.defaultSquareEnixServer();
|
||||
loginServerDelegate.text = LauncherCore.settings.defaultSquareEnixLoginServer();
|
||||
mainServerDelegate.text = LauncherCore.settings.defaultMainServer();
|
||||
preferredProtocolDelegate.text = LauncherCore.config.defaultPreferredProtocol();
|
||||
dalamudServerDelegate.text = LauncherCore.config.defaultDalamudDistribServer();
|
||||
squareMainServerDelegate.text = LauncherCore.config.defaultSquareEnixServer();
|
||||
loginServerDelegate.text = LauncherCore.config.defaultSquareEnixLoginServer();
|
||||
mainServerDelegate.text = LauncherCore.config.defaultMainServer();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,8 +125,8 @@ FormCard.FormCardPage {
|
|||
id: preferredProtocolDelegate
|
||||
|
||||
label: i18n("Preferred Protocol")
|
||||
text: LauncherCore.settings.preferredProtocol
|
||||
onTextChanged: LauncherCore.settings.preferredProtocol = text
|
||||
text: LauncherCore.config.preferredProtocol
|
||||
onTextChanged: LauncherCore.config.preferredProtocol = text
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -138,8 +138,8 @@ FormCard.FormCardPage {
|
|||
id: dalamudServerDelegate
|
||||
|
||||
label: i18n("Dalamud Distribution Server")
|
||||
text: LauncherCore.settings.dalamudDistribServer
|
||||
onTextChanged: LauncherCore.settings.dalamudDistribServer = text
|
||||
text: LauncherCore.config.dalamudDistribServer
|
||||
onTextChanged: LauncherCore.config.dalamudDistribServer = text
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -151,8 +151,8 @@ FormCard.FormCardPage {
|
|||
id: squareMainServerDelegate
|
||||
|
||||
label: i18n("SE Main Server (ffxiv.com)")
|
||||
text: LauncherCore.settings.squareEnixServer
|
||||
onTextChanged: LauncherCore.settings.squareEnixServer = text
|
||||
text: LauncherCore.config.squareEnixServer
|
||||
onTextChanged: LauncherCore.config.squareEnixServer = text
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -164,8 +164,8 @@ FormCard.FormCardPage {
|
|||
id: loginServerDelegate
|
||||
|
||||
label: i18n("SE Login Server (square-enix.com)")
|
||||
text: LauncherCore.settings.squareEnixLoginServer
|
||||
onTextChanged: LauncherCore.settings.squareEnixLoginServer = text
|
||||
text: LauncherCore.config.squareEnixLoginServer
|
||||
onTextChanged: LauncherCore.config.squareEnixLoginServer = text
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -177,8 +177,8 @@ FormCard.FormCardPage {
|
|||
id: mainServerDelegate
|
||||
|
||||
label: i18n("Main Server (finalfantasyxiv.com)")
|
||||
text: LauncherCore.settings.mainServer
|
||||
onTextChanged: LauncherCore.settings.mainServer = text
|
||||
text: LauncherCore.config.mainServer
|
||||
onTextChanged: LauncherCore.config.mainServer = text
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -190,8 +190,8 @@ FormCard.FormCardPage {
|
|||
id: gameServerDelegate
|
||||
|
||||
label: i18n("Game Server (leave blank for default)")
|
||||
text: LauncherCore.settings.customGameServer
|
||||
onTextChanged: LauncherCore.settings.customGameServer = text
|
||||
text: LauncherCore.config.customGameServer
|
||||
onTextChanged: LauncherCore.config.customGameServer = text
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -203,8 +203,8 @@ FormCard.FormCardPage {
|
|||
id: gameServerPortDelegate
|
||||
|
||||
label: i18n("Game Server Port")
|
||||
value: LauncherCore.settings.customGameServerPort
|
||||
onValueChanged: LauncherCore.settings.customGameServerPort = value
|
||||
value: LauncherCore.config.customGameServerPort
|
||||
onValueChanged: LauncherCore.config.customGameServerPort = value
|
||||
from: 1
|
||||
to: 999999
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ FormCard.FormCardPage {
|
|||
id: closeAstraDelegate
|
||||
|
||||
text: i18n("Hide Astra when game is launched")
|
||||
checked: LauncherCore.settings.closeWhenLaunched
|
||||
onCheckedChanged: LauncherCore.settings.closeWhenLaunched = checked
|
||||
checked: LauncherCore.config.closeWhenLaunched
|
||||
onCheckedChanged: LauncherCore.config.closeWhenLaunched = checked
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -39,8 +39,8 @@ FormCard.FormCardPage {
|
|||
|
||||
text: i18n("Show Developer Settings")
|
||||
description: i18n("Enable settings that are useful for developers and tinkerers.")
|
||||
checked: LauncherCore.settings.showDevTools
|
||||
onCheckedChanged: LauncherCore.settings.showDevTools = checked
|
||||
checked: LauncherCore.config.showDevTools
|
||||
onCheckedChanged: LauncherCore.config.showDevTools = checked
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
|
@ -52,9 +52,9 @@ FormCard.FormCardPage {
|
|||
id: screenshotsPathDelegate
|
||||
|
||||
text: i18n("Screenshots Folder")
|
||||
folder: LauncherCore.settings.screenshotDir
|
||||
folder: LauncherCore.config.screenshotDir
|
||||
|
||||
onAccepted: (folder) => LauncherCore.settings.screenshotDir = folder
|
||||
onAccepted: (folder) => LauncherCore.config.screenshotDir = folder
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ FormCard.FormCardPage {
|
|||
id: dalamudChannelDelegate
|
||||
|
||||
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
|
||||
onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex
|
||||
enabled: page.profile.dalamudEnabled
|
||||
|
@ -265,13 +265,13 @@ FormCard.FormCardPage {
|
|||
FormCard.FormDelegateSeparator {
|
||||
above: dalamudChannelDelegate
|
||||
below: dalamudInjectDelegate
|
||||
visible: LauncherCore.settings.showDevTools
|
||||
visible: LauncherCore.config.showDevTools
|
||||
}
|
||||
|
||||
FormCard.FormComboBoxDelegate {
|
||||
id: dalamudInjectDelegate
|
||||
|
||||
visible: LauncherCore.settings.showDevTools
|
||||
visible: LauncherCore.config.showDevTools
|
||||
text: i18n("Injection Method")
|
||||
description: "It shouldn't be nessecary to change this setting, unless you're running into issues injecting Dalamud."
|
||||
model: ["Entrypoint", "DLL Injection"]
|
||||
|
@ -288,7 +288,7 @@ FormCard.FormCardPage {
|
|||
FormCard.FormSpinBoxDelegate {
|
||||
id: dalamudDelayDelegate
|
||||
|
||||
visible: LauncherCore.settings.showDevTools
|
||||
visible: LauncherCore.config.showDevTools
|
||||
label: i18n("Injection Delay")
|
||||
value: page.profile.dalamudInjectDelay
|
||||
onValueChanged: page.profile.dalamudInjectDelay = value
|
||||
|
|
|
@ -67,7 +67,7 @@ KirigamiSettings.CategorizedSettings {
|
|||
text: i18n("Developer Settings")
|
||||
icon.name: "preferences-others-symbolic"
|
||||
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/DeveloperSettings.qml")
|
||||
visible: LauncherCore.settings.showDevTools
|
||||
visible: LauncherCore.config.showDevTools
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "about"
|
||||
|
|
|
@ -38,8 +38,8 @@ FormCard.FormCardPage {
|
|||
|
||||
text: i18n("Enable Sync")
|
||||
description: i18n("Syncing will occur before login, and after the game exits.")
|
||||
checked: LauncherCore.settings.enableSync
|
||||
onCheckedChanged: LauncherCore.settings.enableSync = checked
|
||||
checked: LauncherCore.config.enableSync
|
||||
onCheckedChanged: LauncherCore.config.enableSync = checked
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ FormCard.FormCardPage {
|
|||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
||||
visible: !LauncherCore.syncManager.connected
|
||||
enabled: LauncherCore.settings.enableSync
|
||||
enabled: LauncherCore.config.enableSync
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: usernameDelegate
|
||||
|
|
Loading…
Add table
Reference in a new issue