Feature/serve screenshots (#1003)

* Take screnshots using lua function, returning screenshot number. Add screenshot endpoint.
* Change capitalization from screenShot to screenshot
* Fix screenshot filename collision bug when using multiple windows.
This commit is contained in:
Emil Axelsson
2019-11-01 10:41:59 +01:00
committed by GitHub
parent c96794bf27
commit afb889ff82
10 changed files with 89 additions and 54 deletions
+7 -8
View File
@@ -246,16 +246,15 @@ void WebGuiModule::startProcess() {
std::string formattedDirectories = "[";
std::vector<std::string> directories = _directories.value();
bool first = true;
for (const std::string& str : directories) {
if (!first) {
for (size_t i = 0; i < directories.size(); ++i) {
std::string arg = directories[i];
if (i & 1) {
arg = absPath(arg);
}
formattedDirectories += "\\\"" + escapedJson(escapedJson(arg)) + "\\\"";
if (i != directories.size() - 1) {
formattedDirectories += ",";
}
first = false;
// Escape twice: First json, and then bash (which needs same escape sequences)
formattedDirectories += "\\\"" + escapedJson(escapedJson(str)) + "\\\"";
}
formattedDirectories += "]";