Removing support for older extension to only support .lpf files.
All checks were successful
continuous-integration/drone/push Build is passing

Also implementing file type association for Windows.
This commit is contained in:
Adsooi 2021-08-16 23:17:38 +02:00
parent 6682b75df3
commit c15da47743
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
6 changed files with 23 additions and 7 deletions

View file

@ -182,7 +182,7 @@ def run():
engine.load(path.realpath(path.join(getcwd(), "qml", "eu", "ad5001", "LogarithmPlotter", "LogarithmPlotter.qml"))) engine.load(path.realpath(path.join(getcwd(), "qml", "eu", "ad5001", "LogarithmPlotter", "LogarithmPlotter.qml")))
chdir(pwd) chdir(pwd)
if len(argv) > 0 and path.exists(argv[-1]) and argv[-1].split('.')[-1] in ['json', 'lgg', 'lpf']: if len(argv) > 0 and path.exists(argv[-1]) and argv[-1].split('.')[-1] in ['lpf']:
engine.rootObjects()[0].loadDiagram(argv[-1]) engine.rootObjects()[0].loadDiagram(argv[-1])
chdir(path.dirname(path.realpath(__file__))) chdir(path.dirname(path.realpath(__file__)))

View file

@ -24,7 +24,7 @@ D.FileDialog {
property bool exportMode: false property bool exportMode: false
title: exportMode ? "Export Logarithm Plot file" : "Import Logarithm Plot file" title: exportMode ? "Export Logarithm Plot file" : "Import Logarithm Plot file"
nameFilters: ["Logarithm Plot File (*.lpf *.lgg)", "Old Logarithm Plot Data (*.json)", "All files (*)"] nameFilters: ["Logarithm Plot File (*.lpf)", "All files (*)"]
folder: shortcuts.documents folder: shortcuts.documents
selectExisting: !exportMode selectExisting: !exportMode

View file

@ -162,7 +162,7 @@ ApplicationWindow {
} }
function saveDiagram(filename) { function saveDiagram(filename) {
if(['json', 'lpf', 'lgg'].indexOf(filename.split('.')[filename.split('.').length-1]) == -1) if(['lpf'].indexOf(filename.split('.')[filename.split('.').length-1]) == -1)
filename += '.lpf' filename += '.lpf'
settings.saveFilename = filename settings.saveFilename = filename
var objs = {} var objs = {}

View file

@ -54,6 +54,7 @@ class UpdateCheckerRunnable(QRunnable):
update_available = True update_available = True
else: else:
show_alert = False show_alert = False
msg_text = "No update available."
except HTTPError as e: except HTTPError as e:
msg_text = "Could not fetch update information: Server error " + str(e.code) + "." msg_text = "Could not fetch update information: Server error " + str(e.code) + "."

View file

@ -5,8 +5,6 @@
<comment xml:lang="fr">Fichier Graphe Logarithmique</comment> <comment xml:lang="fr">Fichier Graphe Logarithmique</comment>
<icon name="application-x-logarithm-plot"/> <icon name="application-x-logarithm-plot"/>
<glob-deleteall/> <glob-deleteall/>
<glob pattern="*.json"/>
<glob weight="60" pattern="*.lgg"/>
<glob weight="60" pattern="*.lpf"/> <glob weight="60" pattern="*.lpf"/>
</mime-type> </mime-type>
</mime-info> </mime-info>

View file

@ -8,6 +8,7 @@ Unicode True
;-------------------------------- ;--------------------------------
;Definitions ;Definitions
!define APP_NAME "LogarithmPlotter" !define APP_NAME "LogarithmPlotter"
!define PROG_ID "LogarithmPlotter.File.1"
!define DEV_NAME "Ad5001" !define DEV_NAME "Ad5001"
!define WEBSITE "https://apps.ad5001.eu/LogarithmPlotter" !define WEBSITE "https://apps.ad5001.eu/LogarithmPlotter"
!define APP_VERSION "0.1.0.0" !define APP_VERSION "0.1.0.0"
@ -15,6 +16,9 @@ Unicode True
!define DESCRIPTION "Create graphs with logarithm scales." !define DESCRIPTION "Create graphs with logarithm scales."
!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter" !define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter"
!define REG_APPPATHS "Software\Microsoft\Windows\CurrentVersion\App Paths\logarithmplotter.exe"
!define REG_LPFCLASS "Software\Classes\${PROG_ID}"
!define REG_LPFEXT "Software\Classes\.lpf"
;-------------------------------- ;--------------------------------
;General description ;General description
@ -172,6 +176,18 @@ Section ""
WriteRegStr HKLM ${REG_UNINSTALL} "Readme" "$INSTDIR\README.md" WriteRegStr HKLM ${REG_UNINSTALL} "Readme" "$INSTDIR\README.md"
WriteRegStr HKLM ${REG_UNINSTALL} "URLInfoAbout" "${WEBSITE}" WriteRegStr HKLM ${REG_UNINSTALL} "URLInfoAbout" "${WEBSITE}"
; Registering application
;WriteRegStr HKLM ${REG_APPPATHS} "" "$INSTDIR\logarithmplotter.exe"
;WriteRegStr HKLM ${REG_APPPATHS} "SupportedProtocols" "file:"
; Registering mime type
WriteRegStr HKLM ${REG_LPFCLASS} "" "Logarithm Plot File"
WriteRegStr HKLM "${REG_LPFCLASS}\DefaultIcon" "" "$INSTDIR\logarithmplotter.exe,0" ; I'd like to put the logplotterfile icon, but this seems far too difficult to do.
WriteRegStr HKLM "${REG_LPFCLASS}\shell\open\command" "" "$INSTDIR\logarithmplotter.exe $\"$$1$\""
WriteRegStr HKLM "${REG_LPFCLASS}\shell\edit\command" "" "$INSTDIR\logarithmplotter.exe $\"$$1$\""
WriteRegStr HKLM ${REG_LPFEXT} "" "${PROG_ID}"
WriteRegStr HKLM ${REG_LPFEXT} "Content Type" "application/x-logarithm-plot"
WriteRegStr HKLM ${REG_LPFEXT} "PerceivedType" "Application"
SectionEnd SectionEnd
;-------------------------------- ;--------------------------------
@ -182,7 +198,8 @@ Section "Uninstall"
RMDir /r "$INSTDIR" RMDir /r "$INSTDIR"
Delete "$SMPROGRAMS\LogarithmPlotter.lnk" Delete "$SMPROGRAMS\LogarithmPlotter.lnk"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter" DeleteRegKey HKLM $[REG_UNINSTALL}
DeleteRegKey HKLM $[REG_APPPATHS}
; ;DeleteRegKey /ifempty HKCU "Software\Modern UI Test" ; ;DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
; ;
SectionEnd SectionEnd