mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-05-07 09:19:50 +00:00
Add ablity to load results at start, closes #902
- Add ablility to load .dupguru file at start by passing as first argument - Add file association to .dupeguru file in windows at install
This commit is contained in:
parent
a685524dd5
commit
2fff1a3436
@ -277,6 +277,12 @@ class DupeGuru(QObject):
|
|||||||
"Wrong Locale",
|
"Wrong Locale",
|
||||||
msg,
|
msg,
|
||||||
)
|
)
|
||||||
|
# Load results on open if passed a .dupeguru file
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
results = sys.argv[1]
|
||||||
|
if results.endswith(".dupeguru"):
|
||||||
|
self.model.load_from(results)
|
||||||
|
self.recentResults.insertItem(results)
|
||||||
|
|
||||||
def clearPictureCacheTriggered(self):
|
def clearPictureCacheTriggered(self):
|
||||||
title = tr("Clear Picture Cache")
|
title = tr("Clear Picture Cache")
|
||||||
|
31
setup.nsi
31
setup.nsi
@ -184,6 +184,24 @@ Section "!Application" AppSec
|
|||||||
Pop $R1
|
Pop $R1
|
||||||
Pop $R0
|
Pop $R0
|
||||||
|
|
||||||
|
; Set file association
|
||||||
|
ReadRegStr $1 HKCR ".dupeguru" ""
|
||||||
|
StrCmp $1 "" NoBackup ; is it empty
|
||||||
|
StrCmp $1 "${APPNAME}.File" NoBackup ; is it our own
|
||||||
|
WriteRegStr HKCR ".dupeguru" "backup_val" "$1" ; backup current value
|
||||||
|
NoBackup:
|
||||||
|
WriteRegStr HKCR ".dupeguru" "" "${APPNAME}.File" ; set our file association
|
||||||
|
|
||||||
|
ReadRegStr $0 HKCR "${APPNAME}.File" ""
|
||||||
|
StrCmp $0 "" 0 Skip
|
||||||
|
WriteRegStr HKCR "${APPNAME}.File" "" "${APPNAME} File"
|
||||||
|
WriteRegStr HKCR "${APPNAME}.File\shell" "" "open"
|
||||||
|
WriteRegStr HKCR "${APPNAME}.File\DefaultIcon" "" "$INSTDIR\${APPNAME}-win${BITS}.exe,0"
|
||||||
|
Skip:
|
||||||
|
WriteRegStr HKCR "${APPNAME}.File\shell\open\command" "" '"$INSTDIR\${APPNAME}-win${BITS}.exe" "%1"'
|
||||||
|
WriteRegStr HKCR "${APPNAME}.File\shell\edit" "" "Edit ${APPNAME} File"
|
||||||
|
WriteRegStr HKCR "${APPNAME}.File\shell\edit\command" "" '"$INSTDIR\${APPNAME}-win${BITS}.exe" "%1"'
|
||||||
|
|
||||||
; Uninstall Entry
|
; Uninstall Entry
|
||||||
WriteRegStr SHCTX "${UNINSTALLREG}" "DisplayName" "${APPNAME} ${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONPATCH}"
|
WriteRegStr SHCTX "${UNINSTALLREG}" "DisplayName" "${APPNAME} ${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONPATCH}"
|
||||||
WriteRegStr SHCTX "${UNINSTALLREG}" "DisplayVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONPATCH}"
|
WriteRegStr SHCTX "${UNINSTALLREG}" "DisplayVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONPATCH}"
|
||||||
@ -237,6 +255,19 @@ Section "Uninstall"
|
|||||||
; Remove Install Folder if empty
|
; Remove Install Folder if empty
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
|
ReadRegStr $1 HKCR ".dupeguru" ""
|
||||||
|
StrCmp $1 "${APPNAME}.File" 0 NotOwn ; only do this if we own it
|
||||||
|
ReadRegStr $1 HKCR ".dupeguru" "backup_val"
|
||||||
|
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
|
||||||
|
DeleteRegKey HKCR ".dupeGuru"
|
||||||
|
Goto NotOwn
|
||||||
|
|
||||||
|
Restore:
|
||||||
|
WriteRegStr HKCR ".dupeguru" "" $1
|
||||||
|
DeleteRegValue HKCR ".dupeguru" "backup_val"
|
||||||
|
NotOwn:
|
||||||
|
DeleteRegKey HKCR "${APPNAME}.File" ;Delete key with association name settings
|
||||||
|
|
||||||
; Remove registry keys and vendor keys (if empty)
|
; Remove registry keys and vendor keys (if empty)
|
||||||
DeleteRegKey SHCTX "${BASEREGKEY}"
|
DeleteRegKey SHCTX "${BASEREGKEY}"
|
||||||
DeleteRegKey /ifempty SHCTX "${VENDORREGKEY}"
|
DeleteRegKey /ifempty SHCTX "${VENDORREGKEY}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user