Adding openURL in singleinstance

This commit is contained in:
saumya.jain 2024-02-05 13:22:26 +01:00
parent d67f0696cd
commit 21517c5025
3 changed files with 7 additions and 3 deletions

View File

@ -92,7 +92,11 @@ class SingleInstance:
# Command: Load a model or project file
elif command == "open":
self._application.callLater(lambda f = payload["filePath"]: self._application._openFile(f))
if payload["filePath"].file():
self._application.callLater(lambda f = payload["filePath"]: self._application._openFile(f))
if payload["filePath"].url():
self._application.callLater(lambda f= payload["filepath"]: self._application._openUrl(f))
# Command: Activate the window and bring it to the top.
elif command == "focus":

View File

@ -156,7 +156,7 @@ WriteRegStr HKCR "slicer" "" "URL:slicer"
WriteRegStr HKCR "slicer" "URL Protocol" ""
WriteRegStr HKCR "slicer\DefaultIcon" "" "$INSTDIR\${MAIN_APP_EXE},1"
WriteRegStr HKCR "slicer\shell" "" "open"
WriteRegStr HKCR "slicer\shell\open\command" "" '"$INSTDIR\${MAIN_APP_EXE}" "%1"'
WriteRegStr HKCR "slicer\shell\open\command" "" '"$INSTDIR\${MAIN_APP_EXE}" --single-instance "%1"'
SectionEnd
######################################################################

View File

@ -165,7 +165,7 @@
<RegistryValue Type="string" Value="URL:Cura Protocol"/>
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
<RegistryValue Type="string" Key="DefaultIcon" Value="[APPLICATIONFOLDER]\{{ main_app }},1"/>
<RegistryValue Type="string" Key="shell\open\command" Value="&quot;[APPLICATIONFOLDER]\{{ main_app }}&quot; &quot;%1&quot;"/>
<RegistryValue Type="string" Key="shell\open\command" Value="&quot;[APPLICATIONFOLDER]\{{ main_app }}&quot; --single-instance &quot;%1&quot;"/>
</RegistryKey>
</Component>