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 QtGraphicalEffects 1.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 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
@ -22,8 +22,8 @@ Item {
target: screenPlayCreate
onCreateWallpaperStateChanged: {
print(state)
if (state === Create.State.ConvertingPreviewGifError ||
state === Create.State.ConvertingPreviewVideoError) {
if (state === Create.State.ConvertingPreviewGifError
|| state === Create.State.ConvertingPreviewVideoError) {
createNew.state = "error"
}
}
@ -232,6 +232,77 @@ Item {
}
}
}
}
Item {
id: wrapperError
anchors.fill: parent
Text {
id: txtErrorHeadline
text: qsTr("An error occurred!")
anchors {
top: parent.top
topMargin: 30
horizontalCenter: parent.horizontalCenter
}
height: 40
font.family: "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
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
}
}
}
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.setNavigation("Create")
}
}
}
MouseArea {
anchors {
@ -268,7 +339,6 @@ Item {
}
}
}
}
states: [
State {
@ -282,6 +352,10 @@ Item {
target: effect
opacity: 0
}
PropertyChanges {
target: wrapperError
opacity: 0
}
},
State {
name: "in"
@ -294,6 +368,10 @@ Item {
target: effect
opacity: .4
}
PropertyChanges {
target: wrapperError
opacity: 0
}
},
State {
name: "error"
@ -310,6 +388,10 @@ Item {
target: wrapperSteps
opacity: 0
}
PropertyChanges {
target: wrapperError
opacity: 1
}
}
]
transitions: [
@ -385,12 +467,23 @@ Item {
Transition {
from: "in"
to: "error"
SequentialAnimation {
PropertyAnimation {
target: wrapperSteps
duration: 600
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.Controls 2.3
Item {
id: root
Rectangle {
id: rectangle1
color: "gray"
color: "#eeeeee"
width: parent.width * .5
radius: 3
anchors {
top: parent.top
bottom: parent.bottom
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 {