mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-10 07:08:28 +02:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user