system/settings: store epg times in integers

Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>


Origin commit data
------------------
Branch: ni/coolstream
Commit: b45511b196
Author: martii <m4rtii@gmx.de>
Date: 2013-12-24 (Tue, 24 Dec 2013)



------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-12-24 12:13:04 +01:00
committed by Jacek Jendrzej
parent f870b2d240
commit e558ba8025
4 changed files with 46 additions and 24 deletions

View File

@@ -269,6 +269,12 @@ int CMiscMenue::showMiscSettingsMenu()
#endif /*CPU_FREQ*/ #endif /*CPU_FREQ*/
int res = misc_menue.exec(NULL, ""); int res = misc_menue.exec(NULL, "");
g_settings.epg_cache = atoi(epg_cache.c_str());
g_settings.epg_extendedcache = atoi(epg_extendedcache.c_str());
g_settings.epg_old_events = atoi(epg_old_events.c_str());
g_settings.epg_max_events = atoi(epg_max_events.c_str());
delete fanNotifier; delete fanNotifier;
delete sectionsdConfigNotifier; delete sectionsdConfigNotifier;
#if 0 #if 0
@@ -335,7 +341,7 @@ int CMiscMenue::showMiscSettingsMenuEnergy()
std::string shutdown_count = to_string(g_settings.shutdown_count); std::string shutdown_count = to_string(g_settings.shutdown_count);
if (shutdown_count.length() < 3) if (shutdown_count.length() < 3)
shutdown_count.insert(0, 3 - shutdown_count.length(), '0'); shutdown_count.insert(0, 3 - shutdown_count.length(), ' ');
CStringInput * miscSettings_shutdown_count = new CStringInput(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, &shutdown_count, 3, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, "0123456789 "); CStringInput * miscSettings_shutdown_count = new CStringInput(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, &shutdown_count, 3, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, "0123456789 ");
CMenuForwarder *m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, !g_settings.shutdown_real, shutdown_count.c_str(), miscSettings_shutdown_count); CMenuForwarder *m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, !g_settings.shutdown_real, shutdown_count.c_str(), miscSettings_shutdown_count);
m2->setHint("", LOCALE_MENU_HINT_SHUTDOWN_COUNT); m2->setHint("", LOCALE_MENU_HINT_SHUTDOWN_COUNT);
@@ -383,20 +389,32 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg)
CMenuOptionChooser * mc1 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save); CMenuOptionChooser * mc1 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save);
mc1->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); mc1->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY);
CStringInput * miscSettings_epg_cache = new CStringInput(LOCALE_MISCSETTINGS_EPG_CACHE, &g_settings.epg_cache, 2,LOCALE_MISCSETTINGS_EPG_CACHE_HINT1, LOCALE_MISCSETTINGS_EPG_CACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); epg_cache = to_string(g_settings.epg_cache);
if (epg_cache.length() < 2)
epg_cache.insert(0, 2 - epg_cache.length(), ' ');
CStringInput * miscSettings_epg_cache = new CStringInput(LOCALE_MISCSETTINGS_EPG_CACHE, &epg_cache, 2,LOCALE_MISCSETTINGS_EPG_CACHE_HINT1, LOCALE_MISCSETTINGS_EPG_CACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier);
CMenuForwarder * mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_CACHE, true, NULL, miscSettings_epg_cache); CMenuForwarder * mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_CACHE, true, NULL, miscSettings_epg_cache);
mf->setHint("", LOCALE_MENU_HINT_EPG_CACHE); mf->setHint("", LOCALE_MENU_HINT_EPG_CACHE);
CStringInput * miscSettings_epg_cache_e = new CStringInput(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, &g_settings.epg_extendedcache, 3,LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT1, LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); epg_extendedcache = to_string(g_settings.epg_extendedcache);
CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, true, g_settings.epg_extendedcache, miscSettings_epg_cache_e); if (epg_extendedcache.length() < 3)
epg_extendedcache.insert(0, 3 - epg_extendedcache.length(), ' ');
CStringInput * miscSettings_epg_cache_e = new CStringInput(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, &epg_extendedcache, 3,LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT1, LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier);
CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, true, epg_extendedcache.c_str(), miscSettings_epg_cache_e);
mf1->setHint("", LOCALE_MENU_HINT_EPG_EXTENDEDCACHE); mf1->setHint("", LOCALE_MENU_HINT_EPG_EXTENDEDCACHE);
CStringInput * miscSettings_epg_old_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, &g_settings.epg_old_events, 3,LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); epg_old_events = to_string(g_settings.epg_old_events);
CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, true, g_settings.epg_old_events, miscSettings_epg_old_events); if (epg_old_events.length() < 3)
epg_old_events.insert(0, 3 - epg_old_events.length(), ' ');
CStringInput * miscSettings_epg_old_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, &epg_old_events, 3,LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier);
CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, true, epg_old_events.c_str(), miscSettings_epg_old_events);
mf2->setHint("", LOCALE_MENU_HINT_EPG_OLD_EVENTS); mf2->setHint("", LOCALE_MENU_HINT_EPG_OLD_EVENTS);
CStringInput * miscSettings_epg_max_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, &g_settings.epg_max_events, 6,LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); epg_max_events = to_string(g_settings.epg_max_events);
CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, g_settings.epg_max_events, miscSettings_epg_max_events); if (epg_max_events.length() < 6)
epg_max_events.insert(0, 6 - epg_max_events.length(), ' ');
CStringInput * miscSettings_epg_max_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, &epg_max_events, 6,LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier);
CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, epg_max_events.c_str(), miscSettings_epg_max_events);
mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS); mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS);
CMenuForwarder * mf4 = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, g_settings.epg_save, g_settings.epg_dir, this, "epgdir"); CMenuForwarder * mf4 = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, g_settings.epg_save, g_settings.epg_dir, this, "epgdir");

View File

@@ -43,6 +43,10 @@ class CMiscMenue : public CMenuTarget, CChangeObserver
//COnOffNotifier* miscNotifier; //COnOffNotifier* miscNotifier;
COnOffNotifier* miscEpgNotifier; COnOffNotifier* miscEpgNotifier;
int width; int width;
std::string epg_cache;
std::string epg_extendedcache;
std::string epg_old_events;
std::string epg_max_events;
int showMiscSettingsMenu(); int showMiscSettingsMenu();
void showMiscSettingsMenuGeneral(CMenuWidget *ms_general); void showMiscSettingsMenuGeneral(CMenuWidget *ms_general);

View File

@@ -438,10 +438,10 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.language = configfile.getString("language", ""); g_settings.language = configfile.getString("language", "");
g_settings.timezone = configfile.getString("timezone", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Vienna"); g_settings.timezone = configfile.getString("timezone", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Vienna");
//epg dir //epg dir
g_settings.epg_cache = configfile.getString("epg_cache_time", "14"); g_settings.epg_cache = configfile.getInt32("epg_cache_time", 14);
g_settings.epg_extendedcache = configfile.getString("epg_extendedcache_time", "360"); g_settings.epg_extendedcache = configfile.getInt32("epg_extendedcache_time", 360);
g_settings.epg_old_events = configfile.getString("epg_old_events", "1"); g_settings.epg_old_events = configfile.getInt32("epg_old_events", 1);
g_settings.epg_max_events = configfile.getString("epg_max_events", "30000"); g_settings.epg_max_events = configfile.getInt32("epg_max_events", 30000);
g_settings.epg_dir = configfile.getString("epg_dir", "/media/sda1/epg"); g_settings.epg_dir = configfile.getString("epg_dir", "/media/sda1/epg");
// NTP-Server for sectionsd // NTP-Server for sectionsd
g_settings.network_ntpserver = configfile.getString("network_ntpserver", "time.fu-berlin.de"); g_settings.network_ntpserver = configfile.getString("network_ntpserver", "time.fu-berlin.de");
@@ -941,10 +941,10 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setBool("epg_save", g_settings.epg_save); configfile.setBool("epg_save", g_settings.epg_save);
configfile.setBool("epg_save_standby", g_settings.epg_save_standby); configfile.setBool("epg_save_standby", g_settings.epg_save_standby);
configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan", g_settings.epg_scan);
configfile.setString("epg_cache_time" ,g_settings.epg_cache ); configfile.setInt32("epg_cache_time" ,g_settings.epg_cache );
configfile.setString("epg_extendedcache_time" ,g_settings.epg_extendedcache); configfile.setInt32("epg_extendedcache_time" ,g_settings.epg_extendedcache);
configfile.setString("epg_old_events" ,g_settings.epg_old_events ); configfile.setInt32("epg_old_events" ,g_settings.epg_old_events );
configfile.setString("epg_max_events" ,g_settings.epg_max_events ); configfile.setInt32("epg_max_events" ,g_settings.epg_max_events );
configfile.setString("epg_dir" ,g_settings.epg_dir); configfile.setString("epg_dir" ,g_settings.epg_dir);
// NTP-Server for sectionsd // NTP-Server for sectionsd
@@ -1607,10 +1607,10 @@ void CNeutrinoApp::SetupFonts(int fmode)
void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config) void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config)
{ {
config.epg_cache = atoi(g_settings.epg_cache.c_str()); config.epg_cache = g_settings.epg_cache;
config.epg_old_events = atoi(g_settings.epg_old_events.c_str()); config.epg_old_events = g_settings.epg_old_events;
config.epg_max_events = atoi(g_settings.epg_max_events.c_str()); config.epg_max_events = g_settings.epg_max_events;
config.epg_extendedcache = atoi(g_settings.epg_extendedcache.c_str()); config.epg_extendedcache = g_settings.epg_extendedcache;
config.epg_dir = g_settings.epg_dir; config.epg_dir = g_settings.epg_dir;
config.network_ntpserver = g_settings.network_ntpserver; config.network_ntpserver = g_settings.network_ntpserver;
config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str()); config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str());

View File

@@ -141,10 +141,10 @@ struct SNeutrinoSettings
// EPG // EPG
int epg_save; int epg_save;
int epg_save_standby; int epg_save_standby;
std::string epg_cache; // FIXME int epg_cache;
std::string epg_old_events; // FIXME int epg_old_events;
std::string epg_max_events; // FIXME int epg_max_events;
std::string epg_extendedcache; // FIXME int epg_extendedcache;
std::string epg_dir; std::string epg_dir;
int epg_scan; int epg_scan;