mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
CURA-4870 Update the Sync Button accordingly to changes both in the
output device or in the current configuration, in order to check wether a configuration matches or not.
This commit is contained in:
parent
5280d21c26
commit
987794c515
2 changed files with 33 additions and 3 deletions
|
@ -6,13 +6,30 @@ import QtQuick.Controls 1.4
|
|||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Button
|
||||
{
|
||||
text: "No match"
|
||||
id: base
|
||||
property var outputDevice: Cura.MachineManager.printerOutputDevices[0] != null ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
text: catalog.i18nc("@label:sync indicator", "No match")
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
function updateOnSync()
|
||||
{
|
||||
for (var index in outputDevice.uniqueConfigurations)
|
||||
{
|
||||
var configuration = outputDevice.uniqueConfigurations[index]
|
||||
if (Cura.MachineManager.matchesConfiguration(configuration))
|
||||
{
|
||||
base.text = catalog.i18nc("@label:sync indicator", "Matched")
|
||||
return
|
||||
}
|
||||
}
|
||||
base.text = catalog.i18nc("@label:sync indicator", "No match")
|
||||
}
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
|
@ -68,4 +85,18 @@ Button
|
|||
{
|
||||
panelVisible = !panelVisible
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: outputDevice
|
||||
onUniqueConfigurationsChanged: {
|
||||
updateOnSync()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Cura.MachineManager
|
||||
onCurrentConfigurationChanged: {
|
||||
updateOnSync()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -63,8 +63,7 @@ Column
|
|||
|
||||
ToolButton
|
||||
{
|
||||
id: configurationSelection
|
||||
|
||||
id: printerTypeSelection
|
||||
text: catalog.i18nc("@label", "Printer type");
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("sidebar_margin").width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue