mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- use g_info.hw_caps->can_shutdown; mostly ported from neutrino-mp
This commit is contained in:
@@ -55,7 +55,6 @@
|
|||||||
#include <zapit/femanager.h>
|
#include <zapit/femanager.h>
|
||||||
#include <eitd/sectionsd.h>
|
#include <eitd/sectionsd.h>
|
||||||
|
|
||||||
#include <cs_api.h>
|
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
|
|
||||||
#include <sectionsdclient/sectionsdclient.h>
|
#include <sectionsdclient/sectionsdclient.h>
|
||||||
@@ -245,7 +244,7 @@ int CMiscMenue::showMiscSettingsMenu()
|
|||||||
misc_menue.addItem(mf);
|
misc_menue.addItem(mf);
|
||||||
|
|
||||||
//energy, shutdown
|
//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 = new CMenuForwarder(LOCALE_MISCSETTINGS_ENERGY, true, NULL, this, "energy", CRCInput::RC_green);
|
||||||
mf->setHint("", LOCALE_MENU_HINT_MISC_ENERGY);
|
mf->setHint("", LOCALE_MENU_HINT_MISC_ENERGY);
|
||||||
|
@@ -456,12 +456,14 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254);
|
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.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING);
|
||||||
|
|
||||||
g_settings.shutdown_real = configfile.getBool("shutdown_real" , false );
|
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_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false );
|
||||||
g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0);
|
g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0);
|
||||||
|
|
||||||
g_settings.shutdown_min = 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.shutdown_min = configfile.getInt32("shutdown_min", 180);
|
||||||
g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0);
|
g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0);
|
||||||
|
|
||||||
@@ -2268,7 +2270,7 @@ TIMER_STOP("################################## after all #######################
|
|||||||
}
|
}
|
||||||
RealRun();
|
RealRun();
|
||||||
|
|
||||||
ExitRun(true, (cs_get_revision() > 7));
|
ExitRun(true, g_info.hw_caps->can_shutdown);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3321,7 +3323,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
return messages_return::handled;
|
return messages_return::handled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(g_settings.shutdown_real)
|
if (g_settings.shutdown_real)
|
||||||
g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0);
|
g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0);
|
||||||
else
|
else
|
||||||
g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0);
|
g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0);
|
||||||
@@ -3366,7 +3368,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
}
|
}
|
||||||
else if( msg == NeutrinoMessages::SHUTDOWN ) {
|
else if( msg == NeutrinoMessages::SHUTDOWN ) {
|
||||||
if(!skipShutdownTimer) {
|
if(!skipShutdownTimer) {
|
||||||
ExitRun(true, (cs_get_revision() > 7));
|
ExitRun(true, g_info.hw_caps->can_shutdown);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipShutdownTimer=false;
|
skipShutdownTimer=false;
|
||||||
@@ -3541,6 +3543,7 @@ extern bool timer_is_rec;//timermanager.cpp
|
|||||||
|
|
||||||
void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
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;
|
bool do_shutdown = true;
|
||||||
|
|
||||||
CRecordManager::getInstance()->StopAutoRecord();
|
CRecordManager::getInstance()->StopAutoRecord();
|
||||||
@@ -3556,7 +3559,6 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
|||||||
//SDTreloadChannels = false;
|
//SDTreloadChannels = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dprintf(DEBUG_INFO, "exit\n");
|
dprintf(DEBUG_INFO, "exit\n");
|
||||||
StopSubtitles();
|
StopSubtitles();
|
||||||
stopPlayBack();
|
stopPlayBack();
|
||||||
|
@@ -252,7 +252,7 @@ void CNeutrinoApp::InitMenuMain()
|
|||||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]);
|
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]);
|
||||||
|
|
||||||
//shutdown
|
//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 = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby);
|
||||||
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN);
|
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN);
|
||||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_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]);
|
personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]);
|
||||||
|
|
||||||
//shutdown
|
//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 = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_blue);
|
||||||
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN);
|
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN);
|
||||||
personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]);
|
personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]);
|
||||||
|
Reference in New Issue
Block a user