diff --git a/assets/i18n/lp_de.ts b/assets/i18n/lp_de.ts
index 4876e02..59a9725 100644
--- a/assets/i18n/lp_de.ts
+++ b/assets/i18n/lp_de.ts
@@ -67,22 +67,22 @@
&Lösen
-
+
&Wiederherstellen
-
+
Grafik &Kopieren
-
+
&Einstellung
-
+
&Erstellen
@@ -123,52 +123,52 @@
Syntaktische Färbung
-
+
&Hilfe
-
+
&Quellcode
-
+
Fehler &Melden
-
+
&Benutzerhandbuch
-
+
&Changelog
-
+
&Hilfe beim Übersetzen!
-
+
&Danksagungen
-
+
&Übrigens
-
+
Änderungen speichern?
-
+
Diese Grafik enthält ungespeicherte Änderungen. Dadurch gehen alle ungespeicherten Daten verloren. Fortfahren?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Neues %1objekt erstellen
-
+
Aufnehmen auf Graph
@@ -238,9 +238,8 @@
Name
-
- Etikett
+ Etikett
@@ -405,24 +404,20 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
HistoryBrowser
-
- Filtern…
+ Filtern…
-
- Wiederherstellen >
+ Wiederherstellen >
-
- > Aktueller Stand
+ > Aktueller Stand
-
- < Rückgängig
+ < Rückgängig
@@ -475,17 +470,17 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
Geladene Datei '%1'.
-
+
Grafik in die Zwischenablage kopiert!
-
+
&Aktualisieren
-
+
LogarithmPlotter &aktualisieren
@@ -613,109 +608,109 @@ 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)
-
+
Etikett der X-Achse
-
+
Etikett der Y-Achse
-
+
Logarithmische Skala in X
-
+
X-Teilung anzeigen
-
+
Y-Teilung anzeigen
-
+
Kopieren in die Zwischenablage
-
+
Grafik speichern…
-
+
Grafik speichern unter…
-
+
Grafik laden…
@@ -1160,7 +1155,7 @@ Evaluated expression: %3
Ausdruck analysiert: %3
-
+
Ausdruck analysiert: %3
-
+
LogarithmPlotter - Fehler
@@ -1308,27 +1303,27 @@ Ausdruck analysiert: %3
Verlauf
-
+
Gespeicherte Grafik auf '%1'.
-
+
Laden der Datei '%1'.
-
+
Unbekannter Objekttyp: %1.
-
+
Ungültige Datei angegeben.
-
+
Datei konnte nicht geladen werden:
@@ -1337,7 +1332,7 @@ Ausdruck analysiert: %3
Die Datei konnte nicht gespeichert werden:
-
+
Geladene Datei '%1'.
@@ -1731,6 +1726,11 @@ Bitte vergewissern Sie sich, dass Ihre LaTeX-Installation korrekt ist, und melde
Farbe
+
+
+
+ Etikett
+
repartition
diff --git a/assets/i18n/lp_en.ts b/assets/i18n/lp_en.ts
index b2dfaff..5f653a7 100644
--- a/assets/i18n/lp_en.ts
+++ b/assets/i18n/lp_en.ts
@@ -67,22 +67,22 @@
&Undo
-
+
&Redo
-
+
&Copy plot
-
+
&Preferences
-
+
&Create
@@ -123,52 +123,52 @@
Color Scheme
-
+
&Help
-
+
&Source code
-
+
&Report a bug
-
+
&User manual
-
+
&Changelog
-
+
&Help translating!
-
+
&Thanks
-
+
&About
-
+
Save unsaved changes?
-
+
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Create new %1
-
+
Pick on graph
@@ -238,9 +238,8 @@
Name
-
- Label content
+ Label content
@@ -405,24 +404,20 @@ These settings can be changed at any time from the "Settings" menu.
HistoryBrowser
-
- Filter…
+ Filter…
-
- Redo >
+ Redo >
-
- > Now
+ > Now
-
- < Undo
+ < Undo
@@ -475,17 +470,17 @@ These settings can be changed at any time from the "Settings" menu.Loaded file '%1'.
-
+
Copied plot screenshot to clipboard!
-
+
&Update
-
+
&Update LogarithmPlotter
@@ -613,109 +608,109 @@ 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…
-
+
Open plot…
@@ -1160,7 +1155,7 @@ Evaluated expression: %3
Evaluated expression: %3
-
+
Evaluated expression: %3
-
+
LogarithmPlotter - Drawing error
@@ -1308,27 +1303,27 @@ Evaluated expression: %3
History
-
+
Saved plot to '%1'.
-
+
Loading file '%1'.
-
+
Unknown object type: %1.
-
+
Invalid file provided.
-
+
Could not load file:
@@ -1337,7 +1332,7 @@ Evaluated expression: %3
Could not save file:
-
+
Loaded file '%1'.
@@ -1731,6 +1726,11 @@ Please make sure your LaTeX installation is correct and report a bug if so.color
Color
+
+
+
+ Label content
+
repartition
diff --git a/assets/i18n/lp_es.ts b/assets/i18n/lp_es.ts
index ef79648..7a736b5 100644
--- a/assets/i18n/lp_es.ts
+++ b/assets/i18n/lp_es.ts
@@ -67,22 +67,22 @@
&Cancelar
-
+
&Reiniciar
-
+
&Copiar el gráfico
-
+
&Preferencias
-
+
&Crear
@@ -119,52 +119,52 @@
Esquema de colores
-
+
&Ayuda
-
+
&Código fuente
-
+
&Informar de un error
-
+
&Manual del usuario
-
+
&Registro de cambios
-
+
&¡Ayuda a la traducción!
-
+
&Agradecimientos
-
+
&Acerca de
-
+
¿Guardar los cambios no guardados?
-
+
Este gráfico contiene cambios sin guardar. Al hacer esto, se perderán todos los datos no guardados. ¿Continuar?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Crear nuevo %1
-
+
Elegir en el gráfico
@@ -237,11 +237,6 @@
-
-
-
-
-
@@ -405,24 +400,16 @@ Estos ajustes se pueden cambiar en cualquier momento desde el menú “Ajustes
HistoryBrowser
-
-
-
-
-
-
- Rehacer >
+ Rehacer >
-
- > Ahora
+ > Ahora
-
- < Deshacer
+ < Deshacer
@@ -451,17 +438,17 @@ Estos ajustes se pueden cambiar en cualquier momento desde el menú “Ajustes
Historial
-
+
¡Captura de pantalla del gráfico copiada al portapapeles!
-
+
&Actualizar
-
+
&Actualizar LogarithmPlotter
@@ -613,109 +600,109 @@ Estos ajustes se pueden cambiar en cualquier momento desde el menú “Ajustes
Settings
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Paso por eje X
-
+
Paso por eje Y
-
+
Anchura de la línea
-
+
Tamaño del texto (px)
-
+
-
+
-
+
Escala logarítmica en X
-
+
Mostrar graduación del eje X
-
+
Mostrar graduación del eje Y
-
+
Copiar al portapapeles
-
+
Guardar gráfico…
-
+
Guardar gráfico como…
-
+
Abrir gráfico…
@@ -1147,7 +1134,7 @@ Evaluated expression: %3
Expresión evaluada: %3
-
+
Expresión evaluada: %3
-
+
@@ -1320,27 +1307,27 @@ Expresión evaluada: %3
Objetos
-
+
Gráfico guardado en '%1'.
-
+
Cargando el archivo '%1'.
-
+
Tipo de objeto desconocido: %1 .
-
+
Se ha proporcionado un archivo no válido.
-
+
No se pudo cargar el archivo:
@@ -1349,7 +1336,7 @@ Expresión evaluada: %3
No se ha podido guardar el archivo:
-
+
Archivo cargado '%1'.
@@ -1731,6 +1718,11 @@ Por favor, asegúrese de que su instalación de LaTeX es correcta e informe de u
Valores de inicialización
+
+
+
+ Contenido de la etiqueta
+
repartition
diff --git a/assets/i18n/lp_fr.ts b/assets/i18n/lp_fr.ts
index 2b1a26d..b693568 100644
--- a/assets/i18n/lp_fr.ts
+++ b/assets/i18n/lp_fr.ts
@@ -67,22 +67,22 @@
&Annuler
-
+
&Rétablir
-
+
&Copier le graphe
-
+
&Préférences
-
+
&Créer
@@ -124,52 +124,52 @@
Coloration Syntaxique
-
+
&Aide
-
+
&Code source
-
+
&Rapport de bug
-
+
Manuel d'&utilisation
-
+
&Historique des modifications
-
+
&Aider à la traduction !
-
+
&Remerciements
-
+
&À propos
-
+
Sauvegarder les modifications ?
-
+
Ce graphe contient des modifications non sauvegardées. En faisant cela, toutes les données non sauvegardées seront perdues. Continuer ?
@@ -206,12 +206,12 @@
CustomPropertyList
-
+
+ Créer un nouvel objet %1
-
+
Prendre la position sur le graphe
@@ -239,9 +239,8 @@
Nom
-
- Étiquette
+ Étiquette
@@ -407,24 +406,20 @@ Ces paramètres peuvent être modifiés à tout moment à partir du menu "P
HistoryBrowser
-
- Filtrer…
+ Filtrer…
-
- Rétablir >
+ Rétablir >
-
- > État actuel
+ > État actuel
-
- < Annuler
+ < Annuler
@@ -477,17 +472,17 @@ Ces paramètres peuvent être modifiés à tout moment à partir du menu "P
Fichier '%1' chargé.
-
+
Image du graphe copiée dans le presse-papiers !
-
+
&Mise à jour
-
+
&Mettre à jour LogarithmPlotter
@@ -615,109 +610,109 @@ Ces paramètres peuvent être modifiés à tout moment à partir du menu "P
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…
-
+
Ouvrir un graphe…
@@ -1163,7 +1158,7 @@ Evaluated expression: %3
Formule analysée : %3
-
+
Formule analysée : %3
-
+
LogarithmPlotter - Erreur
@@ -1323,27 +1318,27 @@ Formule analysée : %3
&Mettre à jour LogarithmPlotter
-
+
Graphe sauvegardé dans '%1'.
-
+
Chargement du fichier '%1'.
-
+
Type d'objet inconnu : %1.
-
+
Fichier fourni invalide.
-
+
Impossible de charger le fichier :
@@ -1352,7 +1347,7 @@ Formule analysée : %3
Impossible de sauvegarder le fichier :
-
+
Fichier '%1' chargé.
@@ -1734,6 +1729,11 @@ Vérifiez que votre installation de LaTeX est correcte et signalez un bogue si c
Couleur
+
+
+
+ Étiquette
+
repartition
diff --git a/assets/i18n/lp_hu.ts b/assets/i18n/lp_hu.ts
index 975c600..a43da4d 100644
--- a/assets/i18n/lp_hu.ts
+++ b/assets/i18n/lp_hu.ts
@@ -67,22 +67,22 @@
&Visszavonás
-
+
&Ismétlés
-
+
Ábra má&solása
-
+
&Beállítások
-
+
&Létrehozás
@@ -123,52 +123,52 @@
Színséma
-
+
&Súgó
-
+
&Forráskód
-
+
&Hiba bejelentése
-
+
&Használati utasítás
-
+
&Változásnapló
-
+
&Segítség a fordításban!
-
+
&Köszönjük
-
+
&Névjegy
-
+
Menti a változtatásokat?
-
+
Ez az ábra nem mentett változtatásokat tartalmaz. Ezzel az összes nem mentett adat elveszik. Folytatja?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Új %1 létrehozása
-
+
Ábra kijelölése
@@ -238,9 +238,8 @@
Név
-
- Címketartalom
+ Címketartalom
@@ -405,24 +404,20 @@ Ezek a beállítások bármikor módosíthatók a „Beállítások” menüben.
HistoryBrowser
-
- Szűrő…
+ Szűrő…
-
- Ismétlés >
+ Ismétlés >
-
- > Most
+ > Most
-
- < Visszavonás
+ < Visszavonás
@@ -475,17 +470,17 @@ Ezek a beállítások bármikor módosíthatók a „Beállítások” menüben.
A(z) „%1” fájl betöltve.
-
+
Ábra képernyőkép vágólapra másolva!
-
+
&Frissítés
-
+
A LogarithmPlotter &frissítése
@@ -613,109 +608,109 @@ Ezek a beállítások bármikor módosíthatók a „Beállítások” menüben.
Settings
-
+
X-nagyítás
-
+
Y-nagyítás
-
+
Legkisebb X
-
+
Legnagyobb Y
-
+
Legnagyobb X
-
+
Legkisebb Y
-
+
X tengely lépésköze
-
+
Y tengely lépésköze
-
+
Vonalvastagság
-
+
Szövegméret (képpont)
-
+
X címke
-
+
Y címke
-
+
X tengely logaritmikus skálával
-
+
X érettségi megjelenítése
-
+
Y érettségi megjelenítése
-
+
Másolás a vágólapra
-
+
Ábra mentése…
-
+
Ábra mentése másként…
-
+
Ábra megnyitása…
@@ -1160,7 +1155,7 @@ Evaluated expression: %3
Kiértékelt kifejezés: %3
-
+
Kiértékelt kifejezés: %3
-
+
LogarithmPlotter - Rajzolási hiba
@@ -1304,27 +1299,27 @@ Kiértékelt kifejezés: %3
Előzmények
-
+
Ábra mentve ide: „%1”.
-
+
A(z) „%1” fájl betöltése folyamatban van.
-
+
Ismeretlen objektumtípus: %1.
-
+
A megadott fájl érvénytelen.
-
+
@@ -1333,7 +1328,7 @@ Kiértékelt kifejezés: %3
A fájl mentése nem sikerült:
-
+
A(z) „%1” fájl betöltve.
@@ -1731,6 +1726,11 @@ Kérjük, ellenőrizze, hogy a LaTeX telepítése helyes-e, és ha igen, jelents
Szín
+
+
+
+ Címketartalom
+
repartition
diff --git a/assets/i18n/lp_nb_NO.ts b/assets/i18n/lp_nb_NO.ts
index d278f03..79657f6 100644
--- a/assets/i18n/lp_nb_NO.ts
+++ b/assets/i18n/lp_nb_NO.ts
@@ -67,22 +67,22 @@
&Angre
-
+
&Gjenta
-
+
&Kopier plott
-
+
-
+
&Opprett
@@ -99,52 +99,52 @@
Tilbakestill angrehistorikk automatisk
-
+
&Hjelp
-
+
-
+
&Rapporter en feil
-
+
-
+
&Endringslogg
-
+
&Hjelp til å oversette!
-
+
&Erkjennelser
-
+
&Om
-
+
Lagre ikke-lagrede endringer?
-
+
Dette plottet inneholder ikke-lagrede endringer. Hvis du gjør dette, vil alle ikke-lagrede data gå tapt. Fortsette?
@@ -181,12 +181,12 @@
CustomPropertyList
-
+
+ Opprett nytt %1
-
+
@@ -214,9 +214,8 @@
Navn
-
- Etikett-innhold
+ Etikett-innhold
@@ -361,24 +360,16 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.
HistoryBrowser
-
-
-
-
-
-
- Angre >
+ Angre >
-
- > Nå
+ > Nå
-
- < Angre
+ < Angre
@@ -431,17 +422,17 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.Lastet inn filen «%1».
-
+
Kopierte plott-skjermavbildning til utklippstavlen!
-
+
&Oppdater
-
+
&Installer ny versjon av LogartimePlotter
@@ -569,109 +560,109 @@ 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
@@ -971,7 +962,7 @@ Evaluated expression: %3
-
+
-
+
@@ -1235,27 +1226,27 @@ Evaluated expression: %3
Historikk
-
+
Lagret plott i «%1».
-
+
Laster inn «%1»-fil.
-
+
Ukjent objekttype: %1.
-
+
Ugyldig fil angitt.
-
+
@@ -1264,7 +1255,7 @@ Evaluated expression: %3
Kunne ikke lagre fil:
-
+
Lastet inn filen «%1».
@@ -1641,6 +1632,11 @@ Please make sure your latex installation is correct and report a bug if so.targetValuePosition
+
+
+
+ Etikett-innhold
+
repartition
diff --git a/assets/i18n/lp_template.ts b/assets/i18n/lp_template.ts
index 0981f1b..81221dd 100644
--- a/assets/i18n/lp_template.ts
+++ b/assets/i18n/lp_template.ts
@@ -67,72 +67,72 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -162,12 +162,12 @@
CustomPropertyList
-
+
-
+
@@ -194,11 +194,6 @@
-
-
-
-
-
@@ -294,29 +289,6 @@
-
- HistoryBrowser
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ListSetting
@@ -343,17 +315,17 @@
-
+
-
+
-
+
@@ -457,109 +429,109 @@
Settings
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -859,7 +831,7 @@ Evaluated expression: %3
-
+
-
+
@@ -1069,32 +1041,32 @@ Evaluated expression: %3
io
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1448,6 +1420,11 @@ Please make sure your latex installation is correct and report a bug if so.targetValuePosition
+
+
+
+
+
sequence
diff --git a/common/src/module/history.mjs b/common/src/module/history.mjs
index 7406925..2a38730 100644
--- a/common/src/module/history.mjs
+++ b/common/src/module/history.mjs
@@ -23,9 +23,16 @@ import { Action, Actions } from "../history/index.mjs"
-class UpdatedEvent extends BaseEvent {
+class ClearedEvent extends BaseEvent {
constructor() {
- super("updated")
+ super("cleared")
+ }
+}
+
+class AddedEvent extends BaseEvent {
+ constructor(action) {
+ super("added")
+ this.action = action
}
}
@@ -44,7 +51,7 @@ class RedoneEvent extends BaseEvent {
}
class HistoryAPI extends Module {
- static emits = ["updated", "undone", "redone"]
+ static emits = ["cleared", "added", "undone", "redone"]
#helper
@@ -113,7 +120,7 @@ class HistoryAPI extends Module {
if(!this.initialized) throw new Error("Attempting clear before initialize!")
this.undoStack = []
this.redoStack = []
- this.emit(new UpdatedEvent())
+ this.emit(new ClearedEvent())
}
/**
@@ -127,7 +134,7 @@ class HistoryAPI extends Module {
this.undoStack.push(action)
if(this.#helper.getSettingBool("reset_redo_stack"))
this.redoStack = []
- this.emit(new UpdatedEvent())
+ this.emit(new AddedEvent(action))
}
}
diff --git a/common/src/module/interface.mjs b/common/src/module/interface.mjs
index 1ee65a3..db65ea2 100644
--- a/common/src/module/interface.mjs
+++ b/common/src/module/interface.mjs
@@ -79,7 +79,6 @@ export class CanvasInterface extends Interface {
export class RootInterface extends Interface {
width = NUMBER
height = NUMBER
- updateObjectsLists = FUNCTION
}
export class DialogInterface extends Interface {
diff --git a/common/src/module/io.mjs b/common/src/module/io.mjs
index 8ca4b2b..360a8fc 100644
--- a/common/src/module/io.mjs
+++ b/common/src/module/io.mjs
@@ -22,26 +22,59 @@ import History from "./history.mjs"
import Canvas from "./canvas.mjs"
import Settings from "./settings.mjs"
import { DialogInterface, RootInterface } from "./interface.mjs"
+import { BaseEvent } from "../events.mjs"
+class LoadedEvent extends BaseEvent {
+ constructor() {
+ super("loaded")
+ }
+}
+
+class SavedEvent extends BaseEvent {
+ constructor() {
+ super("saved")
+ }
+}
+
+class ModifiedEvent extends BaseEvent {
+ constructor() {
+ super("modified")
+ }
+}
+
class IOAPI extends Module {
+ static emits = ["loaded", "saved", "modified"]
+
/** @type {RootInterface} */
#rootElement
/** @type {{show: function(string)}} */
#alert
+ #saved = true
constructor() {
super("IO", {
alert: DialogInterface,
root: RootInterface
})
- /**
- * Path of the currently opened file. Empty if no file is opened.
- * @type {string}
- */
- this.saveFileName = ""
+
+ // Settings.on("changed", this.__emitModified.bind(this))
+ console.log("Init IO", this)
+ History.on("added undone redone", this.__emitModified.bind(this))
}
+ __emitModified() {
+ this.#saved = false
+ this.emit(new ModifiedEvent())
+ }
+
+
+ /**
+ * True if no changes have been made since last save, false otherwise.
+ * @return {boolean}
+ */
+ get saved() { return this.#saved }
+
/**
* Initializes module with QML elements.
* @param {RootInterface} root
@@ -92,7 +125,7 @@ class IOAPI extends Module {
}
Helper.write(filename, JSON.stringify(settings))
this.#alert.show(qsTranslate("io", "Saved plot to '%1'.").arg(filename.split("/").pop()))
- History.history.saved = true
+ this.emit(new SavedEvent())
}
/**
@@ -159,8 +192,6 @@ class IOAPI extends Module {
if("history" in data)
History.unserialize(...data["history"])
- // Refreshing sidebar
- this.#rootElement.updateObjectsLists()
} else {
error = qsTranslate("io", "Invalid file provided.")
}
@@ -172,7 +203,7 @@ class IOAPI extends Module {
}
Canvas.redraw()
this.#alert.show(qsTranslate("io", "Loaded file '%1'.").arg(basename))
- History.history.saved = true
+ this.emit(new LoadedEvent())
}
}
diff --git a/common/src/objs/bodephase.mjs b/common/src/objs/bodephase.mjs
index 9c93bba..800671e 100644
--- a/common/src/objs/bodephase.mjs
+++ b/common/src/objs/bodephase.mjs
@@ -63,7 +63,7 @@ export default class BodePhase extends ExecutableObject {
// Create new point
om_0 = Objects.createNewRegisteredObject("Point", [Objects.getNewName("ω"), this.color, "name"])
om_0.labelPosition = this.phase.execute() >= 0 ? "above" : "below"
- History.history.addToHistory(new CreateNewObject(om_0.name, "Point", om_0.export()))
+ History.addToHistory(new CreateNewObject(om_0.name, "Point", om_0.export()))
labelPosition = "below"
}
om_0.requiredBy.push(this)
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
index 8c3f2d1..f4e2f35 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
@@ -117,7 +117,7 @@ MenuBar {
icon.color: sysPalette.buttonText
onTriggered: {
var newObj = Modules.Objects.createNewRegisteredObject(modelData)
- history.addToHistory(new JS.HistoryLib.CreateNewObject(newObj.name, modelData, newObj.export()))
+ Modules.History.addToHistory(new JS.HistoryLib.CreateNewObject(newObj.name, modelData, newObj.export()))
objectLists.update()
}
}
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml
index d79cc84..aca7943 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml
@@ -225,7 +225,7 @@ Item {
imageDepth: Screen.devicePixelRatio,
fontSize: 14
})
- Modules.History.on("updated undone redone", () => {
+ Modules.History.on("cleared added undone redone", () => {
undoCount = Modules.History.undoStack.length
redoCount = Modules.History.redoStack.length
})
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml
index 51abb46..33967aa 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml
@@ -42,7 +42,7 @@ ApplicationWindow {
width: 1000
height: 500
color: sysPalette.window
- title: "LogarithmPlotter"
+ title: qsTr("untitled")
SystemPalette { id: sysPalette; colorGroup: SystemPalette.Active }
SystemPalette { id: sysPaletteIn; colorGroup: SystemPalette.Disabled }
@@ -50,9 +50,7 @@ ApplicationWindow {
menuBar: appMenu.trueItem
AppMenuBar {id: appMenu}
-
- History { id: history }
-
+
Popup.GreetScreen {}
Popup.Preferences {id: preferences}
@@ -185,7 +183,7 @@ ApplicationWindow {
}
onClosing: function(close) {
- if(!history.saved) {
+ if(!Modules.History.saved) {
close.accepted = false
appMenu.openSaveUnsavedChangesDialog()
}
@@ -254,8 +252,20 @@ ApplicationWindow {
if(evt.property === "saveFilename") {
const fileName = evt.newValue.split('/').pop().split('\\').pop()
if(fileName !== "")
- title = `${fileName}`
+ title = fileName
}
})
+ Modules.IO.on("saved loaded", (evt) => {
+ // Refreshing sidebar
+ console.log(evt.name)
+ updateObjectsLists()
+ if(title.endsWith("*"))
+ title = title.substring(0, title.length-1)
+ })
+ Modules.IO.on("modified", () => {
+ console.log("modified")
+ if(!title.endsWith("*"))
+ title = title+"*"
+ })
}
}
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml
index 57ea4ae..1ca75e4 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml
@@ -80,7 +80,7 @@ Repeater {
variables: propertyType.variables
onChanged: function(newExpr) {
if(obj[propertyName].toString() != newExpr.toString()) {
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
obj.name, objType, propertyName,
obj[propertyName], newExpr
))
@@ -123,7 +123,7 @@ Repeater {
// Ensuring old and new values are different to prevent useless adding to history.
if(obj[propertyName] != newValueParsed) {
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
obj.name, objType, propertyName,
obj[propertyName], newValueParsed
))
@@ -168,7 +168,7 @@ Repeater {
return obj[propertyName]
}
onClicked: {
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
obj.name, objType, propertyName,
obj[propertyName], this.checked
))
@@ -209,7 +209,9 @@ Repeater {
if(selectedObj == null) {
// Creating new object.
selectedObj = Modules.Objects.createNewRegisteredObject(propertyType.objType)
- history.addToHistory(new JS.HistoryLib.CreateNewObject(selectedObj.name, propertyType.objType, selectedObj.export()))
+ Modules.History.addToHistory(
+ new JS.HistoryLib.CreateNewObject(selectedObj.name, propertyType.objType, selectedObj.export())
+ )
baseModel = Modules.Objects.getObjectsName(propertyType.objType).concat(
isRealObject ? [qsTr("+ Create new %1").arg(Modules.Objects.types[propertyType.objType].displayType())] :
[])
@@ -219,14 +221,14 @@ Repeater {
//Modules.Objects.currentObjects[objType][objIndex].requiredBy = obj[propertyName].filter((obj) => obj.name != obj.name)
}
obj.requiredBy = obj.requiredBy.filter((obj) => obj.name != obj.name)
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
obj.name, objType, propertyName,
obj[propertyName], selectedObj
))
obj[propertyName] = selectedObj
} else if(baseModel[newIndex] != obj[propertyName]) {
// Ensuring new property is different to not add useless history entries.
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
obj.name, objType, propertyName,
obj[propertyName], baseModel[newIndex]
))
@@ -256,7 +258,7 @@ Repeater {
onChanged: {
var exported = exportModel()
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
obj.name, objType, propertyName,
obj[propertyName], exported
))
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml
index e2b149b..715602a 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml
@@ -112,7 +112,7 @@ Popup.BaseDialog {
if(newName in Modules.Objects.currentObjectsByName) {
invalidNameDialog.showDialog(newName)
} else {
- history.addToHistory(new JS.HistoryLib.NameChanged(
+ Modules.History.addToHistory(new JS.HistoryLib.NameChanged(
objEditor.obj.name, objEditor.objType, newName
))
Modules.Objects.renameObject(obj.name, newName)
@@ -127,13 +127,17 @@ Popup.BaseDialog {
id: labelContentProperty
height: 30
width: dlgProperties.width
- label: qsTr("Label content")
+ label: qsTranslate("prop", "labelContent")
model: [qsTr("null"), qsTr("name"), qsTr("name + value")]
property var idModel: ["null", "name", "name + value"]
icon: "common/label.svg"
currentIndex: idModel.indexOf(objEditor.obj.labelContent)
onActivated: function(newIndex) {
if(idModel[newIndex] != objEditor.obj.labelContent) {
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
+ obj.name, objType, "labelContent",
+ objEditor.obj.labelContent, idModel[newIndex]
+ ))
objEditor.obj.labelContent = idModel[newIndex]
objEditor.obj.update()
objectListList.update()
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml
index 7aa9574..e8d4912 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml
@@ -104,7 +104,9 @@ Column {
onClicked: {
let newObj = Modules.Objects.createNewRegisteredObject(modelData)
- history.addToHistory(new JS.HistoryLib.CreateNewObject(newObj.name, modelData, newObj.export()))
+ Modules.History.addToHistory(new JS.HistoryLib.CreateNewObject(
+ newObj.name, modelData, newObj.export()
+ ))
objectLists.update()
let hasXProp = newObj.constructor.properties().hasOwnProperty('x')
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml
index 5018e5e..9624d23 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml
@@ -72,7 +72,7 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 5
onClicked: {
- history.addToHistory(new JS.HistoryLib.EditedVisibility(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedVisibility(
obj.name, obj.type, this.checked
))
obj.visible = this.checked
@@ -212,7 +212,7 @@ Item {
selectedColor: obj.color
title: qsTr("Pick new color for %1 %2").arg(obj.constructor.displayType()).arg(obj.name)
onAccepted: {
- history.addToHistory(new JS.HistoryLib.ColorChanged(
+ Modules.History.addToHistory(new JS.HistoryLib.ColorChanged(
obj.name, obj.type, obj.color, selectedColor.toString()
))
obj.color = selectedColor.toString()
@@ -231,7 +231,7 @@ Item {
// Object still exists
// Temporary fix for objects require not being propertly updated.
object.requiredBy = []
- history.addToHistory(new JS.HistoryLib.DeleteObject(
+ Modules.History.addToHistory(new JS.HistoryLib.DeleteObject(
object.name, object.type, object.export()
))
Modules.Objects.deleteObject(object.name)
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml
index 680c310..b364e73 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml
@@ -115,7 +115,7 @@ Item {
let obj = Modules.Objects.currentObjectsByName[objName]
// Set values
if(parent.userPickX && parent.userPickY) {
- history.addToHistory(new JS.HistoryLib.EditedPosition(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedPosition(
objName, objType, obj[propertyX], newValueX, obj[propertyY], newValueY
))
obj[propertyX] = newValueX
@@ -124,7 +124,7 @@ Item {
objectLists.update()
pickerRoot.picked(obj)
} else if(parent.userPickX) {
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
objName, objType, propertyX, obj[propertyX], newValueX
))
obj[propertyX] = newValueX
@@ -132,7 +132,7 @@ Item {
objectLists.update()
pickerRoot.picked(obj)
} else if(parent.userPickY) {
- history.addToHistory(new JS.HistoryLib.EditedProperty(
+ Modules.History.addToHistory(new JS.HistoryLib.EditedProperty(
objName, objType, propertyY, obj[propertyY], newValueY
))
obj[propertyY] = newValueY