From c16edb7a8453fc7b8994393b87bcdc6f46b4596f Mon Sep 17 00:00:00 2001 From: kelteseth Date: Thu, 18 Oct 2018 12:53:46 +0200 Subject: [PATCH] Fix error z level Fix conversion of file missinterpreted as an error --- .../CreateWallpaper/CreateWallpaperWizard.qml | 3 +++ ScreenPlay/src/create.cpp | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml index 60dbc826..b0c791cc 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml @@ -78,6 +78,7 @@ Item { Item { id: wrapperSteps + z:10 anchors.fill: parent Text { @@ -398,11 +399,13 @@ Item { PropertyChanges { target: wrapperSteps opacity: 0 + z:0 } PropertyChanges { target: wrapperError opacity: 1 } + } ] transitions: [ diff --git a/ScreenPlay/src/create.cpp b/ScreenPlay/src/create.cpp index 7e6550e6..6aa0594e 100644 --- a/ScreenPlay/src/create.cpp +++ b/ScreenPlay/src/create.cpp @@ -214,9 +214,12 @@ bool Create::createWallpaperVideoPreview(CreateWallpaperData& createWallpaperDat qDebug() << tmpErr; qDebug() << proConvertPreviewMP4.data()->readAllStandardOutput(); qDebug() << proConvertPreviewMP4.data()->readAll(); - emit processOutput(tmpErr); - emit createWallpaperStateChanged(Create::State::ConvertingPreviewVideoError); - return false; + QFile previewVideo(createWallpaperData.exportPath + "/preview.mp4"); + if (!previewVideo.exists() && !(previewVideo.size() > 0)) { + emit processOutput(tmpErr); + emit createWallpaperStateChanged(Create::State::ConvertingPreviewVideoError); + return false; + } } // qDebug() << proConvertPreviewMP4.data()->program() << proConvertPreviewMP4.data()->arguments(); // qDebug() << "Done converting video to preview" << proConvertPreviewMP4.data()->readAll() << "\n" @@ -251,8 +254,11 @@ bool Create::createWallpaperVideoPreview(CreateWallpaperData& createWallpaperDat proConvertGif.data()->start(); proConvertGif.data()->waitForFinished(-1); if (!proConvertGif.data()->readAllStandardError().isEmpty()) { - emit createWallpaperStateChanged(Create::State::ConvertingPreviewGifError); - return false; + QFile previewGif(createWallpaperData.exportPath + "/preview.gif"); + if (!previewGif.exists() && !(previewGif.size() > 0)) { + emit createWallpaperStateChanged(Create::State::ConvertingPreviewGifError); + return false; + } } // qDebug() << proConvertGif.data()->program() << proConvertGif.data()->arguments();