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

Conflicts:
	src/gui/start_wizard.cpp

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-12-06 05:18:19 +01:00
committed by Thilo Graf
parent b42885f423
commit 0125eb6e15
2 changed files with 56 additions and 42 deletions

View File

@@ -35,7 +35,6 @@
Otherwise ask the copyright owners, anything else would be theft! Otherwise ask the copyright owners, anything else would be theft!
*/ */
#include "start_wizard.h" #include "start_wizard.h"
#include <global.h> #include <global.h>
@@ -80,6 +79,11 @@ const CMenuOptionChooser::keyval WIZARD_SETUP_TYPE[] =
int CStartUpWizard::exec(CMenuTarget *parent, const string &/*actionKey*/) int CStartUpWizard::exec(CMenuTarget *parent, const string &/*actionKey*/)
{ {
// 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");
int res = menu_return::RETURN_REPAINT; int res = menu_return::RETURN_REPAINT;
showBackgroundLogo(); showBackgroundLogo();
@@ -93,7 +97,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
languageSettings.showLanguageSetup(&osdl_setup); languageSettings.showLanguageSetup(&osdl_setup);
osdl_setup.exec(NULL, ""); 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; CTZChangeNotifier tzn;
tzn.changeNotify(NONEXISTANT_LOCALE, (void *)"dummy"); tzn.changeNotify(NONEXISTANT_LOCALE, (void *)"dummy");
@@ -101,14 +105,13 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
CSettingsManager settingsManager(SNeutrinoSettings::WIZARD_START); CSettingsManager settingsManager(SNeutrinoSettings::WIZARD_START);
settingsManager.exec(NULL, ""); 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)
if(ShowMsg (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbrCancel) == CMsgBox::mbrYes)
#endif
{ {
int advanced = 1; int advanced = 1;
#ifdef ENABLE_FASTSCAN #ifdef ENABLE_FASTSCAN
std::string lang = g_settings.language; std::string lang = g_settings.language;
if (lang == "nederlands") { if (lang == "nederlands")
{
advanced = 0; advanced = 0;
CMenuWidget wtype(LOCALE_WIZARD_SETUP); CMenuWidget wtype(LOCALE_WIZARD_SETUP);
wtype.setWizardMode(SNeutrinoSettings::WIZARD_ON); wtype.setWizardMode(SNeutrinoSettings::WIZARD_ON);
@@ -120,7 +123,8 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
} }
#endif #endif
// open video settings in wizardmode // 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); g_videoSettings->setWizardMode(SNeutrinoSettings::WIZARD_ON);
res = g_videoSettings->exec(NULL, ""); res = g_videoSettings->exec(NULL, "");
g_videoSettings->setWizardMode(SNeutrinoSettings::WIZARD_OFF); g_videoSettings->setWizardMode(SNeutrinoSettings::WIZARD_OFF);
@@ -161,7 +165,8 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
if (advanced && init_settings && (res != menu_return::RETURN_EXIT_ALL)) if (advanced && init_settings && (res != menu_return::RETURN_EXIT_ALL))
{ {
if (ShowMsg(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS), 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); system("/bin/cp " CONFIGDIR "/initial/* " ZAPITDIR);
CFEManager::getInstance()->loadSettings(); CFEManager::getInstance()->loadSettings();
CFEManager::getInstance()->saveSettings(); CFEManager::getInstance()->saveSettings();
@@ -171,21 +176,26 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
if (res != menu_return::RETURN_EXIT_ALL) if (res != menu_return::RETURN_EXIT_ALL)
{ {
CScanSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_ON); CScanSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_ON);
if (advanced) { if (advanced)
{
res = CScanSetup::getInstance()->exec(NULL, "setup_frontend"); res = CScanSetup::getInstance()->exec(NULL, "setup_frontend");
if (res != menu_return::RETURN_EXIT_ALL) if (res != menu_return::RETURN_EXIT_ALL)
res = CScanSetup::getInstance()->exec(NULL, ""); res = CScanSetup::getInstance()->exec(NULL, "");
} else { }
else
{
CZapit::getInstance()->GetConfig(zapitCfg); CZapit::getInstance()->GetConfig(zapitCfg);
#ifdef ENABLE_FASTSCAN #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); CMenuWidget fastScanMenu(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_FAST_SCAN);
fastScanMenu.setWizardMode(SNeutrinoSettings::WIZARD_ON); fastScanMenu.setWizardMode(SNeutrinoSettings::WIZARD_ON);
CScanSetup::getInstance()->addScanMenuFastScan(&fastScanMenu); CScanSetup::getInstance()->addScanMenuFastScan(&fastScanMenu);
res = fastScanMenu.exec(NULL, ""); res = fastScanMenu.exec(NULL, "");
} }
#endif #endif
if (CFEManager::getInstance()->haveCable()) { if (CFEManager::getInstance()->haveCable())
{
CMenuWidget cableScan(LOCALE_SATSETUP_CABLE, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_CABLE_SCAN); CMenuWidget cableScan(LOCALE_SATSETUP_CABLE, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_CABLE_SCAN);
cableScan.setWizardMode(SNeutrinoSettings::WIZARD_ON); cableScan.setWizardMode(SNeutrinoSettings::WIZARD_ON);
CScanSetup::getInstance()->addScanMenuCable(&cableScan); CScanSetup::getInstance()->addScanMenuCable(&cableScan);
@@ -196,6 +206,13 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
} }
} }
// 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");
}
killBackgroundLogo(); killBackgroundLogo();
return res; return res;
} }
@@ -209,4 +226,3 @@ inline void CStartUpWizard::killBackgroundLogo()
{ {
CFrameBuffer::getInstance()->stopFrame(); CFrameBuffer::getInstance()->stopFrame();
} }

View File

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