Keep showing ip enter dialog after wrongly entered ip address

In component discover um 3 dialog. After a "complete" action the
dialog will immediately close. This was undesired behaviour as we want
to keep the dialog active if an IP address is wrongly added.

Additionally, it is no longer necessary to close/hide the dialog after
a reject/accept as this is done by default.

CURA-8955
This commit is contained in:
casper 2022-02-15 09:29:32 +01:00
parent b9feac9816
commit aeb433b2a1

View File

@ -333,18 +333,16 @@ Cura.MachineAction
}
}
onRejected:
{
manualPrinterDialog.reject()
manualPrinterDialog.hide()
}
onAccepted:
{
// Validate the input first
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
{
invalidIPAddressMessageDialog.open()
return
// prefent closing of element, as we want to keep the dialog active after a wrongly entered IP adress
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
@ -354,14 +352,12 @@ Cura.MachineAction
var device = manager.foundDevices[i]
if (device.address == manualPrinterDialog.addressText)
{
currentItemIndex = i
manualPrinterDialog.hide()
return
currentItemIndex = i;
return;
}
}
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText)
manualPrinterDialog.hide()
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText);
}
}
}