From c6d5716c8f0d5c44f2d985cd277e2459d0f8d02e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 11 Mar 2014 16:21:32 +0400 Subject: [PATCH] neutrino.cpp: add timeshift record duration setting Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6201a95358817f0355a618a90793a44645689b22 Author: [CST] Focus Date: 2014-03-11 (Tue, 11 Mar 2014) --- src/gui/record_setup.cpp | 6 ++++++ src/neutrino.cpp | 2 ++ src/system/settings.h | 1 + 3 files changed, 9 insertions(+) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 207b6ea94..41d70ed3a 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -390,6 +390,12 @@ void CRecordSetup::showRecordTimeShiftSetup(CMenuWidget *menu_ts) mc = new CMenuOptionChooser(LOCALE_EXTRA_TEMP_TIMESHIFT, &g_settings.temp_timeshift, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT_TEMP); menu_ts->addItem(mc); + + //rec hours + mn = new CMenuOptionNumberChooser(LOCALE_EXTRA_RECORD_TIME_TS, &g_settings.timeshift_hours, true, 1, 24, NULL); + mn->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_HOUR)); + mn->setHint("", LOCALE_MENU_HINT_RECORD_TIME_TS); + menu_ts->addItem(mn); } } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 838cba8ee..df548abe1 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -599,6 +599,7 @@ int CNeutrinoApp::loadSetup(const char * fname) } } g_settings.record_hours = configfile.getInt32( "record_hours", 4 ); + g_settings.timeshift_hours = configfile.getInt32( "timeshift_hours", 4 ); g_settings.filesystem_is_utf8 = configfile.getBool("filesystem_is_utf8" , true ); //recording (server + vcr) @@ -1118,6 +1119,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "auto_timeshift", g_settings.auto_timeshift ); configfile.setInt32( "auto_delete", g_settings.auto_delete ); configfile.setInt32( "record_hours", g_settings.record_hours ); + configfile.setInt32( "timeshift_hours", g_settings.timeshift_hours ); //printf("set: key_unlock =============== %d\n", g_settings.key_unlock); configfile.setInt32( "screenshot_count", g_settings.screenshot_count ); configfile.setInt32( "screenshot_format", g_settings.screenshot_format ); diff --git a/src/system/settings.h b/src/system/settings.h index ead5916f9..610d38d9e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -414,6 +414,7 @@ struct SNeutrinoSettings int temp_timeshift; int auto_delete; int record_hours; + int timeshift_hours; int mpkey_rewind; int mpkey_forward;