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

Add screenshots directory setting

This commit is contained in:
Joshua Goins 2023-10-11 12:58:53 -04:00
parent 428cbeae4c
commit 2d7538bae1
4 changed files with 37 additions and 0 deletions

View file

@ -8,6 +8,7 @@ SPDX-FileCopyrightText: Joshua Goins <josh@redstrate.com>
SPDX-License-Identifier: CC0-1.0
-->
<kcfgfile arg="true" />
<include>QDir</include>
<group name="General">
<entry name="CloseWhenLaunched" type="bool">
<default>true</default>
@ -24,6 +25,9 @@ SPDX-License-Identifier: CC0-1.0
</entry>
<entry name="CurrentProfile" type="String">
</entry>
<entry name="ScreenshotDir" type="String">
<default code="true">QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + QDir::separator() + QStringLiteral("FFXIV")</default>
</entry>
</group>
<group name="Developer">
<entry name="KeepPatches" type="bool">

View file

@ -74,6 +74,7 @@ class LauncherCore : public QObject
Q_PROPERTY(QString squareEnixLoginServer READ squareEnixLoginServer WRITE setSquareEnixLoginServer NOTIFY squareEnixLoginServerChanged)
Q_PROPERTY(QString xivApiServer READ xivApiServer WRITE setXivApiServer NOTIFY xivApiServerChanged)
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(Headline *headline READ headline NOTIFY newsChanged)
Q_PROPERTY(Profile *currentProfile READ currentProfile WRITE setCurrentProfile NOTIFY currentProfileChanged)
@ -151,6 +152,9 @@ public:
[[nodiscard]] QString preferredProtocol() const;
void setPreferredProtocol(const QString &value);
[[nodiscard]] QString screenshotDir() const;
void setScreenshotDir(const QString &value);
[[nodiscard]] bool argumentsEncrypted() const;
void setArgumentsEncrypted(bool value);
@ -190,6 +194,7 @@ signals:
void squareEnixLoginServerChanged();
void xivApiServerChanged();
void preferredProtocolChanged();
void screenshotDirChanged();
void encryptedArgumentsChanged();
void loginError(QString message);
void dalamudError(QString message);

View file

@ -646,6 +646,20 @@ void LauncherCore::setPreferredProtocol(const QString &value)
}
}
QString LauncherCore::screenshotDir() const
{
return m_config->screenshotDir();
}
void LauncherCore::setScreenshotDir(const QString &value)
{
if (value != m_config->screenshotDir()) {
m_config->setScreenshotDir(value);
m_config->save();
Q_EMIT screenshotDirChanged();
}
}
bool LauncherCore::argumentsEncrypted() const
{
return m_config->encryptArguments();

View file

@ -86,6 +86,20 @@ FormCard.FormCardPage {
checked: LauncherCore.showDevTools
onCheckedChanged: LauncherCore.showDevTools = checked
}
FormCard.FormDelegateSeparator {
above: showDevToolsDelegate
below: screenshotsPathDelegate
}
FormFolderDelegate {
id: screenshotsPathDelegate
text: i18n("Screenshots Folder")
folder: LauncherCore.screenshotDir
onAccepted: (folder) => LauncherCore.screenshotDir = folder
}
}
FormCard.FormCard {