Add option to disable feature for checking for a new update

(cherry picked from commit d26dd55dba066aa4884b00b55173597f49309f0d)
This commit is contained in:
Yuriy Puchkov
2021-01-31 11:47:03 +02:00
parent de3b0385d5
commit 540e407eb7
7 changed files with 62 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ GeneralConf::GeneralConf(QWidget* parent)
initShowSidePanelButton();
initShowDesktopNotification();
initShowTrayIcon();
initCheckForUpdates();
initAutostart();
initUseJpgForClipboard();
initSaveAfterCopy();
@@ -93,6 +94,12 @@ void GeneralConf::showTrayIconChanged(bool checked)
}
}
void GeneralConf::checkForUpdatesChanged(bool checked)
{
ConfigHandler().setCheckForUpdates(checked);
Controller::getInstance()->setCheckForUpdatesEnabled(checked);
}
void GeneralConf::autostartChanged(bool checked)
{
ConfigHandler().setStartupLaunch(checked);
@@ -247,6 +254,19 @@ void GeneralConf::initConfigButtons()
&GeneralConf::resetConfiguration);
}
void GeneralConf::initCheckForUpdates()
{
m_checkForUpdates = new QCheckBox(tr("Automatic check for updates"), this);
m_checkForUpdates->setChecked(ConfigHandler().checkForUpdates());
m_checkForUpdates->setToolTip(tr("Automatic check for updates"));
m_layout->addWidget(m_checkForUpdates);
connect(m_checkForUpdates,
&QCheckBox::clicked,
this,
&GeneralConf::checkForUpdatesChanged);
}
void GeneralConf::initAutostart()
{
m_autostart = new QCheckBox(tr("Launch at startup"), this);