mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Remove "Show News" setting
I think this was rarely used, and it just complicates some things.
This commit is contained in:
parent
a106f01697
commit
27ee80522b
6 changed files with 4 additions and 57 deletions
|
@ -13,9 +13,6 @@ SPDX-License-Identifier: CC0-1.0
|
|||
<entry name="CloseWhenLaunched" type="bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="ShowNews" type="bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="AutoLogin" type="string">
|
||||
</entry>
|
||||
<entry name="ShowDevTools" type="bool">
|
||||
|
|
|
@ -15,7 +15,6 @@ class LauncherSettings : public QObject
|
|||
QML_UNCREATABLE("Use LauncherCore.settings")
|
||||
|
||||
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)
|
||||
|
@ -34,9 +33,6 @@ public:
|
|||
[[nodiscard]] bool closeWhenLaunched() const;
|
||||
void setCloseWhenLaunched(bool value);
|
||||
|
||||
[[nodiscard]] bool showNews() const;
|
||||
void setShowNews(bool value);
|
||||
|
||||
[[nodiscard]] bool showDevTools() const;
|
||||
void setShowDevTools(bool value);
|
||||
|
||||
|
@ -82,7 +78,6 @@ public:
|
|||
|
||||
Q_SIGNALS:
|
||||
void closeWhenLaunchedChanged();
|
||||
void showNewsChanged();
|
||||
void showDevToolsChanged();
|
||||
void keepPatchesChanged();
|
||||
void dalamudDistribServerChanged();
|
||||
|
@ -97,4 +92,4 @@ Q_SIGNALS:
|
|||
|
||||
private:
|
||||
Config *m_config = nullptr;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -23,20 +23,6 @@ void LauncherSettings::setCloseWhenLaunched(const bool value)
|
|||
}
|
||||
}
|
||||
|
||||
bool LauncherSettings::showNews() const
|
||||
{
|
||||
return m_config->showNews();
|
||||
}
|
||||
|
||||
void LauncherSettings::setShowNews(const bool value)
|
||||
{
|
||||
if (value != m_config->showNews()) {
|
||||
m_config->setShowNews(value);
|
||||
m_config->save();
|
||||
Q_EMIT showNewsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool LauncherSettings::showDevTools() const
|
||||
{
|
||||
return m_config->showDevTools();
|
||||
|
@ -233,4 +219,4 @@ Config *LauncherSettings::config()
|
|||
return m_config;
|
||||
}
|
||||
|
||||
#include "moc_launchersettings.cpp"
|
||||
#include "moc_launchersettings.cpp"
|
||||
|
|
|
@ -127,15 +127,5 @@ Kirigami.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: LauncherCore.settings
|
||||
|
||||
function onShowNewsChanged(): void {
|
||||
// workaround annoying Qt layout bug
|
||||
// TODO: see if this changed in Qt7
|
||||
appWindow.pageStack.replace(Qt.createComponent("zone.xiv.astra", "MainPage"))
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: checkSetup()
|
||||
}
|
||||
|
|
|
@ -41,8 +41,7 @@ Kirigami.Page {
|
|||
id: loginPage
|
||||
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.minimumWidth: LauncherCore.settings.showNews ? Kirigami.Units.gridUnit * 26 : 0
|
||||
Layout.fillWidth: !LauncherCore.settings.showNews
|
||||
Layout.minimumWidth: Kirigami.Units.gridUnit * 26
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
@ -52,8 +51,6 @@ Kirigami.Page {
|
|||
}
|
||||
|
||||
Loader {
|
||||
active: LauncherCore.settings.showNews
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
|
@ -67,4 +64,4 @@ Kirigami.Page {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,24 +31,6 @@ FormCard.FormCardPage {
|
|||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: closeAstraDelegate
|
||||
below: showNewsDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showNewsDelegate
|
||||
|
||||
text: i18n("Enable and show news")
|
||||
checked: LauncherCore.settings.showNews
|
||||
onCheckedChanged: {
|
||||
LauncherCore.settings.showNews = checked;
|
||||
if (page.Window.window !== null) {
|
||||
page.Window.window.close(); // if we don't close the dialog it crashes!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: showNewsDelegate
|
||||
below: showDevToolsDelegate
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue