mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 11:47:50 -06:00
CURA-5330 Fix typing in SingleInstance
This commit is contained in:
parent
3a8756efa5
commit
221cd3e73e
1 changed files with 6 additions and 3 deletions
|
@ -12,7 +12,7 @@ from UM.Logger import Logger
|
|||
|
||||
class SingleInstance:
|
||||
|
||||
def __init__(self, application, files_to_open: Optional[List[str]]):
|
||||
def __init__(self, application, files_to_open: Optional[List[str]]) -> None:
|
||||
self._application = application
|
||||
self._files_to_open = files_to_open
|
||||
|
||||
|
@ -61,8 +61,11 @@ class SingleInstance:
|
|||
|
||||
def startServer(self) -> None:
|
||||
self._single_instance_server = QLocalServer()
|
||||
self._single_instance_server.newConnection.connect(self._onClientConnected)
|
||||
self._single_instance_server.listen("ultimaker-cura")
|
||||
if self._single_instance_server:
|
||||
self._single_instance_server.newConnection.connect(self._onClientConnected)
|
||||
self._single_instance_server.listen("ultimaker-cura")
|
||||
else:
|
||||
Logger.log("e", "Single instance server was not created.")
|
||||
|
||||
def _onClientConnected(self):
|
||||
Logger.log("i", "New connection recevied on our single-instance server")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue