start_wizard: add settingsmanager menu ...

... to allow restoring of backups


Origin commit data
------------------
Branch: ni/coolstream
Commit: f3044134b1
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-05-15 (Fri, 15 May 2015)

Origin message was:
------------------
- start_wizard: add settingsmanager menu ...

 ... to allow restoring of backups


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2015-05-15 03:25:54 +02:00
parent 4d2372f37e
commit af4fcb301d
3 changed files with 42 additions and 5 deletions

View File

@@ -48,9 +48,10 @@
CSettingsManager::CSettingsManager()
CSettingsManager::CSettingsManager(bool wizard_mode)
{
width = 40;
is_wizard = wizard_mode;
}
@@ -136,11 +137,35 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
return res;
}
res = showMenu();
res = is_wizard ? showMenu_wizard() : showMenu();
return res;
}
//use a own small menu for start_wizard, because i don't want to fiddle around the easymenu code
int CSettingsManager::showMenu_wizard()
{
printf("[neutrino] CSettingsManager call %s...\n", __FUNCTION__);
CMenuWidget * mset = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_SETTINGS_MNGR);
mset->setWizardMode(is_wizard);
mset->addIntroItems(LOCALE_MAINSETTINGS_MANAGE);
CMenuForwarder * mf;
mf = new CMenuForwarder(LOCALE_EXTRA_LOADCONFIG, true, NULL, this, "loadconfig", CRCInput::RC_red);
mf->setHint(NEUTRINO_ICON_HINT_LOAD, LOCALE_MENU_HINT_LOAD);
mset->addItem(mf);
mf = new CMenuForwarder(LOCALE_SETTINGS_RESTORE, true, NULL, this, "restore", CRCInput::RC_green);
mf->setHint(NEUTRINO_ICON_HINT_BACKUP, LOCALE_MENU_HINT_BACKUP);
mset->addItem(mf);
int res = mset->exec(NULL, "");
delete mset;
return res;
}
int CSettingsManager::showMenu()
{
printf("[neutrino] CSettingsManager call %s...\n", __FUNCTION__);

View File

@@ -39,11 +39,19 @@ class CSettingsManager : public CMenuTarget
{
private:
int width;
bool is_wizard;
int showMenu();
int showMenu_wizard();
public:
CSettingsManager();
enum SETTINGSMANAGER_MODE
{
SETTINGSMANAGER_MODE_WIZARD_NO = 0,
SETTINGSMANAGER_MODE_WIZARD = 1
};
CSettingsManager(bool wizard_mode = SETTINGSMANAGER_MODE_WIZARD_NO);
~CSettingsManager();
int exec(CMenuTarget* parent, const std::string & actionKey = "");

View File

@@ -46,6 +46,7 @@
#include "osd_setup.h"
#include "osdlang_setup.h"
#include "scan_setup.h"
#include "settings_manager.h"
#include "videosettings.h"
#include <zapit/zapit.h>
#include <system/helpers.h>
@@ -91,6 +92,9 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
languageSettings.showLanguageSetup(&osdl_setup);
osdl_setup.exec(NULL, "");
CSettingsManager settingsManager(CSettingsManager::SETTINGSMANAGER_MODE_WIZARD);
settingsManager.exec(NULL, "");
if(ShowMsg (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes)
{
int advanced = 1;