Add busyIndicator and text in AddCloudPrintersView

CURA-7022
This commit is contained in:
Kostas Karmas 2020-04-23 15:10:45 +02:00
parent 15e7cb44af
commit 1aea28a8eb

View file

@ -18,16 +18,66 @@ Item
id: addCloudPrinterScreen id: addCloudPrinterScreen
Label property bool searchingForCloudPrinters: true
Rectangle
{ {
id: titleLabel id: cloudPrintersContent
anchors.top: parent.top //color: "steelblue"
anchors.horizontalCenter: parent.horizontalCenter //opacity: 0.3
horizontalAlignment: Text.AlignHCenter width: parent.width
text: catalog.i18nc("@label", "Add a Cloud printer") border.width: 1
color: UM.Theme.getColor("primary_button") anchors
font: UM.Theme.getFont("huge") {
renderType: Text.NativeRendering 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 Cura.SecondaryButton
@ -38,23 +88,23 @@ Item
text: catalog.i18nc("@button", "Add printer manually") text: catalog.i18nc("@button", "Add printer manually")
onClicked: onClicked:
{ {
CuraApplication.getDiscoveredPrintersModel().cancelCurrentManualDeviceRequest() Cura.API.account.test("Back button pressed in AddCloudPrintersView.qml")
base.showPreviousPage() base.showPreviousPage()
} }
} }
Cura.PrimaryButton Cura.PrimaryButton
{ {
id: connectButton id: finishButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: catalog.i18nc("@button", "Finish") text: catalog.i18nc("@button", "Finish")
onClicked: onClicked:
{ {
CuraApplication.getDiscoveredPrintersModel().createMachineFromDiscoveredPrinter(discoveredPrinter) Cura.API.account.test("Finish button pressed in AddCloudPrintersView.qml")
base.showNextPage() base.showNextPage()
} }
enabled: addPrinterByIpScreen.canAddPrinter // enabled: 1 === 1 addPrinterByIpScreen.canAddPrinter
} }
} }