mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-06-13 22:23:16 +02:00
Added additional files for default setup.
Fixed executable to path variable expansion for the launcher. Added default launcher for Main menu. Just add .bat, .exe, or .sh programs/scripts to your Main's roms directory to add functionality like Kodi, Shutdown, etc.
This commit is contained in:
@@ -42,12 +42,11 @@ bool Launcher::run(std::string collection, Item *collectionItem)
|
||||
std::string executablePath;
|
||||
std::string selectedItemsDirectory;
|
||||
std::string selectedItemsPath;
|
||||
std::string currentDirectory;
|
||||
std::string extensionstr;
|
||||
std::string matchedExtension;
|
||||
std::string args;
|
||||
|
||||
if(!launcherExecutable(executablePath, currentDirectory, launcherName))
|
||||
if(!launcherExecutable(executablePath, launcherName))
|
||||
{
|
||||
Logger::write(Logger::ZONE_ERROR, "Launcher", "Failed to find launcher executable (launcher: " + launcherName + " executable: " + executablePath + ")");
|
||||
return false;
|
||||
@@ -85,6 +84,11 @@ bool Launcher::run(std::string collection, Item *collectionItem)
|
||||
selectedItemsDirectory,
|
||||
collection);
|
||||
|
||||
std::string currentDirectoryKey = "launchers." + launcherName + ".currentDirectory";
|
||||
std::string currentDirectory = Utils::getDirectory(executablePath);
|
||||
|
||||
config_.getProperty(currentDirectoryKey, currentDirectory);
|
||||
|
||||
currentDirectory = replaceVariables(currentDirectory,
|
||||
selectedItemsPath,
|
||||
collectionItem->name,
|
||||
@@ -222,7 +226,7 @@ bool Launcher::launcherName(std::string &launcherName, std::string collection)
|
||||
|
||||
|
||||
|
||||
bool Launcher::launcherExecutable(std::string &executable, std::string ¤tDirectory, std::string launcherName)
|
||||
bool Launcher::launcherExecutable(std::string &executable, std::string launcherName)
|
||||
{
|
||||
std::string executableKey = "launchers." + launcherName + ".executable";
|
||||
|
||||
@@ -231,11 +235,6 @@ bool Launcher::launcherExecutable(std::string &executable, std::string ¤tD
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string currentDirectoryKey = "launchers." + launcherName + ".currentDirectory";
|
||||
currentDirectory = Utils::getDirectory(executable);
|
||||
|
||||
config_.getProperty(currentDirectoryKey, currentDirectory);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ private:
|
||||
const std::string &replace);
|
||||
|
||||
bool launcherName(std::string &launcherName, std::string collection);
|
||||
bool launcherExecutable(std::string &executable, std::string ¤tDirectory, std::string launcherName);
|
||||
bool launcherExecutable(std::string &executable, std::string launcherName);
|
||||
bool launcherArgs(std::string &args, std::string launcherName);
|
||||
bool extensions(std::string &extensions, std::string launcherName);
|
||||
bool collectionDirectory(std::string &directory, std::string collection);
|
||||
|
||||
Reference in New Issue
Block a user