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" source: "../pages/icon-seaprint-nobg-bw.svg"
} }
Column {
width: parent.width
anchors.verticalCenter: parent.verticalCenter
Label { Label {
id: label id: msgLabel
anchors.centerIn: parent anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("SeaPrint") 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 ApplicationWindow
{ {
id: appWin
initialPage: Component { FirstPage { selectedFile: Qt.application.arguments[1] ? Qt.application.arguments[1] : "" } } initialPage: Component { FirstPage { selectedFile: Qt.application.arguments[1] ? Qt.application.arguments[1] : "" } }
cover: Qt.resolvedUrl("cover/CoverPage.qml") cover: Qt.resolvedUrl("cover/CoverPage.qml")
allowedOrientations: Orientation.All allowedOrientations: Orientation.All
property string busyMessage: ""
property string progress: ""
Item { Item {
id: db id: db
property var db_conn property var db_conn

View file

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