mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-23 04:57:44 +00:00
Add a unified news option
This commit is contained in:
parent
160b96229e
commit
79483c1303
3 changed files with 11 additions and 33 deletions
|
@ -12,10 +12,7 @@ SPDX-License-Identifier: CC0-1.0
|
||||||
<entry name="CloseWhenLaunched" type="bool">
|
<entry name="CloseWhenLaunched" type="bool">
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
</entry>
|
</entry>
|
||||||
<entry name="ShowNewsBanners" type="bool">
|
<entry name="ShowNews" type="bool">
|
||||||
<default>true</default>
|
|
||||||
</entry>
|
|
||||||
<entry name="ShowNewsList" type="bool">
|
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
</entry>
|
</entry>
|
||||||
<entry name="AutoLogin" type="string">
|
<entry name="AutoLogin" type="string">
|
||||||
|
|
|
@ -59,8 +59,7 @@ class LauncherCore : public QObject
|
||||||
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(bool closeWhenLaunched READ closeWhenLaunched WRITE setCloseWhenLaunched NOTIFY closeWhenLaunchedChanged)
|
Q_PROPERTY(bool closeWhenLaunched READ closeWhenLaunched WRITE setCloseWhenLaunched NOTIFY closeWhenLaunchedChanged)
|
||||||
Q_PROPERTY(bool showNewsBanners READ showNewsBanners WRITE setShowNewsBanners NOTIFY showNewsBannersChanged)
|
Q_PROPERTY(bool showNews READ showNews WRITE setShowNews NOTIFY showNewsChanged)
|
||||||
Q_PROPERTY(bool showNewsList READ showNewsList WRITE setShowNewsList NOTIFY showNewsListChanged)
|
|
||||||
Q_PROPERTY(Headline *headline READ headline NOTIFY newsChanged)
|
Q_PROPERTY(Headline *headline READ headline NOTIFY newsChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -115,11 +114,8 @@ public:
|
||||||
bool closeWhenLaunched() const;
|
bool closeWhenLaunched() const;
|
||||||
void setCloseWhenLaunched(bool value);
|
void setCloseWhenLaunched(bool value);
|
||||||
|
|
||||||
bool showNewsBanners() const;
|
bool showNews() const;
|
||||||
void setShowNewsBanners(bool value);
|
void setShowNews(bool value);
|
||||||
|
|
||||||
bool showNewsList() const;
|
|
||||||
void setShowNewsList(bool value);
|
|
||||||
|
|
||||||
int defaultProfileIndex = 0;
|
int defaultProfileIndex = 0;
|
||||||
|
|
||||||
|
@ -147,8 +143,7 @@ signals:
|
||||||
void successfulLaunch();
|
void successfulLaunch();
|
||||||
void gameClosed();
|
void gameClosed();
|
||||||
void closeWhenLaunchedChanged();
|
void closeWhenLaunchedChanged();
|
||||||
void showNewsBannersChanged();
|
void showNewsChanged();
|
||||||
void showNewsListChanged();
|
|
||||||
void loginError(QString message);
|
void loginError(QString message);
|
||||||
void stageChanged(QString message);
|
void stageChanged(QString message);
|
||||||
void stageIndeterminate();
|
void stageIndeterminate();
|
||||||
|
|
|
@ -416,31 +416,17 @@ void LauncherCore::setCloseWhenLaunched(const bool value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LauncherCore::showNewsBanners() const
|
bool LauncherCore::showNews() const
|
||||||
{
|
{
|
||||||
return Config::showNewsBanners();
|
return Config::showNews();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherCore::setShowNewsBanners(const bool value)
|
void LauncherCore::setShowNews(const bool value)
|
||||||
{
|
{
|
||||||
if (value != Config::showNewsBanners()) {
|
if (value != Config::showNews()) {
|
||||||
Config::setShowNewsBanners(value);
|
Config::setShowNews(value);
|
||||||
Config::self()->save();
|
Config::self()->save();
|
||||||
Q_EMIT showNewsBannersChanged();
|
Q_EMIT showNewsChanged();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LauncherCore::showNewsList() const
|
|
||||||
{
|
|
||||||
return Config::showNewsList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LauncherCore::setShowNewsList(const bool value)
|
|
||||||
{
|
|
||||||
if (value != Config::showNewsList()) {
|
|
||||||
Config::setShowNewsList(value);
|
|
||||||
Config::self()->save();
|
|
||||||
Q_EMIT showNewsListChanged();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue