diff --git a/src/driver/shutdown_count.cpp b/src/driver/shutdown_count.cpp index 39eacffbc..c9219f583 100644 --- a/src/driver/shutdown_count.cpp +++ b/src/driver/shutdown_count.cpp @@ -64,7 +64,7 @@ void* SHTDCNT::TimeThread(void *) void SHTDCNT::init() { shutdown_cnt = atoi(g_settings.shutdown_count) * 60; - sleep_cnt = g_settings.shutdown_min*60; + sleep_cnt = atoi(g_settings.shutdown_min)*60; if (pthread_create (&thrTime, NULL, TimeThread, NULL) != 0 ) { perror("[SHTDCNT]: pthread_create(TimeThread)"); @@ -99,7 +99,7 @@ void SHTDCNT::shutdown_counter() } } - if(g_settings.shutdown_min > 0) { + if(atoi(g_settings.shutdown_min) > 0) { if(sleep_cnt > 0) { sleeptimer_active = true; sleep_cnt--; @@ -113,5 +113,5 @@ void SHTDCNT::shutdown_counter() void SHTDCNT::resetSleepTimer() { - sleep_cnt = g_settings.shutdown_min*60; + sleep_cnt = atoi(g_settings.shutdown_min)*60; } diff --git a/src/gui/sleeptimer.cpp b/src/gui/sleeptimer.cpp index 4fc05b033..a15eac04b 100644 --- a/src/gui/sleeptimer.cpp +++ b/src/gui/sleeptimer.cpp @@ -60,7 +60,7 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey) parent->hide(); if(permanent) { - sprintf(value,"%03d", g_settings.shutdown_min); + strcpy(value,g_settings.shutdown_min); } else { shutdown_min = g_Timerd->getSleepTimerRemaining(); // remaining shutdown time? sprintf(value,"%03d", shutdown_min); @@ -93,8 +93,8 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey) int new_val = atoi(value); if(permanent) { - g_settings.shutdown_min = new_val; - printf("permanent sleeptimer min: %d\n", g_settings.shutdown_min); + sprintf(g_settings.shutdown_min,"%03d", new_val); + printf("permanent sleeptimer min: %s\n", g_settings.shutdown_min); } else if(shutdown_min != new_val) { shutdown_min = new_val; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ececfecda..28a62c221 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -473,9 +473,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); strcpy(g_settings.shutdown_count, configfile.getString("shutdown_count","0").c_str()); - g_settings.shutdown_min = 0; + strcpy(g_settings.shutdown_min, "000"); if(cs_get_revision() > 7) - g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180 ); + strcpy(g_settings.shutdown_min, configfile.getString("shutdown_min","180").c_str()); g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos" , 0 ); @@ -1024,7 +1024,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("shutdown_real" , g_settings.shutdown_real ); configfile.setBool("shutdown_real_rcdelay", g_settings.shutdown_real_rcdelay); configfile.setString("shutdown_count" , g_settings.shutdown_count); - configfile.setInt32("shutdown_min" , g_settings.shutdown_min ); + configfile.setString("shutdown_min" , g_settings.shutdown_min ); configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); configfile.setBool("progressbar_color" , g_settings.progressbar_color ); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index e7487d683..24a950c50 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -978,7 +978,7 @@ void CNeutrinoApp::InitMiscSettings(CMenuWidget &miscSettings) miscSettingsGeneral->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_SHUTDOWN_REAL, &g_settings.shutdown_real, OPTIONS_OFF1_ON0_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, miscNotifier)); miscSettingsGeneral->addItem(m1); miscSettingsGeneral->addItem(m2); - miscSettingsGeneral->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_SLEEPTIMER, true, NULL, new CSleepTimerWidget, "permanent")); + miscSettingsGeneral->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_SLEEPTIMER, true, g_settings.shutdown_min, new CSleepTimerWidget, "permanent")); } #if 0 diff --git a/src/system/settings.h b/src/system/settings.h index 8fbe478c4..da9a5f284 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -57,7 +57,7 @@ struct SNeutrinoSettings int shutdown_real; int shutdown_real_rcdelay; char shutdown_count[4]; - int shutdown_min; + char shutdown_min[4]; char record_safety_time_before[3]; char record_safety_time_after[3]; int infobar_sat_display;