mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Show upload error or success in header once completed
According to the brand new design. Contributes to issue CURA-8609.
This commit is contained in:
parent
8ae93c6bc1
commit
c3d392c5cf
2 changed files with 56 additions and 16 deletions
|
@ -408,5 +408,7 @@ class MaterialManagementModel(QObject):
|
|||
def exportUploadCompleted(self, job_result: UploadMaterialsJob.Result):
|
||||
if job_result == UploadMaterialsJob.Result.FAILED:
|
||||
self._sync_all_dialog.setProperty("syncStatusText", catalog.i18nc("@text", "Something went wrong when sending the materials to the printers."))
|
||||
self._export_upload_status = "idle"
|
||||
self._export_upload_status = "error"
|
||||
else:
|
||||
self._export_upload_status = "success"
|
||||
self.exportUploadStatusChanged.emit()
|
|
@ -186,12 +186,62 @@ Window
|
|||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
visible: cloudPrinterList.count > 0
|
||||
|
||||
Row
|
||||
{
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
states: [
|
||||
State
|
||||
{
|
||||
name: "idle"
|
||||
when: typeof materialManagementModel === "undefined" || materialManagementModel.exportUploadStatus == "idle" || materialManagementModel.exportUploadStatus == "uploading"
|
||||
PropertyChanges { target: printerListHeader; text: catalog.i18nc("@title:header", "The following printers will receive the new material profiles:") }
|
||||
PropertyChanges { target: printerListHeaderIcon; status: UM.StatusIcon.Status.NEUTRAL }
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "error"
|
||||
when: typeof materialManagementModel !== "undefined" && materialManagementModel.exportUploadStatus == "error"
|
||||
PropertyChanges { target: printerListHeader; text: catalog.i18nc("@title:header", "Something went wrong when sending the materials to the printers.") }
|
||||
PropertyChanges { target: printerListHeaderIcon; status: UM.StatusIcon.Status.ERROR }
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "success"
|
||||
when: typeof materialManagementModel !== "undefined" && materialManagementModel.exportUploadStatus == "success"
|
||||
PropertyChanges { target: printerListHeader; text: catalog.i18nc("@title:header", "Material profiles successfully synced with the following printers:") }
|
||||
PropertyChanges { target: printerListHeaderIcon; status: UM.StatusIcon.Status.POSITIVE }
|
||||
}
|
||||
]
|
||||
|
||||
UM.StatusIcon
|
||||
{
|
||||
id: printerListHeaderIcon
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: printerListHeader
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
//Text is always defined by the states above.
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@title:header", "The following printers will receive the new material profiles")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
id: syncStatusLabel
|
||||
|
||||
anchors.right: syncButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
visible: text !== ""
|
||||
text: ""
|
||||
color: UM.Theme.getColor("text")
|
||||
Layout.preferredHeight: height
|
||||
font: UM.Theme.getFont("medium")
|
||||
}
|
||||
ScrollView
|
||||
{
|
||||
|
@ -359,18 +409,6 @@ Window
|
|||
return materialManagementModel.exportUploadStatus != "uploading";
|
||||
}
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: syncStatusLabel
|
||||
|
||||
anchors.right: syncButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
visible: syncButton.visible
|
||||
text: ""
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
Item
|
||||
{
|
||||
anchors.right: parent.right
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue