mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
WIP: Disable unknown printer type buttons
This commit is contained in:
parent
2b0e9ea439
commit
b3621bae84
4 changed files with 30 additions and 4 deletions
|
|
@ -84,7 +84,14 @@ Button
|
|||
background: Rectangle
|
||||
{
|
||||
id: backgroundRect
|
||||
color: machineSelectorButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
|
||||
color:
|
||||
{
|
||||
if (!machineSelectorButton.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled")
|
||||
}
|
||||
return machineSelectorButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
|
||||
}
|
||||
radius: UM.Theme.getSize("action_button_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: machineSelectorButton.selected ? UM.Theme.getColor("primary") : "transparent"
|
||||
|
|
|
|||
|
|
@ -70,7 +70,20 @@ Item
|
|||
id: networkPrinterListView
|
||||
anchors.fill: parent
|
||||
model: CuraApplication.getDiscoveredPrintersModel().discovered_printers
|
||||
//visible: base.visible && model.length > 0
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
// select the first one that's not "unknown" by default.
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
|
||||
if (!model[i].is_unknown_machine_type)
|
||||
{
|
||||
currentIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delegate: MachineSelectorButton
|
||||
{
|
||||
|
|
@ -81,6 +94,8 @@ Item
|
|||
anchors.rightMargin: 10
|
||||
outputDevice: modelData.device
|
||||
|
||||
enabled: !modelData.is_unknown_machine_type
|
||||
|
||||
printerTypeLabelAutoFit: true
|
||||
|
||||
updatePrinterTypesFunction: updateMachineTypes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue