1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add error screen and ffmpeg output

This commit is contained in:
kelteseth 2018-10-14 21:51:53 +02:00
parent 51ab2b6006
commit 17547a70c6
2 changed files with 156 additions and 34 deletions

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.9
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0 import Qt.labs.platform 1.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import net.aimber.create 1.0 import net.aimber.create 1.0
@ -22,8 +22,8 @@ Item {
target: screenPlayCreate target: screenPlayCreate
onCreateWallpaperStateChanged: { onCreateWallpaperStateChanged: {
print(state) print(state)
if (state === Create.State.ConvertingPreviewGifError || if (state === Create.State.ConvertingPreviewGifError
state === Create.State.ConvertingPreviewVideoError) { || state === Create.State.ConvertingPreviewVideoError) {
createNew.state = "error" createNew.state = "error"
} }
} }
@ -232,42 +232,112 @@ Item {
} }
} }
} }
}
MouseArea { Item {
id: wrapperError
anchors.fill: parent
Text {
id: txtErrorHeadline
text: qsTr("An error occurred!")
anchors { anchors {
top: parent.top top: parent.top
right: parent.right topMargin: 30
margins: 5 horizontalCenter: parent.horizontalCenter
} }
width: 32 height: 40
height: width font.family: "Roboto"
cursorShape: Qt.PointingHandCursor font.weight: Font.Light
onClicked: { color: Material.color(Material.Red)
createNew.state = "out" renderType: Text.NativeRendering
timerBack.start() 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
} }
Image { Flickable {
id: imgClose anchors.fill: parent
source: "qrc:/assets/icons/font-awsome/close.svg" contentHeight: txtFFMPEG.paintedHeight
width: 16 ScrollBar.vertical: ScrollBar {
height: 16 snapMode: ScrollBar.SnapOnRelease
anchors.centerIn: parent policy: ScrollBar.AlwaysOn
sourceSize: Qt.size(width, width) }
Text {
id: txtFFMPEG
anchors {
fill: parent
margins: 20
}
wrapMode: Text.WordWrap
color: "#626262"
renderType: Text.NativeRendering
height: txtFFMPEG.paintedHeight
}
} }
ColorOverlay { }
id: iconColorOverlay
anchors.fill: imgClose Button {
source: imgClose id: btnBack
color: "gray" 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
} }
Timer { onClicked: {
id: timerBack utility.setNavigation("Create")
interval: 800
onTriggered: utility.setNavigation("Create")
} }
} }
} }
MouseArea {
anchors {
top: parent.top
right: parent.right
margins: 5
}
width: 32
height: width
cursorShape: Qt.PointingHandCursor
onClicked: {
createNew.state = "out"
timerBack.start()
}
Image {
id: imgClose
source: "qrc:/assets/icons/font-awsome/close.svg"
width: 16
height: 16
anchors.centerIn: parent
sourceSize: Qt.size(width, width)
}
ColorOverlay {
id: iconColorOverlay
anchors.fill: imgClose
source: imgClose
color: "gray"
}
Timer {
id: timerBack
interval: 800
onTriggered: utility.setNavigation("Create")
}
}
} }
states: [ states: [
@ -282,6 +352,10 @@ Item {
target: effect target: effect
opacity: 0 opacity: 0
} }
PropertyChanges {
target: wrapperError
opacity: 0
}
}, },
State { State {
name: "in" name: "in"
@ -294,6 +368,10 @@ Item {
target: effect target: effect
opacity: .4 opacity: .4
} }
PropertyChanges {
target: wrapperError
opacity: 0
}
}, },
State { State {
name: "error" name: "error"
@ -310,6 +388,10 @@ Item {
target: wrapperSteps target: wrapperSteps
opacity: 0 opacity: 0
} }
PropertyChanges {
target: wrapperError
opacity: 1
}
} }
] ]
transitions: [ transitions: [
@ -385,11 +467,22 @@ Item {
Transition { Transition {
from: "in" from: "in"
to: "error" to: "error"
PropertyAnimation { SequentialAnimation {
target: wrapperSteps PropertyAnimation {
duration: 600 target: wrapperSteps
property: "opacity" duration: 600
easing.type: Easing.InOutQuad property: "opacity"
easing.type: Easing.InOutQuad
}
PauseAnimation {
duration: 50
}
PropertyAnimation {
target: wrapperError
duration: 200
property: "opacity"
easing.type: Easing.InOutQuad
}
} }
} }
] ]

View File

@ -1,16 +1,45 @@
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 2.3
Item { Item {
id: root id: root
Rectangle { Rectangle {
id: rectangle1 id: rectangle1
color: "gray" color: "#eeeeee"
width: parent.width * .5 width: parent.width * .5
radius: 3
anchors { anchors {
top: parent.top top: parent.top
bottom: parent.bottom bottom: parent.bottom
left: parent.left left: parent.left
} }
Flickable {
anchors.fill: parent
contentHeight: txtFFMPEG.paintedHeight
ScrollBar.vertical: ScrollBar {
snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn
}
Text {
id: txtFFMPEG
anchors {
fill: parent
margins: 20
}
wrapMode: Text.WordWrap
color: "#626262"
renderType: Text.NativeRendering
height: txtFFMPEG.paintedHeight
}
}
}
Connections {
target: screenPlayCreate
onProcessOutput: {
txtFFMPEG.text = text
}
} }
Rectangle { Rectangle {