mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Close camera upon disconnecting instead of relying on Uranium to do that
Uranium shouldn't know about no camera.
This commit is contained in:
parent
b7165ad41d
commit
2a593e316b
1 changed files with 9 additions and 0 deletions
|
@ -188,9 +188,18 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
else:
|
else:
|
||||||
self._updatePrinterType("unknown")
|
self._updatePrinterType("unknown")
|
||||||
|
|
||||||
|
Application.getInstance().getOutputDeviceManager().outputDevicesChanged.connect(self._onOutputDevicesChanged)
|
||||||
|
|
||||||
def _onNetworkAccesibleChanged(self, accessible):
|
def _onNetworkAccesibleChanged(self, accessible):
|
||||||
Logger.log("d", "Network accessible state changed to: %s", accessible)
|
Logger.log("d", "Network accessible state changed to: %s", accessible)
|
||||||
|
|
||||||
|
## Triggered when the output device manager changes devices.
|
||||||
|
#
|
||||||
|
# This is how we can detect that our device is no longer active now.
|
||||||
|
def _onOutputDevicesChanged(self):
|
||||||
|
if self.getId() not in Application.getInstance().getOutputDeviceManager().getOutputDeviceIds():
|
||||||
|
self.stopCamera()
|
||||||
|
|
||||||
def _onAuthenticationTimer(self):
|
def _onAuthenticationTimer(self):
|
||||||
self._authentication_counter += 1
|
self._authentication_counter += 1
|
||||||
self._authentication_requested_message.setProgress(self._authentication_counter / self._max_authentication_counter * 100)
|
self._authentication_requested_message.setProgress(self._authentication_counter / self._max_authentication_counter * 100)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue