From 1aea28a8ebe3d4bb63d26b6671f1724c0e4a4634 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Thu, 23 Apr 2020 15:10:45 +0200 Subject: [PATCH] Add busyIndicator and text in AddCloudPrintersView CURA-7022 --- .../qml/WelcomePages/AddCloudPrintersView.qml | 76 +++++++++++++++---- 1 file changed, 63 insertions(+), 13 deletions(-) diff --git a/resources/qml/WelcomePages/AddCloudPrintersView.qml b/resources/qml/WelcomePages/AddCloudPrintersView.qml index 73fe1f433e..05351341f6 100644 --- a/resources/qml/WelcomePages/AddCloudPrintersView.qml +++ b/resources/qml/WelcomePages/AddCloudPrintersView.qml @@ -18,16 +18,66 @@ Item id: addCloudPrinterScreen - Label + property bool searchingForCloudPrinters: true + + + + Rectangle { - id: titleLabel - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - horizontalAlignment: Text.AlignHCenter - text: catalog.i18nc("@label", "Add a Cloud printer") - color: UM.Theme.getColor("primary_button") - font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering + id: cloudPrintersContent + //color: "steelblue" + //opacity: 0.3 + width: parent.width + border.width: 1 + anchors + { + top: parent.top + bottom: finishButton.top + left: parent.left + right: parent.right + bottomMargin: UM.Theme.getSize("default_margin").height + } + + Label + { + id: titleLabel + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + text: catalog.i18nc("@label", "Add a Cloud printer") + color: UM.Theme.getColor("primary_button") + font: UM.Theme.getFont("huge") + renderType: Text.NativeRendering + } + + Rectangle + { + id: waitingContent + width: parent.width + height: waitingIndicator.height + waitingLabel.height + border.width: 1 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + BusyIndicator + { + id: waitingIndicator + anchors.horizontalCenter: parent.horizontalCenter + running: searchingForCloudPrinters + } + Label + { + id: waitingLabel + anchors.top: waitingIndicator.bottom + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + text: catalog.i18nc("@label", "Waiting for Cloud response") + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering + } + visible: false + } + + } Cura.SecondaryButton @@ -38,23 +88,23 @@ Item text: catalog.i18nc("@button", "Add printer manually") onClicked: { - CuraApplication.getDiscoveredPrintersModel().cancelCurrentManualDeviceRequest() + Cura.API.account.test("Back button pressed in AddCloudPrintersView.qml") base.showPreviousPage() } } Cura.PrimaryButton { - id: connectButton + id: finishButton anchors.right: parent.right anchors.bottom: parent.bottom text: catalog.i18nc("@button", "Finish") onClicked: { - CuraApplication.getDiscoveredPrintersModel().createMachineFromDiscoveredPrinter(discoveredPrinter) + Cura.API.account.test("Finish button pressed in AddCloudPrintersView.qml") base.showNextPage() } - enabled: addPrinterByIpScreen.canAddPrinter + // enabled: 1 === 1 addPrinterByIpScreen.canAddPrinter } }