as requested, implement 'easy' menu mode for novice users;

default behavior should not be changed, easy mode forced by /var/etc/.easymenu file inside image;
at the moment switch between modes is done by main menu -> 'stop' button -> enter pin code,
restart needed after mode switch
This commit is contained in:
[CST] Focus
2013-10-25 13:01:07 +04:00
parent af49e54d22
commit 606bd01878
23 changed files with 769 additions and 375 deletions

View File

@@ -146,33 +146,51 @@ int CSettingsManager::showMenu()
CMenuWidget * mset = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_SETTINGS_MNGR);
mset->addIntroItems(LOCALE_MAINSETTINGS_MANAGE);
CMenuForwarder * mf = new CMenuForwarder(LOCALE_RESET_SETTINGS, true, NULL, resetNotifier, "settings", CRCInput::RC_recall);
CMenuForwarder * mf;
if (g_settings.easymenu)
mf = new CMenuForwarder(LOCALE_RESET_SETTINGS, true, NULL, resetNotifier, "settings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
else
mf = new CMenuForwarder(LOCALE_RESET_SETTINGS, true, NULL, resetNotifier, "settings", CRCInput::RC_recall);
mf->setHint(NEUTRINO_ICON_HINT_RESET, LOCALE_MENU_HINT_RESET); // FIXME: RC-button RECALL is broken
mset->addItem(mf);
mset->addItem(GenericMenuSeparatorLine);
if (!g_settings.easymenu) {
mset->addItem(GenericMenuSeparatorLine);
mf = new CMenuForwarder(LOCALE_EXTRA_SAVECONFIG, true, NULL, this, "saveconfig", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
mf->setHint(NEUTRINO_ICON_HINT_SAVEAS, LOCALE_MENU_HINT_SAVEAS);
mset->addItem(mf);
mf = new CMenuForwarder(LOCALE_EXTRA_SAVECONFIG, true, NULL, this, "saveconfig", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
mf->setHint(NEUTRINO_ICON_HINT_SAVEAS, LOCALE_MENU_HINT_SAVEAS);
mset->addItem(mf);
mf = new CMenuForwarder(LOCALE_EXTRA_LOADCONFIG, true, NULL, this, "loadconfig", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
mf->setHint(NEUTRINO_ICON_HINT_LOAD, LOCALE_MENU_HINT_LOAD);
mset->addItem(mf);
mf = new CMenuForwarder(LOCALE_EXTRA_LOADCONFIG, true, NULL, this, "loadconfig", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
mf->setHint(NEUTRINO_ICON_HINT_LOAD, LOCALE_MENU_HINT_LOAD);
mset->addItem(mf);
mset->addItem(GenericMenuSeparatorLine);
mset->addItem(GenericMenuSeparatorLine);
}
if (g_settings.easymenu)
mf = new CMenuForwarder(LOCALE_SETTINGS_BACKUP, true, NULL, this, "backup", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
else
mf = new CMenuForwarder(LOCALE_SETTINGS_BACKUP, true, NULL, this, "backup", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
mf = new CMenuForwarder(LOCALE_SETTINGS_BACKUP, true, NULL, this, "backup", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
mf->setHint(NEUTRINO_ICON_HINT_BACKUP, LOCALE_MENU_HINT_BACKUP);
mset->addItem(mf);
mf = new CMenuForwarder(LOCALE_SETTINGS_RESTORE, true, NULL, this, "restore", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
if (g_settings.easymenu)
mf = new CMenuForwarder(LOCALE_SETTINGS_RESTORE, true, NULL, this, "restore", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
else
mf = new CMenuForwarder(LOCALE_SETTINGS_RESTORE, true, NULL, this, "restore", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
mf->setHint(NEUTRINO_ICON_HINT_RESTORE, LOCALE_MENU_HINT_RESTORE);
mset->addItem(mf);
mset->addItem(GenericMenuSeparatorLine);
mf = new CMenuForwarder(LOCALE_RESET_ALL, true, NULL, resetNotifier, "all", CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER);
if (g_settings.easymenu) {
mf = new CMenuForwarder(LOCALE_RESET_ALL, true, NULL, resetNotifier, "all", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
} else {
mset->addItem(GenericMenuSeparatorLine);
mf = new CMenuForwarder(LOCALE_RESET_ALL, true, NULL, resetNotifier, "all", CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER);
}
mf->setHint(NEUTRINO_ICON_HINT_FACTORY, LOCALE_MENU_HINT_FACTORY);
mset->addItem(mf);