mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-12 09:59:01 +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
|
||||
|
||||
property var packageData
|
||||
property var technicalDataSheetUrl: {
|
||||
property var technicalDataSheetUrl:
|
||||
{
|
||||
var link = undefined
|
||||
if ("Technical Data Sheet" in packageData.links)
|
||||
{
|
||||
@ -25,10 +26,22 @@ Item
|
||||
}
|
||||
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
|
||||
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
|
||||
{
|
||||
@ -163,23 +176,40 @@ Item
|
||||
|
||||
Label
|
||||
{
|
||||
id: technical_data_sheet
|
||||
id: data_sheet_links
|
||||
anchors.top: combatibilityItem.bottom
|
||||
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
|
||||
text:
|
||||
{
|
||||
var result = ""
|
||||
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")
|
||||
color: UM.Theme.getColor("text")
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user