From 2e5f07ec99874d5dfda5eb96d41b8201e106be9d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 9 Sep 2017 11:03:52 +0200 Subject: [PATCH] settings_manager_teams: small reworks; unify locales * cleanup from unused code * remove RC_help hotkey from menu (this hotkey breaks global hint-switch) * fix text alignment in help-box Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8eb3a618294038208ad302537bb167914602e2dc Author: vanhofen Date: 2017-09-09 (Sat, 09 Sep 2017) Origin message was: ------------------ - settings_manager_teams: small reworks; unify locales * cleanup from unused code * remove RC_help hotkey from menu (this hotkey breaks global hint-switch) * fix text alignment in help-box ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 8 ++++---- data/locale/english.locale | 2 +- src/gui/settings_manager_teams.cpp | 23 +++++++---------------- src/gui/settings_manager_teams.h | 1 - src/neutrino.h | 3 +-- 5 files changed, 13 insertions(+), 24 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 9fe918891..f0c8d7850 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -385,9 +385,9 @@ cpu.freq_default Standard Frequenz cpu.freq_normal Normale Frequenz cpu.freq_standby Standby Frequenz crossteam.hint_settings_teams Einstellungen sichern und wiederherstellen,\ndie zu teilnehmenden Team-Images kompatibel sind. -crossteam.hint_settings_teams_backup Teamübergreifende Einstellungen sichern -crossteam.hint_settings_teams_help Hilfe zu teamübergreifenden Einstellungen -crossteam.hint_settings_teams_restore Teamübergreifende Einstellungen wiederherstellen +crossteam.hint_settings_teams_backup Team-übergreifende Einstellungen sichern +crossteam.hint_settings_teams_help Hilfe zu den Team-übergreifenden Einstellungen +crossteam.hint_settings_teams_restore Team-übergreifende Einstellungen wiederherstellen date.Apr Apr date.Aug Aug date.Dec Dez @@ -2557,7 +2557,7 @@ settings.teams.backup Sichern settings.teams.backup_failed Sicherung fehlgeschlagen! settings.teams.backup_to Sichern nach settings.teams.help Hilfe -settings.teams.help_text In diesem Menü können Einstellungen gesichert und\nwiederhergestellt werden, die zu folgenden Team-Images\nkompatibel sind:\n \n - BluePeer HD\n - NI CS-Image\n \nGesichert werden:\n \n * Kanallisten\n * Timer und Timer-Einstellungen\n * Netzwerkeinstellungen (LAN und WLAN) +settings.teams.help_text In diesem Menü können Einstellungen\ngesichert und wiederhergestellt werden,\ndie zu folgenden Team-Images kompatibel sind:\n \n - BluePeer HD\n - NI-Image\n \nGesichert werden:\n \n * Kanallisten\n * Timer und Timer-Einstellungen\n * Netzwerkeinstellungen (LAN und WLAN) settings.teams.restore Wiederherstellen settings.teams.restore_warn Team-übergreifende Einstellungen werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? shoutcast.dev_id SHOUTcast Dev ID diff --git a/data/locale/english.locale b/data/locale/english.locale index 44ba3dcfd..6fe96266e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2557,7 +2557,7 @@ settings.teams.backup Save settings.teams.backup_failed Backup failed! settings.teams.backup_to Saving to settings.teams.help Help -settings.teams.help_text In this menu, settings can be saved and restored,\nwhich are compatible with these Team-Images:\n \n - BluePeer HD\n - NI CS-Image\n \nSaved will be:\n \n * Channellists\n * Timer and Timer-Settings\n * Network-Settings (LAN and WLAN) +settings.teams.help_text In this menu can settings be saved and restored,\nwhich are compatible with following Team-Images:\n \n - BluePeer HD\n - NI-Image\n \nSaved will be:\n \n * Channellists\n * Timer and timer-settings\n * Network-settings (LAN and WLAN) settings.teams.restore Restore settings.teams.restore_warn This will replace all cross-team settings and reboot\nContinue ? shoutcast.dev_id SHOUTcast Dev ID diff --git a/src/gui/settings_manager_teams.cpp b/src/gui/settings_manager_teams.cpp index e1a033b2c..45c4122f0 100644 --- a/src/gui/settings_manager_teams.cpp +++ b/src/gui/settings_manager_teams.cpp @@ -4,7 +4,7 @@ Copyright (C) 2011 'defans' Homepage: http://www.bluepeercrew.us/ - Copyright (C) 2011 'vanhofen' + Copyright (C) 2017 'vanhofen' Homepage: http://www.neutrino-images.de/ License: GPL @@ -37,7 +37,6 @@ #include "gui/widget/hintbox.h" #include "gui/widget/msgbox.h" -#include "gui/widget/stringinput.h" #include #include @@ -51,8 +50,7 @@ #define SYSCALLBACKUP "tar -cz -f" #define SYSCALLRESTORE "cd /; tar -xz -f" -#define OBJECT_COUNT 6 -const char * object[OBJECT_COUNT] = +const char * object[] = { CONFIGDIR "/cables.xml", CONFIGDIR "/satellites.xml", @@ -61,8 +59,7 @@ const char * object[OBJECT_COUNT] = "/etc/network/interfaces", "/etc/wpa_supplicant.conf" }; - -//int CSettingsManagerTeams::selected = -1; // remember location in old style +const int OBJECT_COUNT = sizeof(object) / sizeof(object[0]); CSettingsManagerTeams::CSettingsManagerTeams() { @@ -105,14 +102,12 @@ int CSettingsManagerTeams::showMenu() //printf("[neutrino] CSettingsManagerTeams call %s...\n", __FUNCTION__); CMenuWidget * teamset = new CMenuWidget(LOCALE_SETTINGS_TEAMS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_TEAMS_SETTINGS); -// CMenuWidget * teamset = new CMenuWidget(LOCALE_SETTINGS_TEAMS, NEUTRINO_ICON_SETTINGS, width); -// teamset->setSelected(selected); teamset->addIntroItems(); CMenuForwarder * mf; - mf = new CMenuForwarder(LOCALE_SETTINGS_TEAMS_HELP, true, NULL, this, "help", CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP_SMALL); //ToDo? + mf = new CMenuForwarder(LOCALE_SETTINGS_TEAMS_HELP, true, NULL, this, "help"); mf->setHint("", LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS_HELP); teamset->addItem(mf); @@ -128,7 +123,6 @@ int CSettingsManagerTeams::showMenu() int res = teamset->exec(NULL, ""); teamset->hide(); -// selected = teamset->getSelected(); delete teamset; return res; @@ -136,7 +130,8 @@ int CSettingsManagerTeams::showMenu() void CSettingsManagerTeams::showHelp() { - ShowMsg(LOCALE_SETTINGS_TEAMS_HELP, g_Locale->getText(LOCALE_SETTINGS_TEAMS_HELP_TEXT), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + ShowMsg(LOCALE_SETTINGS_TEAMS_HELP, LOCALE_SETTINGS_TEAMS_HELP_TEXT, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO, + MSGBOX_MIN_WIDTH, NO_TIMEOUT, false, (CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH)); return; } @@ -204,10 +199,6 @@ void CSettingsManagerTeams::doRestore() void CSettingsManagerTeams::doReboot() { - FILE *f = fopen("/tmp/.reboot", "w"); - fclose(f); - // we need a public ExitRun() in src/neutrino.h - CNeutrinoApp::getInstance()->ExitRun(true); - unlink("/tmp/.reboot"); + CNeutrinoApp::getInstance()->exec(NULL, "reboot"); return; } diff --git a/src/gui/settings_manager_teams.h b/src/gui/settings_manager_teams.h index 1d1a8e621..6cc17b863 100644 --- a/src/gui/settings_manager_teams.h +++ b/src/gui/settings_manager_teams.h @@ -37,7 +37,6 @@ class CSettingsManagerTeams : public CMenuTarget { private: int width; -// static int selected; int showMenu(); void showHelp(); diff --git a/src/neutrino.h b/src/neutrino.h index 504f8d8fa..92b1d6605 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -122,7 +122,7 @@ private: void standbyMode( bool bOnOff, bool fromDeepStandby = false ); void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name); - //NI void ExitRun(int can_shutdown = 0); + void ExitRun(int can_shutdown = 0); void RealRun(); void InitZapper(); void InitTimerdClient(); @@ -163,7 +163,6 @@ public: CUserMenu usermenu; - void ExitRun(int can_shutdown = 0); //NI cross-team settings void saveSetup(const char * fname); int loadSetup(const char * fname); void setScreenSettings();