mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-14 16:48:04 +08:00
Merge branch 'CURA-5922_add_safety_data_sheet_links' of https://github.com/Ultimaker/Cura into master_CURA-5922_add_safety_data_sheet_links
This commit is contained in:
commit
9bc85fcda7
@ -11,7 +11,8 @@ Item
|
|||||||
id: base
|
id: base
|
||||||
|
|
||||||
property var packageData
|
property var packageData
|
||||||
property var technicalDataSheetUrl: {
|
property var technicalDataSheetUrl:
|
||||||
|
{
|
||||||
var link = undefined
|
var link = undefined
|
||||||
if ("Technical Data Sheet" in packageData.links)
|
if ("Technical Data Sheet" in packageData.links)
|
||||||
{
|
{
|
||||||
@ -25,10 +26,22 @@ Item
|
|||||||
}
|
}
|
||||||
return link
|
return link
|
||||||
}
|
}
|
||||||
|
property var safetyDataSheetUrl:
|
||||||
|
{
|
||||||
|
var sds_name = "safetyDataSheet"
|
||||||
|
return (sds_name in packageData.links) ? packageData.links[sds_name] : undefined
|
||||||
|
}
|
||||||
|
property var printingGuidelinesUrl:
|
||||||
|
{
|
||||||
|
var pg_name = "printingGuidelines"
|
||||||
|
return (pg_name in packageData.links) ? packageData.links[pg_name] : undefined
|
||||||
|
}
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
height: visible ? childrenRect.height : 0
|
height: visible ? childrenRect.height : 0
|
||||||
|
|
||||||
visible: packageData.type == "material" && (packageData.has_configs || technicalDataSheetUrl != undefined)
|
visible: packageData.type == "material" &&
|
||||||
|
(packageData.has_configs || technicalDataSheetUrl !== undefined ||
|
||||||
|
safetyDataSheetUrl !== undefined || printingGuidelinesUrl !== undefined)
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
@ -163,23 +176,40 @@ Item
|
|||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: technical_data_sheet
|
id: data_sheet_links
|
||||||
anchors.top: combatibilityItem.bottom
|
anchors.top: combatibilityItem.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height / 2
|
anchors.topMargin: UM.Theme.getSize("default_margin").height / 2
|
||||||
visible: base.technicalDataSheetUrl !== undefined
|
visible: base.technicalDataSheetUrl !== undefined ||
|
||||||
|
base.safetyDataSheetUrl !== undefined || base.printingGuidelinesUrl !== undefined
|
||||||
height: visible ? contentHeight : 0
|
height: visible ? contentHeight : 0
|
||||||
text:
|
text:
|
||||||
{
|
{
|
||||||
|
var result = ""
|
||||||
if (base.technicalDataSheetUrl !== undefined)
|
if (base.technicalDataSheetUrl !== undefined)
|
||||||
{
|
{
|
||||||
return "<a href='%1'>%2</a>".arg(base.technicalDataSheetUrl).arg("Technical Data Sheet")
|
result += "<a href='%1'>%2</a>".arg(base.technicalDataSheetUrl).arg("Technical Data Sheet")
|
||||||
}
|
}
|
||||||
return ""
|
if (base.safetyDataSheetUrl !== undefined)
|
||||||
|
{
|
||||||
|
if (result.length > 0)
|
||||||
|
{
|
||||||
|
result += "<br/>"
|
||||||
|
}
|
||||||
|
result += "<a href='%1'>%2</a>".arg(base.safetyDataSheetUrl).arg("Safety Data Sheet")
|
||||||
|
}
|
||||||
|
if (base.printingGuidelinesUrl !== undefined)
|
||||||
|
{
|
||||||
|
if (result.length > 0)
|
||||||
|
{
|
||||||
|
result += "<br/>"
|
||||||
|
}
|
||||||
|
result += "<a href='%1'>%2</a>".arg(base.printingGuidelinesUrl).arg("Printing Guidelines")
|
||||||
|
}
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
font: UM.Theme.getFont("very_small")
|
font: UM.Theme.getFont("very_small")
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
linkColor: UM.Theme.getColor("text_link")
|
linkColor: UM.Theme.getColor("text_link")
|
||||||
onLinkActivated: Qt.openUrlExternally(link)
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user