start-wizard: formatting code using astyle; some manual code nicenings

Origin commit data
------------------
Commit: d415de350d
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-12-04 (Sat, 04 Dec 2021)

Origin message was:
------------------
- start-wizard: formatting code using astyle; some manual code nicenings
This commit is contained in:
vanhofen
2021-12-04 23:22:35 +01:00
parent c4eba4cff4
commit 30b430ea8d
2 changed files with 48 additions and 45 deletions

View File

@@ -35,7 +35,6 @@
Otherwise ask the copyright owners, anything else would be theft!
*/
#include "start_wizard.h"
#include <global.h>
@@ -80,7 +79,7 @@ const CMenuOptionChooser::keyval WIZARD_SETUP_TYPE[] =
int CStartUpWizard::exec(CMenuTarget *parent, const string &/*actionKey*/)
{
//NI remove menu-timeout during wizard
// remove menu-timeout during wizard
int default_timing_menu = g_settings.timing[SNeutrinoSettings::TIMING_MENU];
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = 0;
//printf("[neutrino] Removing 'timing.menu' during wizard ...\n");
@@ -98,7 +97,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
languageSettings.showLanguageSetup(&osdl_setup);
osdl_setup.exec(NULL, "");
/* hack to ensure system's view of timezone is the same as neutrino's */
// hack to ensure system's view of timezone is the same as neutrino's
CTZChangeNotifier tzn;
tzn.changeNotify(NONEXISTANT_LOCALE, (void *)"dummy");
@@ -106,14 +105,13 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
CSettingsManager settingsManager(SNeutrinoSettings::WIZARD_START);
settingsManager.exec(NULL, "");
#if 0
if(ShowMsg (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbrCancel) == CMsgBox::mbrYes)
#endif
//if (ShowMsg(LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbrCancel) == CMsgBox::mbrYes)
{
int advanced = 1;
#ifdef ENABLE_FASTSCAN
std::string lang = g_settings.language;
if (lang == "nederlands") {
if (lang == "nederlands")
{
advanced = 0;
CMenuWidget wtype(LOCALE_WIZARD_SETUP);
wtype.setWizardMode(SNeutrinoSettings::WIZARD_ON);
@@ -125,7 +123,8 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
}
#endif
// open video settings in wizardmode
if(advanced && res != menu_return::RETURN_EXIT_ALL) {
if (advanced && res != menu_return::RETURN_EXIT_ALL)
{
g_videoSettings->setWizardMode(SNeutrinoSettings::WIZARD_ON);
res = g_videoSettings->exec(NULL, "");
g_videoSettings->setWizardMode(SNeutrinoSettings::WIZARD_OFF);
@@ -166,7 +165,8 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
if (advanced && init_settings && (res != menu_return::RETURN_EXIT_ALL))
{
if (ShowMsg(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS),
CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30) == CMsgBox::mbrYes) {
CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30) == CMsgBox::mbrYes)
{
system("/bin/cp " CONFIGDIR "/initial/* " ZAPITDIR);
CFEManager::getInstance()->loadSettings();
CFEManager::getInstance()->saveSettings();
@@ -176,21 +176,26 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
if (res != menu_return::RETURN_EXIT_ALL)
{
CScanSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_ON);
if (advanced) {
if (advanced)
{
res = CScanSetup::getInstance()->exec(NULL, "setup_frontend");
if (res != menu_return::RETURN_EXIT_ALL)
res = CScanSetup::getInstance()->exec(NULL, "");
} else {
}
else
{
CZapit::getInstance()->GetConfig(zapitCfg);
#ifdef ENABLE_FASTSCAN
if (CFEManager::getInstance()->haveSat()) {
if (CFEManager::getInstance()->haveSat())
{
CMenuWidget fastScanMenu(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_FAST_SCAN);
fastScanMenu.setWizardMode(SNeutrinoSettings::WIZARD_ON);
CScanSetup::getInstance()->addScanMenuFastScan(&fastScanMenu);
res = fastScanMenu.exec(NULL, "");
}
#endif
if (CFEManager::getInstance()->haveCable()) {
if (CFEManager::getInstance()->haveCable())
{
CMenuWidget cableScan(LOCALE_SATSETUP_CABLE, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_CABLE_SCAN);
cableScan.setWizardMode(SNeutrinoSettings::WIZARD_ON);
CScanSetup::getInstance()->addScanMenuCable(&cableScan);
@@ -201,8 +206,9 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
}
}
//NI reset menu-timeout to our default if user doesn't change the value
if (g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0) {
// reset menu-timeout to our default if user doesn't change the value
if (g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0)
{
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = default_timing_menu;
//printf("[neutrino] Set 'timing.menu' to default...\n");
}
@@ -220,4 +226,3 @@ inline void CStartUpWizard::killBackgroundLogo()
{
CFrameBuffer::getInstance()->stopFrame();
}

View File

@@ -42,7 +42,6 @@
#include <neutrino.h>
#include <neutrino_menue.h>
class CStartUpWizard : public CMenuTarget
{
private:
@@ -55,5 +54,4 @@ class CStartUpWizard : public CMenuTarget
int exec(CMenuTarget *parent, const std::string &actionKey);
};
#endif