update_settings: fix update autocheck on/off handling

Origin commit data
------------------
Commit: 30b47b60ed
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-01-12 (Fri, 12 Jan 2018)

Origin message was:
------------------
- update_settings: fix update autocheck on/off handling
This commit is contained in:
vanhofen
2018-01-12 11:31:55 +01:00
parent ca8ecfd93c
commit 6caa304a17
3 changed files with 19 additions and 2 deletions

View File

@@ -38,6 +38,7 @@
#include <mymenu.h>
#include <neutrino_menue.h>
#include <gui/filebrowser.h>
#include <gui/update_check.h>
#include <gui/update_ext.h>
#include <gui/update_settings.h>
#include <gui/widget/icons.h>
@@ -143,7 +144,7 @@ int CUpdateSettings::initMenu()
OnOffNotifier->addItem(apply_kernel);
#endif
CMenuOptionChooser *autocheck = new CMenuOptionChooser(LOCALE_FLASHUPDATE_AUTOCHECK, &g_settings.softupdate_autocheck, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, OnOffNotifier);
CMenuOptionChooser *autocheck = new CMenuOptionChooser(LOCALE_FLASHUPDATE_AUTOCHECK, &g_settings.softupdate_autocheck, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
// apply_settings->setHint("", LOCALE_MENU_HINT_XXX);
w_upsettings.addItem(fw_update_dir);
@@ -167,3 +168,15 @@ int CUpdateSettings::initMenu()
return res;
}
bool CUpdateSettings::changeNotify(const neutrino_locale_t OptionName, void * /* data */)
{
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_FLASHUPDATE_AUTOCHECK))
{
CFlashUpdateCheck::getInstance()->stopThread();
if (g_settings.softupdate_autocheck)
CFlashUpdateCheck::getInstance()->startThread();
}
return false;
}