mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
assigning different command for opening url
CURA-11596
This commit is contained in:
parent
eff4584203
commit
664fa4f48d
1 changed files with 8 additions and 7 deletions
|
@ -56,8 +56,8 @@ class SingleInstance:
|
|||
payload = {"command": "open", "filePath": os.path.abspath(filename)}
|
||||
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding="ascii"))
|
||||
|
||||
for filename in self._url_to_open:
|
||||
payload = {"command": "open", "urlPath": os.path.abspath(filename)}
|
||||
for url in self._url_to_open:
|
||||
payload = {"command": "open-url", "urlPath": url}
|
||||
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding="ascii"))
|
||||
|
||||
payload = {"command": "close-connection"}
|
||||
|
@ -97,9 +97,10 @@ class SingleInstance:
|
|||
|
||||
# Command: Load a model or project file
|
||||
elif command == "open":
|
||||
if payload["filePath"].file():
|
||||
self._application.callLater(lambda f = payload["filePath"]: self._application._openFile(f))
|
||||
if payload["urlPath"].url():
|
||||
|
||||
#command: Load a url link in Cura
|
||||
elif command == "open-url":
|
||||
self._application.callLater(lambda f = payload["urlPath"]: self._application._openUrl(f))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue