mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-23 04:57:44 +00:00
Add an option to hide and show the dev tools
This commit is contained in:
parent
f14058afe9
commit
46a74830fd
5 changed files with 37 additions and 0 deletions
|
@ -17,6 +17,9 @@ SPDX-License-Identifier: CC0-1.0
|
|||
</entry>
|
||||
<entry name="AutoLogin" type="string">
|
||||
</entry>
|
||||
<entry name="ShowDevTools" type="bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="KeepPatches" type="bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
|
|
|
@ -64,6 +64,7 @@ class LauncherCore : public QObject
|
|||
Q_PROPERTY(AccountManager *accountManager READ accountManager CONSTANT)
|
||||
Q_PROPERTY(bool closeWhenLaunched READ closeWhenLaunched WRITE setCloseWhenLaunched NOTIFY closeWhenLaunchedChanged)
|
||||
Q_PROPERTY(bool showNews READ showNews WRITE setShowNews NOTIFY showNewsChanged)
|
||||
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)
|
||||
|
@ -125,6 +126,9 @@ public:
|
|||
bool showNews() const;
|
||||
void setShowNews(bool value);
|
||||
|
||||
bool showDevTools() const;
|
||||
void setShowDevTools(bool value);
|
||||
|
||||
bool keepPatches() const;
|
||||
void setKeepPatches(bool value);
|
||||
|
||||
|
@ -165,6 +169,7 @@ signals:
|
|||
void gameClosed();
|
||||
void closeWhenLaunchedChanged();
|
||||
void showNewsChanged();
|
||||
void showDevToolsChanged();
|
||||
void keepPatchesChanged();
|
||||
void dalamudDistribServerChanged();
|
||||
void squareEnixServerChanged();
|
||||
|
|
|
@ -504,6 +504,20 @@ void LauncherCore::setShowNews(const bool value)
|
|||
}
|
||||
}
|
||||
|
||||
bool LauncherCore::showDevTools() const
|
||||
{
|
||||
return Config::showDevTools();
|
||||
}
|
||||
|
||||
void LauncherCore::setShowDevTools(const bool value)
|
||||
{
|
||||
if (value != Config::showDevTools()) {
|
||||
Config::setShowDevTools(value);
|
||||
Config::self()->save();
|
||||
Q_EMIT showDevToolsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool LauncherCore::keepPatches() const
|
||||
{
|
||||
return Config::keepPatches();
|
||||
|
|
|
@ -37,5 +37,18 @@ FormCard.FormCardPage {
|
|||
checked: LauncherCore.showNews
|
||||
onCheckedChanged: LauncherCore.showNews = checked
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: showNewsDelegate
|
||||
below: showDevToolsDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showDevToolsDelegate
|
||||
|
||||
text: i18n("Show Developer Settings")
|
||||
checked: LauncherCore.showDevTools
|
||||
onCheckedChanged: LauncherCore.showDevTools = checked
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ import QtQuick 2.15
|
|||
import org.kde.kirigami 2.18 as Kirigami
|
||||
import org.kde.kirigamiaddons.settings 1.0 as KirigamiSettings
|
||||
import QtQuick.Layouts 1.15
|
||||
import zone.xiv.astra 1.0
|
||||
|
||||
KirigamiSettings.CategorizedSettings {
|
||||
id: settingsPage
|
||||
|
@ -39,6 +40,7 @@ KirigamiSettings.CategorizedSettings {
|
|||
text: i18n("Developer Settings")
|
||||
icon.name: "preferences-others"
|
||||
page: Qt.resolvedUrl("DeveloperSettings.qml")
|
||||
visible: LauncherCore.showDevTools
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
actionName: "about"
|
||||
|
|
Loading…
Add table
Reference in a new issue