logic: Moved update check setting to preferences and enable automatic update check by default
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "License.h"
|
||||
#include "PublicKey.h"
|
||||
#include "qt/network/QtUpdateChecker.h"
|
||||
#include "qt/element/QtUpdateCheckerWidget.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "settings/ProjectSettings.h"
|
||||
@@ -163,33 +163,8 @@ void QtStartScreen::setupStartScreen()
|
||||
versionLabel->setObjectName("versionLabel");
|
||||
col->addWidget(versionLabel);
|
||||
|
||||
QPushButton* updateButton = new QPushButton("check for new version", this);
|
||||
updateButton->setObjectName("updateButton");
|
||||
updateButton->setCursor(Qt::PointingHandCursor);
|
||||
connect(updateButton, &QPushButton::clicked,
|
||||
[]()
|
||||
{
|
||||
QtUpdateChecker::check(true);
|
||||
}
|
||||
);
|
||||
col->addWidget(updateButton);
|
||||
|
||||
QCheckBox* updateCheckbox = new QCheckBox("automatic update check");
|
||||
updateCheckbox->setObjectName("updateCheckbox");
|
||||
updateCheckbox->setChecked(ApplicationSettings::getInstance()->getAutomaticUpdateCheck());
|
||||
connect(updateCheckbox, &QCheckBox::stateChanged,
|
||||
[updateCheckbox]()
|
||||
{
|
||||
ApplicationSettings::getInstance()->setAutomaticUpdateCheck(updateCheckbox->isChecked());
|
||||
ApplicationSettings::getInstance()->save();
|
||||
|
||||
if (updateCheckbox->isChecked())
|
||||
{
|
||||
QtUpdateChecker::check();
|
||||
}
|
||||
}
|
||||
);
|
||||
col->addWidget(updateCheckbox);
|
||||
QtUpdateCheckerWidget* checker = new QtUpdateCheckerWidget(this);
|
||||
col->addWidget(checker);
|
||||
|
||||
if (!licenseValid)
|
||||
{
|
||||
|
||||
@@ -91,13 +91,33 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
|
||||
QString modifierName =utility::getOsType() == OS_MAC ? "Cmd" : "Ctrl";
|
||||
m_graphZooming = addCheckBox(
|
||||
"Graph Zoom",
|
||||
"Zoom on mouse wheel",
|
||||
"Zoom graph on mouse wheel",
|
||||
"<p>Enable graph zoom using mouse wheel only, instead of using " + modifierName + " + Mouse Wheel.</p>",
|
||||
layout, row
|
||||
);
|
||||
|
||||
addGap(layout, row);
|
||||
|
||||
// Network
|
||||
addTitle("NETWORK", layout, row);
|
||||
|
||||
// Update check
|
||||
m_automaticUpdateCheck = addCheckBox("Automatic<br />Update Check", "Check automatically for updates",
|
||||
"<p>Check automatically for a new releases once a day.</p>", layout, row);
|
||||
addGap(layout, row);
|
||||
|
||||
// Plugins
|
||||
addTitle("PLUGIN", layout, row);
|
||||
|
||||
// Sourcetrail port
|
||||
m_sourcetrailPort = addLineEdit("Sourcetrail Port",
|
||||
"<p>Port number that Sourcetrail uses to listen for incoming messages from plugins.</p>", layout, row);
|
||||
|
||||
// Sourcetrail port
|
||||
m_pluginPort = addLineEdit("Plugin Port", "<p>Port number that Sourcetrail uses to sends outgoing messages to plugins.</p>", layout, row);
|
||||
|
||||
addGap(layout, row);
|
||||
|
||||
// indexing
|
||||
addTitle("INDEXING", layout, row);
|
||||
|
||||
@@ -140,18 +160,6 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
|
||||
addGap(layout, row);
|
||||
|
||||
|
||||
// Plugins
|
||||
addTitle("PLUGIN", layout, row);
|
||||
|
||||
// Sourcetrail port
|
||||
m_sourcetrailPort = addLineEdit("Sourcetrail Port",
|
||||
"<p>Port number that Sourcetrail uses to listen for incoming messages from plugins.</p>", layout, row);
|
||||
|
||||
// Sourcetrail port
|
||||
m_pluginPort = addLineEdit("Plugin Port", "<p>Port number that Sourcetrail uses to sends outgoing messages to plugins.</p>", layout, row);
|
||||
|
||||
addGap(layout, row);
|
||||
|
||||
// Java
|
||||
addTitle("JAVA", layout, row);
|
||||
|
||||
@@ -301,6 +309,8 @@ void QtProjectWizzardContentPreferences::load()
|
||||
m_scrollSpeed->setText(QString::number(appSettings->getScrollSpeed(), 'f', 1));
|
||||
m_graphZooming->setChecked(appSettings->getControlsGraphZoomOnMouseWheel());
|
||||
|
||||
m_automaticUpdateCheck->setChecked(appSettings->getAutomaticUpdateCheck());
|
||||
|
||||
m_sourcetrailPort->setText(QString::number(appSettings->getSourcetrailPort()));
|
||||
m_pluginPort->setText(QString::number(appSettings->getPluginPort()));
|
||||
|
||||
@@ -345,6 +355,8 @@ void QtProjectWizzardContentPreferences::save()
|
||||
|
||||
appSettings->setControlsGraphZoomOnMouseWheel(m_graphZooming->isChecked());
|
||||
|
||||
appSettings->setAutomaticUpdateCheck(m_automaticUpdateCheck->isChecked());
|
||||
|
||||
int sourcetrailPort = m_sourcetrailPort->text().toInt();
|
||||
if (sourcetrailPort) appSettings->setSourcetrailPort(sourcetrailPort);
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ private:
|
||||
QLineEdit* m_scrollSpeed;
|
||||
QCheckBox* m_graphZooming;
|
||||
|
||||
QCheckBox* m_automaticUpdateCheck;
|
||||
|
||||
QLineEdit* m_sourcetrailPort;
|
||||
QLineEdit* m_pluginPort;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user