Commits from @MartB and more ...

- Commit: 1d9165f403
- New default QT capture implementation
- UploadHandler added to Effects Configurator to allow uploading GIF files
- Docker compile script and instruction
- Travis Fix
This commit is contained in:
Paulchen-Panther
2019-01-06 19:49:56 +01:00
parent 7352ff4d42
commit 2dca1c93e6
57 changed files with 1134 additions and 341 deletions

View File

@@ -8,6 +8,7 @@
#include <QFileInfo>
#include <QDir>
#include <QMap>
#include <QByteArray>
// createEffect helper
struct find_schema: std::unary_function<EffectSchema, bool>
@@ -69,7 +70,15 @@ const bool EffectFileHandler::deleteEffect(const QString& effectName, QString& r
{
if (effectConfigurationFile.exists())
{
if ( (it->script == ":/effects/gif.py") && !it->args.value("image").toString("").isEmpty())
{
QFileInfo effectImageFile(effectConfigurationFile.absolutePath() + "/" + it->args.value("image").toString());
if (effectImageFile.exists())
QFile::remove(effectImageFile.absoluteFilePath());
}
bool result = QFile::remove(effectConfigurationFile.absoluteFilePath());
if (result)
{
updateEffects();
@@ -141,6 +150,17 @@ const bool EffectFileHandler::saveEffect(const QJsonObject& message, QString& re
newFileName.setFile(f);
}
//TODO check if filename exist
if (!message["imageData"].toString("").isEmpty() && !message["args"].toObject().value("image").toString("").isEmpty())
{
QFileInfo imageFileName(effectArray[0].toString().replace("$ROOT",_rootPath) + "/" + message["args"].toObject().value("image").toString());
if(!FileUtils::writeFile(imageFileName.absoluteFilePath(), QByteArray::fromBase64(message["imageData"].toString("").toUtf8()), _log))
{
resultMsg = "Error while saving image file '" + message["args"].toObject().value("image").toString() + ", please check the Hyperion Log";
return false;
}
}
if(!JsonUtils::write(newFileName.absoluteFilePath(), effectJson, _log))
{
resultMsg = "Error while saving effect, please check the Hyperion Log";