From 110eadb85a2c2532ba65dded6a76e7e9e1222f30 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 16 Dec 2017 21:04:38 +0100 Subject: [PATCH 1/9] CSettingsManager: add hintbox while execute backup_sh Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/73fa25f936b4881aae66e8bedc76539228e6e90f Author: Thilo Graf Date: 2017-12-16 (Sat, 16 Dec 2017) --- src/gui/settings_manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 156ec6489..beaf20ca8 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -112,9 +112,13 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) int ret = ::statfs(fileBrowser.getSelectedFile()->Name.c_str(), &s); if(ret == 0 && s.f_type != 0x72b6L) /*jffs2*/ { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SETTINGS_BACKUP)); + hintBox->paint(); const char backup_sh[] = "/bin/backup.sh"; - printf("backup: executing [%s %s]\n",backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); + printf("backup: executing [%s %s]\n", backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); my_system(2, backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); + hintBox->hide(); + delete hintBox; } else ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_BACKUP_FAILED),CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_ERROR); From 104d6d3211fa2c91711234ace1bbb952676e6cc1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Dec 2017 14:02:39 +0100 Subject: [PATCH 2/9] CPictureViewer: add current image into debug line It's not possible to see which file causes this error. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc2629eec5f0a11540ca37a771bc50e0f249741b Author: Thilo Graf Date: 2017-12-17 (Sun, 17 Dec 2017) --- src/driver/pictureviewer/pictureviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 90947fe39..1afb445a4 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; } From 174d00c2a5eff4a158bf23726cc4c158093147dc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Dec 2017 15:06:46 +0100 Subject: [PATCH 3/9] icons: add missing picon vor save as Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa1c16609c27684bc198c498f0b43746895cb6d9 Author: Thilo Graf Date: 2017-12-17 (Sun, 17 Dec 2017) --- data/icons/hints/Makefile.am | 1 + data/icons/hints/hint_saveas.png | Bin 0 -> 2091 bytes 2 files changed, 1 insertion(+) create mode 100644 data/icons/hints/hint_saveas.png diff --git a/data/icons/hints/Makefile.am b/data/icons/hints/Makefile.am index 6447b47aa..1279c08e8 100644 --- a/data/icons/hints/Makefile.am +++ b/data/icons/hints/Makefile.am @@ -36,6 +36,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 0000000000000000000000000000000000000000..c43ae333b214b4f2e0633df5f15cd6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#8)k`rgbicaUcJD`4ZebL+ns`=j@d;@0v??Bu$ z42qXnaB;&#FfZQ$J-;$d_tK_Zc1t3|Ku55n`V3s2oM&-O2d~S6HL8~p6U*fE;rVmR z7>GurAjuB=eg99GW9I#(cOP-u^DF|G8*NIDS)|(<)i6J*9Ov5ixF&A5v zgdTqQ5#iv$`&N|D_|zgSY6{15!pIDzOc#UZlR839W%y@i>qb~abg3^un z&^Ml}O&dm@8Bq{dlv6=;vO+8+JEmzGym;pOc;(`FTI-|Q93f}NEZz1|GQPd^*`)wJ zONSrO#dQS$(Bo0tD1NuN-EPz4@mQtYEl{Vh)AvQejJ2DR;U7{?vSm{ z{{kwD5_OvewC-bCZ1BDik8)=Z>x;=l^k@oSaFs6kCF#DW+~WOj{j0%7Y#ScHe*x|q VT&eGAk#+z8002ovPDHLkV1f&(>+%2q literal 0 HcmV?d00001 From 1ea8e362ef38e96ae7597057c16867fc6cad7954 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 15 Dec 2017 23:20:55 +0100 Subject: [PATCH 4/9] acinclude: fix TARGET_PREFIX define for native target Signed-off-by: Thilo Graf Note: TARGET_PREFIX describes inside the yocto SDK the toolchain binary prefix for the target tools. Maybe this could make confuse with usage of yocto SDK environment. Maybe we should rename this variable. e.g EXEC_PREFIX or so ... Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/615688f3b98e3e04a31c91b185d78b2022e5cc5a Author: vanhofen Date: 2017-12-15 (Fri, 15 Dec 2017) Origin message was: ------------------ - acinclude: fix TARGET_PREFIX define for native target Signed-off-by: Thilo Graf Note: TARGET_PREFIX describes inside the yocto SDK the toolchain binary prefix for the target tools. Maybe this could make confuse with usage of yocto SDK environment. Maybe we should rename this variable. e.g EXEC_PREFIX or so ... --- acinclude.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index d0daddef7..9db7454bf 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -50,11 +50,12 @@ if test "$TARGET" = "native"; then if test "$prefix" = "NONE"; then prefix=/usr/local fi - TARGET_PREFIX=$prefix if test "$exec_prefix" = "NONE"; then exec_prefix=$prefix fi targetprefix=$prefix + TARGET_PREFIX=$prefix + AC_DEFINE_UNQUOTED(TARGET_PREFIX, "$TARGET_PREFIX", [The targets prefix]) elif test "$TARGET" = "cdk"; then AC_MSG_RESULT(cdk) From 4059258a9755e46d70c4e3ab874a3cac18fcdb91 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 15 Dec 2017 23:20:55 +0100 Subject: [PATCH 5/9] settings_manager: add TARGET_PREFIX define to backup/restore calls Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4f3f435bc5428348ec34fd033011fd6d5ef21fb1 Author: vanhofen Date: 2017-12-15 (Fri, 15 Dec 2017) Origin message was: ------------------ - settings_manager: add TARGET_PREFIX define to backup/restore calls Signed-off-by: Thilo Graf --- src/gui/settings_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index beaf20ca8..f2f8ef170 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -114,7 +114,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SETTINGS_BACKUP)); hintBox->paint(); - const char backup_sh[] = "/bin/backup.sh"; + const char backup_sh[] = TARGET_PREFIX "/bin/backup.sh"; printf("backup: executing [%s %s]\n", backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); my_system(2, backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); hintBox->hide(); @@ -134,7 +134,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) int result = ShowMsg(LOCALE_SETTINGS_RESTORE, g_Locale->getText(LOCALE_SETTINGS_RESTORE_WARN), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); if(result == CMsgBox::mbrYes) { - const char restore_sh[] = "/bin/restore.sh"; + 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()); } From 68f80a3a7ea48097c5faa64bf4857f5c0c33485d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 15 Dec 2017 23:20:55 +0100 Subject: [PATCH 6/9] settings_manager: remember last used directory Conflicts: data/locale/deutsch.locale data/locale/english.locale src/gui/settings_manager.cpp Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/483f4053a526e234e3d9d45f670fdc8677799228 Author: vanhofen Date: 2017-12-15 (Fri, 15 Dec 2017) Origin message was: ------------------ - settings_manager: remember last used directory Conflicts: data/locale/deutsch.locale data/locale/english.locale src/gui/settings_manager.cpp Signed-off-by: Thilo Graf --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/settings_manager.cpp | 78 +++++++++++++++++++++++------------- src/neutrino.cpp | 4 ++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 2 + 7 files changed, 61 insertions(+), 27 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 6e4d34163..651df3d38 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2266,6 +2266,7 @@ servicemenu.restart_refused_recording Aufnahme läuft. Neustart nicht möglich. servicemenu.scants Kanalsuche servicemenu.update Software-Aktualisierung settings.backup System-Einstellungen sichern +settings.backup_dir Nach %s sichern?\n"Nein" wählt ein anderes Verzeichnis settings.backup_failed Sicherung fehlgeschlagen! settings.help Hilfe settings.menu_hints Hinweise anzeigen diff --git a/data/locale/english.locale b/data/locale/english.locale index 5e3b5c825..7106641bc 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2266,6 +2266,7 @@ servicemenu.restart_refused_recording Cant restart, recording in progress servicemenu.scants Servicescan servicemenu.update Software Update settings.backup Save system settings +settings.backup_dir Save to %s?\n"No" chooses another directory. settings.backup_failed Backup failed! settings.help Help settings.menu_hints Show menu hints diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index f2f8ef170..526c4b269 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -75,8 +75,9 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) { fileFilter.addFilter("conf"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec(CONFIGDIR) == true) + if (fileBrowser.exec(g_settings.backup_dir.c_str()) == true) { + g_settings.backup_dir = fileBrowser.getCurrentDir(); CNeutrinoApp::getInstance()->loadSetup(fileBrowser.getSelectedFile()->Name.c_str()); CColorSetupNotifier *colorSetupNotifier = new CColorSetupNotifier; colorSetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL); @@ -89,48 +90,71 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey == "saveconfig") { - fileBrowser.Dir_Mode = true; - if (fileBrowser.exec("/media") == true) - { - std::string fname = "neutrino.conf"; - CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVECONFIG, &fname); - sms->exec(NULL, ""); + char msgtxt[1024]; + snprintf(msgtxt, sizeof(msgtxt), g_Locale->getText(LOCALE_SETTINGS_BACKUP_DIR), g_settings.backup_dir.c_str()); - std::string sname = fileBrowser.getSelectedFile()->Name + "/" + fname; - printf("[neutrino] save settings: %s\n", sname.c_str()); - CNeutrinoApp::getInstance()->saveSetup(sname.c_str()); - delete sms; + int result = ShowMsg(LOCALE_EXTRA_SAVECONFIG, msgtxt, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo); + if (result == CMsgBox::mbrNo) + { + fileBrowser.Dir_Mode = true; + if (fileBrowser.exec(g_settings.backup_dir.c_str()) == true) + g_settings.backup_dir = fileBrowser.getSelectedFile()->Name; + else + return res; } + + std::string fname = "neutrino.conf"; + CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVECONFIG, &fname); + sms->exec(NULL, ""); + delete sms; + + std::string sname = g_settings.backup_dir + "/" + fname; + printf("[neutrino] save settings: %s\n", sname.c_str()); + CNeutrinoApp::getInstance()->saveSetup(sname.c_str()); + return res; } else if(actionKey == "backup") { - fileBrowser.Dir_Mode = true; - if (fileBrowser.exec("/media") == true) + 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); + if (result == CMsgBox::mbrNo) { - struct statfs s; - int ret = ::statfs(fileBrowser.getSelectedFile()->Name.c_str(), &s); - if(ret == 0 && s.f_type != 0x72b6L) /*jffs2*/ - { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SETTINGS_BACKUP)); - hintBox->paint(); - const char backup_sh[] = TARGET_PREFIX "/bin/backup.sh"; - printf("backup: executing [%s %s]\n", backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); - my_system(2, backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); - hintBox->hide(); - delete hintBox; - } + fileBrowser.Dir_Mode = true; + if (fileBrowser.exec(g_settings.backup_dir.c_str()) == true) + g_settings.backup_dir = fileBrowser.getSelectedFile()->Name; else - ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_BACKUP_FAILED),CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_ERROR); + return res; } + + struct statfs s; + int ret = ::statfs(g_settings.backup_dir.c_str(), &s); + if (ret == 0 && s.f_type != 0x72b6L) /*jffs2*/ + { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SETTINGS_BACKUP)); + 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()); + my_system(2, backup_sh, g_settings.backup_dir.c_str()); + + hintBox->hide(); + delete hintBox; + } + else + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_BACKUP_FAILED),CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_ERROR); + return res; } else if(actionKey == "restore") { fileFilter.addFilter("tar"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec("/media") == true) + if (fileBrowser.exec(g_settings.backup_dir.c_str()) == true) { + g_settings.backup_dir = fileBrowser.getCurrentDir(); int result = ShowMsg(LOCALE_SETTINGS_RESTORE, g_Locale->getText(LOCALE_SETTINGS_RESTORE_WARN), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); if(result == CMsgBox::mbrYes) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 522a885f1..39d26c862 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -827,6 +827,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.font_scaling_x = configfile.getInt32("font_scaling_x", 100); g_settings.font_scaling_y = configfile.getInt32("font_scaling_y", 100); + 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); @@ -1446,6 +1448,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString("softupdate_proxyusername" , g_settings.softupdate_proxyusername ); configfile.setString("softupdate_proxypassword" , g_settings.softupdate_proxypassword ); + configfile.setString("backup_dir", g_settings.backup_dir); + configfile.setString("update_dir", g_settings.update_dir); configfile.setString("update_dir_opkg", g_settings.update_dir_opkg); diff --git a/src/system/locals.h b/src/system/locals.h index d1260c9ef..339ad53f9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2293,6 +2293,7 @@ typedef enum LOCALE_SERVICEMENU_SCANTS, LOCALE_SERVICEMENU_UPDATE, LOCALE_SETTINGS_BACKUP, + LOCALE_SETTINGS_BACKUP_DIR, LOCALE_SETTINGS_BACKUP_FAILED, LOCALE_SETTINGS_HELP, LOCALE_SETTINGS_MENU_HINTS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 61003a67d..013449970 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2293,6 +2293,7 @@ const char * locale_real_names[] = "servicemenu.scants", "servicemenu.update", "settings.backup", + "settings.backup_dir", "settings.backup_failed", "settings.help", "settings.menu_hints", diff --git a/src/system/settings.h b/src/system/settings.h index 7242b221a..e813dd0f0 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -668,6 +668,8 @@ struct SNeutrinoSettings int flashupdate_createimage_add_spare; int flashupdate_createimage_add_kernel; + std::string backup_dir; + std::string update_dir; std::string update_dir_opkg; From 1148802999b2cf1682bdcfa23420c478ac48c5ad Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Dec 2017 19:39:48 +0100 Subject: [PATCH 7/9] CSettingsManager: use neutrino internal debug output, Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/52c279fc4f34a556185a684419ef5d70d110b185 Author: Thilo Graf Date: 2017-12-17 (Sun, 17 Dec 2017) --- src/gui/settings_manager.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 526c4b269..0da1b5f40 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -44,11 +44,11 @@ #include #include #include +#include #include - CSettingsManager::CSettingsManager(int wizard_mode) { width = 40; @@ -62,7 +62,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) @@ -78,12 +78,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; @@ -109,7 +110,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; @@ -137,7 +139,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(); @@ -159,8 +161,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; From d9ef2e5b843f1bea21604f04dc399fab5ae0b589 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Dec 2017 20:43:03 +0100 Subject: [PATCH 8/9] CSettingsManager: add cancel buttons to backup/save config messages User should have this possibility because 'yes' and 'no' are coming with defined effects. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6c781b05a1f45976155e2274fc9be97496ff2361 Author: Thilo Graf Date: 2017-12-17 (Sun, 17 Dec 2017) --- src/gui/settings_manager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 0da1b5f40..a9544fdd8 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -94,7 +94,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; @@ -121,7 +123,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; From 3f9101a5f405b6f1d9d9932ed9fc7b5761109271 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Dec 2017 21:44:51 +0100 Subject: [PATCH 9/9] icons: fix assignment of settings, network and mainmenu icons Assignment was confused. There are probaly more. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f38e03a4312945372c44a1c943034f4a0e33db3b Author: Thilo Graf Date: 2017-12-17 (Sun, 17 Dec 2017) --- data/icons/headers/mainmenue.png | Bin 1775 -> 2050 bytes data/icons/headers/settings.png | Bin 386 -> 1775 bytes src/gui/network_setup.cpp | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/icons/headers/mainmenue.png b/data/icons/headers/mainmenue.png index a43f2a61d4e1a8190b7d8d76a8952eb36a81e6cc..251e5378651c6014fe14bc2d4be42fa4d5e389d7 100644 GIT binary patch delta 2036 zcmV?(i2wiq32;bR za{vGf6951U69E94oEQKA00(qQO+^Rc3=tF`5rABpyZ`_I9cffpbVF}#ZDnqB00000 z07G(RVRU6=Aa`kWXdp*PO;BVmWd{HN2UbZ$K~z}7#aC^N6@OP5e%^D=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}H`{SWI~f=sKvh)I z*QN9N?$_C#w4L_Bb}rqy6ybmg0n3Tdm~V^^{(t%b{(ztIAD3g(Y}7Q=JfJ6%DgP8w zNQ96`1PTf}lXsHo%48-qL$o=Xwf40Lq4Tx(Yh(UlF)~FSRw!zpHh zGYfQJMGh=wA2)qW;S+^qu78T49snS1U4I%k@7|<;yq|0I)cOEK$R+bNGBK!B6P9*cO__KQGbD4 zodadt%BU!=p!SPeVxnSjIb4`j6S~k*6hk#_CL1MNONfh#qie8>$(hO3c;(mFvO0hl zw!OfsyIv(WDi-&8H_i8&Y3OJm-Vq;O--ZebDG2I8GB;$B`&cd=y&Vir46Xv;sg+m3 zb6L-Ec+X)}RYeMk-D=03;3g$Lg@3w+Ix-S7uv_fL(hKM4LMJXdj$LWHXzXg_`^oQD z*bP_Uz`o3VR6JW@h|BEUg~X(qh_S`s9r03qp&E;3nd4Ph19V--VR3N!<?+( z%%w-Lf9rlK_g6CQpGG2)LPSJm)Hlkpi^pi|X=8YD7>mimmW^8$@L?8=ihoLBdLf?s z9tOt;ml#3DVgRMNr5xIG$dK3hl}VVGp5Ww_lQefVN8;}d-Xkk1i?#N(=t4I-H46fX z)np}Sa}FK79Sn>OJOIGGkOL(-C6pJIqbjOVImX9SMJ1$%s61CmOLxnHN_>7F-~9U< z3Z5*$X0}C^=PVE*1#7Hpcz-(eXV+Xawc4GBs=ueL-ddKbM&L5eDb$X zA{9s-=+xb)<6`5*MLMAI1aBg-A;I%6 z4?#W1Cg&zP`#O31+*sSR_q6|4H=p70VH&?}qQJd_Gk-qArKU?u-H!YUMSKNp<^N-C z8jmxG;J~~KM$3VSdCr9d^1^oT0&0e%Bq_z#IO{%IFBh(Q1V002ovPDHLkV1l#o BT9p6* diff --git a/data/icons/headers/settings.png b/data/icons/headers/settings.png index 7d7217c8167ed018e6e40d855e93532fa946388e..a43f2a61d4e1a8190b7d8d76a8952eb36a81e6cc 100644 GIT binary patch literal 1775 zcmVVGd000McNliru-U}2FHX;qvKkx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DymUA#>Z4e zC8UR_JXc9ecguoGe10F_{QDaUo-Dv-wndibED#|DYpiQ{I`wHG6**{%E^l-@!az~lwx{^yd14RO3zRaDr!U{`~g3wuAky^ z)8z&68mV&}h_lD>OvW>0J(flOllg@75Xa9Sr@6EF2VFWwCPujHy-Qwd9(Jo8UFg)^ zsN-Ve#YH-x@dR%ou_3|pFAqUI$R_6|I{P|#``p{K_q6|4H=p70VH&?}qQJd_Gk-qA zrKU?u-H!YUMSKNp<^N-C8jmxG;J~~KM$3VSdCr9d^1^oT0&0e%Bq_z#IO{%IFB Rh(Q1V002ovPDHLkV1gvxR}KIG literal 386 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;wg8-ipR~8SJh7Bb#-NBlrsshRU zZZ-DmnaW;0j_i?afByZMIAP-IHLK(2gwCHof5*-pCiVKZ%h+Rpdbvu1{DS|(0K=v; zI_H6+oCO|{#S9GGLLkg|>2BR0px`4<7sn8Z%gHl3StJ~eu&}ZDNwhCy=8#aB!zr6^ zfb&^FNy(b1s~0aaJo0(*f~m+NjA5xnTG5s@QPtny-3@inY?~*|}y zJuIpmB(kF*u7U*&cW~Ws@wjTdOpY9FKR59ckBQ9>e|)JCkh#h z4xK)~ci&Z}r&s1!vIjn!RQ7xBqBFa%XD0Z4x?B7H-rn1@ryV+JF!?N3(s?891>6xm zih3U243<}ZgkQM3dsX*k2fn#C|JY|-)moasy`etshPZ5ymj1hzit4t?%F0^xZ48af Z3>xb5<@X#bDhK+O!PC{xWt~$(699fLqsetWizardMode(is_wizard); //apply button @@ -352,9 +352,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; @@ -805,7 +805,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];