diff --git a/LogarithmPlotter/i18n/lp_de.ts b/LogarithmPlotter/i18n/lp_de.ts
index dc3fef2..9fe9b7d 100644
--- a/LogarithmPlotter/i18n/lp_de.ts
+++ b/LogarithmPlotter/i18n/lp_de.ts
@@ -5,7 +5,7 @@
About
-
+
Über LogarithmPlotter
@@ -28,95 +28,105 @@
AppMenuBar
-
+
&Datei
-
+
&Laden…
-
+
&Speichern
-
+
Speichern &Unter…
-
+
&Ausfahrt
-
+
&Bearbeiten
-
+
&Lösen
-
+
&Wiederherstellen
-
+
Grafik &Kopieren
-
+
&Erstellen
-
+
&Einstellungen
-
+
Beim Starten auf Updates prüfen
-
+
Wiederherstellen-Stapel automatisch zurücksetzen
-
+
&Hilfe
-
+
&Quellcode
-
+
Fehler &Melden
-
+
&Hilfe beim Übersetzen!
-
+
&Übrigens
+
+
+
+
+
+
+
+
+
+
EditorDialog
@@ -131,28 +141,28 @@
Name
-
+
Etikett
-
+
leer
-
+
Name
-
+
Name + Wert
-
-
+
+
+ Neues %1objekt erstellen
@@ -246,42 +256,42 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
Gespeicherte Grafik auf '%1'.
-
+
Laden der Datei '%1'.
-
+
Unbekannter Objekttyp: %1.
-
+
Ungültige Datei angegeben.
-
+
Die Datei konnte nicht gespeichert werden:
-
+
Geladene Datei '%1'.
-
+
Grafik in die Zwischenablage kopiert!
-
+
&Aktualisieren
-
+
LogarithmPlotter &aktualisieren
@@ -348,97 +358,97 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
Settings
-
+
Zoom auf X
-
+
Zoom auf Y
-
+
Minimum X
-
+
Maximum Y
-
+
Maximum X
-
+
Minimum Y
-
+
X-Achsen-Schritt
-
+
Y-Achsen-Schritt
-
+
Linienbreite
-
+
Textgröße (px)
-
+
Label der X-Achse
-
+
Label der Y-Achse
-
+
Logarithmische Skala in X
-
+
X-Teilung anzeigen
-
+
Y-Teilung anzeigen
-
+
Kopieren in die Zwischenablage
-
+
Grafik speichern
-
+
Grafik speichern unter
-
+
Grafik laden
@@ -507,6 +517,49 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
%1 %2 ausgeblendet.
+
+ parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
phasebode
diff --git a/LogarithmPlotter/i18n/lp_en.ts b/LogarithmPlotter/i18n/lp_en.ts
index cc6e318..7f43098 100644
--- a/LogarithmPlotter/i18n/lp_en.ts
+++ b/LogarithmPlotter/i18n/lp_en.ts
@@ -5,7 +5,7 @@
About
-
+
About LogarithmPlotter
@@ -28,95 +28,105 @@
AppMenuBar
-
+
&File
-
+
&Load…
-
+
&Save
-
+
Save &As…
-
+
&Quit
-
+
&Edit
-
+
&Undo
-
+
&Redo
-
+
&Copy plot
-
+
&Create
-
+
&Settings
-
+
Check for updates on startup
-
+
Reset redo stack automatically
-
+
&Help
-
+
&Source code
-
+
&Report a bug
-
+
&Help translating!
-
+
&About
+
+
+
+
+
+
+
+
+
+
EditorDialog
@@ -131,28 +141,28 @@
Name
-
+
Label content
-
+
null
-
+
name
-
+
name + value
-
-
+
+
+ Create new %1
@@ -246,42 +256,42 @@ These settings can be changed at any time from the "Settings" menu.Saved plot to '%1'.
-
+
Loading file '%1'.
-
+
Unknown object type: %1.
-
+
Invalid file provided.
-
+
Could not save file:
-
+
Loaded file '%1'.
-
+
Copied plot screenshot to clipboard!
-
+
&Update
-
+
&Update LogarithmPlotter
@@ -348,97 +358,97 @@ These settings can be changed at any time from the "Settings" menu.
Settings
-
+
X Zoom
-
+
Y Zoom
-
+
Min X
-
+
Max Y
-
+
Max X
-
+
Min Y
-
+
X Axis Step
-
+
Y Axis Step
-
+
Line width
-
+
Text size (px)
-
+
X Label
-
+
Y Label
-
+
X Log scale
-
+
Show X graduation
-
+
Show Y graduation
-
+
Copy to clipboard
-
+
Save plot
-
+
Save plot as
-
+
Load plot
@@ -507,6 +517,49 @@ These settings can be changed at any time from the "Settings" menu.%1 %2 hidden.
+
+ parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
phasebode
diff --git a/LogarithmPlotter/i18n/lp_es.ts b/LogarithmPlotter/i18n/lp_es.ts
index 23732d7..3c31b1b 100644
--- a/LogarithmPlotter/i18n/lp_es.ts
+++ b/LogarithmPlotter/i18n/lp_es.ts
@@ -5,7 +5,7 @@
About
-
+
@@ -28,95 +28,105 @@
AppMenuBar
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
EditorDialog
@@ -131,28 +141,28 @@
-
+
-
+
-
+
-
+
-
-
+
+
@@ -245,42 +255,42 @@ These settings can be changed at any time from the "Settings" menu.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -347,97 +357,97 @@ These settings can be changed at any time from the "Settings" menu.
Settings
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -506,6 +516,49 @@ These settings can be changed at any time from the "Settings" menu.
+
+ parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
phasebode
diff --git a/LogarithmPlotter/i18n/lp_fr.ts b/LogarithmPlotter/i18n/lp_fr.ts
index 3ef8845..2ec8da5 100644
--- a/LogarithmPlotter/i18n/lp_fr.ts
+++ b/LogarithmPlotter/i18n/lp_fr.ts
@@ -5,7 +5,7 @@
About
-
+
À propos de LogarithmPlotter
@@ -28,96 +28,106 @@
AppMenuBar
-
+
&Fichier
-
+
&Ouvrir…
-
+
&Sauvegarder
-
+
Sauvegarde &Sous…
-
+
&Quitter
-
+
&Édition
-
+
&Annuler
-
+
&Rétablir
-
+
&Copier le graphe
-
+
&Créer
-
+
&Paramètres
-
+
Vérifier la présence de mise à jour au démarrage
-
+
Légèrement long, et pas forcément très compréhensible.
Réinitialiser la pile d'action "Rétablir" automatiquement
-
+
&Aide
-
+
&Code source
-
+
Rapport de bug
-
+
&Aider à la traduction !
-
+
&À propos
+
+
+
+
+
+
+
+
+
+
EditorDialog
@@ -132,28 +142,28 @@
Nom
-
+
Étiquette
-
+
vide
-
+
nom
-
+
nom + valeur
-
-
+
+
Traduction non litéralle pour éviter les problèmes de genre.
+ Créer un nouvel objet %1
@@ -254,42 +264,42 @@ These settings can always be changed at any time from the "Settings" m
Graphe sauvegardé dans '%1'.
-
+
Chargement du fichier '%1'.
-
+
Type d'objet inconnu : %1.
-
+
Fichier fourni invalide.
-
+
Impossible de sauvegarder le fichier :
-
+
Fichier '%1' chargé.
-
+
Image du graphe copiée dans le presse-papiers !
-
+
&Mise à jour
-
+
&Mettre à jour LogarithmPlotter
@@ -356,97 +366,97 @@ These settings can always be changed at any time from the "Settings" m
Settings
-
+
Zoom en X
-
+
Zoom en Y
-
+
Min X
-
+
Max Y
-
+
Max X
-
+
Min Y
-
+
Pas de l'axe X
-
+
Pas de l'axe Y
-
+
Taille des lignes
-
+
Taille du texte (px)
-
+
Label de l'axe X
-
+
Label de l'axe Y
-
+
Échelle logarithmique en X
-
+
Montrer la graduation de l'axe X
-
+
Montrer la graduation de l'axe Y
-
+
Copier vers le presse-papiers
-
+
Sauvegarder le graphe
-
+
Sauvegarder le graphe sous
-
+
Charger un graphe
@@ -515,6 +525,49 @@ These settings can always be changed at any time from the "Settings" m
%1 %2 cachée(e).
+
+ parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
phasebode
diff --git a/LogarithmPlotter/i18n/lp_hu.ts b/LogarithmPlotter/i18n/lp_hu.ts
index d1ab6d2..9022215 100644
--- a/LogarithmPlotter/i18n/lp_hu.ts
+++ b/LogarithmPlotter/i18n/lp_hu.ts
@@ -5,7 +5,7 @@
About
-
+
@@ -28,95 +28,105 @@
AppMenuBar
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
EditorDialog
@@ -131,28 +141,28 @@
-
+
-
+
-
+
-
+
-
-
+
+
@@ -245,42 +255,42 @@ These settings can be changed at any time from the "Settings" menu.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -347,97 +357,97 @@ These settings can be changed at any time from the "Settings" menu.
Settings
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -506,6 +516,49 @@ These settings can be changed at any time from the "Settings" menu.
+
+ parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
phasebode
diff --git a/LogarithmPlotter/i18n/lp_nb_NO.ts b/LogarithmPlotter/i18n/lp_nb_NO.ts
index 2e52427..545dfc5 100644
--- a/LogarithmPlotter/i18n/lp_nb_NO.ts
+++ b/LogarithmPlotter/i18n/lp_nb_NO.ts
@@ -5,7 +5,7 @@
About
-
+
Om
@@ -28,95 +28,105 @@
AppMenuBar
-
+
&Fil
-
+
&Last inn …
-
+
&Lagre
-
+
Lagre &som …
-
+
&Avslutt
-
+
&Rediger
-
+
&Angre
-
+
&Gjenta
-
+
&Kopier plott
-
+
&Opprett
-
+
&Innstillinger
-
+
Se etter nye versjoner ved programstart
-
+
Tilbakestill angrehistorikk automatisk
-
+
&Hjelp
-
+
-
+
-
+
-
+
&Om
+
+
+
+
+
+
+
+
+
+
EditorDialog
@@ -131,28 +141,28 @@
Navn
-
+
Etikett-innhold
-
+
NULL
-
+
navn
-
+
navn + veri
-
-
+
+
+ Opprett nytt %1
@@ -246,42 +256,42 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.Lagret plott i «%1».
-
+
Laster inn «%1»-fil.
-
+
Ukjent objekttype: %1.
-
+
Ugyldig fil angitt.
-
+
Kunne ikke lagre fil:
-
+
Lastet inn filen «%1».
-
+
Kopierte plott-skjermavbildning til utklippstavlen!
-
+
&Oppdater
-
+
&Installer ny versjon av LogartimePlotter
@@ -348,97 +358,97 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.
Settings
-
+
X-forstørrelse
-
+
Y-forstørrelse
-
+
Min. X
-
+
Maks. Y
-
+
Maks. X
-
+
Min. Y
-
+
X-aksesteg
-
+
Y-aksesteg
-
+
Linjebredde
-
+
Tekststørrelse (piksler)
-
+
Navn på X-akse
-
+
Navn på Y-akse
-
+
Logaritmisk skala i x
-
+
Vis X-inndeling
-
+
Vis Y-inndeling
-
+
Kopier til utklippstavle
-
+
Lagre plott
-
+
Lagre plott som
-
+
Last inn plott
@@ -507,6 +517,49 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.%1 %2 skjult.
+
+ parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
phasebode
diff --git a/LogarithmPlotter/i18n/lp_template.ts b/LogarithmPlotter/i18n/lp_template.ts
index 041b785..689d033 100644
--- a/LogarithmPlotter/i18n/lp_template.ts
+++ b/LogarithmPlotter/i18n/lp_template.ts
@@ -5,7 +5,7 @@
About
-
+
@@ -28,95 +28,105 @@
AppMenuBar
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
EditorDialog
@@ -131,28 +141,28 @@
-
+
-
+
-
+
-
+
-
-
+
+
@@ -245,42 +255,42 @@ These settings can be changed at any time from the "Settings" menu.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -347,97 +357,97 @@ These settings can be changed at any time from the "Settings" menu.
Settings
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -506,6 +516,49 @@ These settings can be changed at any time from the "Settings" menu.
+
+ parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
phasebode
diff --git a/LogarithmPlotter/logarithmplotter.py b/LogarithmPlotter/logarithmplotter.py
index 9859813..bdb09e6 100644
--- a/LogarithmPlotter/logarithmplotter.py
+++ b/LogarithmPlotter/logarithmplotter.py
@@ -103,7 +103,7 @@ class Helper(QObject):
QMessageBox.warning(None, 'LogarithmPlotter', QCoreApplication.translate('main','Could not open file: "{}"\nFile does not exist.').format(filename), QMessageBox.Ok) # Cannot parse file
chdir(path.dirname(path.realpath(__file__)))
return data
-
+
@Slot(result=str)
def gettmpfile(self):
global tmpfile
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
index 7bcca41..bce122e 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
@@ -17,6 +17,7 @@
*/
import QtQuick 2.12
+import QtQuick.Dialogs 1.3
import eu.ad5001.MixedMenu 1.1
import "js/objects.js" as Objects
import "js/historylib.js" as HistoryLib
@@ -49,7 +50,13 @@ MenuBar {
Action {
text: qsTr("&Quit")
shortcut: StandardKey.Quit
- onTriggered: Qt.quit()
+ onTriggered: {
+ if(settings.saved)
+ Qt.quit()
+ else
+ saveUnsavedChangesDialog.visible = true;
+ }
+
icon.name: 'application-exit'
}
}
@@ -149,4 +156,17 @@ MenuBar {
onTriggered: about.open()
}
}
+
+ MessageDialog {
+ id: saveUnsavedChangesDialog
+ title: qsTr("Save unsaved changes?")
+ icon: StandardIcon.Question
+ text: qsTr("This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?")
+ standardButtons: StandardButton.Yes | StandardButton.No
+ onYes: Qt.quit()
+ }
+
+ function showSaveUnsavedChangesDialog() {
+ saveUnsavedChangesDialog.visible = true
+ }
}
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml
index e9fb19d..c2f4530 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml
@@ -28,5 +28,4 @@ D.FileDialog {
folder: shortcuts.documents
selectExisting: !exportMode
-
}
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml
index df2b772..b6deebb 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml
@@ -29,6 +29,8 @@ Item {
property int redoCount: 0
property var undoStack: []
property var redoStack: []
+ // Only true when no modification was done to the current working file.
+ property bool saved: true
function clear() {
undoStack = []
@@ -71,6 +73,7 @@ Item {
redoStack = []
redoCount = 0
}
+ saved = false
}
}
@@ -82,6 +85,7 @@ Item {
redoStack.push(action)
undoCount--;
redoCount++;
+ saved = false
}
}
@@ -93,17 +97,22 @@ Item {
undoStack.push(action)
undoCount++;
redoCount--;
+ saved = false
}
}
function undoMultipleDefered(toUndoCount) {
undoTimer.toUndoCount = toUndoCount;
undoTimer.start()
+ if(toUndoCount > 0)
+ saved = false
}
function redoMultipleDefered(toRedoCount) {
redoTimer.toRedoCount = toRedoCount;
redoTimer.start()
+ if(toRedoCount > 0)
+ saved = false
}
Timer {
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml
index 749df05..3c13c2d 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml
@@ -34,7 +34,7 @@ ApplicationWindow {
width: 1000
height: 500
color: sysPalette.window
- title: "LogarithmPlotter " + (settings.saveFilename != "" ? " - " + settings.saveFilename.split('/').pop() : "")
+ title: "LogarithmPlotter " + (settings.saveFilename != "" ? " - " + settings.saveFilename.split('/').pop() : "") + (history.saved ? "" : "*")
SystemPalette { id: sysPalette; colorGroup: SystemPalette.Active }
SystemPalette { id: sysPaletteIn; colorGroup: SystemPalette.Disabled }
@@ -195,6 +195,7 @@ ApplicationWindow {
"type": "logplotv1"
}))
alert.show(qsTr("Saved plot to '%1'.").arg(filename.split("/").pop()))
+ history.saved = true
}
function loadDiagram(filename) {
@@ -258,9 +259,11 @@ ApplicationWindow {
console.log(error)
alert.show(qsTr("Could not save file: ") + error)
// TODO: Error handling
+ return
}
drawCanvas.requestPaint()
alert.show(qsTr("Loaded file '%1'.").arg(basename))
+ history.saved = true
}
Timer {
@@ -277,6 +280,13 @@ ApplicationWindow {
onTriggered: Qt.quit() // Quit after paint on test build
}
+ onClosing: {
+ if(!history.saved) {
+ close.accepted = false
+ appMenu.showSaveUnsavedChangesDialog()
+ }
+ }
+
function copyDiagramToClipboard() {
var file = Helper.gettmpfile()
drawCanvas.save(file)
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml
index b7e45d0..7990ac0 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml
@@ -65,7 +65,6 @@ D.Dialog {
var newName = Utils.parseName(newValue)
if(newName != '' && objEditor.obj.name != newName) {
if(Objects.getObjectByName(newName) != null) {
- console.log(Objects.getObjectByName(newName).name, newName)
newName = ObjectsCommons.getNewName(newName)
}
history.addToHistory(new HistoryLib.NameChanged(
@@ -181,23 +180,25 @@ D.Dialog {
// True to select an object of type, false for enums.
property bool selectObjMode: paramTypeIn(modelData[1], ['ObjectType'])
- model: visible ?
+ property var baseModel: visible ?
(selectObjMode ? Objects.getObjectsName(modelData[1].objType).concat([qsTr("+ Create new %1").arg(Objects.types[modelData[1].objType].displayType())]) : modelData[1].values)
: []
+ // Translate the model if necessary.
+ model: selectObjMode ? baseModel : baseModel.map(x => qsTr(x))
visible: paramTypeIn(modelData[1], ['ObjectType', 'Enum'])
- currentIndex: model.indexOf(selectObjMode ? objEditor.obj[modelData[0]].name : objEditor.obj[modelData[0]])
+ currentIndex: baseModel.indexOf(selectObjMode ? objEditor.obj[modelData[0]].name : objEditor.obj[modelData[0]])
onActivated: function(newIndex) {
if(selectObjMode) {
// This is only done when what we're selecting are Objects.
// Setting object property.
- var selectedObj = Objects.getObjectByName(model[newIndex], modelData[1].objType)
+ var selectedObj = Objects.getObjectByName(baseModel[newIndex], modelData[1].objType)
if(selectedObj == null) {
// Creating new object.
selectedObj = Objects.createNewRegisteredObject(modelData[1].objType)
history.addToHistory(new HistoryLib.CreateNewObject(selectedObj.name, modelData[1].objType, selectedObj.export()))
- model = Objects.getObjectsName(modelData[1].objType).concat([qsTr("+ Create new %1").arg(Objects.types[modelData[1].objType].displayType())])
- currentIndex = model.indexOf(selectedObj.name)
+ baseModel = Objects.getObjectsName(modelData[1].objType).concat([qsTr("+ Create new %1").arg(Objects.types[modelData[1].objType].displayType())])
+ currentIndex = baseModel.indexOf(selectedObj.name)
}
//Objects.currentObjects[objEditor.objType][objEditor.objIndex].requiredBy = objEditor.obj[modelData[0]].filter((obj) => objEditor.obj.name != obj.name)
objEditor.obj.requiredBy = objEditor.obj.requiredBy.filter((obj) => objEditor.obj.name != obj.name)
@@ -207,13 +208,13 @@ D.Dialog {
objEditor.obj[modelData[0]], selectedObj
))
objEditor.obj[modelData[0]] = selectedObj
- } else if(model[newIndex] != objEditor.obj[modelData[0]]) {
+ } else if(baseModel[newIndex] != objEditor.obj[modelData[0]]) {
// Ensuring new property is different to not add useless history entries.
history.addToHistory(new HistoryLib.EditedProperty(
objEditor.obj.name, objEditor.objType, modelData[0],
- objEditor.obj[modelData[0]], model[newIndex]
+ objEditor.obj[modelData[0]], baseModel[newIndex]
))
- objEditor.obj[modelData[0]] = model[newIndex]
+ objEditor.obj[modelData[0]] = baseModel[newIndex]
}
// Refreshing
Objects.currentObjects[objEditor.objType][objEditor.objIndex].update()
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml
index b701dd0..0903271 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml
@@ -18,6 +18,7 @@
import QtQuick.Controls 2.12
import QtQuick 2.12
+import QtQuick.Dialogs 1.1
import "js/utils.js" as Utils
ScrollView {
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js
index 182c2dd..09b8701 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js
@@ -29,17 +29,29 @@ class Function extends Common.ExecutableObject {
static displayType(){return qsTr('Function')}
static displayTypeMultiple(){return qsTr('Functions')}
static properties() {return {
- 'expression': 'Expression',
- 'definitionDomain': 'Domain',
- 'destinationDomain': 'Domain',
- 'comment1': 'Ex: R+* (ℝ⁺*), N (ℕ), Z-* (ℤ⁻*), ]0;1[, {3;4;5}',
- 'labelPosition': new P.Enum('above', 'below', 'left', 'right', 'above-left', 'above-right', 'below-left', 'below-right'),
- 'displayMode': new P.Enum('application', 'function'),
- 'labelX': 'number',
- 'comment2': 'The following parameters are used when the definition domain is a non-continuous set. (Ex: ℕ, ℤ, sets like {0;3}...)',
- 'drawPoints': 'boolean',
- 'drawDashedLines': 'boolean'
+ 'expression': 'Expression',
+ 'definitionDomain': 'Domain',
+ 'destinationDomain': 'Domain',
+ 'comment1': 'Ex: R+* (ℝ⁺*), N (ℕ), Z-* (ℤ⁻*), ]0;1[, {3;4;5}',
+ 'labelPosition': P.Enum.Position,
+ 'displayMode': new P.Enum('application', 'function'),
+ 'labelX': 'number',
+ 'comment2': 'The following parameters are used when the definition domain is a non-continuous set. (Ex: ℕ, ℤ, sets like {0;3}...)',
+ 'drawPoints': 'boolean',
+ 'drawDashedLines': 'boolean'
}}
+ /*static properties() {return {
+ [QT_TR_NOOP('expression')]: 'Expression',
+ [QT_TR_NOOP('definitionDomain')]: 'Domain',
+ [QT_TR_NOOP('destinationDomain')]: 'Domain',
+ 'comment1': 'Ex: R+* (ℝ⁺*), N (ℕ), Z-* (ℤ⁻*), ]0;1[, {3;4;5}',
+ [QT_TR_NOOP('labelPosition')]: P.Enum.Position,
+ [QT_TR_NOOP('displayMode')]: new P.Enum('application', 'function'),
+ [QT_TR_NOOP('labelX')]: 'number',
+ 'comment2': 'The following parameters are used when the definition domain is a non-continuous set. (Ex: ℕ, ℤ, sets like {0;3}...)',
+ [QT_TR_NOOP('drawPoints')]: 'boolean',
+ [QT_TR_NOOP('drawDashedLines')]: 'boolean'
+ }}*/
constructor(name = null, visible = true, color = null, labelContent = 'name + value',
expression = 'x', definitionDomain = 'RPE', destinationDomain = 'R',
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js
index 710a3f7..b9d6690 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js
@@ -54,3 +54,16 @@ class Dictionary {
this.forbidAdding = forbidAdding
}
}
+
+// Common parameters of them:
+
+Enum.Position = new Enum(
+ QT_TR_NOOP('above'),
+ QT_TR_NOOP('below'),
+ QT_TR_NOOP('left'),
+ QT_TR_NOOP('right'),
+ QT_TR_NOOP('above-left'),
+ QT_TR_NOOP('above-right'),
+ QT_TR_NOOP('below-left'),
+ QT_TR_NOOP('below-right')
+)