1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Add not yet working import

This commit is contained in:
Elias 2018-12-18 16:03:44 +01:00
parent 8b727d6c1b
commit 6c71f8bc86
10 changed files with 764 additions and 304 deletions

View File

@ -0,0 +1,5 @@
import QtQuick 2.0
Item {
}

View File

@ -0,0 +1,5 @@
import QtQuick 2.0
Item {
}

View File

@ -6,6 +6,8 @@ import QtGraphicalEffects 1.0
import net.aimber.create 1.0
import "Wizards/CreateWallpaper"
Item {
id: create
anchors.fill: parent
@ -19,15 +21,28 @@ Item {
Connections {
target: createWallpaper
onVideoFileSelected: {
onVideoImportConvertFileSelected: {
create.state = "import"
activeVideoFile = videoFile
loader.setSource(
"Wizards/CreateWallpaper/CreateWallpaperWizard.qml", {
"filePath": activeVideoFile
"filePath": activeVideoFile,
"importState": CreateWallpaperWizard.ImportState.Convert
})
}
onVideoImportFileSelected: {
create.state = "import"
activeVideoFile = videoFile
loader.setSource(
"Wizards/CreateWallpaper/CreateWallpaperWizard.qml", {
"filePath": activeVideoFile,
"importState": CreateWallpaperWizard.ImportState.Import
})
}
onProjectFileSelected: {
create.state = "import"

View File

@ -7,6 +7,7 @@ import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3
import RemoteWorkshopCreationStatus 1.0
Item {
id: createUpload
anchors.fill: parent
@ -18,6 +19,8 @@ Item {
property string projectFile
property var jsonProjectFile
// First we parse the content of the project file
// TODO: Implement parse error
onProjectFileChanged: {
@ -527,3 +530,8 @@ Item {
}
]
}
/*##^## Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -4,15 +4,21 @@ import QtQuick.Controls 2.3
import Qt.labs.platform 1.0
import QtQuick.Controls.Material 2.2
import "../Workshop"
Item {
id: createWallpaper
state: "out"
Component.onCompleted: createWallpaper.state = "in"
signal videoFileSelected(var videoFile)
signal projectFileSelected(var projectFile)
signal videoImportConvertFileSelected(var videoFile)
signal videoImportFileSelected(var videoFile)
signal projectFileSelected(var projectFile)
WorkshopLoader {
id: wl
}
Text {
id: txtHeadline
text: qsTr("Import Video Wallpaper")
@ -68,7 +74,7 @@ Item {
}
Button {
text: qsTr("Select File")
text: qsTr("Import video")
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
@ -87,7 +93,7 @@ Item {
id: fileDialogImportVideo
// nameFilters: ["Video files (*.mp4)"]
onAccepted: {
videoFileSelected(fileDialogImportVideo.currentFile)
videoImportConvertFileSelected(fileDialogImportVideo.currentFile)
}
}
}
@ -148,7 +154,7 @@ Item {
}
Button {
text: qsTr("Select File")
text: qsTr("Convert Video")
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
@ -167,7 +173,7 @@ Item {
id: fileDialogImportVideo2
// nameFilters: ["Video files (*.mp4)"]
onAccepted: {
videoFileSelected(fileDialogImportVideo.currentFile)
videoImportConvertFileSelected(fileDialogImportVideo.currentFile)
}
}
}
@ -194,6 +200,7 @@ Item {
id: wrapperUploadProject
width: parent.width
height: 120
visible: wl.available
anchors {
top: wrapperConvertVideo.bottom
@ -217,9 +224,11 @@ Item {
opacity: 0
}
Rectangle {
id: importVideoBg3
radius: 3
anchors {
fill: parent
margins: 10
@ -375,6 +384,20 @@ Item {

View File

@ -0,0 +1,87 @@
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0
import QtQuick.Layouts 1.3
import net.aimber.create 1.0
Item {
id: wrapperError
opacity: 0
Text {
id: txtErrorHeadline
text: qsTr("An error occurred!")
anchors {
top: parent.top
topMargin: 30
horizontalCenter: parent.horizontalCenter
}
height: 40
font.family: "Segoe UI, Roboto"
font.weight: Font.Light
color: Material.color(Material.Red)
renderType: Text.NativeRendering
font.pixelSize: 32
}
Rectangle {
id: rectangle1
color: "#eeeeee"
radius: 3
anchors {
top: txtErrorHeadline.bottom
right: parent.right
bottom: btnBack.top
left: parent.left
margins: 30
bottomMargin: 10
}
Flickable {
anchors.fill: parent
clip: true
contentHeight: txtFFMPEGDebug.paintedHeight
ScrollBar.vertical: ScrollBar {
snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn
}
Text {
id: txtFFMPEGDebug
anchors {
top: parent.top
right: parent.right
left: parent.left
margins: 20
}
wrapMode: Text.WordWrap
color: "#626262"
renderType: Text.NativeRendering
height: txtFFMPEGDebug.paintedHeight
}
Connections {
target: screenPlayCreate
onProcessOutput: {
txtFFMPEGDebug.text = text
}
}
}
}
Button {
id: btnBack
text: qsTr("Back to create and send an error report!")
Material.background: Material.Orange
Material.foreground: "white"
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
margins: 10
}
onClicked: {
utility.setNavigationActive(true)
utility.setNavigation("Create")
}
}
}

View File

@ -0,0 +1,58 @@
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0
import QtQuick.Layouts 1.3
import net.aimber.create 1.0
Item {
id: wrapperSuccess
opacity: 0
Text {
id: txtSuccessHeadline
text: qsTr("Video creation success!")
anchors {
top: parent.top
topMargin: 30
horizontalCenter: parent.horizontalCenter
}
height: 40
font.family: "Segoe UI, Roboto"
font.weight: Font.Light
color: Material.color(Material.Green)
renderType: Text.NativeRendering
font.pixelSize: 32
}
AnimatedImage {
id: imgSuccess
asynchronous: true
playing: true
anchors.centerIn: parent
width: 600
height: 400
}
Button {
id: btnSuccessBack
text: qsTr("Back to create!")
Material.background: Material.Orange
Material.foreground: "white"
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
margins: 10
}
onClicked: {
utility.setNavigationActive(true)
utility.setNavigation("Create")
}
}
}
/*##^## Designer {
D{i:0;autoSize:true;height:768;width:1366}
}
##^##*/

View File

@ -0,0 +1,245 @@
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0
import QtQuick.Layouts 1.3
import net.aimber.create 1.0
Item {
id: wrapperContent
Text {
id: txtHeadline
text: qsTr("Import a video to a wallpaper")
height: 40
font.family: "Roboto"
font.weight: Font.Light
color: "#757575"
renderType: Text.NativeRendering
font.pixelSize: 23
anchors {
top: parent.top
left: parent.left
margins: 40
bottomMargin: 0
}
}
Item {
id: wrapperLeft
width: parent.width * .5
anchors {
left: parent.left
top: txtHeadline.bottom
margins: 30
bottom: parent.bottom
}
Rectangle {
id: imgWrapper
width: 425
height: 247
anchors {
top: parent.top
left: parent.left
}
color: Material.color(Material.Grey)
AnimatedImage {
id: imgPreview
asynchronous: true
playing: true
visible: false
anchors.fill: parent
}
BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
running: true
}
Text {
id: txtConvertNumber
color: "white"
text: qsTr("")
font.pixelSize: 21
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 40
}
}
Text {
id: txtConvert
color: "white"
text: qsTr("Generating preview video...")
font.pixelSize: 14
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 20
}
}
}
RowLayout {
id: row
height: 50
anchors {
top: imgWrapper.bottom
topMargin: 20
right: parent.right
rightMargin: 30
left: parent.left
}
Rectangle {
height: 50
color: "#eeeeee"
Layout.fillWidth: true
Text {
id: txtCustomPreviewPath
color: "#333333"
text: qsTr("Add custom preview image")
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 10
}
}
Button {
id: button
Material.background: Material.Orange
Material.foreground: "white"
text: qsTr("Choose Image")
anchors {
right: parent.right
rightMargin: 10
}
onClicked: fileDialogOpenFile.open()
}
FileDialog {
id: fileDialogOpenFile
nameFilters: ["*.png *.jpg"]
onAccepted: {
var file = fileDialogOpenFile.file.toString()
txtCustomPreviewPath.text = fileDialogOpenFile.file
}
}
}
}
}
Item {
id: wrapperRight
width: parent.width * .5
anchors {
top: txtHeadline.bottom
topMargin: 30
bottom: parent.bottom
right: parent.right
}
ColumnLayout {
id: column
spacing: 0
anchors {
right: parent.right
left: parent.left
margins: 30
top:parent.top
topMargin: 0
bottom: column1.top
bottomMargin: 50
}
TextField {
id: textField
placeholderText: qsTr("Name")
width:parent.width
Layout.fillWidth: true
onTextChanged: {
if (textField.text.length >= 3) {
canNext = true
} else {
canNext = false
}
}
}
TextField {
id: textField1
placeholderText: qsTr("Description")
width:parent.width
Layout.fillWidth: true
}
TextField {
id: textField2
placeholderText: qsTr("Youtube URL")
width:parent.width
Layout.fillWidth: true
}
TextField {
id: textField3
width:parent.width
placeholderText: qsTr("Tags")
Layout.fillWidth: true
}
}
Row {
id: column1
height: 80
width: childrenRect.width
spacing: 10
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
Button {
id: btnExit
text: qsTr("Abort")
Material.background: Material.Gray
Material.foreground: "white"
onClicked: {
screenPlayCreate.abort()
utility.setNavigationActive(true)
utility.setNavigation("Create")
}
}
NextButton {
id: btnFinish
onClicked: {
if (btnFinish.state === "enabled" && canNext) {
screenPlayCreate.createWallpaperProjectFile(
textField.text, textField1.text)
utility.setNavigationActive(true)
createNew.state = "success"
}
}
}
}
Connections {
target: screenPlayCreate
onCreateWallpaperStateChanged: {
if (state === Create.State.ConvertingVideoFinished) {
btnFinish.state = "enabled"
}
}
}
}
}

View File

@ -0,0 +1,292 @@
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0
import QtQuick.Layouts 1.3
import net.aimber.create 1.0
Item {
id: wrapperContent
Text {
id: txtHeadline
text: qsTr("Convert a video to a wallpaper")
height: 40
font.family: "Roboto"
font.weight: Font.Light
color: "#757575"
renderType: Text.NativeRendering
font.pixelSize: 23
anchors {
top: parent.top
left: parent.left
margins: 40
bottomMargin: 0
}
}
Item {
id: wrapperLeft
width: parent.width * .5
anchors {
left: parent.left
top: txtHeadline.bottom
margins: 30
bottom: parent.bottom
}
Rectangle {
id: imgWrapper
width: 425
height: 247
anchors {
top: parent.top
left: parent.left
}
color: Material.color(Material.Grey)
AnimatedImage {
id: imgPreview
asynchronous: true
playing: true
visible: false
anchors.fill: parent
}
BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
running: true
}
Text {
id: txtConvertNumber
color: "white"
text: qsTr("")
font.pixelSize: 21
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 40
}
}
Text {
id: txtConvert
color: "white"
text: qsTr("Generating preview video...")
font.pixelSize: 14
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 20
}
}
Connections {
target: screenPlayCreate
onCreateWallpaperStateChanged: {
if (state === Create.State.ConvertingPreviewImageFinished) {
imgPreview.source = "file:///"
+ screenPlayCreate.workingDir + "/preview.png"
imgPreview.visible = true
txtConvert.text = qsTr(
"Converting Video preview mp4")
}
if (state === Create.State.ConvertingPreviewVideo) {
txtConvert.text = qsTr(
"Generating preview video...")
}
if (state === Create.State.ConvertingPreviewGif) {
txtConvert.text = qsTr(
"Generating preview gif...")
}
if (state === Create.State.ConvertingPreviewGifFinished) {
imgPreview.source = "file:///"
+ screenPlayCreate.workingDir + "/preview.gif"
imgPreview.visible = true
imgPreview.playing = true
}
if (state === Create.State.ConvertingAudio) {
txtConvert.text = qsTr("Converting Audio...")
}
if (state === Create.State.ConvertingVideo) {
txtConvert.text = qsTr("Converting Video...")
}
if (state === Create.State.Finished) {
imgSuccess.source = "file:///"
+ screenPlayCreate.workingDir + "/preview.gif"
}
}
onProgressChanged: {
var percentage = Math.floor(progress * 100)
if (percentage > 100)
percentage = 100
txtConvertNumber.text = percentage + "%"
}
}
}
RowLayout {
id: row
height: 50
anchors {
top: imgWrapper.bottom
topMargin: 20
right: parent.right
rightMargin: 30
left: parent.left
}
Rectangle {
height: 50
color: "#eeeeee"
Layout.fillWidth: true
Text {
id: txtCustomPreviewPath
color: "#333333"
text: qsTr("Add custom preview image")
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 10
}
}
Button {
id: button
Material.background: Material.Orange
Material.foreground: "white"
text: qsTr("Choose Image")
anchors {
right: parent.right
rightMargin: 10
}
onClicked: fileDialogOpenFile.open()
}
FileDialog {
id: fileDialogOpenFile
nameFilters: ["*.png *.jpg"]
onAccepted: {
var file = fileDialogOpenFile.file.toString()
txtCustomPreviewPath.text = fileDialogOpenFile.file
}
}
}
}
}
Item {
id: wrapperRight
width: parent.width * .5
anchors {
top: txtHeadline.bottom
topMargin: 30
bottom: parent.bottom
right: parent.right
}
ColumnLayout {
id: column
spacing: 0
anchors {
right: parent.right
left: parent.left
margins: 30
top:parent.top
topMargin: 0
bottom: column1.top
bottomMargin: 50
}
TextField {
id: textField
placeholderText: qsTr("Name")
width:parent.width
Layout.fillWidth: true
onTextChanged: {
if (textField.text.length >= 3) {
canNext = true
} else {
canNext = false
}
}
}
TextField {
id: textField1
placeholderText: qsTr("Description")
width:parent.width
Layout.fillWidth: true
}
TextField {
id: textField2
placeholderText: qsTr("Youtube URL")
width:parent.width
Layout.fillWidth: true
}
TextField {
id: textField3
width:parent.width
placeholderText: qsTr("Tags")
Layout.fillWidth: true
}
}
Row {
id: column1
height: 80
width: childrenRect.width
spacing: 10
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
Button {
id: btnExit
text: qsTr("Abort")
Material.background: Material.Gray
Material.foreground: "white"
onClicked: {
screenPlayCreate.abort()
utility.setNavigationActive(true)
utility.setNavigation("Create")
}
}
NextButton {
id: btnFinish
onClicked: {
if (btnFinish.state === "enabled" && canNext) {
screenPlayCreate.createWallpaperProjectFile(
textField.text, textField1.text)
utility.setNavigationActive(true)
createNew.state = "success"
}
}
}
}
Connections {
target: screenPlayCreate
onCreateWallpaperStateChanged: {
if (state === Create.State.ConvertingVideoFinished) {
btnFinish.state = "enabled"
}
}
}
}
}

View File

@ -13,10 +13,23 @@ Item {
property string filePath
property bool canNext: false
property int importState: CreateWallpaperWizard.ImportState.Import
enum ImportState {
Create,
Import
}
Component.onCompleted: {
state = "in"
print(importState)
utility.setNavigationActive(false)
if (importState === CreateWallpaperWizard.ImportState.Import) {
loader_wrapperContent.source = "qrc:/qml/Create/Wizards/CreateWallpaper/CreateWallpaperVideoImport.qml"
} else {
loader_wrapperContent.source = "qrc:/qml/Create/Wizards/CreateWallpaper/CreateWallpaperVideoImportConvert.qml"
}
}
//Blocks some MouseArea from create page
@ -80,292 +93,11 @@ Item {
radius: 4
height: 460
Item {
id: wrapperContent
z: 10
Loader {
id: loader_wrapperContent
anchors.fill: parent
Text {
id: txtHeadline
text: qsTr("Convert a video to a wallpaper")
height: 40
font.family: "Roboto"
font.weight: Font.Light
color: "#757575"
renderType: Text.NativeRendering
font.pixelSize: 23
anchors {
top: parent.top
left: parent.left
margins: 40
bottomMargin: 0
}
}
Item {
id: wrapperLeft
width: parent.width * .5
anchors {
left: parent.left
top: txtHeadline.bottom
margins: 30
bottom: parent.bottom
}
Rectangle {
id: imgWrapper
width: 425
height: 247
anchors {
top: parent.top
left: parent.left
}
color: Material.color(Material.Grey)
AnimatedImage {
id: imgPreview
asynchronous: true
playing: true
visible: false
anchors.fill: parent
}
BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
running: true
}
Text {
id: txtConvertNumber
color: "white"
text: qsTr("")
font.pixelSize: 21
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 40
}
}
Text {
id: txtConvert
color: "white"
text: qsTr("Generating preview video...")
font.pixelSize: 14
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 20
}
}
Connections {
target: screenPlayCreate
onCreateWallpaperStateChanged: {
if (state === Create.State.ConvertingPreviewImageFinished) {
imgPreview.source = "file:///"
+ screenPlayCreate.workingDir + "/preview.png"
imgPreview.visible = true
txtConvert.text = qsTr(
"Converting Video preview mp4")
}
if (state === Create.State.ConvertingPreviewVideo) {
txtConvert.text = qsTr(
"Generating preview video...")
}
if (state === Create.State.ConvertingPreviewGif) {
txtConvert.text = qsTr(
"Generating preview gif...")
}
if (state === Create.State.ConvertingPreviewGifFinished) {
imgPreview.source = "file:///"
+ screenPlayCreate.workingDir + "/preview.gif"
imgPreview.visible = true
imgPreview.playing = true
}
if (state === Create.State.ConvertingAudio) {
txtConvert.text = qsTr("Converting Audio...")
}
if (state === Create.State.ConvertingVideo) {
txtConvert.text = qsTr("Converting Video...")
}
if (state === Create.State.Finished) {
imgSuccess.source = "file:///"
+ screenPlayCreate.workingDir + "/preview.gif"
}
}
onProgressChanged: {
var percentage = Math.floor(progress * 100)
if (percentage > 100)
percentage = 100
txtConvertNumber.text = percentage + "%"
}
}
}
RowLayout {
id: row
height: 50
anchors {
top: imgWrapper.bottom
topMargin: 20
right: parent.right
rightMargin: 30
left: parent.left
}
Rectangle {
height: 50
color: "#eeeeee"
Layout.fillWidth: true
Text {
id: txtCustomPreviewPath
color: "#333333"
text: qsTr("Add custom preview image")
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 10
}
}
Button {
id: button
Material.background: Material.Orange
Material.foreground: "white"
text: qsTr("Choose Image")
anchors {
right: parent.right
rightMargin: 10
}
onClicked: fileDialogOpenFile.open()
}
FileDialog {
id: fileDialogOpenFile
nameFilters: ["*.png *.jpg"]
onAccepted: {
var file = fileDialogOpenFile.file.toString()
txtCustomPreviewPath.text = fileDialogOpenFile.file
}
}
}
}
}
Item {
id: wrapperRight
width: parent.width * .5
anchors {
top: txtHeadline.bottom
topMargin: 30
bottom: parent.bottom
right: parent.right
}
ColumnLayout {
id: column
spacing: 0
anchors {
right: parent.right
left: parent.left
margins: 30
top:parent.top
topMargin: 0
bottom: column1.top
bottomMargin: 50
}
TextField {
id: textField
placeholderText: qsTr("Name")
width:parent.width
Layout.fillWidth: true
onTextChanged: {
if (textField.text.length >= 3) {
canNext = true
} else {
canNext = false
}
}
}
TextField {
id: textField1
placeholderText: qsTr("Description")
width:parent.width
Layout.fillWidth: true
}
TextField {
id: textField2
placeholderText: qsTr("Youtube URL")
width:parent.width
Layout.fillWidth: true
}
TextField {
id: textField3
width:parent.width
placeholderText: qsTr("Tags")
Layout.fillWidth: true
}
}
Row {
id: column1
height: 80
width: childrenRect.width
spacing: 10
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
Button {
id: btnExit
text: qsTr("Abort")
Material.background: Material.Gray
Material.foreground: "white"
onClicked: {
screenPlayCreate.abort()
utility.setNavigationActive(true)
utility.setNavigation("Create")
}
}
NextButton {
id: btnFinish
onClicked: {
if (btnFinish.state === "enabled" && canNext) {
screenPlayCreate.createWallpaperProjectFile(
textField.text, textField1.text)
utility.setNavigationActive(true)
createNew.state = "success"
}
}
}
}
Connections {
target: screenPlayCreate
onCreateWallpaperStateChanged: {
if (state === Create.State.ConvertingVideoFinished) {
btnFinish.state = "enabled"
}
}
}
}
z: 10
}
CreateWallpaperError {
@ -609,18 +341,8 @@ Item {
]
}
/*##^## Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/