CURA-5254 Keep track of the latest manual entry key, so it is then

selected in the list.
This commit is contained in:
Diego Prado Gesto 2018-05-22 12:05:33 +02:00
parent 74a7452333
commit eea9b7ab46
3 changed files with 25 additions and 2 deletions

View file

@ -45,6 +45,8 @@ class DiscoverUM3Action(MachineAction):
@pyqtSlot()
def reset(self):
Logger.log("d", "Reset the list of found devices.")
if self._network_plugin:
self._network_plugin.resetLastManualDevice()
self.discoveredDevicesChanged.emit()
@pyqtSlot()
@ -131,7 +133,7 @@ class DiscoverUM3Action(MachineAction):
self._network_plugin.reCheckConnections()
@pyqtSlot(result = str)
def getStoredKey(self):
def getStoredKey(self) -> str:
global_container_stack = Application.getInstance().getGlobalContainerStack()
if global_container_stack:
meta_data = global_container_stack.getMetaData()
@ -140,6 +142,12 @@ class DiscoverUM3Action(MachineAction):
return ""
@pyqtSlot(result = str)
def getLastManualEntryKey(self) -> str:
if self._network_plugin:
return self._network_plugin.getLastManualDevice()
return ""
@pyqtSlot(str, result = bool)
def existsKey(self, key) -> bool:
return Application.getInstance().getMachineManager().existNetworkInstances(network_key = key)