mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
- start_wizard: add settingsmanager menu ...
... to allow restoring of backups
This commit is contained in:
@@ -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__);
|
||||
|
@@ -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 = "");
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user