Merge branch 'master' of https://github.com/tuxbox-neutrino/gui-neutrino into ni/mp/tuxbox

Conflicts:
	data/icons/headers/mainmenue.png
	data/icons/headers/settings.png
	data/locale/deutsch.locale
	data/locale/english.locale
	src/gui/settings_manager.cpp


Origin commit data
------------------
Commit: d756ed789a
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-12-17 (Sun, 17 Dec 2017)
This commit is contained in:
vanhofen
2017-12-17 23:38:33 +01:00
6 changed files with 25 additions and 15 deletions

View File

@@ -241,7 +241,7 @@ int CNetworkSetup::showNetworkSetup()
backupNetworkSettings();
//menue init
CMenuWidget* networkSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP);
CMenuWidget* networkSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_NETWORK, width, MN_WIDGET_ID_NETWORKSETUP);
networkSettings->setWizardMode(is_wizard);
//apply button
@@ -353,9 +353,9 @@ int CNetworkSetup::showNetworkSetup()
networkSettings->addItem( m5); //nameserver
//------------------------------------------------
sectionsdConfigNotifier = NULL;
CMenuWidget ntp(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP_NTP);
CMenuWidget ntp(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_NETWORK, width, MN_WIDGET_ID_NETWORKSETUP_NTP);
#ifdef ENABLE_GUI_MOUNT
CMenuWidget networkmounts(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP_MOUNTS);
CMenuWidget networkmounts(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_NETWORK, width, MN_WIDGET_ID_NETWORKSETUP_MOUNTS);
#endif
CProxySetup proxy(LOCALE_MAINSETTINGS_NETWORK);
CNetworkServiceSetup services;
@@ -832,7 +832,7 @@ int CNetworkSetup::showWlanList()
return res;
}
CMenuWidget wlist(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width);
CMenuWidget wlist(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_NETWORK, width);
wlist.addIntroItems(LOCALE_NETWORKMENU_SSID_SCAN); //intros
char cnt[5];

View File

@@ -44,13 +44,13 @@
#include <driver/screen_max.h>
#include <driver/display.h>
#include <system/helpers.h>
#include <system/debug.h>
#include <sys/vfs.h>
#include <gui/widget/hintbox.h> //NI
#include "gui/settings_manager_teams.h" //NI cross-team settings
CSettingsManager::CSettingsManager(int wizard_mode)
{
width = 40;
@@ -64,7 +64,7 @@ CSettingsManager::~CSettingsManager()
int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
{
printf("[neutrino] CSettingsManager %s: init...\n",__FUNCTION__);
dprintf(DEBUG_NORMAL, "[CSettingsManager]\t[%s - %d] actionKey = [%s]\n", __func__, __LINE__, actionKey.c_str());
int res = menu_return::RETURN_REPAINT;
if (parent)
@@ -80,12 +80,13 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
if (fileBrowser.exec(g_settings.backup_dir.c_str()) == true)
{
g_settings.backup_dir = fileBrowser.getCurrentDir();
CNeutrinoApp::getInstance()->loadSetup(fileBrowser.getSelectedFile()->Name.c_str());
std::string new_config = fileBrowser.getSelectedFile()->Name.c_str();
CNeutrinoApp::getInstance()->loadSetup(new_config.c_str());
CColorSetupNotifier *colorSetupNotifier = new CColorSetupNotifier;
colorSetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL);
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_ALL);
CVFD::getInstance()->setlcdparameter();
printf("[neutrino] new settings: %s\n", fileBrowser.getSelectedFile()->Name.c_str());
dprintf(DEBUG_NORMAL, "[CSettingsManager]\t[%s - %d] load config from %s\n", __func__, __LINE__, new_config.c_str());
delete colorSetupNotifier;
}
return res;
@@ -95,7 +96,9 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
char msgtxt[1024];
snprintf(msgtxt, sizeof(msgtxt), g_Locale->getText(LOCALE_SETTINGS_BACKUP_DIR), g_settings.backup_dir.c_str());
int result = ShowMsg(LOCALE_EXTRA_SAVECONFIG, msgtxt, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo);
int result = ShowMsg(LOCALE_EXTRA_SAVECONFIG, msgtxt, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo | CMsgBox::mbCancel);
if (result == CMsgBox::mbrCancel)
return res;
if (result == CMsgBox::mbrNo)
{
fileBrowser.Dir_Mode = true;
@@ -111,7 +114,8 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
delete sms;
std::string sname = g_settings.backup_dir + "/" + fname;
printf("[neutrino] save settings: %s\n", sname.c_str());
dprintf(DEBUG_NORMAL, "[CSettingsManager]\t[%s - %d] save neutrino settings to %s\n", __func__, __LINE__, sname.c_str());
CNeutrinoApp::getInstance()->saveSetup(sname.c_str());
return res;
@@ -121,7 +125,9 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
char msgtxt[1024];
snprintf(msgtxt, sizeof(msgtxt), g_Locale->getText(LOCALE_SETTINGS_BACKUP_DIR), g_settings.backup_dir.c_str());
int result = ShowMsg(LOCALE_SETTINGS_BACKUP, msgtxt, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo);
int result = ShowMsg(LOCALE_SETTINGS_BACKUP, msgtxt, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo | CMsgBox::mbCancel);
if (result == CMsgBox::mbrCancel)
return res;
if (result == CMsgBox::mbrNo)
{
fileBrowser.Dir_Mode = true;
@@ -139,7 +145,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
hintBox->paint();
const char backup_sh[] = TARGET_PREFIX "/bin/backup.sh";
printf("backup: executing [%s %s]\n", backup_sh, g_settings.backup_dir.c_str());
dprintf(DEBUG_NORMAL, "[CSettingsManager]\t[%s - %d] executing [%s %s]\n", __func__, __LINE__, backup_sh, g_settings.backup_dir.c_str());
my_system(2, backup_sh, g_settings.backup_dir.c_str());
hintBox->hide();
@@ -162,8 +168,9 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
if(result == CMsgBox::mbrYes)
{
const char restore_sh[] = TARGET_PREFIX "/bin/restore.sh";
printf("restore: executing [%s %s]\n", restore_sh, fileBrowser.getSelectedFile()->Name.c_str());
my_system(2, restore_sh, fileBrowser.getSelectedFile()->Name.c_str());
std::string restore_file = fileBrowser.getSelectedFile()->Name;
dprintf(DEBUG_NORMAL, "[CSettingsManager]\t[%s - %d] executing [%s %s]\n", __func__, __LINE__, restore_sh, restore_file.c_str());
my_system(2, restore_sh, restore_file.c_str());
}
}
return res;