mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Add legacy 'Connect over Network' button back
This commit is contained in:
parent
d703e48007
commit
e977cdd431
7 changed files with 131 additions and 140 deletions
|
@ -23,37 +23,13 @@ Cura.MachineAction
|
|||
|
||||
function connectToPrinter()
|
||||
{
|
||||
if(base.selectedDevice && base.completeProperties)
|
||||
if (base.selectedDevice && base.completeProperties)
|
||||
{
|
||||
var printerKey = base.selectedDevice.key
|
||||
var printerName = base.selectedDevice.name // TODO To change when the groups have a name
|
||||
if (manager.getStoredKey() != printerKey)
|
||||
{
|
||||
// Check if there is another instance with the same key
|
||||
if (!manager.existsKey(printerKey))
|
||||
{
|
||||
manager.associateActiveMachineWithPrinterDevice(base.selectedDevice)
|
||||
manager.setGroupName(printerName) // TODO To change when the groups have a name
|
||||
completed()
|
||||
}
|
||||
else
|
||||
{
|
||||
existingConnectionDialog.open()
|
||||
}
|
||||
}
|
||||
manager.associateActiveMachineWithPrinterDevice(base.selectedDevice)
|
||||
completed()
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: existingConnectionDialog
|
||||
title: catalog.i18nc("@window:title", "Existing Connection")
|
||||
icon: StandardIcon.Information
|
||||
text: catalog.i18nc("@message:text", "This printer/group is already added to Cura. Please select another printer/group.")
|
||||
standardButtons: StandardButton.Ok
|
||||
modality: Qt.ApplicationModal
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
anchors.fill: parent;
|
||||
|
@ -151,21 +127,6 @@ Cura.MachineAction
|
|||
{
|
||||
id: listview
|
||||
model: manager.foundDevices
|
||||
onModelChanged:
|
||||
{
|
||||
var selectedKey = manager.getLastManualEntryKey()
|
||||
// If there is no last manual entry key, then we select the stored key (if any)
|
||||
if (selectedKey == "")
|
||||
selectedKey = manager.getStoredKey()
|
||||
for(var i = 0; i < model.length; i++) {
|
||||
if(model[i].key == selectedKey)
|
||||
{
|
||||
currentIndex = i;
|
||||
return
|
||||
}
|
||||
}
|
||||
currentIndex = -1;
|
||||
}
|
||||
width: parent.width
|
||||
currentIndex: -1
|
||||
onCurrentIndexChanged:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue