mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 20:25:55 +08:00
Merge branch 'Ip_adress_dialog' of github.com:Ultimaker/Cura into replace_controls_1_for_controls_2
This commit is contained in:
commit
266214d651
@ -333,18 +333,16 @@ Cura.MachineAction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onRejected:
|
|
||||||
{
|
|
||||||
manualPrinterDialog.reject()
|
|
||||||
manualPrinterDialog.hide()
|
|
||||||
}
|
|
||||||
onAccepted:
|
onAccepted:
|
||||||
{
|
{
|
||||||
// Validate the input first
|
// Validate the input first
|
||||||
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
|
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
|
||||||
{
|
{
|
||||||
invalidIPAddressMessageDialog.open()
|
// prefent closing of element, as we want to keep the dialog active after a wrongly entered IP adress
|
||||||
return
|
manualPrinterDialog.open()
|
||||||
|
// show invalid ip warning
|
||||||
|
invalidIPAddressMessageDialog.open();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the entered IP address has already been discovered, switch the current item to that item
|
// if the entered IP address has already been discovered, switch the current item to that item
|
||||||
@ -354,14 +352,12 @@ Cura.MachineAction
|
|||||||
var device = manager.foundDevices[i]
|
var device = manager.foundDevices[i]
|
||||||
if (device.address == manualPrinterDialog.addressText)
|
if (device.address == manualPrinterDialog.addressText)
|
||||||
{
|
{
|
||||||
currentItemIndex = i
|
currentItemIndex = i;
|
||||||
manualPrinterDialog.hide()
|
return;
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText)
|
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText);
|
||||||
manualPrinterDialog.hide()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user