diff --git a/data/icons/hints/Makefile.am b/data/icons/hints/Makefile.am index 2124a6d87..60f954242 100644 --- a/data/icons/hints/Makefile.am +++ b/data/icons/hints/Makefile.am @@ -39,6 +39,7 @@ install_DATA = \ hint_reload.png \ hint_restart.png \ hint_save.png \ + hint_saveas.png \ hint_scan.png \ hint_scripts.png \ hint_service.png \ diff --git a/data/icons/hints/hint_saveas.png b/data/icons/hints/hint_saveas.png new file mode 100644 index 000000000..c43ae333b Binary files /dev/null and b/data/icons/hints/hint_saveas.png differ diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 5d5118ab1..561304b17 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -629,7 +629,7 @@ void CPictureViewer::rescaleImageDimensions(int *width, int *height, const int m bool CPictureViewer::DisplayImage(const std::string & name, int posx, int posy, int width, int height, int transp) { if(width < 1 || height < 1){ - dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: width %i height %i \n", __func__, __LINE__, width, height); + dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: image [%s] width %i height %i \n", __func__, __LINE__, name.c_str(), width, height); return false; } diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index 9a4b137b0..77d25188b 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -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]; diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 18c8c2b66..be420eadf 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -44,13 +44,13 @@ #include #include #include +#include #include #include //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; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f6eec7635..8e7135c3b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -893,6 +893,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.backup_dir = configfile.getString("backup_dir", "/media"); + g_settings.backup_dir = configfile.getString("backup_dir", "/media"); + g_settings.update_dir = configfile.getString("update_dir", "/tmp"); g_settings.update_dir_opkg = configfile.getString("update_dir_opkg", g_settings.update_dir);