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")))
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])
chdir(path.dirname(path.realpath(__file__)))

View file

@ -24,7 +24,7 @@ D.FileDialog {
property bool exportMode: false
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
selectExisting: !exportMode

View file

@ -162,7 +162,7 @@ ApplicationWindow {
}
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'
settings.saveFilename = filename
var objs = {}

View file

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