mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
added "beta update" settings
This commit is contained in:
parent
b1ed458c31
commit
42581598e1
|
@ -24,6 +24,7 @@
|
|||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/Toasts.hpp"
|
||||
#include "singletons/Updates.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/IsBigEndian.hpp"
|
||||
#include "util/PostToThread.hpp"
|
||||
|
@ -99,6 +100,9 @@ int Application::run(QApplication &qtApp)
|
|||
|
||||
this->windows->getMainWindow().show();
|
||||
|
||||
getSettings()->betaUpdates.connect(
|
||||
[] { Updates::getInstance().checkForUpdates(); }, false);
|
||||
|
||||
return qtApp.exec();
|
||||
}
|
||||
|
||||
|
|
|
@ -198,6 +198,7 @@ public:
|
|||
QStringSetting streamlinkOpts = {"/external/streamlink/options", ""};
|
||||
|
||||
/// Misc
|
||||
BoolSetting betaUpdates = {"/misc/beta", false};
|
||||
IntSetting startUpNotification = {"/misc/startUpNotification", 0};
|
||||
QStringSetting currentVersion = {"/misc/currentVersion", ""};
|
||||
BoolSetting loadTwitchMessageHistoryOnConnect = {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "Updates.hpp"
|
||||
|
||||
#include "Settings.hpp"
|
||||
#include "common/NetworkRequest.hpp"
|
||||
#include "common/Outcome.hpp"
|
||||
#include "common/Version.hpp"
|
||||
|
@ -13,6 +14,12 @@
|
|||
#include <QProcess>
|
||||
|
||||
namespace chatterino {
|
||||
namespace {
|
||||
QString currentBranch()
|
||||
{
|
||||
return getSettings()->betaUpdates ? "beta" : "stable";
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Updates::Updates()
|
||||
: currentVersion_(CHATTERINO_VERSION)
|
||||
|
@ -195,8 +202,8 @@ void Updates::installUpdates()
|
|||
void Updates::checkForUpdates()
|
||||
{
|
||||
QString url =
|
||||
"https://notitia.chatterino.com/version/chatterino/" CHATTERINO_OS
|
||||
"/stable";
|
||||
"https://notitia.chatterino.com/version/chatterino/" CHATTERINO_OS "/" +
|
||||
currentBranch();
|
||||
|
||||
NetworkRequest(url)
|
||||
.timeout(60000)
|
||||
|
|
|
@ -290,6 +290,11 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
|||
layout.addCheckbox("Category", s.headerGame);
|
||||
layout.addCheckbox("Title", s.headerStreamTitle);
|
||||
|
||||
layout.addTitle("Beta");
|
||||
layout.addDescription("You can receive updates earlier by ticking the box "
|
||||
"below. Updates are checked on startup.");
|
||||
layout.addCheckbox("Receive beta updates", s.betaUpdates);
|
||||
|
||||
layout.addTitle("Miscellaneous");
|
||||
|
||||
//layout.addWidget(makeOpenSettingDirButton());
|
||||
|
|
Loading…
Reference in a new issue