gui/miscsettings_menu.cpp: move epg scan OFF option to epg mode,

reorder epg settings, add separators
This commit is contained in:
[CST] Focus
2014-05-14 16:32:49 +04:00
parent 8acad336ba
commit 0c22682df3
8 changed files with 39 additions and 31 deletions

View File

@@ -860,8 +860,8 @@ menu.hint_epg_max_events Maximum events to cache. After reaching limit\nEPG cach
menu.hint_epg_old_events Hours after event end time to consider\nevent old and remove it from cache
menu.hint_epg_save Save cached EPG to harddisk or usb flash\nand load it after boot
menu.hint_epg_save_standby Save EPG on soft standby mode
menu.hint_epg_scan Enable background epg scan using free tuner,\ncurrent bouquet or all favorites
menu.hint_epg_scan_mode Select box state to run epg scan
menu.hint_epg_scan Select bouquets to scan epg, current on zap,\nall or selected favorites
menu.hint_epg_scan_mode Enable background epg scan using free tuner
menu.hint_event_textcolor Change event color for colored-event options\nin channel list and infobar
menu.hint_eventlist_additional Show additional informations\nin main box
menu.hint_eventlist_fonts Change event list font sizes
@@ -1276,10 +1276,11 @@ miscsettings.epg_old_events_hint1 How long will EPG-Data be stored after they ti
miscsettings.epg_old_events_hint2 Set in hours
miscsettings.epg_save Save/Restore epg on reboot
miscsettings.epg_save_standby Save epg on soft standby
miscsettings.epg_scan EPG scan
miscsettings.epg_scan EPG scan mode
miscsettings.epg_scan_always Always
miscsettings.epg_scan_bq bouquet
miscsettings.epg_scan_fav favorites
miscsettings.epg_scan_bouquets EPG scan bouquets
miscsettings.epg_scan_bq Current
miscsettings.epg_scan_fav Favorites
miscsettings.epg_scan_live Live
miscsettings.epg_scan_sel Selected
miscsettings.epg_scan_standby Standby

View File

@@ -172,14 +172,14 @@ void CEpgScan::AddTransponders()
AddBouquet(bouquetList->Bouquets[current_bnum]->channelList);
INFO("Added bouquet #%d, scan map size: %d", current_bnum, scanmap.size());
}
} else {
} else if (g_settings.epg_scan == SCAN_FAV) {
AddFavorites();
}
}
bool CEpgScan::CheckMode()
{
if (!g_settings.epg_scan
if ((g_settings.epg_scan_mode == CEpgScan::MODE_OFF)
|| (standby && !(g_settings.epg_scan_mode & MODE_STANDBY))
|| (!standby && !(g_settings.epg_scan_mode & MODE_LIVE))
|| (!standby && (CFEManager::getInstance()->getEnabledCount() <= 1))) {
@@ -201,7 +201,7 @@ void CEpgScan::Start(bool instandby)
void CEpgScan::Stop()
{
if (!g_settings.epg_scan)
if (g_settings.epg_scan_mode == CEpgScan::MODE_OFF)
return;
INFO("stopping %s scan...", standby ? "standby" : "live");
@@ -306,12 +306,7 @@ void CEpgScan::Next()
bool locked = false;
next_chid = 0;
#if 0
if (!g_settings.epg_scan)
return;
if (!CheckMode())
return;
#endif
if (!standby && CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby)
return;
if (CRecordManager::getInstance()->RecordingStatus() || CStreamManager::getInstance()->StreamStatus())

View File

@@ -36,6 +36,7 @@ class CEpgScan
SCAN_SEL
};
enum {
MODE_OFF = 0,
MODE_LIVE = 0x1,
MODE_STANDBY = 0x2,
MODE_ALWAYS = 0x3

View File

@@ -204,7 +204,6 @@ const CMenuOptionChooser::keyval_ext CPU_FREQ_OPTIONS[CPU_FREQ_OPTION_COUNT] =
const CMenuOptionChooser::keyval EPG_SCAN_OPTIONS[] =
{
{ CEpgScan::SCAN_OFF, LOCALE_OPTIONS_OFF },
{ CEpgScan::SCAN_CURRENT, LOCALE_MISCSETTINGS_EPG_SCAN_BQ },
{ CEpgScan::SCAN_FAV, LOCALE_MISCSETTINGS_EPG_SCAN_FAV },
{ CEpgScan::SCAN_SEL, LOCALE_MISCSETTINGS_EPG_SCAN_SEL },
@@ -213,8 +212,9 @@ const CMenuOptionChooser::keyval EPG_SCAN_OPTIONS[] =
const CMenuOptionChooser::keyval EPG_SCAN_MODE_OPTIONS[] =
{
{ CEpgScan::MODE_LIVE, LOCALE_MISCSETTINGS_EPG_SCAN_LIVE },
{ CEpgScan::MODE_OFF, LOCALE_OPTIONS_OFF },
{ CEpgScan::MODE_STANDBY, LOCALE_MISCSETTINGS_EPG_SCAN_STANDBY },
{ CEpgScan::MODE_LIVE, LOCALE_MISCSETTINGS_EPG_SCAN_LIVE },
{ CEpgScan::MODE_ALWAYS, LOCALE_MISCSETTINGS_EPG_SCAN_ALWAYS }
};
#define EPG_SCAN_MODE_OPTION_COUNT (sizeof(EPG_SCAN_MODE_OPTIONS)/sizeof(CMenuOptionChooser::keyval))
@@ -309,6 +309,7 @@ int CMiscMenue::showMiscSettingsMenu()
delete miscNotifier;
#endif
delete miscEpgNotifier;
delete miscEpgScanNotifier;
return res;
}
@@ -461,32 +462,33 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg)
miscEpgNotifier = new COnOffNotifier();
miscEpgNotifier->addItem(mc1);
//miscEpgNotifier->addItem(mf);
//miscEpgNotifier->addItem(mf1);
//miscEpgNotifier->addItem(mf2);
//miscEpgNotifier->addItem(mf3);
miscEpgNotifier->addItem(mf4);
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true,miscEpgNotifier);
mc->setHint("", LOCALE_MENU_HINT_EPG_SAVE);
CMenuOptionChooser * mc2 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &g_settings.epg_scan, EPG_SCAN_OPTIONS, EPG_SCAN_OPTION_COUNT,
true /*CFEManager::getInstance()->getEnabledCount() > 1*/);
CMenuOptionChooser * mc2 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN_BOUQUETS, &g_settings.epg_scan, EPG_SCAN_OPTIONS, EPG_SCAN_OPTION_COUNT,
g_settings.epg_scan_mode != CEpgScan::MODE_OFF);
mc2->setHint("", LOCALE_MENU_HINT_EPG_SCAN);
CMenuOptionChooser * mc3 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &g_settings.epg_scan_mode, EPG_SCAN_MODE_OPTIONS, EPG_SCAN_MODE_OPTION_COUNT,
CFEManager::getInstance()->getEnabledCount() > 1);
miscEpgScanNotifier = new COnOffNotifier();
miscEpgScanNotifier->addItem(mc2);
CMenuOptionChooser * mc3 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &g_settings.epg_scan_mode, EPG_SCAN_MODE_OPTIONS,
CFEManager::getInstance()->getEnabledCount() > 1 ? EPG_SCAN_MODE_OPTION_COUNT : 2, true, miscEpgScanNotifier);
mc3->setHint("", LOCALE_MENU_HINT_EPG_SCAN_MODE);
ms_epg->addItem(mc);
ms_epg->addItem(mc1);
ms_epg->addItem(mf4);
ms_epg->addItem(GenericMenuSeparatorLine);
ms_epg->addItem(mf);
ms_epg->addItem(mf1);
ms_epg->addItem(mf2);
ms_epg->addItem(mf3);
ms_epg->addItem(mf4);
ms_epg->addItem(mc2);
ms_epg->addItem(GenericMenuSeparatorLine);
ms_epg->addItem(mc3);
ms_epg->addItem(mc2);
}
//filebrowser settings

View File

@@ -42,6 +42,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver
CSectionsdConfigNotifier* sectionsdConfigNotifier;
//COnOffNotifier* miscNotifier;
COnOffNotifier* miscEpgNotifier;
COnOffNotifier* miscEpgScanNotifier;
int width;
std::string epg_cache;
std::string epg_extendedcache;

View File

@@ -469,8 +469,13 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.epg_save = configfile.getBool("epg_save", false);
g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true);
g_settings.epg_scan = configfile.getInt32("epg_scan", 0);
g_settings.epg_scan_mode = configfile.getInt32("epg_scan_mode", CEpgScan::MODE_ALWAYS);
g_settings.epg_scan = configfile.getInt32("epg_scan", CEpgScan::SCAN_CURRENT);
g_settings.epg_scan_mode = configfile.getInt32("epg_scan_mode", CEpgScan::MODE_OFF);
// backward-compatible check
if (g_settings.epg_scan == 0) {
g_settings.epg_scan = CEpgScan::SCAN_CURRENT;
g_settings.epg_scan_mode = CEpgScan::MODE_OFF;
}
//widget settings
g_settings.widget_fade = false;
g_settings.widget_fade = configfile.getBool("widget_fade" , false );
@@ -2141,7 +2146,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
StartSubtitles();
saveSetup(NEUTRINO_SETTINGS_FILE);
if (old_epg != g_settings.epg_scan || old_mode != g_settings.epg_scan_mode) {
if (g_settings.epg_scan)
if (g_settings.epg_scan_mode != CEpgScan::MODE_OFF)
CEpgScan::getInstance()->Start();
else
CEpgScan::getInstance()->Clear();
@@ -3400,7 +3405,8 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
g_Zapit->stopPip();
#endif
bool stream_status = CStreamManager::getInstance()->StreamStatus();
if(!g_settings.epg_scan && !fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus() && !stream_status) {
if((g_settings.epg_scan_mode == CEpgScan::MODE_OFF) && !fromDeepStandby &&
!CRecordManager::getInstance()->RecordingStatus() && !stream_status) {
g_Zapit->setStandby(true);
} else {
//g_Zapit->stopPlayBack();
@@ -3753,7 +3759,7 @@ void stop_daemons(bool stopall, bool for_flash)
CVFD::getInstance()->Clear();
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
CVFD::getInstance()->ShowText("Stop daemons...");
g_settings.epg_scan = false;
g_settings.epg_scan_mode = CEpgScan::MODE_OFF;
my_system(NEUTRINO_ENTER_FLASH_SCRIPT);
}

View File

@@ -1305,6 +1305,7 @@ typedef enum
LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY,
LOCALE_MISCSETTINGS_EPG_SCAN,
LOCALE_MISCSETTINGS_EPG_SCAN_ALWAYS,
LOCALE_MISCSETTINGS_EPG_SCAN_BOUQUETS,
LOCALE_MISCSETTINGS_EPG_SCAN_BQ,
LOCALE_MISCSETTINGS_EPG_SCAN_FAV,
LOCALE_MISCSETTINGS_EPG_SCAN_LIVE,

View File

@@ -1305,6 +1305,7 @@ const char * locale_real_names[] =
"miscsettings.epg_save_standby",
"miscsettings.epg_scan",
"miscsettings.epg_scan_always",
"miscsettings.epg_scan_bouquets",
"miscsettings.epg_scan_bq",
"miscsettings.epg_scan_fav",
"miscsettings.epg_scan_live",