diff options
author | casper <c.lamboo@ultimaker.com> | 2022-02-15 11:29:32 +0300 |
---|---|---|
committer | casper <c.lamboo@ultimaker.com> | 2022-02-15 11:29:32 +0300 |
commit | aeb433b2a1eb6bd8a2e2e42dde1ec1d48fc3b2c4 (patch) | |
tree | d77ca103296d30b33df831f403f1fb69d5593fca /plugins/UM3NetworkPrinting | |
parent | b9feac9816ad215b3c6efd7f4ec6cd9d6c640c5a (diff) |
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
Diffstat (limited to 'plugins/UM3NetworkPrinting')
-rw-r--r-- | plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 94e265e4b8..3117775eaf 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -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); } } } |