diff --git a/ScreenPlay/Resources.qrc b/ScreenPlay/Resources.qrc index 13e859c6..698aac54 100644 --- a/ScreenPlay/Resources.qrc +++ b/ScreenPlay/Resources.qrc @@ -119,9 +119,7 @@ settings.json translations/ScreenPlay_de.qm translations/ScreenPlay_en.qm - qml/Create/Wizards/CreateWallpaper/Page_0.qml - qml/Create/Wizards/CreateWallpaper/Page_1.qml - qml/Create/Wizards/CreateWallpaper/Page_2.qml qml/Create/Wizards/CreateWallpaper/NextButton.qml + qml/Screen/Screen.qml diff --git a/ScreenPlay/main.cpp b/ScreenPlay/main.cpp index 29b514a2..8551e0f8 100644 --- a/ScreenPlay/main.cpp +++ b/ScreenPlay/main.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include #include #include @@ -26,6 +26,7 @@ #endif #include "ThirdParty/qt-google-analytics/ganalytics.h" +#include "ThirdParty/steam/steam_api.h" #include "src/create.h" #include "src/installedlistfilter.h" #include "src/installedlistmodel.h" @@ -36,11 +37,9 @@ #include "src/sdkconnector.h" #include "src/settings.h" #include "src/startuperror.h" -#include "ThirdParty/steam/steam_api.h" #include "src/steamworkshop.h" #include "src/steamworkshoplistmodel.h" - int main(int argc, char* argv[]) { @@ -50,7 +49,6 @@ int main(int argc, char* argv[]) app.setQuitOnLastWindowClosed(false); qSetMessagePattern("%{if-category}%{category}: %{endif}%{message}\n Loc: [%{file}:%{line}]"); - QTranslator trsl; trsl.load(":/translations/ScreenPlay_de.qm"); app.installTranslator(&trsl); diff --git a/ScreenPlay/qml/Create/CreateWallpaper.qml b/ScreenPlay/qml/Create/CreateWallpaper.qml index 807b7139..96cdca53 100644 --- a/ScreenPlay/qml/Create/CreateWallpaper.qml +++ b/ScreenPlay/qml/Create/CreateWallpaper.qml @@ -85,7 +85,7 @@ Item { FileDialog { id: fileDialogOpenFile - nameFilters: ["Video files (*.mp4)"] + // nameFilters: ["Video files (*.mp4)"] onAccepted: { videoFileSelected(fileDialogOpenFile.currentFile) } diff --git a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml index cdb0599f..0fdc0797 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml @@ -127,6 +127,25 @@ Item { running: true } + AnimatedImage { + id: imgPreview + asynchronous: true + playing: true + visible: false + anchors.fill: parent + } + Text { + id: txtConvertNumber + color: "white" + text: qsTr("") + font.pixelSize: 21 + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + bottomMargin: 40 + } + } + Text { id: txtConvert color: "white" @@ -135,7 +154,7 @@ Item { anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom - bottomMargin: 30 + bottomMargin: 20 } } @@ -152,20 +171,17 @@ Item { imgPreview.source = "file:///" + screenPlayCreate.workingDir + "/preview.gif" imgPreview.visible = true - + txtConvert.text = qsTr("Converting Video") } } - } - - AnimatedImage { - id: imgPreview - asynchronous: true - playing: true - visible: false - anchors.fill: parent + onProgressChanged: { + var percentage = Math.floor(progress * 100) + if (percentage > 100) + percentage = 100 + txtConvertNumber.text = percentage + "%" + } } } - } Item { @@ -191,9 +207,8 @@ Item { anchors.right: parent.right anchors.left: parent.left onTextChanged: { - if (textField.text.length >= 3 ) { + if (textField.text.length >= 3) { canNext = true - } else { canNext = false } diff --git a/ScreenPlay/qml/Installed/Sidebar.qml b/ScreenPlay/qml/Installed/Sidebar.qml index ee1455fe..419948ee 100644 --- a/ScreenPlay/qml/Installed/Sidebar.qml +++ b/ScreenPlay/qml/Installed/Sidebar.qml @@ -225,8 +225,8 @@ Item { height: 100 width: 400 anchors { - top: monitorSelectionWrapper.bottom - topMargin: 30 + bottom: btnSetWallpaper.top + bottomMargin: 20 right: parent.right rightMargin: 30 leftMargin: 30 diff --git a/ScreenPlay/qml/MonitorSelection.qml b/ScreenPlay/qml/MonitorSelection.qml index 333f881c..fff51047 100644 --- a/ScreenPlay/qml/MonitorSelection.qml +++ b/ScreenPlay/qml/MonitorSelection.qml @@ -93,9 +93,7 @@ Rectangle { rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta } - for(var i = 0; i < rp.count; i++){ - } } Repeater { diff --git a/ScreenPlay/qml/Navigation.qml b/ScreenPlay/qml/Navigation.qml index 55e73855..f55a0339 100644 --- a/ScreenPlay/qml/Navigation.qml +++ b/ScreenPlay/qml/Navigation.qml @@ -46,6 +46,7 @@ Rectangle { navInstalled.state = "inactive" navSettings.state = "inactive" navCommunity.state = "inactive" + navScreen.state = "inactive" navCreate.state = "inactive" } else if (name === "Installed") { navWorkshop.state = "inactive" @@ -53,24 +54,35 @@ Rectangle { navSettings.state = "inactive" navCommunity.state = "inactive" navCreate.state = "inactive" + navScreen.state = "inactive" } else if (name === "Settings") { navWorkshop.state = "inactive" navInstalled.state = "inactive" navSettings.state = "active" navCommunity.state = "inactive" navCreate.state = "inactive" + navScreen.state = "inactive" } else if (name === "Create") { navWorkshop.state = "inactive" navInstalled.state = "inactive" navSettings.state = "inactive" navCreate.state = "active" navCommunity.state = "inactive" + navScreen.state = "inactive" } else if (name === "Community") { navWorkshop.state = "inactive" navInstalled.state = "inactive" navSettings.state = "inactive" navCommunity.state = "active" navCreate.state = "inactive" + navScreen.state = "inactive" + }else if (name === "Screen") { + navWorkshop.state = "inactive" + navInstalled.state = "inactive" + navSettings.state = "inactive" + navCommunity.state = "inactive" + navCreate.state = "inactive" + navScreen.state = "active" } } @@ -104,6 +116,14 @@ Rectangle { onPageClicked: navigation.onPageChanged(name) } + NavigationItem { + id: navScreen + state: "inactive" + name: "Screen" + iconSource: "qrc:/assets/icons/icon_monitor.svg" + onPageClicked: navigation.onPageChanged(name) + } + NavigationItem { id: navCommunity state: "inactive" diff --git a/ScreenPlay/qml/Settings/SettingsHeader.qml b/ScreenPlay/qml/Settings/SettingsHeader.qml index 2f2acd2a..799fe31e 100644 --- a/ScreenPlay/qml/Settings/SettingsHeader.qml +++ b/ScreenPlay/qml/Settings/SettingsHeader.qml @@ -67,6 +67,7 @@ Item { text: settingsHeader.text font.pixelSize: 18 color: "white" + verticalAlignment: Text.AlignTop renderType: Text.NativeRendering font.family: "Roboto" anchors{ diff --git a/ScreenPlay/src/create.cpp b/ScreenPlay/src/create.cpp index 997cf783..b5b0ef41 100644 --- a/ScreenPlay/src/create.cpp +++ b/ScreenPlay/src/create.cpp @@ -330,11 +330,21 @@ bool Create::createWallpaperVideo() // Somehow readyRead gets seldom called in the end with an // not valid QProcess pointer.... - if(proConvertVideo.isNull()) { + if (proConvertVideo.isNull()) { qDebug() << "EROR NULL"; return; } + if (!proConvertVideo.data()->isOpen()) { + qDebug() << "ERROR NOT OPEN"; + return; + } + + if (!proConvertVideo.data()->isReadable()) { + qDebug() << "ERROR CANNOT READ LINE"; + return; + } + QString tmpOut = proConvertVideo.data()->readAll(); qDebug() << tmpOut << m_createWallpaperData.length; auto tmpList = tmpOut.split(QRegExp("\\s+"), QString::SkipEmptyParts); @@ -344,9 +354,10 @@ bool Create::createWallpaperVideo() if (!ok) return; + qDebug() << currentFrame << m_createWallpaperData.length << m_createWallpaperData.framerate; float progress = currentFrame / (m_createWallpaperData.length * m_createWallpaperData.framerate); - + qDebug() << progress ; this->setProgress(progress); } this->processOutput(tmpOut); diff --git a/ScreenPlay/src/installedlistmodel.cpp b/ScreenPlay/src/installedlistmodel.cpp index 45bbba1e..acbbdf74 100644 --- a/ScreenPlay/src/installedlistmodel.cpp +++ b/ScreenPlay/src/installedlistmodel.cpp @@ -129,7 +129,7 @@ void InstalledListModel::loadScreens() if (fileEnding.endsWith(".webm") || (obj.value("type").toString() == "qmlScene") || fileEnding.endsWith(".html")) emit addInstalledItem(obj, item.baseName()); - if(obj.value("type") == "qmlWidget") + if(obj.value("type") == "qmlWidget" || obj.value("type") == "standalonewidget") emit addInstalledItem(obj, item.baseName()); } diff --git a/ScreenPlayWidget/ScreenPlayWidget.pro b/ScreenPlayWidget/ScreenPlayWidget.pro index 76b3a4ed..afd715c7 100644 --- a/ScreenPlayWidget/ScreenPlayWidget.pro +++ b/ScreenPlayWidget/ScreenPlayWidget.pro @@ -1,4 +1,4 @@ -QT += quick qml quickcontrols2 core charts widgets gui +QT += quick qml quickcontrols2 core widgets gui CONFIG += c++17 CONFIG += qtquickcompiler # The following define makes your compiler emit warnings if you use diff --git a/ScreenPlayWindow/SPWmain.cpp b/ScreenPlayWindow/SPWmain.cpp index 2b1bc09f..db792146 100644 --- a/ScreenPlayWindow/SPWmain.cpp +++ b/ScreenPlayWindow/SPWmain.cpp @@ -29,7 +29,7 @@ int main(int argc, char* argv[]) // Args: which monitor, (2) path to project, (3)wallpaper secret to identify the connected socket, (4) decoder, (5) volume, (6) fillmode // See screenplay.h @ScreenPlayWallpaper constructor how the args get created - // MainWindow w(0,"D:/672870/827148653","","","",""); + //MainWindow w(0,"D:/672870/_tmp_135011","","","",""); sdk.setAppID(argumentList.at(3)); qDebug() << "Starting MainWindow: " << argumentList.at(2) << argumentList.at(3) << argumentList.at(4) << argumentList.at(5) << argumentList.at(6); MainWindow w(monitor, argumentList.at(2), argumentList.at(3), argumentList.at(4), argumentList.at(5), argumentList.at(6));