New file format name, minor changes and fixes.

This commit is contained in:
Adsooi 2021-03-14 18:28:53 +01:00
parent f63e86b78a
commit 620bdfc28c
8 changed files with 75 additions and 44 deletions

View file

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

View file

@ -94,9 +94,9 @@ ApplicationWindow {
LogGraphCanvas {
id: drawCanvas
anchors.top: parent.top
anchors.left: sidebar.right
anchors.left: sidebar.inPortrait ? parent.left : sidebar.right
height: parent.height
width: parent.width - sidebar.position*sidebar.width
width: sidebar.inPortrait ? parent.width : parent.width - sidebar.position*sidebar.width
x: sidebar.position*sidebar.width
xmin: settings.xmin
@ -117,6 +117,8 @@ ApplicationWindow {
}
function saveDiagram(filename) {
if(['json', 'lpf', 'lgg'].indexOf(filename.split('.')[filename.split('.').length-1]) == -1)
filename += '.lpf'
settings.saveFilename = filename
var objs = {}
for(var objType in Objects.currentObjects){

View file

@ -234,7 +234,7 @@ class Function extends ExecutableObject {
getReadableString() {
if(this.displayMode == 'application') {
return `${this.name}: ${this.definitionDomain} ${this.destinationDomain}\n ${' '.repeat(this.name.length)}x ⟼ ${this.expression.toString()}`
return `${this.name}: ${this.definitionDomain} ${this.destinationDomain}\n ${' '.repeat(this.name.length)}x ⟼ ${this.expression.toString()}`
} else {
return `${this.name}(x) = ${this.expression.toString()}\nD${Utils.textsub(this.name)} = ${this.definitionDomain}`
}