mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 02:07:51 -06:00
Fixed qml warnings (reading from undefined properties)
CL-893 && CL-894
This commit is contained in:
parent
1fa3b60f94
commit
03a7833180
3 changed files with 46 additions and 9 deletions
|
@ -183,6 +183,7 @@ class Toolbox(QObject, Extension):
|
|||
"materials_available": QUrl("{base_url}/packages?package_type=material".format(base_url=self._api_url)),
|
||||
"materials_generic": QUrl("{base_url}/packages?package_type=material&tags=generic".format(base_url=self._api_url))
|
||||
}
|
||||
print("*******", self._request_urls )
|
||||
|
||||
# Get the API root for the packages API depending on Cura version settings.
|
||||
def _getCloudAPIRoot(self) -> str:
|
||||
|
|
|
@ -203,29 +203,50 @@ Component
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||
Label
|
||||
{
|
||||
id: printJobName
|
||||
text: modelData.activePrintJob.name
|
||||
text: modelData.activePrintJob != null ? modelData.activePrintJob.name : ""
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: ownerName
|
||||
anchors.top: printJobName.bottom
|
||||
text: modelData.activePrintJob.owner
|
||||
text: modelData.activePrintJob != null ? modelData.activePrintJob.owner : ""
|
||||
}
|
||||
|
||||
Image
|
||||
{
|
||||
source: modelData.activePrintJob.preview_image_url
|
||||
id: printJobPreview
|
||||
source: modelData.activePrintJob != null ? modelData.activePrintJob.preview_image_url : ""
|
||||
anchors.top: ownerName.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: totalTimeLabel.top
|
||||
width: height
|
||||
//anchors.bottom: totalTimeLabel.top
|
||||
width: parent.width / 3
|
||||
height: width
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: showCameraIcon
|
||||
width: 30 * screenScaleFactor
|
||||
height: width
|
||||
radius: width
|
||||
anchors.left: parent.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.bottom: printJobPreview.bottom
|
||||
color: UM.Theme.getColor("setting_control_border_highlight")
|
||||
Image
|
||||
{
|
||||
width: parent.width
|
||||
height: width
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: parent.rightMargin
|
||||
source: "camera-icon.svg"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,22 @@ Item
|
|||
{
|
||||
anchors.centerIn: parent
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
text: printCoreConfiguration.position + 1
|
||||
text: printCoreConfiguration != undefined ? printCoreConfiguration.position + 1 : ""
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: materialLabel
|
||||
text: printCoreConfiguration.activeMaterial != null ? printCoreConfiguration.activeMaterial.name : ":("
|
||||
text:
|
||||
|
||||
{
|
||||
if(printCoreConfiguration != undefined && printCoreConfiguration.activeMaterial != undefined)
|
||||
{
|
||||
return printCoreConfiguration.activeMaterial.name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
|
@ -48,7 +56,14 @@ Item
|
|||
Label
|
||||
{
|
||||
id: printCoreLabel
|
||||
text: printCoreConfiguration.hotendID
|
||||
text:
|
||||
{
|
||||
if(printCoreConfiguration != undefined && printCoreConfiguration.hotendID != undefined)
|
||||
{
|
||||
return printCoreConfiguration.hotendID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
anchors.top: materialLabel.bottom
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue