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
-
+
&Redo
&Wiederherstellen
-
+
&Copy plot
Grafik &Kopieren
-
+
&Preferences
&Einstellung
-
+
&Create
&Erstellen
@@ -123,52 +123,52 @@
Syntaktische Färbung
-
+
&Help
&Hilfe
-
+
&Source code
&Quellcode
-
+
&Report a bug
Fehler &Melden
-
+
&User manual
&Benutzerhandbuch
-
+
&Changelog
&Changelog
-
+
&Help translating!
&Hilfe beim Übersetzen!
-
+
&Thanks
&Danksagungen
-
+
&About
&Übrigens
-
+
Save unsaved changes?
Änderungen speichern?
-
+
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
Diese Grafik enthält ungespeicherte Änderungen. Dadurch gehen alle ungespeicherten Daten verloren. Fortfahren?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Create new %1
+ Neues %1objekt erstellen
-
+
Pick on graph
Aufnehmen auf Graph
@@ -238,9 +238,8 @@
Name
-
Label content
- Etikett
+ Etikett
@@ -405,24 +404,20 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
HistoryBrowser
-
Filter...
- Filtern…
+ Filtern…
-
Redo >
- Wiederherstellen >
+ Wiederherstellen >
-
> Now
- > Aktueller Stand
+ > Aktueller Stand
-
< Undo
- < Rückgängig
+ < Rückgängig
@@ -475,17 +470,17 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
Geladene Datei '%1'.
-
+
Copied plot screenshot to clipboard!
Grafik in die Zwischenablage kopiert!
-
+
&Update
&Aktualisieren
-
+
&Update LogarithmPlotter
LogarithmPlotter &aktualisieren
@@ -613,109 +608,109 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen"
Settings
-
+
X Zoom
Zoom auf X
-
+
Y Zoom
Zoom auf Y
-
+
Min X
Minimum X
-
+
Max Y
Maximum Y
-
+
Max X
Maximum X
-
+
Min Y
Minimum Y
-
+
X Axis Step
X-Achsen-Schritt
-
+
Y Axis Step
Y-Achsen-Schritt
-
+
Line width
Linienbreite
-
+
Text size (px)
Textgröße (px)
-
+
X Label
Etikett der X-Achse
-
+
Y Label
Etikett der Y-Achse
-
+
X Log scale
Logarithmische Skala in X
-
+
Show X graduation
X-Teilung anzeigen
-
+
Show Y graduation
Y-Teilung anzeigen
-
+
Copy to clipboard
Kopieren in die Zwischenablage
-
+
Save plot
Grafik speichern…
-
+
Save plot as
Grafik speichern unter…
-
+
Load plot
Grafik laden…
@@ -1160,7 +1155,7 @@ Evaluated expression: %3
Ausdruck analysiert: %3
-
+
Error while attempting to draw %1 %2:
%3
@@ -1191,7 +1186,7 @@ Evaluated expression: %3
Ausdruck analysiert: %3
-
+
LogarithmPlotter - Drawing error
LogarithmPlotter - Fehler
@@ -1308,27 +1303,27 @@ Ausdruck analysiert: %3
Verlauf
-
+
Saved plot to '%1'.
Gespeicherte Grafik auf '%1'.
-
+
Loading file '%1'.
Laden der Datei '%1'.
-
+
Unknown object type: %1.
Unbekannter Objekttyp: %1.
-
+
Invalid file provided.
Ungültige Datei angegeben.
-
+
Could not load file:
Datei konnte nicht geladen werden:
@@ -1337,7 +1332,7 @@ Ausdruck analysiert: %3
Die Datei konnte nicht gespeichert werden:
-
+
Loaded file '%1'.
Geladene Datei '%1'.
@@ -1731,6 +1726,11 @@ Bitte vergewissern Sie sich, dass Ihre LaTeX-Installation korrekt ist, und melde
color
Farbe
+
+
+ labelContent
+ 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
&Redo
-
+
&Copy plot
&Copy plot
-
+
&Preferences
&Preferences
-
+
&Create
&Create
@@ -123,52 +123,52 @@
Color Scheme
-
+
&Help
&Help
-
+
&Source code
&Source code
-
+
&Report a bug
&Report a bug
-
+
&User manual
&User manual
-
+
&Changelog
&Changelog
-
+
&Help translating!
&Help translating!
-
+
&Thanks
&Thanks
-
+
&About
&About
-
+
Save unsaved changes?
Save unsaved changes?
-
+
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Create new %1
+ Create new %1
-
+
Pick on graph
Pick on graph
@@ -238,9 +238,8 @@
Name
-
Label content
- Label content
+ Label content
@@ -405,24 +404,20 @@ These settings can be changed at any time from the "Settings" menu.
HistoryBrowser
-
Filter...
- Filter…
+ Filter…
-
Redo >
- Redo >
+ Redo >
-
> Now
- > Now
+ > Now
-
< Undo
- < 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!
Copied plot screenshot to clipboard!
-
+
&Update
&Update
-
+
&Update LogarithmPlotter
&Update LogarithmPlotter
@@ -613,109 +608,109 @@ These settings can be changed at any time from the "Settings" menu.Settings
-
+
X Zoom
X Zoom
-
+
Y Zoom
Y Zoom
-
+
Min X
Min X
-
+
Max Y
Max Y
-
+
Max X
Max X
-
+
Min Y
Min Y
-
+
X Axis Step
X Axis Step
-
+
Y Axis Step
Y Axis Step
-
+
Line width
Line width
-
+
Text size (px)
Text size (px)
-
+
X Label
X Label
-
+
Y Label
Y Label
-
+
X Log scale
X Log scale
-
+
Show X graduation
Show X graduation
-
+
Show Y graduation
Show Y graduation
-
+
Copy to clipboard
Copy to clipboard
-
+
Save plot
Save plot…
-
+
Save plot as
Save plot as…
-
+
Load plot
Open plot…
@@ -1160,7 +1155,7 @@ Evaluated expression: %3
Evaluated expression: %3
-
+
Error while attempting to draw %1 %2:
%3
@@ -1191,7 +1186,7 @@ Evaluated expression: %3
Evaluated expression: %3
-
+
LogarithmPlotter - Drawing error
LogarithmPlotter - Drawing error
@@ -1308,27 +1303,27 @@ Evaluated expression: %3
History
-
+
Saved plot to '%1'.
Saved plot to '%1'.
-
+
Loading file '%1'.
Loading file '%1'.
-
+
Unknown object type: %1.
Unknown object type: %1.
-
+
Invalid file provided.
Invalid file provided.
-
+
Could not load file:
Could not load file:
@@ -1337,7 +1332,7 @@ Evaluated expression: %3
Could not save file:
-
+
Loaded file '%1'.
Loaded file '%1'.
@@ -1731,6 +1726,11 @@ Please make sure your LaTeX installation is correct and report a bug if so.color
Color
+
+
+ labelContent
+ 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
-
+
&Redo
&Reiniciar
-
+
&Copy plot
&Copiar el gráfico
-
+
&Preferences
&Preferencias
-
+
&Create
&Crear
@@ -119,52 +119,52 @@
Esquema de colores
-
+
&Help
&Ayuda
-
+
&Source code
&Código fuente
-
+
&Report a bug
&Informar de un error
-
+
&User manual
&Manual del usuario
-
+
&Changelog
&Registro de cambios
-
+
&Help translating!
&¡Ayuda a la traducción!
-
+
&Thanks
&Agradecimientos
-
+
&About
&Acerca de
-
+
Save unsaved changes?
¿Guardar los cambios no guardados?
-
+
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
Este gráfico contiene cambios sin guardar. Al hacer esto, se perderán todos los datos no guardados. ¿Continuar?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Create new %1
+ Crear nuevo %1
-
+
Pick on graph
Elegir en el gráfico
@@ -237,11 +237,6 @@
Name
-
-
- Label content
-
-
null
@@ -405,24 +400,16 @@ Estos ajustes se pueden cambiar en cualquier momento desde el menú “Ajustes
HistoryBrowser
-
- Filter...
-
-
-
-
Redo >
- Rehacer >
+ Rehacer >
-
> Now
- > Ahora
+ > Ahora
-
< Undo
- < Deshacer
+ < Deshacer
@@ -451,17 +438,17 @@ Estos ajustes se pueden cambiar en cualquier momento desde el menú “Ajustes
Historial
-
+
Copied plot screenshot to clipboard!
¡Captura de pantalla del gráfico copiada al portapapeles!
-
+
&Update
&Actualizar
-
+
&Update LogarithmPlotter
&Actualizar LogarithmPlotter
@@ -613,109 +600,109 @@ Estos ajustes se pueden cambiar en cualquier momento desde el menú “Ajustes
Settings
-
+
X Zoom
-
+
Y Zoom
-
+
Min X
-
+
Max Y
-
+
Max X
-
+
Min Y
-
+
X Axis Step
Paso por eje X
-
+
Y Axis Step
Paso por eje Y
-
+
Line width
Anchura de la línea
-
+
Text size (px)
Tamaño del texto (px)
-
+
X Label
-
+
Y Label
-
+
X Log scale
Escala logarítmica en X
-
+
Show X graduation
Mostrar graduación del eje X
-
+
Show Y graduation
Mostrar graduación del eje Y
-
+
Copy to clipboard
Copiar al portapapeles
-
+
Save plot
Guardar gráfico…
-
+
Save plot as
Guardar gráfico como…
-
+
Load plot
Abrir gráfico…
@@ -1147,7 +1134,7 @@ Evaluated expression: %3
Expresión evaluada: %3
-
+
Error while attempting to draw %1 %2:
%3
@@ -1191,7 +1178,7 @@ Evaluated expression: %3
Expresión evaluada: %3
-
+
LogarithmPlotter - Drawing error
@@ -1320,27 +1307,27 @@ Expresión evaluada: %3
Objetos
-
+
Saved plot to '%1'.
Gráfico guardado en '%1'.
-
+
Loading file '%1'.
Cargando el archivo '%1'.
-
+
Unknown object type: %1.
Tipo de objeto desconocido: %1 .
-
+
Invalid file provided.
Se ha proporcionado un archivo no válido.
-
+
Could not load file:
No se pudo cargar el archivo:
@@ -1349,7 +1336,7 @@ Expresión evaluada: %3
No se ha podido guardar el archivo:
-
+
Loaded file '%1'.
Archivo cargado '%1'.
@@ -1731,6 +1718,11 @@ Por favor, asegúrese de que su instalación de LaTeX es correcta e informe de u
baseValues
Valores de inicialización
+
+
+ labelContent
+ 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
-
+
&Redo
&Rétablir
-
+
&Copy plot
&Copier le graphe
-
+
&Preferences
&Préférences
-
+
&Create
&Créer
@@ -124,52 +124,52 @@
Coloration Syntaxique
-
+
&Help
&Aide
-
+
&Source code
&Code source
-
+
&Report a bug
&Rapport de bug
-
+
&User manual
Manuel d'&utilisation
-
+
&Changelog
&Historique des modifications
-
+
&Help translating!
&Aider à la traduction !
-
+
&Thanks
&Remerciements
-
+
&About
&À propos
-
+
Save unsaved changes?
Sauvegarder les modifications ?
-
+
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
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
-
+
+ Create new %1
+ Créer un nouvel objet %1
-
+
Pick on graph
Prendre la position sur le graphe
@@ -239,9 +239,8 @@
Nom
-
Label content
- Étiquette
+ Étiquette
@@ -407,24 +406,20 @@ Ces paramètres peuvent être modifiés à tout moment à partir du menu "P
HistoryBrowser
-
Filter...
- Filtrer…
+ Filtrer…
-
Redo >
- Rétablir >
+ Rétablir >
-
> Now
- > État actuel
+ > État actuel
-
< Undo
- < Annuler
+ < Annuler
@@ -477,17 +472,17 @@ Ces paramètres peuvent être modifiés à tout moment à partir du menu "P
Fichier '%1' chargé.
-
+
Copied plot screenshot to clipboard!
Image du graphe copiée dans le presse-papiers !
-
+
&Update
&Mise à jour
-
+
&Update LogarithmPlotter
&Mettre à jour LogarithmPlotter
@@ -615,109 +610,109 @@ Ces paramètres peuvent être modifiés à tout moment à partir du menu "P
Settings
-
+
X Zoom
Zoom en X
-
+
Y Zoom
Zoom en Y
-
+
Min X
Min X
-
+
Max Y
Max Y
-
+
Max X
Max X
-
+
Min Y
Min Y
-
+
X Axis Step
Pas de l'axe X
-
+
Y Axis Step
Pas de l'axe Y
-
+
Line width
Taille des lignes
-
+
Text size (px)
Taille du texte (px)
-
+
X Label
Label de l'axe X
-
+
Y Label
Label de l'axe Y
-
+
X Log scale
Échelle logarithmique en X
-
+
Show X graduation
Montrer la graduation de l'axe X
-
+
Show Y graduation
Montrer la graduation de l'axe Y
-
+
Copy to clipboard
Copier vers le presse-papiers
-
+
Save plot
Sauvegarder le graphe…
-
+
Save plot as
Sauvegarder le graphe sous…
-
+
Load plot
Ouvrir un graphe…
@@ -1163,7 +1158,7 @@ Evaluated expression: %3
Formule analysée : %3
-
+
Error while attempting to draw %1 %2:
%3
@@ -1194,7 +1189,7 @@ Evaluated expression: %3
Formule analysée : %3
-
+
LogarithmPlotter - Drawing error
LogarithmPlotter - Erreur
@@ -1323,27 +1318,27 @@ Formule analysée : %3
&Mettre à jour LogarithmPlotter
-
+
Saved plot to '%1'.
Graphe sauvegardé dans '%1'.
-
+
Loading file '%1'.
Chargement du fichier '%1'.
-
+
Unknown object type: %1.
Type d'objet inconnu : %1.
-
+
Invalid file provided.
Fichier fourni invalide.
-
+
Could not load file:
Impossible de charger le fichier :
@@ -1352,7 +1347,7 @@ Formule analysée : %3
Impossible de sauvegarder le fichier :
-
+
Loaded file '%1'.
Fichier '%1' chargé.
@@ -1734,6 +1729,11 @@ Vérifiez que votre installation de LaTeX est correcte et signalez un bogue si c
color
Couleur
+
+
+ labelContent
+ É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
-
+
&Redo
&Ismétlés
-
+
&Copy plot
Ábra má&solása
-
+
&Preferences
&Beállítások
-
+
&Create
&Létrehozás
@@ -123,52 +123,52 @@
Színséma
-
+
&Help
&Súgó
-
+
&Source code
&Forráskód
-
+
&Report a bug
&Hiba bejelentése
-
+
&User manual
&Használati utasítás
-
+
&Changelog
&Változásnapló
-
+
&Help translating!
&Segítség a fordításban!
-
+
&Thanks
&Köszönjük
-
+
&About
&Névjegy
-
+
Save unsaved changes?
Menti a változtatásokat?
-
+
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
Ez az ábra nem mentett változtatásokat tartalmaz. Ezzel az összes nem mentett adat elveszik. Folytatja?
@@ -205,12 +205,12 @@
CustomPropertyList
-
+
+ Create new %1
+ Új %1 létrehozása
-
+
Pick on graph
Ábra kijelölése
@@ -238,9 +238,8 @@
Név
-
Label content
- 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
-
Filter...
- Szűrő…
+ Szűrő…
-
Redo >
- Ismétlés >
+ Ismétlés >
-
> Now
- > Most
+ > Most
-
< Undo
- < 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.
-
+
Copied plot screenshot to clipboard!
Ábra képernyőkép vágólapra másolva!
-
+
&Update
&Frissítés
-
+
&Update LogarithmPlotter
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 Zoom
X-nagyítás
-
+
Y Zoom
Y-nagyítás
-
+
Min X
Legkisebb X
-
+
Max Y
Legnagyobb Y
-
+
Max X
Legnagyobb X
-
+
Min Y
Legkisebb Y
-
+
X Axis Step
X tengely lépésköze
-
+
Y Axis Step
Y tengely lépésköze
-
+
Line width
Vonalvastagság
-
+
Text size (px)
Szövegméret (képpont)
-
+
X Label
X címke
-
+
Y Label
Y címke
-
+
X Log scale
X tengely logaritmikus skálával
-
+
Show X graduation
X érettségi megjelenítése
-
+
Show Y graduation
Y érettségi megjelenítése
-
+
Copy to clipboard
Másolás a vágólapra
-
+
Save plot
Ábra mentése…
-
+
Save plot as
Ábra mentése másként…
-
+
Load plot
Ábra megnyitása…
@@ -1160,7 +1155,7 @@ Evaluated expression: %3
Kiértékelt kifejezés: %3
-
+
Error while attempting to draw %1 %2:
%3
@@ -1191,7 +1186,7 @@ Evaluated expression: %3
Kiértékelt kifejezés: %3
-
+
LogarithmPlotter - Drawing error
LogarithmPlotter - Rajzolási hiba
@@ -1304,27 +1299,27 @@ Kiértékelt kifejezés: %3
Előzmények
-
+
Saved plot to '%1'.
Ábra mentve ide: „%1”.
-
+
Loading file '%1'.
A(z) „%1” fájl betöltése folyamatban van.
-
+
Unknown object type: %1.
Ismeretlen objektumtípus: %1.
-
+
Invalid file provided.
A megadott fájl érvénytelen.
-
+
Could not load file:
@@ -1333,7 +1328,7 @@ Kiértékelt kifejezés: %3
A fájl mentése nem sikerült:
-
+
Loaded file '%1'.
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
color
Szín
+
+
+ labelContent
+ 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
-
+
&Redo
&Gjenta
-
+
&Copy plot
&Kopier plott
-
+
&Preferences
-
+
&Create
&Opprett
@@ -99,52 +99,52 @@
Tilbakestill angrehistorikk automatisk
-
+
&Help
&Hjelp
-
+
&Source code
-
+
&Report a bug
&Rapporter en feil
-
+
&User manual
-
+
&Changelog
&Endringslogg
-
+
&Help translating!
&Hjelp til å oversette!
-
+
&Thanks
&Erkjennelser
-
+
&About
&Om
-
+
Save unsaved changes?
Lagre ikke-lagrede endringer?
-
+
This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?
Dette plottet inneholder ikke-lagrede endringer. Hvis du gjør dette, vil alle ikke-lagrede data gå tapt. Fortsette?
@@ -181,12 +181,12 @@
CustomPropertyList
-
+
+ Create new %1
+ Opprett nytt %1
-
+
Pick on graph
@@ -214,9 +214,8 @@
Navn
-
Label content
- Etikett-innhold
+ Etikett-innhold
@@ -361,24 +360,16 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.
HistoryBrowser
-
- Filter...
-
-
-
-
Redo >
- Angre >
+ Angre >
-
> Now
- > Nå
+ > Nå
-
< Undo
- < Angre
+ < Angre
@@ -431,17 +422,17 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.Lastet inn filen «%1».
-
+
Copied plot screenshot to clipboard!
Kopierte plott-skjermavbildning til utklippstavlen!
-
+
&Update
&Oppdater
-
+
&Update LogarithmPlotter
&Installer ny versjon av LogartimePlotter
@@ -569,109 +560,109 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.Settings
-
+
X Zoom
X-forstørrelse
-
+
Y Zoom
Y-forstørrelse
-
+
Min X
Min. X
-
+
Max Y
Maks. Y
-
+
Max X
Maks. X
-
+
Min Y
Min. Y
-
+
X Axis Step
X-aksesteg
-
+
Y Axis Step
Y-aksesteg
-
+
Line width
Linjebredde
-
+
Text size (px)
Tekststørrelse (piksler)
-
+
X Label
Navn på X-akse
-
+
Y Label
Navn på Y-akse
-
+
X Log scale
Logaritmisk skala i x
-
+
Show X graduation
Vis X-inndeling
-
+
Show Y graduation
Vis Y-inndeling
-
+
Copy to clipboard
Kopier til utklippstavle
-
+
Save plot
Lagre plott
-
+
Save plot as
Lagre plott som
-
+
Load plot
Last inn plott
@@ -971,7 +962,7 @@ Evaluated expression: %3
-
+
Error while attempting to draw %1 %2:
%3
@@ -1122,7 +1113,7 @@ Evaluated expression: %3
-
+
LogarithmPlotter - Drawing error
@@ -1235,27 +1226,27 @@ Evaluated expression: %3
Historikk
-
+
Saved plot to '%1'.
Lagret plott i «%1».
-
+
Loading file '%1'.
Laster inn «%1»-fil.
-
+
Unknown object type: %1.
Ukjent objekttype: %1.
-
+
Invalid file provided.
Ugyldig fil angitt.
-
+
Could not load file:
@@ -1264,7 +1255,7 @@ Evaluated expression: %3
Kunne ikke lagre fil:
-
+
Loaded file '%1'.
Lastet inn filen «%1».
@@ -1641,6 +1632,11 @@ Please make sure your latex installation is correct and report a bug if so.targetValuePosition
+
+
+ labelContent
+ 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 @@
-
+
&Redo
-
+
&Copy plot
-
+
&Preferences
-
+
&Create
-
+
&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?
@@ -162,12 +162,12 @@
CustomPropertyList
-
+
+ Create new %1
-
+
Pick on graph
@@ -194,11 +194,6 @@
Name
-
-
- Label content
-
-
null
@@ -294,29 +289,6 @@
-
- HistoryBrowser
-
-
- Filter...
-
-
-
-
- Redo >
-
-
-
-
- > Now
-
-
-
-
- < Undo
-
-
-
ListSetting
@@ -343,17 +315,17 @@
-
+
Copied plot screenshot to clipboard!
-
+
&Update
-
+
&Update LogarithmPlotter
@@ -457,109 +429,109 @@
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
@@ -859,7 +831,7 @@ Evaluated expression: %3
-
+
Error while attempting to draw %1 %2:
%3
@@ -1010,7 +982,7 @@ Evaluated expression: %3
-
+
LogarithmPlotter - Drawing error
@@ -1069,32 +1041,32 @@ Evaluated expression: %3
io
-
+
Saved plot to '%1'.
-
+
Loading file '%1'.
-
+
Unknown object type: %1.
-
+
Invalid file provided.
-
+
Could not load file:
-
+
Loaded file '%1'.
@@ -1448,6 +1420,11 @@ Please make sure your latex installation is correct and report a bug if so.targetValuePosition
+
+
+ labelContent
+
+
sequence
diff --git a/common/src/events.mjs b/common/src/events.mjs
index 4e95db6..dbdd00f 100644
--- a/common/src/events.mjs
+++ b/common/src/events.mjs
@@ -54,29 +54,40 @@ export class BaseEventEmitter {
* @param {function(BaseEvent)} eventListener - The function to be called back when the event is emitted.
*/
on(eventType, eventListener) {
- if(!this.constructor.emits.includes(eventType)) {
- const className = this.constructor.name
- const eventTypes = this.constructor.emits.join(", ")
- throw new Error(`Cannot listen to unknown event ${eventType} in class ${className}. ${className} only emits: ${eventTypes}`)
+ if(eventType.includes(" ")) // Listen to several different events with the same listener.
+ for(const type of eventType.split(" "))
+ this.on(type, eventListener)
+ else {
+ if(!this.constructor.emits.includes(eventType)) {
+ const className = this.constructor.name
+ const eventTypes = this.constructor.emits.join(", ")
+ throw new Error(`Cannot listen to unknown event ${eventType} in class ${className}. ${className} only emits: ${eventTypes}`)
+ }
+ if(!this.#listeners[eventType].has(eventListener))
+ this.#listeners[eventType].add(eventListener)
}
- if(!this.#listeners[eventType].has(eventListener))
- this.#listeners[eventType].add(eventListener)
}
/**
- * Remvoes a listener from an event that can be emitted by this object.
+ * Removes a listener from an event that can be emitted by this object.
*
* @param {string} eventType - Name of the event that was listened to. Throws an error if this object does not emit this kind of event.
* @param {function(BaseEvent)} eventListener - The function previously registered as a listener.
* @returns {boolean} True if the listener was removed, false if it was not found.
*/
off(eventType, eventListener) {
- if(!this.constructor.emits.includes(eventType)) {
- const className = this.constructor.name
- const eventTypes = this.constructor.emits.join(", ")
- throw new Error(`Cannot listen to unknown event ${eventType} in class ${className}. ${className} only emits: ${eventTypes}`)
+ if(eventType.includes(" ")) { // Unlisten to several different events with the same listener.
+ let found = false
+ for(const type of eventType.split(" "))
+ found ||= this.off(eventType, eventListener)
+ } else {
+ if(!this.constructor.emits.includes(eventType)) {
+ const className = this.constructor.name
+ const eventTypes = this.constructor.emits.join(", ")
+ throw new Error(`Cannot listen to unknown event ${eventType} in class ${className}. ${className} only emits: ${eventTypes}`)
+ }
+ return this.#listeners[eventType].delete(eventListener)
}
- return this.#listeners[eventType].delete(eventListener)
}
/**
diff --git a/common/src/lib/polyfills/js.mjs b/common/src/lib/polyfills/js.mjs
index b412716..f8b910b 100644
--- a/common/src/lib/polyfills/js.mjs
+++ b/common/src/lib/polyfills/js.mjs
@@ -67,6 +67,19 @@ function stringReplaceAll(from, to) {
return this.split(from).join(to)
}
+/**
+ * Returns the value of an element of the array at a given index.
+ * Accepts negative indexes.
+ * @this {Array|string}
+ * @param {number} index
+ * @return {*}
+ */
+function arrayAt(index) {
+ if(typeof index !== "number")
+ throw new Error(`${index} is not a number`)
+ return index >= 0 ? this[index] : this[this.length + index]
+}
+
const polyfills = {
2017: [
@@ -95,8 +108,8 @@ const polyfills = {
[String.prototype, "replaceAll", stringReplaceAll]
],
2022: [
- [Array.prototype, "at", notPolyfilled("Array.prototype.at")],
- [String.prototype, "at", notPolyfilled("String.prototype.at")],
+ [Array.prototype, "at", arrayAt],
+ [String.prototype, "at", arrayAt],
[Object, "hasOwn", notPolyfilled("Object.hasOwn")]
],
2023: [
diff --git a/common/src/module/history.mjs b/common/src/module/history.mjs
index 8cd3f60..6e32fed 100644
--- a/common/src/module/history.mjs
+++ b/common/src/module/history.mjs
@@ -17,60 +17,164 @@
*/
import { Module } from "./common.mjs"
-import { HistoryInterface, NUMBER, STRING } from "./interface.mjs"
+import { HelperInterface, HistoryInterface, NUMBER, STRING } from "./interface.mjs"
+import { BaseEvent } from "../events.mjs"
+import { Action, Actions } from "../history/index.mjs"
+
+class ClearedEvent extends BaseEvent {
+ constructor() {
+ super("cleared")
+ }
+}
+
+class LoadedEvent extends BaseEvent {
+ constructor() {
+ super("loaded")
+ }
+}
+
+class AddedEvent extends BaseEvent {
+ constructor(action) {
+ super("added")
+ this.action = action
+ }
+}
+
+class UndoneEvent extends BaseEvent {
+ constructor(action) {
+ super("undone")
+ this.undid = action
+ }
+}
+
+class RedoneEvent extends BaseEvent {
+ constructor(action) {
+ super("redone")
+ this.redid = action
+ }
+}
+
class HistoryAPI extends Module {
+ static emits = ["cleared", "loaded", "added", "undone", "redone"]
+
+ #helper
+
constructor() {
super("History", {
- historyObj: HistoryInterface,
+ helper: HelperInterface,
themeTextColor: STRING,
imageDepth: NUMBER,
fontSize: NUMBER
})
// History QML object
- this.history = null
+ /** @type {Action[]} */
+ this.undoStack = []
+ /** @type {Action[]} */
+ this.redoStack = []
+
this.themeTextColor = "#FF0000"
this.imageDepth = 2
this.fontSize = 28
}
- initialize({ historyObj, themeTextColor, imageDepth, fontSize }) {
- super.initialize({ historyObj, themeTextColor, imageDepth, fontSize })
- this.history = historyObj
+ /**
+ * @param {HelperInterface} historyObj
+ * @param {string} themeTextColor
+ * @param {number} imageDepth
+ * @param {number} fontSize
+ */
+ initialize({ helper, themeTextColor, imageDepth, fontSize }) {
+ super.initialize({ helper, themeTextColor, imageDepth, fontSize })
+ this.#helper = helper
this.themeTextColor = themeTextColor
this.imageDepth = imageDepth
this.fontSize = fontSize
}
+ /**
+ * Undoes the Action at the top of the undo stack and pushes it to the top of the redo stack.
+ */
undo() {
if(!this.initialized) throw new Error("Attempting undo before initialize!")
- this.history.undo()
+ if(this.undoStack.length > 0) {
+ const action = this.undoStack.pop()
+ action.undo()
+ this.redoStack.push(action)
+ this.emit(new UndoneEvent(action))
+ }
}
+ /**
+ * Redoes the Action at the top of the redo stack and pushes it to the top of the undo stack.
+ */
redo() {
if(!this.initialized) throw new Error("Attempting redo before initialize!")
- this.history.redo()
+ if(this.redoStack.length > 0) {
+ const action = this.redoStack.pop()
+ action.redo()
+ this.undoStack.push(action)
+ this.emit(new RedoneEvent(action))
+ }
}
+ /**
+ * Clears both undo and redo stacks completely.
+ */
clear() {
if(!this.initialized) throw new Error("Attempting clear before initialize!")
- this.history.clear()
+ this.undoStack = []
+ this.redoStack = []
+ this.emit(new ClearedEvent())
}
+ /**
+ * Adds an instance of HistoryLib.Action to history.
+ * @param action
+ */
addToHistory(action) {
if(!this.initialized) throw new Error("Attempting addToHistory before initialize!")
- this.history.addToHistory(action)
+ if(action instanceof Action) {
+ console.log("Added new entry to history: " + action.getReadableString())
+ this.undoStack.push(action)
+ if(this.#helper.getSettingBool("reset_redo_stack"))
+ this.redoStack = []
+ this.emit(new AddedEvent(action))
+ }
}
- unserialize(...data) {
+ /**
+ * Unserializes both the undo stack and redo stack from serialized content.
+ * @param {[string, any[]][]} undoSt
+ * @param {[string, any[]][]} redoSt
+ */
+ unserialize(undoSt, redoSt) {
if(!this.initialized) throw new Error("Attempting unserialize before initialize!")
- this.history.unserialize(...data)
+ this.clear()
+ for(const [name, args] of undoSt)
+ this.undoStack.push(
+ new Actions[name](...args)
+ )
+ for(const [name, args] of redoSt)
+ this.redoStack.push(
+ new Actions[name](...args)
+ )
+ this.emit(new LoadedEvent())
}
+ /**
+ * Serializes history into JSON-able content.
+ * @return {[[string, any[]], [string, any[]]]}
+ */
serialize() {
if(!this.initialized) throw new Error("Attempting serialize before initialize!")
- return this.history.serialize()
+ let undoSt = [], redoSt = [];
+ for(const action of this.undoStack)
+ undoSt.push([ action.type(), action.export() ])
+ for(const action of this.redoStack)
+ redoSt.push([ action.type(), action.export() ])
+ return [undoSt, redoSt]
}
}
diff --git a/common/src/module/interface.mjs b/common/src/module/interface.mjs
index 606ec4d..db65ea2 100644
--- a/common/src/module/interface.mjs
+++ b/common/src/module/interface.mjs
@@ -60,24 +60,6 @@ export class Interface {
}
-export class SettingsInterface extends Interface {
- width = NUMBER
- height = NUMBER
- xmin = NUMBER
- ymax = NUMBER
- xzoom = NUMBER
- yzoom = NUMBER
- xaxisstep = STRING
- yaxisstep = STRING
- xlabel = STRING
- ylabel = STRING
- linewidth = NUMBER
- textsize = NUMBER
- logscalex = BOOLEAN
- showxgrad = BOOLEAN
- showygrad = BOOLEAN
-}
-
export class CanvasInterface extends Interface {
imageLoaders = OBJECT
/** @type {function(string): CanvasRenderingContext2D} */
@@ -97,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 0b4c6fa..472b061 100644
--- a/common/src/module/io.mjs
+++ b/common/src/module/io.mjs
@@ -21,27 +21,59 @@ import Objects from "./objects.mjs"
import History from "./history.mjs"
import Canvas from "./canvas.mjs"
import Settings from "./settings.mjs"
-import { DialogInterface, RootInterface, SettingsInterface } from "./interface.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))
+ 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 +124,8 @@ 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.#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,8 @@ class IOAPI extends Module {
}
Canvas.redraw()
this.#alert.show(qsTranslate("io", "Loaded file '%1'.").arg(basename))
- History.history.saved = true
+ this.#saved = true
+ this.emit(new LoadedEvent())
}
}
diff --git a/common/src/module/settings.mjs b/common/src/module/settings.mjs
index 44a6593..1530839 100644
--- a/common/src/module/settings.mjs
+++ b/common/src/module/settings.mjs
@@ -72,7 +72,11 @@ class SettingsAPI extends Module {
helper: HelperInterface
})
}
-
+
+ /**
+ *
+ * @param {HelperInterface} helper
+ */
initialize({ helper }) {
super.initialize({ helper })
// Initialize default values.
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 f26fd5b..f4e2f35 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml
@@ -76,18 +76,16 @@ MenuBar {
Action {
text: qsTr("&Undo")
shortcut: StandardKey.Undo
- onTriggered: history.undo()
+ onTriggered: Modules.History.undo()
icon.name: 'edit-undo'
icon.color: enabled ? sysPalette.windowText : sysPaletteIn.windowText
- enabled: history.undoCount > 0
}
Action {
text: qsTr("&Redo")
shortcut: StandardKey.Redo
- onTriggered: history.redo()
+ onTriggered: Modules.History.redo()
icon.name: 'edit-redo'
icon.color: enabled ? sysPalette.windowText : sysPaletteIn.windowText
- enabled: history.redoCount > 0
}
Action {
text: qsTr("&Copy plot")
@@ -119,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/History.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/History.qml
deleted file mode 100644
index 47db5f3..0000000
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/History.qml
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and distribution functions.
- * Copyright (C) 2021-2024 Ad5001
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-import QtQuick
-import QtQml
-import QtQuick.Window
-import "../js/index.mjs" as JS
-
-/*!
- \qmltype History
- \inqmlmodule eu.ad5001.LogarithmPlotter.History
- \brief QObject holding persistantly for undo & redo stacks.
-
- \sa HistoryBrowser, HistoryLib
-*/
-Item {
- // Using a QtObject is necessary in order to have proper property propagation in QML
- id: historyObj
-
- /*!
- \qmlproperty int History::undoCount
- Count of undo actions.
- */
- property int undoCount: 0
- /*!
- \qmlproperty int History::redoCount
- Count of redo actions.
- */
- property int redoCount: 0
- /*!
- \qmlproperty var History::undoStack
- Stack of undo actions.
- */
- property var undoStack: []
- /*!
- \qmlproperty var History::redoStack
- Stack of redo actions.
- */
- property var redoStack: []
- /*!
- \qmlproperty bool History::saved
- true when no modification was done to the current working file, false otherwise.
- */
- property bool saved: true
-
-
- /*!
- \qmlmethod void History::clear()
- Clears both undo and redo stacks completly.
- */
- function clear() {
- undoCount = 0
- redoCount = 0
- undoStack = []
- redoStack = []
- }
-
-
- /*!
- \qmlmethod var History::serialize()
- Serializes history into JSON-able content.
- */
- function serialize() {
- let undoSt = [], redoSt = [];
- for(let i = 0; i < undoCount; i++)
- undoSt.push([
- undoStack[i].type(),
- undoStack[i].export()
- ]);
- for(let i = 0; i < redoCount; i++)
- redoSt.push([
- redoStack[i].type(),
- redoStack[i].export()
- ]);
- return [undoSt, redoSt]
- }
-
- /*!
- \qmlmethod void History::unserialize(var undoSt, var redoSt)
- Unserializes both \c undoSt stack and \c redoSt stack from serialized content.
- */
- function unserialize(undoSt, redoSt) {
- clear();
- for(let i = 0; i < undoSt.length; i++)
- undoStack.push(new JS.HistoryLib.Actions[undoSt[i][0]](...undoSt[i][1]))
- for(let i = 0; i < redoSt.length; i++)
- redoStack.push(new JS.HistoryLib.Actions[redoSt[i][0]](...redoSt[i][1]))
- undoCount = undoSt.length;
- redoCount = redoSt.length;
- objectLists.update()
- }
-
- /*!
- \qmlmethod void History::addToHistory(var action)
- Adds an instance of HistoryLib.Action to history.
- */
- function addToHistory(action) {
- if(action instanceof JS.HistoryLib.Action) {
- console.log("Added new entry to history: " + action.getReadableString())
- undoStack.push(action)
- undoCount++;
- if(Helper.getSettingBool("reset_redo_stack")) {
- redoStack = []
- redoCount = 0
- }
- saved = false
- }
- }
-
- /*!
- \qmlmethod void History::undo(bool updateObjectList = true)
- Undoes the HistoryLib.Action at the top of the undo stack and pushes it to the top of the redo stack.
- By default, will update the graph and the object list. This behavior can be disabled by setting the \c updateObjectList to false.
- */
- function undo(updateObjectList = true) {
- if(undoStack.length > 0) {
- var action = undoStack.pop()
- action.undo()
- if(updateObjectList)
- objectLists.update()
- redoStack.push(action)
- undoCount--;
- redoCount++;
- saved = false
- }
- }
-
- /*!
- \qmlmethod void History::redo(bool updateObjectList = true)
- Redoes the HistoryLib.Action at the top of the redo stack and pushes it to the top of the undo stack.
- By default, will update the graph and the object list. This behavior can be disabled by setting the \c updateObjectList to false.
- */
- function redo(updateObjectList = true) {
- if(redoStack.length > 0) {
- var action = redoStack.pop()
- action.redo()
- if(updateObjectList)
- objectLists.update()
- undoStack.push(action)
- undoCount++;
- redoCount--;
- saved = false
- }
- }
-
- /*!
- \qmlmethod void History::undoMultipleDefered(int toUndoCount)
- Undoes several HistoryLib.Action at the top of the undo stack and pushes them to the top of the redo stack.
- It undoes them deferedly to avoid overwhelming the computer while creating a cool short accelerated summary of all changes.
- */
- function undoMultipleDefered(toUndoCount) {
- undoTimer.toUndoCount = toUndoCount;
- undoTimer.start()
- if(toUndoCount > 0)
- saved = false
- }
-
-
- /*!
- \qmlmethod void History::redoMultipleDefered(int toRedoCount)
- Redoes several HistoryLib.Action at the top of the redo stack and pushes them to the top of the undo stack.
- It redoes them deferedly to avoid overwhelming the computer while creating a cool short accelerated summary of all changes.
- */
- function redoMultipleDefered(toRedoCount) {
- redoTimer.toRedoCount = toRedoCount;
- redoTimer.start()
- if(toRedoCount > 0)
- saved = false
- }
-
- Timer {
- id: undoTimer
- interval: 5; running: false; repeat: true
- property int toUndoCount: 0
- onTriggered: {
- if(toUndoCount > 0) {
- historyObj.undo(toUndoCount % 4 == 1) // Only redraw once every 4 changes.
- toUndoCount--;
- } else {
- running = false;
- }
- }
- }
-
- Timer {
- id: redoTimer
- interval: 5; running: false; repeat: true
- property int toRedoCount: 0
- onTriggered: {
- if(toRedoCount > 0) {
- historyObj.redo(toRedoCount % 4 == 1) // Only redraw once every 4 changes.
- toRedoCount--;
- } else {
- running = false;
- }
- }
- }
-
- Component.onCompleted: {
- Modules.History.initialize({
- historyObj,
- themeTextColor: sysPalette.windowText.toString(),
- imageDepth: Screen.devicePixelRatio,
- fontSize: 14
- })
- }
-}
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 926b42a..eb84340 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml
@@ -16,6 +16,8 @@
* along with this program. If not, see .
*/
+pragma ComponentBehavior: Bound
+
import QtQuick.Controls
import QtQuick
import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting
@@ -46,6 +48,18 @@ Item {
true when the system is running with a dark theme, false otherwise.
*/
property bool darkTheme: isDarkTheme()
+
+ /*!
+ \qmlproperty int HistoryBrowser::undoCount
+ Number of actions in the undo stack.
+ */
+ property int undoCount: 0
+
+ /*!
+ \qmlproperty int HistoryBrowser::redoCount
+ Number of actions in the redo stack.
+ */
+ property int redoCount: 0
Setting.TextSetting {
id: filterInput
@@ -76,19 +90,22 @@ Item {
id: redoColumn
anchors.right: parent.right
anchors.top: parent.top
- width: actionWidth
+ width: historyBrowser.actionWidth
Repeater {
- model: history.redoCount
+ model: historyBrowser.redoCount
HistoryItem {
id: redoButton
- width: actionWidth
+ width: historyBrowser.actionWidth
//height: actionHeight
isRedo: true
- idx: index
darkTheme: historyBrowser.darkTheme
hidden: !(filterInput.value == "" || content.includes(filterInput.value))
+ onClicked: {
+ redoTimer.toRedoCount = Modules.History.redoStack.length-index
+ redoTimer.start()
+ }
}
}
}
@@ -101,14 +118,14 @@ Item {
transform: Rotation { origin.x: 30; origin.y: 30; angle: 270}
height: 70
width: 20
- visible: history.redoCount > 0
+ visible: historyBrowser.redoCount > 0
}
Rectangle {
id: nowRect
anchors.right: parent.right
anchors.top: redoColumn.bottom
- width: actionWidth
+ width: historyBrowser.actionWidth
height: 40
color: sysPalette.highlight
Text {
@@ -124,20 +141,24 @@ Item {
id: undoColumn
anchors.right: parent.right
anchors.top: nowRect.bottom
- width: actionWidth
+ width: historyBrowser.actionWidth
Repeater {
- model: history.undoCount
+ model: historyBrowser.undoCount
HistoryItem {
id: undoButton
- width: actionWidth
+ width: historyBrowser.actionWidth
//height: actionHeight
isRedo: false
- idx: index
darkTheme: historyBrowser.darkTheme
hidden: !(filterInput.value == "" || content.includes(filterInput.value))
+
+ onClicked: {
+ undoTimer.toUndoCount = +index+1
+ undoTimer.start()
+ }
}
}
}
@@ -150,7 +171,39 @@ Item {
transform: Rotation { origin.x: 30; origin.y: 30; angle: 270}
height: 60
width: 20
- visible: history.undoCount > 0
+ visible: historyBrowser.undoCount > 0
+ }
+ }
+ }
+
+ Timer {
+ id: undoTimer
+ interval: 5; running: false; repeat: true
+ property int toUndoCount: 0
+ onTriggered: {
+ if(toUndoCount > 0) {
+ Modules.History.undo()
+ if(toUndoCount % 3 === 1)
+ Modules.Canvas.requestPaint()
+ toUndoCount--;
+ } else {
+ running = false;
+ }
+ }
+ }
+
+ Timer {
+ id: redoTimer
+ interval: 5; running: false; repeat: true
+ property int toRedoCount: 0
+ onTriggered: {
+ if(toRedoCount > 0) {
+ Modules.History.redo()
+ if(toRedoCount % 3 === 1)
+ Modules.Canvas.requestPaint()
+ toRedoCount--;
+ } else {
+ running = false;
}
}
}
@@ -163,6 +216,18 @@ Item {
let hex = sysPalette.windowText.toString()
// We only check the first parameter, as on all normal OSes, text color is grayscale.
return parseInt(hex.substr(1,2), 16) > 128
-
+ }
+
+ Component.onCompleted: {
+ Modules.History.initialize({
+ helper: Helper,
+ themeTextColor: sysPalette.windowText.toString(),
+ imageDepth: Screen.devicePixelRatio,
+ fontSize: 14
+ })
+ Modules.History.on("cleared loaded added undone redone", () => {
+ undoCount = Modules.History.undoStack.length
+ redoCount = Modules.History.redoStack.length
+ })
}
}
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryItem.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryItem.qml
index f1e20a0..f37eb3b 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryItem.qml
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryItem.qml
@@ -41,17 +41,17 @@ Button {
\qmlproperty bool HistoryItem::isRedo
true if the action is in the redo stack, false othewise.
*/
- property bool isRedo
+ required property bool isRedo
/*!
- \qmlproperty int HistoryItem::idx
+ \qmlproperty int HistoryItem::index
Index of the item within the HistoryBrowser list.
*/
- property int idx
+ required property int index
/*!
\qmlproperty bool HistoryItem::darkTheme
true when the system is running with a dark theme, false otherwise.
*/
- property bool darkTheme
+ required property bool darkTheme
/*!
\qmlproperty bool HistoryItem::hidden
true when the item is filtered out, false otherwise.
@@ -61,7 +61,7 @@ Button {
\qmlproperty int HistoryItem::historyAction
Associated history action.
*/
- readonly property var historyAction: isRedo ? history.redoStack[idx] : history.undoStack[history.undoCount-idx-1]
+ readonly property var historyAction: isRedo ? Modules.History.redoStack.at(index) : Modules.History.undoStack.at(-index-1)
/*!
\qmlproperty int HistoryItem::actionHeight
@@ -147,13 +147,6 @@ Button {
ToolTip.visible: hovered
ToolTip.delay: 200
ToolTip.text: content
-
- onClicked: {
- if(isRedo)
- history.redoMultipleDefered(history.redoCount-idx)
- else
- history.undoMultipleDefered(+idx+1)
- }
}
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir
index 4f011a5..7f8a628 100644
--- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir
+++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir
@@ -1,5 +1,4 @@
module eu.ad5001.LogarithmPlotter.History
-History 1.0 History.qml
HistoryBrowser 1.0 HistoryBrowser.qml
HistoryItem 1.0 HistoryItem.qml
diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml
index 51abb46..e7cfc1a 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.IO.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