From 2ba8aff42bac427e5792b937c1c992a5428ca953 Mon Sep 17 00:00:00 2001 From: kelteseth Date: Wed, 17 Oct 2018 20:40:20 +0200 Subject: [PATCH] Cleanup --- ScreenPlay/main.cpp | 2 +- ScreenPlay/qml/Create/Create.qml | 16 ++++++++-------- .../CreateWallpaper/CreateWallpaperWizard.qml | 15 +++++++++++++-- .../Create/Wizards/CreateWallpaper/Page_0.qml | 1 + .../Create/Wizards/CreateWallpaper/Page_1.qml | 6 +++++- ScreenPlay/src/screenplay.cpp | 3 ++- 6 files changed, 30 insertions(+), 13 deletions(-) diff --git a/ScreenPlay/main.cpp b/ScreenPlay/main.cpp index f51ec5ea..10aa12f3 100644 --- a/ScreenPlay/main.cpp +++ b/ScreenPlay/main.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -138,6 +137,7 @@ int main(int argc, char* argv[]) settings.loadActiveProfiles(); QQmlApplicationEngine mainWindowEngine; + qmlRegisterType("analytics", 0, 1, "Tracker"); mainWindowEngine.rootContext()->setContextProperty("screenPlay", &screenPlay); mainWindowEngine.rootContext()->setContextProperty("screenPlayCreate", &create); diff --git a/ScreenPlay/qml/Create/Create.qml b/ScreenPlay/qml/Create/Create.qml index 401f47b1..9ab2b417 100644 --- a/ScreenPlay/qml/Create/Create.qml +++ b/ScreenPlay/qml/Create/Create.qml @@ -38,14 +38,14 @@ Rectangle { } } - Connections { - target: screenPlayCreate - onLocalWorkshopCreationStatusChanged: { - if (status === Create.State.Started) { - loader.setSource("CreateImportStatus.qml") - } - } - } +// Connections { +// target: screenPlayCreate +// onLocalWorkshopCreationStatusChanged: { +// if (status === Create.State.Started) { +// loader.setSource("CreateImportStatus.qml") +// } +// } +// } Connections { target: loader.item diff --git a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml index dc0c28db..60dbc826 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml @@ -23,7 +23,9 @@ Item { onCreateWallpaperStateChanged: { print(state) if (state === Create.State.ConvertingPreviewGifError - || state === Create.State.ConvertingPreviewVideoError) { + || state === Create.State.ConvertingPreviewVideoError + || state === Create.State.AnalyseVideoError) + { createNew.state = "error" } } @@ -269,6 +271,7 @@ Item { Flickable { anchors.fill: parent + clip: true contentHeight: txtFFMPEG.paintedHeight ScrollBar.vertical: ScrollBar { snapMode: ScrollBar.SnapOnRelease @@ -277,7 +280,9 @@ Item { Text { id: txtFFMPEG anchors { - fill: parent + top: parent.top + right: parent.right + left: parent.left margins: 20 } wrapMode: Text.WordWrap @@ -285,6 +290,12 @@ Item { renderType: Text.NativeRendering height: txtFFMPEG.paintedHeight } + Connections { + target: screenPlayCreate + onProcessOutput: { + txtFFMPEG.text = text + } + } } } diff --git a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_0.qml b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_0.qml index bcb295d9..d02cffd0 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_0.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_0.qml @@ -73,6 +73,7 @@ Rectangle { onCreateWallpaperStateChanged: { if (state === Create.State.ConvertingPreviewGif) { txtConvert.text = qsTr("Generating preview gif...") + } if (state === Create.State.ConvertingPreviewGifFinished) { diff --git a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_1.qml b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_1.qml index e01f0c82..6f83c736 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_1.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/Page_1.qml @@ -17,6 +17,7 @@ Item { Flickable { anchors.fill: parent + focus: true contentHeight: txtFFMPEG.paintedHeight ScrollBar.vertical: ScrollBar { snapMode: ScrollBar.SnapOnRelease @@ -25,13 +26,16 @@ Item { Text { id: txtFFMPEG anchors { - fill: parent + top: parent.top + right: parent.right + left: parent.left margins: 20 } wrapMode: Text.WordWrap color: "#626262" renderType: Text.NativeRendering height: txtFFMPEG.paintedHeight + } } } diff --git a/ScreenPlay/src/screenplay.cpp b/ScreenPlay/src/screenplay.cpp index c028afbd..8d439d11 100644 --- a/ScreenPlay/src/screenplay.cpp +++ b/ScreenPlay/src/screenplay.cpp @@ -51,7 +51,8 @@ void ScreenPlay::removeAllWallpaper() void ScreenPlay::requestProjectSettingsListModelAt(int index) { - Q_ASSERT(index < m_screenPlayWallpaperList.size()); + qDebug() << index << m_mlm->size(); + //Q_ASSERT(index > m_mlm->size()); for (int i = 0; i < m_screenPlayWallpaperList.count(); ++i) { if (m_screenPlayWallpaperList.at(i).data()->screenNumber().at(0) == index) { emit projectSettingsListModelFound(m_screenPlayWallpaperList.at(i).data()->projectSettingsListModel().data(), m_screenPlayWallpaperList.at(i).data()->type());