From ef4e82b97068c77f06175ec38db8f3ef1d3166a7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 24 May 2018 22:18:52 +0200 Subject: [PATCH] remove cross-team settings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/61d3083d6a04566cb51e47d5b017810bfdf6674d Author: vanhofen Date: 2018-05-24 (Thu, 24 May 2018) Origin message was: ------------------ - remove cross-team settings --- data/locale/deutsch.locale | 12 -- data/locale/english.locale | 12 -- src/gui/Makefile.am | 1 - src/gui/settings_manager.cpp | 8 -- src/gui/settings_manager_teams.cpp | 204 ----------------------------- src/gui/settings_manager_teams.h | 57 -------- src/neutrino_menue.h | 3 - src/system/locals.h | 12 -- src/system/locals_intern.h | 12 -- 9 files changed, 321 deletions(-) delete mode 100644 src/gui/settings_manager_teams.cpp delete mode 100644 src/gui/settings_manager_teams.h diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c88e42ae0..3a23039a1 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -395,10 +395,6 @@ cpu.freq CPU Frequenz 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 den Team-übergreifenden Einstellungen -crossteam.hint_settings_teams_restore Team-übergreifende Einstellungen wiederherstellen daemon_control Daemon-Steuerung daemon_item.crond_desc cron Daemon kann zeitgesteuerte Aufgaben ausführen daemon_item.crond_name crond @@ -2558,14 +2554,6 @@ settings.pos_top_left oben links settings.pos_top_right oben rechts settings.restore NI-Backup wiederherstellen settings.restore_warn Alle Settings werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? -settings.teams Team-übergreifende Einstellungen -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\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 shoutcast.enabled SHOUTcast-Unterstützung shutdown.recording_query Aufnahme läuft. Trotzdem beenden? diff --git a/data/locale/english.locale b/data/locale/english.locale index a415699c3..8460e2a1e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -395,10 +395,6 @@ cpu.freq CPU frequency cpu.freq_default Default frequency cpu.freq_normal Normal frequency cpu.freq_standby Standby frequency -crossteam.hint_settings_teams Save and restore settings, which\nare compatible with participating Team-Images. -crossteam.hint_settings_teams_backup Save cross-team settings -crossteam.hint_settings_teams_help Help about cross-team settings -crossteam.hint_settings_teams_restore Restore cross-team settings daemon_control Daemon control daemon_item.crond_desc Cron daemon allows scheduled tasks daemon_item.crond_name crond @@ -2558,14 +2554,6 @@ settings.pos_top_left top left settings.pos_top_right top right settings.restore Load NI-Backup settings.restore_warn This will replace all settings and reboot\nContinue ? -settings.teams Cross-Team Settings -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 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 shoutcast.enabled SHOUTcast support shutdown.recording_query You really want to to stop record ? diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 7bfc0c8f2..8a47b3438 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -98,7 +98,6 @@ libneutrino_gui_a_SOURCES = \ screensaver.cpp \ screensetup.cpp \ settings_manager.cpp \ - settings_manager_teams.cpp \ sleeptimer.cpp \ start_wizard.cpp \ subchannel_select.cpp \ diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index cc669bc16..083c02472 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -49,7 +49,6 @@ #include #include //NI -#include "gui/settings_manager_teams.h" //NI cross-team settings CSettingsManager::CSettingsManager(int wizard_mode) { @@ -239,13 +238,6 @@ int CSettingsManager::showMenu() mf->setHint(NEUTRINO_ICON_HINT_RESTORE, LOCALE_MENU_HINT_RESTORE); mset->addItem(mf); - //NI cross-team settings - mset->addItem(GenericMenuSeparatorLine); - CSettingsManagerTeams * teamsettings = new CSettingsManagerTeams(); - mf = new CMenuForwarder(LOCALE_SETTINGS_TEAMS, true, NULL, teamsettings, NULL, CRCInput::convertDigitToKey(0)); - mf->setHint("", LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS); - mset->addItem(mf); - mset->addItem(GenericMenuSeparatorLine); mf = new CMenuForwarder(LOCALE_RESET_ALL, true, NULL, resetNotifier, "all", CRCInput::RC_standby); mf->setHint(NEUTRINO_ICON_HINT_FACTORY, LOCALE_MENU_HINT_FACTORY); diff --git a/src/gui/settings_manager_teams.cpp b/src/gui/settings_manager_teams.cpp deleted file mode 100644 index 45c4122f0..000000000 --- a/src/gui/settings_manager_teams.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* - cross-team settings manager menue - Neutrino-GUI - - Copyright (C) 2011 'defans' - Homepage: http://www.bluepeercrew.us/ - - Copyright (C) 2017 'vanhofen' - Homepage: http://www.neutrino-images.de/ - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "gui/settings_manager_teams.h" - -#include "gui/widget/hintbox.h" -#include "gui/widget/msgbox.h" - -#include -#include - -#include -#include - -#define TAREXT "teams" -#define TARCHIVE "settings." TAREXT - -#define SYSCALLBACKUP "tar -cz -f" -#define SYSCALLRESTORE "cd /; tar -xz -f" - -const char * object[] = -{ - CONFIGDIR "/cables.xml", - CONFIGDIR "/satellites.xml", - CONFIGDIR "/timerd.conf", - CONFIGDIR "/zapit/", - "/etc/network/interfaces", - "/etc/wpa_supplicant.conf" -}; -const int OBJECT_COUNT = sizeof(object) / sizeof(object[0]); - -CSettingsManagerTeams::CSettingsManagerTeams() -{ - width = 40; -} - -CSettingsManagerTeams::~CSettingsManagerTeams() -{ -} - -int CSettingsManagerTeams::exec(CMenuTarget* parent, const std::string &actionKey) -{ - //printf("[neutrino] CSettingsManagerTeams %s: init...\n",__FUNCTION__); - - if(parent) - parent->hide(); - - if(actionKey == "help") - { - showHelp(); - return menu_return::RETURN_REPAINT; - } - else if(actionKey == "backup") - { - doBackup(); - return menu_return::RETURN_REPAINT; - } - else if(actionKey == "restore") - { - doRestore(); - return menu_return::RETURN_REPAINT; - } - int res = showMenu(); - - return res; -} - -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); - - teamset->addIntroItems(); - - CMenuForwarder * mf; - - mf = new CMenuForwarder(LOCALE_SETTINGS_TEAMS_HELP, true, NULL, this, "help"); - mf->setHint("", LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS_HELP); - teamset->addItem(mf); - - teamset->addItem(GenericMenuSeparatorLine); - - mf =new CMenuForwarder(LOCALE_SETTINGS_TEAMS_BACKUP, true, NULL, this, "backup", CRCInput::RC_red); - mf->setHint("", LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS_BACKUP); - teamset->addItem(mf); - - mf = new CMenuForwarder(LOCALE_SETTINGS_TEAMS_RESTORE, true, NULL, this, "restore", CRCInput::RC_green); - mf->setHint("", LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS_RESTORE); - teamset->addItem(mf); - - int res = teamset->exec(NULL, ""); - teamset->hide(); - delete teamset; - - return res; -} - -void CSettingsManagerTeams::showHelp() -{ - 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; -} - -void CSettingsManagerTeams::doBackup() -{ - int objectCounter = 0; - std::string objects = " "; - for(int i=0 ; i < OBJECT_COUNT; i++) - { - if ( access((object[i]), F_OK) ) - continue; - - objects += object[i]; - objects += " "; - - objectCounter++; - } - - fileBrowser.Dir_Mode = true; - if(fileBrowser.exec("/media") == true) - { - std::string TDirectory = fileBrowser.getSelectedFile()->Name.c_str(); - std::string hintBoxContent = g_Locale->getText(LOCALE_SETTINGS_TEAMS_BACKUP_TO) + TDirectory + "/" + TARCHIVE; - struct statfs s; - int ret = ::statfs(TDirectory.c_str(), &s); - if(objectCounter && ret == 0 && s.f_type != 0x72b6L/* && s.f_type != 0x858458f6L*/) /*jffs2 and ramfs*/ - { - CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, hintBoxContent.c_str()); - hintBox.paint(); - char buf[256]; - sprintf(buf, SYSCALLBACKUP " %s/" TARCHIVE "%s", TDirectory.c_str(), objects.c_str()); - //printf("CSettingsManagerTeams::doBackup: %s/%s\n", TDirectory.c_str(), TARCHIVE); - if (system(buf) != 0) - printf("CSettingsManagerTeams::Backup: failed\n"); - hintBox.hide(); - } - else - ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_TEAMS_BACKUP_FAILED),CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_ERROR); - } - return; -} - -void CSettingsManagerTeams::doRestore() -{ - fileFilter.addFilter(TAREXT); - fileBrowser.Filter = &fileFilter; - fileBrowser.Dir_Mode = false; - if(fileBrowser.exec("/media") == true) - { - std::string TFile = fileBrowser.getSelectedFile()->Name.c_str(); - int result = ShowMsg(LOCALE_SETTINGS_TEAMS_RESTORE, g_Locale->getText(LOCALE_SETTINGS_TEAMS_RESTORE_WARN), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); - if(result == CMsgBox::mbrYes) - { - char buf[256]; - sprintf(buf, SYSCALLRESTORE " %s", TFile.c_str()); - //printf("CSettingsManagerTeams::doRestore: %s\n", TFile.c_str()); - if (system(buf) != 0) - printf("CSettingsManagerTeams::doRestore: failed\n"); - else - doReboot(); - } - } - return; -} - -void CSettingsManagerTeams::doReboot() -{ - CNeutrinoApp::getInstance()->exec(NULL, "reboot"); - return; -} diff --git a/src/gui/settings_manager_teams.h b/src/gui/settings_manager_teams.h deleted file mode 100644 index 6cc17b863..000000000 --- a/src/gui/settings_manager_teams.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - cross-team settings manager menue - Neutrino-GUI - - Copyright (C) 2011 'defans' - Homepage: http://www.bluepeercrew.us/ - - Copyright (C) 2011 'vanhofen' - Homepage: http://www.neutrino-images.de/ - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef __settings_manager_teams__ -#define __settings_manager_teams__ - -#include -#include "gui/filebrowser.h" -#include - - -class CSettingsManagerTeams : public CMenuTarget -{ - private: - int width; - - int showMenu(); - void showHelp(); - void doBackup(); - void doRestore(); - void doReboot(); - - CFileBrowser fileBrowser; - CFileFilter fileFilter; - - public: - CSettingsManagerTeams(); - ~CSettingsManagerTeams(); - - int exec(CMenuTarget* parent, const std::string & actionKey); -}; - -#endif diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index 60704f916..2117e359f 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -174,9 +174,6 @@ enum MN_WIDGET_ID MN_WIDGET_ID_PLUGINS_CONTROL, MN_WIDGET_ID_PLUGINS_HIDE, - //Cross-Team - MN_WIDGET_ID_TEAMS_SETTINGS, - //update file selector MN_WIDGET_ID_IMAGESELECTOR, MN_WIDGET_ID_MTDREAD_SELECTOR, diff --git a/src/system/locals.h b/src/system/locals.h index 87fc1e88b..d07570404 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -422,10 +422,6 @@ typedef enum LOCALE_CPU_FREQ_DEFAULT, LOCALE_CPU_FREQ_NORMAL, LOCALE_CPU_FREQ_STANDBY, - LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS, - LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS_BACKUP, - LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS_HELP, - LOCALE_CROSSTEAM_HINT_SETTINGS_TEAMS_RESTORE, LOCALE_DAEMON_CONTROL, LOCALE_DAEMON_ITEM_CROND_DESC, LOCALE_DAEMON_ITEM_CROND_NAME, @@ -2585,14 +2581,6 @@ typedef enum LOCALE_SETTINGS_POS_TOP_RIGHT, LOCALE_SETTINGS_RESTORE, LOCALE_SETTINGS_RESTORE_WARN, - LOCALE_SETTINGS_TEAMS, - LOCALE_SETTINGS_TEAMS_BACKUP, - LOCALE_SETTINGS_TEAMS_BACKUP_FAILED, - LOCALE_SETTINGS_TEAMS_BACKUP_TO, - LOCALE_SETTINGS_TEAMS_HELP, - LOCALE_SETTINGS_TEAMS_HELP_TEXT, - LOCALE_SETTINGS_TEAMS_RESTORE, - LOCALE_SETTINGS_TEAMS_RESTORE_WARN, LOCALE_SHOUTCAST_DEV_ID, LOCALE_SHOUTCAST_ENABLED, LOCALE_SHUTDOWN_RECORDING_QUERY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ce6e615a0..88225f506 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -422,10 +422,6 @@ const char * locale_real_names[] = "cpu.freq_default", "cpu.freq_normal", "cpu.freq_standby", - "crossteam.hint_settings_teams", - "crossteam.hint_settings_teams_backup", - "crossteam.hint_settings_teams_help", - "crossteam.hint_settings_teams_restore", "daemon_control", "daemon_item.crond_desc", "daemon_item.crond_name", @@ -2585,14 +2581,6 @@ const char * locale_real_names[] = "settings.pos_top_right", "settings.restore", "settings.restore_warn", - "settings.teams", - "settings.teams.backup", - "settings.teams.backup_failed", - "settings.teams.backup_to", - "settings.teams.help", - "settings.teams.help_text", - "settings.teams.restore", - "settings.teams.restore_warn", "shoutcast.dev_id", "shoutcast.enabled", "shutdown.recording_query",