use g_info.hw_caps->can_shutdown; mostly ported from neutrino-mp

Origin commit data
------------------
Branch: ni/coolstream
Commit: de1ee8b73a
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-19 (Sun, 19 Mar 2017)

Origin message was:
------------------
- use g_info.hw_caps->can_shutdown; mostly ported from neutrino-mp

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

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-03-19 23:50:52 +01:00
parent 02c9a3dec4
commit 514707f0c8
3 changed files with 11 additions and 10 deletions

View File

@@ -55,7 +55,6 @@
#include <zapit/femanager.h>
#include <eitd/sectionsd.h>
#include <cs_api.h>
#include <video.h>
#include <sectionsdclient/sectionsdclient.h>
@@ -245,7 +244,7 @@ int CMiscMenue::showMiscSettingsMenu()
misc_menue.addItem(mf);
//energy, shutdown
if(cs_get_revision() > 7)
if(g_info.hw_caps->can_shutdown)
{
mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ENERGY, true, NULL, this, "energy", CRCInput::RC_green);
mf->setHint("", LOCALE_MENU_HINT_MISC_ENERGY);

View File

@@ -456,12 +456,14 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254);
g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING);
g_settings.shutdown_real = false;
if (g_info.hw_caps->can_shutdown)
g_settings.shutdown_real = configfile.getBool("shutdown_real" , false );
g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false );
g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0);
g_settings.shutdown_min = 0;
if(cs_get_revision() > 7)
if (g_info.hw_caps->can_shutdown)
g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180);
g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0);
@@ -2268,7 +2270,7 @@ TIMER_STOP("################################## after all #######################
}
RealRun();
ExitRun(true, (cs_get_revision() > 7));
ExitRun(true, g_info.hw_caps->can_shutdown);
return 0;
}
@@ -3366,7 +3368,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
}
else if( msg == NeutrinoMessages::SHUTDOWN ) {
if(!skipShutdownTimer) {
ExitRun(true, (cs_get_revision() > 7));
ExitRun(true, g_info.hw_caps->can_shutdown);
}
else {
skipShutdownTimer=false;
@@ -3541,6 +3543,7 @@ extern bool timer_is_rec;//timermanager.cpp
void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
{
printf("[neutrino] %s retcode: %d can_shutdown: %d\n", __func__, retcode, g_info.hw_caps->can_shutdown);
bool do_shutdown = true;
CRecordManager::getInstance()->StopAutoRecord();
@@ -3556,7 +3559,6 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
//SDTreloadChannels = false;
}
dprintf(DEBUG_INFO, "exit\n");
StopSubtitles();
stopPlayBack();

View File

@@ -252,7 +252,7 @@ void CNeutrinoApp::InitMenuMain()
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]);
//shutdown
if(system_rev >= 8) {
if (g_info.hw_caps->can_shutdown) {
mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby);
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN);
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]);
@@ -298,7 +298,7 @@ void CNeutrinoApp::InitMenuMain()
personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]);
//shutdown
if(system_rev >= 8) {
if (g_info.hw_caps->can_shutdown) {
mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_blue);
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN);
personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]);