Put progress on the cover

This commit is contained in:
Anton Thomasson 2021-02-07 14:55:20 +01:00
parent 3d08d137e2
commit 4fbfd0d5a2
3 changed files with 36 additions and 4 deletions

View file

@ -10,9 +10,20 @@ CoverBackground {
source: "../pages/icon-seaprint-nobg-bw.svg"
}
Label {
id: label
anchors.centerIn: parent
text: qsTr("SeaPrint")
Column {
width: parent.width
anchors.verticalCenter: parent.verticalCenter
Label {
id: msgLabel
anchors.horizontalCenter: parent.horizontalCenter
text: appWin.busyMessage != "" ? appWin.busyMessage : qsTr("SeaPrint")
}
Label {
id: progressLabel
anchors.horizontalCenter: parent.horizontalCenter
text: appWin.progress
}
}
}

View file

@ -7,10 +7,15 @@ import "pages"
ApplicationWindow
{
id: appWin
initialPage: Component { FirstPage { selectedFile: Qt.application.arguments[1] ? Qt.application.arguments[1] : "" } }
cover: Qt.resolvedUrl("cover/CoverPage.qml")
allowedOrientations: Orientation.All
property string busyMessage: ""
property string progress: ""
Item {
id: db
property var db_conn

View file

@ -5,6 +5,10 @@ import "utils.js" as Utils
Page {
allowedOrientations: Orientation.All
Component.onCompleted: {
appWin.busyMessage = printer.busyMessage
}
property var printer
backNavigation: false
Connections {
@ -28,10 +32,22 @@ Page {
notifier.notify(qsTr("Print failed: ") + msg)
}
}
onBusyMessageChanged: {
appWin.busyMessage = printer.busyMessage
}
onProgressChanged: {
appWin.progress = printer.progress
}
}
BusyLabel {
text: printer.busyMessage+"\n"+printer.progress;
running: true
}
Component.onDestruction: {
appWin.busyMessage = ""
appWin.progress = ""
}
}