Added support for reboot parameter to the launcher configuration files. RetroFE is rebooted when set to yes/true.

This commit is contained in:
Pieter Hulshoff 2020-04-27 14:39:49 +02:00
parent 1d0962eafe
commit 1d9f942af2
3 changed files with 20 additions and 9 deletions

View File

@ -122,7 +122,10 @@ bool Launcher::run(std::string collection, Item *collectionItem)
return false;
}
return true;
bool reboot = false;
config_.getProperty("launchers." + launcherName + ".reboot", reboot);
return reboot;
}
std::string Launcher::replaceVariables(std::string str,

View File

@ -1036,10 +1036,18 @@ bool RetroFE::run( )
if (currentPage_->getPlaylistName( ) != attractModeSkipPlaylist &&
nextPageItem_->collectionInfo->name != lastPlayedSkipCollection)
cib.updateLastPlayedPlaylist( currentPage_->getCollection(), nextPageItem_, size ); // Update last played playlist if not currently in the skip playlist (e.g. settings)
l.run(nextPageItem_->collectionInfo->name, nextPageItem_);
launchExit( );
currentPage_->exitGame( );
state = RETROFE_LAUNCH_EXIT;
if (l.run(nextPageItem_->collectionInfo->name, nextPageItem_)) // Run and check if we need to reboot
{
attract_.reset( );
reboot_ = true;
state = RETROFE_QUIT_REQUEST;
}
else
{
launchExit( );
currentPage_->exitGame( );
state = RETROFE_LAUNCH_EXIT;
}
}
break;
@ -1707,9 +1715,9 @@ CollectionInfo *RetroFE::getCollection(std::string collectionName)
(void)config_.getProperty( "showParenthesis", showParenthesis );
(void)config_.getProperty( "showSquareBrackets", showSquareBrackets );
typedef std::map<std::string, std::vector <Item *> *> Playlists_T;
for ( Playlists_T::iterator itP = collection->playlists.begin( ); itP != collection->playlists.end( ); itP++ )
{
typedef std::map<std::string, std::vector <Item *> *> Playlists_T;
for ( Playlists_T::iterator itP = collection->playlists.begin( ); itP != collection->playlists.end( ); itP++ )
{
for ( std::vector <Item *>::iterator itI = itP->second->begin( ); itI != itP->second->end( ); itI++ )
{
if ( !showParenthesis )

View File

@ -21,7 +21,7 @@
std::string retrofe_version_major = "0";
std::string retrofe_version_minor = "9";
std::string retrofe_version_build = "36";
std::string retrofe_version_build = "37";
std::string Version::getString( )