add menu option to delete 'removed channels'

Origin commit data
------------------
Branch: ni/coolstream
Commit: 1c58f5f093
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-04-14 (Sun, 14 Apr 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2013-04-14 12:46:10 +02:00
parent 7e15658420
commit df0884a4e4
6 changed files with 23 additions and 3 deletions

View File

@@ -460,12 +460,16 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK
bool delete_all = (actionKey == "all");
bool delete_chan = (actionKey == "channels") || delete_all;
bool delete_set = (actionKey == "settings") || delete_all;
bool delete_removed = (actionKey == "delete_removed");
neutrino_locale_t msg = delete_all ? LOCALE_RESET_ALL : delete_chan ? LOCALE_RESET_CHANNELS : LOCALE_RESET_SETTINGS;
int ret = menu_return::RETURN_REPAINT;
int result = ShowMsgUTF(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo);
if(result != CMessageBox::mbrYes)
return true;
/* no need to confirm if we only remove deleted channels */
if (!delete_removed) {
int result = ShowMsgUTF(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo);
if (result != CMessageBox::mbrYes)
return true;
}
if(delete_all) {
my_system(3, "/bin/sh", "-c", "rm -f " CONFIGDIR "/zapit/*.conf");
@@ -491,6 +495,10 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK
my_system(3, "/bin/sh", "-c", "rm -f " CONFIGDIR "/zapit/*.xml");
g_Zapit->reinitChannels();
}
if (delete_removed) {
CServiceManager::getInstance()->SaveServices(true, false, true);
g_Zapit->reinitChannels();
}
return ret;
}