mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Connect to selected printer when confirming the dialog
CURA-2019
This commit is contained in:
parent
14624e7acb
commit
6c0168c3ea
1 changed files with 19 additions and 7 deletions
|
|
@ -11,6 +11,23 @@ Cura.MachineAction
|
|||
id: base
|
||||
anchors.fill: parent;
|
||||
property var selectedPrinter: null
|
||||
|
||||
Connections
|
||||
{
|
||||
target: dialog ? dialog : null
|
||||
ignoreUnknownSignals: true
|
||||
onNextClicked: connectToPrinter()
|
||||
}
|
||||
|
||||
function connectToPrinter()
|
||||
{
|
||||
if(base.selectedPrinter)
|
||||
{
|
||||
manager.setKey(base.selectedPrinter.getKey())
|
||||
completed()
|
||||
}
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
anchors.fill: parent;
|
||||
|
|
@ -57,7 +74,7 @@ Cura.MachineAction
|
|||
id: listview
|
||||
model: manager.foundDevices
|
||||
width: parent.width
|
||||
currentIndex: activeIndex
|
||||
currentIndex: -1
|
||||
onCurrentIndexChanged: base.selectedPrinter = listview.model[currentIndex]
|
||||
Component.onCompleted: manager.startDiscovery()
|
||||
delegate: Rectangle
|
||||
|
|
@ -147,13 +164,8 @@ Cura.MachineAction
|
|||
{
|
||||
text: catalog.i18nc("@action:button", "Connect")
|
||||
enabled: base.selectedPrinter
|
||||
onClicked:
|
||||
{
|
||||
manager.setKey(base.selectedPrinter.getKey())
|
||||
completed()
|
||||
}
|
||||
onClicked: connectToPrinter()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue