UI: Fixed multiple connects to signal
This commit is contained in:
parent
2c00ccaea6
commit
33a10f76c0
|
@ -89,6 +89,7 @@ class VM(GObject.Object):
|
|||
prefix="clan_vm-", suffix=f"-{self.data.flake.flake_attr}"
|
||||
)
|
||||
self._finalizer = weakref.finalize(self, self.stop)
|
||||
self.connect("vm_status_changed", self._start_logs_task)
|
||||
|
||||
def __start(self) -> None:
|
||||
if self.is_running():
|
||||
|
@ -113,8 +114,6 @@ class VM(GObject.Object):
|
|||
|
||||
threading.Thread(target=self.__start).start()
|
||||
|
||||
self.connect("vm_status_changed", self._start_logs_task)
|
||||
|
||||
# Every 50ms check if the VM is still running
|
||||
self._watcher_id = GLib.timeout_add(50, self._vm_watcher_task)
|
||||
if self._watcher_id == 0:
|
||||
|
|
Loading…
Reference in New Issue
Block a user