From 40743e54c37b32c0f994f33b0251627a058f32ea Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Wed, 24 May 2023 08:00:58 +0200 Subject: [PATCH] Allow the user to choose what he wants to pick. Updating translations. --- LogarithmPlotter/i18n/lp_de.ts | 94 ++++++++++++------- LogarithmPlotter/i18n/lp_en.ts | 94 ++++++++++++------- LogarithmPlotter/i18n/lp_es.ts | 90 +++++++++++------- LogarithmPlotter/i18n/lp_fr.ts | 94 ++++++++++++------- LogarithmPlotter/i18n/lp_hu.ts | 94 ++++++++++++------- LogarithmPlotter/i18n/lp_nb_NO.ts | 94 ++++++++++++------- LogarithmPlotter/i18n/lp_template.ts | 90 +++++++++++------- .../LogarithmPlotter/PickLocationOverlay.qml | 64 +++++++++---- 8 files changed, 474 insertions(+), 240 deletions(-) diff --git a/LogarithmPlotter/i18n/lp_de.ts b/LogarithmPlotter/i18n/lp_de.ts index c762813..c50b71b 100644 --- a/LogarithmPlotter/i18n/lp_de.ts +++ b/LogarithmPlotter/i18n/lp_de.ts @@ -569,25 +569,44 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen" PickLocationOverlay - + Pointer precision: Genauigkeit des Zeigers: - Snap to grid - Am Gitter einrasten + Am Gitter einrasten - + + Snap to grid: + + + + + Pick X + + + + + Pick Y + + + + Open picker settings Zeigereinstellungen öffnen - + Hide picker settings Zeigereinstellungen ausblenden + + + (no pick selected) + + Settings @@ -877,7 +896,7 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen" error - + Cannot find property %1 of object %2. Eigenschaft %1 von Objekt %2 kann nicht gefunden werden. @@ -887,126 +906,137 @@ Diese Einstellungen können jederzeit über das Menü "Einstellungen" Die Variable %1 ist nicht definiert. - + + In order to be executed, object %1 must have at least one argument. + + + + %1 cannot be executed. %1 ist keine Formel. - - - + + + Invalid expression. Ungültiger Ausdruck. - + Invalid expression (parity). Ungültiger Ausdruck (Parität). - + Unknown character "%1". Unbekanntes Schriftzeichen "%1". - - + + Illegal escape sequence: %1. Unzulässige Escapesequenz: %1. - - + + Parse error [%1:%2]: %3 Analysefehler [%1:%2]: %3 - + Expected %1 Erwartet %1 - + Unexpected %1 Unerwartetes %1 - + Function definition is not permitted. Funktionsdefinition ist nicht erlaubt. - + Expected variable for assignment. Erwartete Variable für Zuweisung. - + Unexpected ".": member access is not permitted Unerwartetes ".": Mitgliederzugriff ist nicht erlaubt - + Unexpected "[]": arrays are disabled. Unerwartetes "[]": Arrays sind deaktiviert. - + Unexpected symbol: %1. Unerwartetes Symbol: %1. - + + + Function %1 must have at least one argument. + + + + First argument to map is not a function. Der erste Parameter von map ist keine Formel. - + Second argument to map is not an array. Der zweite Parameter von map ist kein Array. - + First argument to fold is not a function. Der erste Parameter für fold ist keine Formel. - + Second argument to fold is not an array. Der zweite Parameter für fold ist kein Array. - + First argument to filter is not a function. Der erste Parameter für filter ist keine Formel. - + Second argument to filter is not an array. Der zweite Parameter von filter ist kein Array. - + Second argument to indexOf is not a string or array. Der zweite Parameter von indexOf ist kein String oder Array. - + Second argument to join is not an array. Der zweite Parameter von join ist kein Array. - + EOF Ende des Ausdrucks diff --git a/LogarithmPlotter/i18n/lp_en.ts b/LogarithmPlotter/i18n/lp_en.ts index 2a43526..bcd31f4 100644 --- a/LogarithmPlotter/i18n/lp_en.ts +++ b/LogarithmPlotter/i18n/lp_en.ts @@ -569,25 +569,44 @@ These settings can be changed at any time from the "Settings" menu. PickLocationOverlay - + Pointer precision: Pointer precision: - Snap to grid - Snap to grid + Snap to grid - + + Snap to grid: + + + + + Pick X + + + + + Pick Y + + + + Open picker settings Open picker settings - + Hide picker settings Hide picker settings + + + (no pick selected) + + Settings @@ -877,7 +896,7 @@ These settings can be changed at any time from the "Settings" menu.error - + Cannot find property %1 of object %2. Cannot find property %1 of object %2. @@ -887,126 +906,137 @@ These settings can be changed at any time from the "Settings" menu.Undefined variable %1. - + + In order to be executed, object %1 must have at least one argument. + + + + %1 cannot be executed. %1 is not a function. - - - + + + Invalid expression. Invalid expression. - + Invalid expression (parity). Invalid expression (parity). - + Unknown character "%1". Unknown character "%1". - - + + Illegal escape sequence: %1. Illegal escape sequence: %1. - - + + Parse error [%1:%2]: %3 Parse error [%1:%2]: %3 - + Expected %1 Expected %1 - + Unexpected %1 Unexpected %1 - + Function definition is not permitted. Function definition is not permitted. - + Expected variable for assignment. Expected variable for assignment. - + Unexpected ".": member access is not permitted Unexpected ".": member access is not permitted - + Unexpected "[]": arrays are disabled. Unexpected "[]": arrays are disabled. - + Unexpected symbol: %1. Unexpected symbol: %1. - + + + Function %1 must have at least one argument. + + + + First argument to map is not a function. First argument to map is not a function. - + Second argument to map is not an array. Second argument to map is not an array. - + First argument to fold is not a function. First argument to fold is not a function. - + Second argument to fold is not an array. Second argument to fold is not an array. - + First argument to filter is not a function. First argument to filter is not a function. - + Second argument to filter is not an array. Second argument to filter is not an array. - + Second argument to indexOf is not a string or array. Second argument to indexOf is not a string or array. - + Second argument to join is not an array. Second argument to join is not an array. - + EOF End of expression diff --git a/LogarithmPlotter/i18n/lp_es.ts b/LogarithmPlotter/i18n/lp_es.ts index 307c1fa..8f4f452 100644 --- a/LogarithmPlotter/i18n/lp_es.ts +++ b/LogarithmPlotter/i18n/lp_es.ts @@ -517,25 +517,40 @@ These settings can be changed at any time from the "Settings" menu. PickLocationOverlay - + Pointer precision: - - Snap to grid + + Snap to grid: - + + Pick X + + + + + Pick Y + + + + Open picker settings - + Hide picker settings + + + (no pick selected) + + Settings @@ -825,7 +840,7 @@ These settings can be changed at any time from the "Settings" menu.error - + Cannot find property %1 of object %2. @@ -835,126 +850,137 @@ These settings can be changed at any time from the "Settings" menu. - + + In order to be executed, object %1 must have at least one argument. + + + + %1 cannot be executed. - - - + + + Invalid expression. - + Invalid expression (parity). - + Unknown character "%1". - - + + Illegal escape sequence: %1. - - + + Parse error [%1:%2]: %3 - + Expected %1 - + Unexpected %1 - + Function definition is not permitted. - + Expected variable for assignment. - + Unexpected ".": member access is not permitted - + Unexpected "[]": arrays are disabled. - + Unexpected symbol: %1. - + + + Function %1 must have at least one argument. + + + + First argument to map is not a function. - + Second argument to map is not an array. - + First argument to fold is not a function. - + Second argument to fold is not an array. - + First argument to filter is not a function. - + Second argument to filter is not an array. - + Second argument to indexOf is not a string or array. - + Second argument to join is not an array. - + EOF diff --git a/LogarithmPlotter/i18n/lp_fr.ts b/LogarithmPlotter/i18n/lp_fr.ts index ef59464..ccfa587 100644 --- a/LogarithmPlotter/i18n/lp_fr.ts +++ b/LogarithmPlotter/i18n/lp_fr.ts @@ -577,25 +577,44 @@ These settings can always be changed at any time from the "Settings" m PickLocationOverlay - + Pointer precision: Précision du pointeur : - Snap to grid - Placement sur la grille + Placement sur la grille - + + Snap to grid: + + + + + Pick X + + + + + Pick Y + + + + Open picker settings Ouvrir les paramètres du pointeur - + Hide picker settings Cacher les paramètres du pointeur + + + (no pick selected) + + Settings @@ -886,7 +905,7 @@ These settings can always be changed at any time from the "Settings" m error - + Cannot find property %1 of object %2. Impossible de trouver la propriété %1 de l'objet %2. @@ -896,126 +915,137 @@ These settings can always be changed at any time from the "Settings" m La variable %1 n'est pas définie. - + + In order to be executed, object %1 must have at least one argument. + + + + %1 cannot be executed. %1 n'est pas une fonction. - - - + + + Invalid expression. Formule invalide. - + Invalid expression (parity). Formule invalide (parité). - + Unknown character "%1". Le caractère "%1" est inconnu. - - + + Illegal escape sequence: %1. Séquence d'échappement illégale : %1. - - + + Parse error [%1:%2]: %3 Erreur de syntaxe [%1:%2] : %3 - + Expected %1 %1 attendu - + Unexpected %1 %1 inattendu - + Function definition is not permitted. La définition de fonctions n'est pas autorisée. - + Expected variable for assignment. Une variable est attendue pour l'affectation. - + Unexpected ".": member access is not permitted "." inattendu : l'accès aux propriétés n'est pas autorisé - + Unexpected "[]": arrays are disabled. "[]" inattendu : les tableaux sont désactivés. - + Unexpected symbol: %1. Symbole inconnu : %1. - + + + Function %1 must have at least one argument. + + + + First argument to map is not a function. Le premier argument de map n'est pas une fonction. - + Second argument to map is not an array. Le deuxième argument de map n'est pas un tableau. - + First argument to fold is not a function. Le premier argument de fold n'est pas une fonction. - + Second argument to fold is not an array. Le deuxième argument de fold n'est pas un tableau. - + First argument to filter is not a function. Le premier argument de filter n'est pas une fonction. - + Second argument to filter is not an array. Le deuxième argument de filter n'est pas un tableau. - + Second argument to indexOf is not a string or array. Le deuxième argument de indexOf n'est ni chaîne de caractères ni un tableau. - + Second argument to join is not an array. Le deuxième argument de join n'est pas un tableau. - + EOF Fin de la formule diff --git a/LogarithmPlotter/i18n/lp_hu.ts b/LogarithmPlotter/i18n/lp_hu.ts index 46fd264..feafc52 100644 --- a/LogarithmPlotter/i18n/lp_hu.ts +++ b/LogarithmPlotter/i18n/lp_hu.ts @@ -569,25 +569,44 @@ Ezek a beállítások bármikor módosíthatók a „Beállítások” menüben. PickLocationOverlay - + Pointer precision: Mutató pontossága: - Snap to grid - Rácshoz illesztés + Rácshoz illesztés - + + Snap to grid: + + + + + Pick X + + + + + Pick Y + + + + Open picker settings - + Hide picker settings + + + (no pick selected) + + Settings @@ -877,7 +896,7 @@ Ezek a beállítások bármikor módosíthatók a „Beállítások” menüben. error - + Cannot find property %1 of object %2. A(z) %2 objektum %1 tulajdonsága nem található. @@ -887,126 +906,137 @@ Ezek a beállítások bármikor módosíthatók a „Beállítások” menüben. A(z) %1 változó nincs meghatározva. - + + In order to be executed, object %1 must have at least one argument. + + + + %1 cannot be executed. A(z) %1 nem függvény. - - - + + + Invalid expression. Érvénytelen kifejezés. - + Invalid expression (parity). Érvénytelen kifejezés (paritás). - + Unknown character "%1". Ismeretlen karakter „%1”. - - + + Illegal escape sequence: %1. Érvénytelen kilépési sorozat: %1. - - + + Parse error [%1:%2]: %3 Elemzési hiba [%1:%2]: %3 - + Expected %1 Várható %1 - + Unexpected %1 Váratlan %1 - + Function definition is not permitted. A függvény meghatározása nem engedélyezett. - + Expected variable for assignment. A hozzárendeléshez várt változó. - + Unexpected ".": member access is not permitted Váratlan „.”: a tagok hozzáférése nem engedélyezett - + Unexpected "[]": arrays are disabled. Váratlan „[]”: a tömbök le vannak tiltva. - + Unexpected symbol: %1. Váratlan szimbólum: %1. - + + + Function %1 must have at least one argument. + + + + First argument to map is not a function. Az első leképezési argumentum nem függvény. - + Second argument to map is not an array. A második leképezési argumentum nem tömb. - + First argument to fold is not a function. Az első behajtási argumentum nem függvény. - + Second argument to fold is not an array. A második behajtási argumentum nem tömb. - + First argument to filter is not a function. Az első szűrési argumentum nem függvény. - + Second argument to filter is not an array. A második szűrési argumentum nem tömb. - + Second argument to indexOf is not a string or array. Az indexOf második argumentuma nem karakterlánc vagy tömb. - + Second argument to join is not an array. A második csatlakozási argumentum nem tömb. - + EOF Kifejezés vége diff --git a/LogarithmPlotter/i18n/lp_nb_NO.ts b/LogarithmPlotter/i18n/lp_nb_NO.ts index 6daa1a1..4d1cc28 100644 --- a/LogarithmPlotter/i18n/lp_nb_NO.ts +++ b/LogarithmPlotter/i18n/lp_nb_NO.ts @@ -569,25 +569,44 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen. PickLocationOverlay - + Pointer precision: Peker-presisjon: - Snap to grid - Fest til rutenett + Fest til rutenett - + + Snap to grid: + + + + + Pick X + + + + + Pick Y + + + + Open picker settings - + Hide picker settings + + + (no pick selected) + + Settings @@ -877,7 +896,7 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen.error - + Cannot find property %1 of object %2. @@ -887,126 +906,137 @@ Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen. - + + In order to be executed, object %1 must have at least one argument. + + + + %1 cannot be executed. - - - + + + Invalid expression. - + Invalid expression (parity). - + Unknown character "%1". - - + + Illegal escape sequence: %1. - - + + Parse error [%1:%2]: %3 - + Expected %1 - + Unexpected %1 - + Function definition is not permitted. - + Expected variable for assignment. - + Unexpected ".": member access is not permitted - + Unexpected "[]": arrays are disabled. - + Unexpected symbol: %1. - + + + Function %1 must have at least one argument. + + + + First argument to map is not a function. - + Second argument to map is not an array. - + First argument to fold is not a function. - + Second argument to fold is not an array. - + First argument to filter is not a function. - + Second argument to filter is not an array. - + Second argument to indexOf is not a string or array. - + Second argument to join is not an array. - + EOF diff --git a/LogarithmPlotter/i18n/lp_template.ts b/LogarithmPlotter/i18n/lp_template.ts index 8390e18..87973c3 100644 --- a/LogarithmPlotter/i18n/lp_template.ts +++ b/LogarithmPlotter/i18n/lp_template.ts @@ -517,25 +517,40 @@ These settings can be changed at any time from the "Settings" menu. PickLocationOverlay - + Pointer precision: - - Snap to grid + + Snap to grid: - + + Pick X + + + + + Pick Y + + + + Open picker settings - + Hide picker settings + + + (no pick selected) + + Settings @@ -825,7 +840,7 @@ These settings can be changed at any time from the "Settings" menu.error - + Cannot find property %1 of object %2. @@ -835,126 +850,137 @@ These settings can be changed at any time from the "Settings" menu. - + + In order to be executed, object %1 must have at least one argument. + + + + %1 cannot be executed. - - - + + + Invalid expression. - + Invalid expression (parity). - + Unknown character "%1". - - + + Illegal escape sequence: %1. - - + + Parse error [%1:%2]: %3 - + Expected %1 - + Unexpected %1 - + Function definition is not permitted. - + Expected variable for assignment. - + Unexpected ".": member access is not permitted - + Unexpected "[]": arrays are disabled. - + Unexpected symbol: %1. - + + + Function %1 must have at least one argument. + + + + First argument to map is not a function. - + Second argument to map is not an array. - + First argument to fold is not a function. - + Second argument to fold is not an array. - + First argument to filter is not a function. - + Second argument to filter is not an array. - + Second argument to indexOf is not a string or array. - + Second argument to join is not an array. - + EOF diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml index 5173a24..f3077b6 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml @@ -56,12 +56,12 @@ Item { property string objName: 'A' /*! \qmlproperty bool PickLocationOverlay::pickX - true if the user should be picking a position on the x axis. + true if the property in propertyX is pickable. */ property bool pickX: true /*! \qmlproperty bool PickLocationOverlay::pickY - true if the user should be picking a position on the y axis. + true if the property in propertyY is pickable. */ property bool pickY: true /*! @@ -79,6 +79,16 @@ Item { Precision of the picked value (post-dot precision). */ property alias precision: precisionSlider.value + /*! + \qmlproperty bool PickLocationOverlay::userPickX + true if the user can and wants to be picking a position on the x axis. + */ + readonly property bool userPickX: pickX && pickXCheckbox.checked + /*! + \qmlproperty bool PickLocationOverlay::userPickY + true if the user can and wants to be picking a position on the y axis. + */ + readonly property bool userPickY: pickY && pickYCheckbox.checked Rectangle { color: sysPalette.window @@ -94,29 +104,33 @@ Item { acceptedButtons: Qt.LeftButton | Qt.RightButton onClicked: function(mouse) { if(mouse.button == Qt.LeftButton) { // Validate - let newValueX = !parent.pickX ? null : parseValue(picked.mouseX.toString(), objType, propertyX) - let newValueY = !parent.pickY ? null : parseValue(picked.mouseY.toString(), objType, propertyY) + let newValueX = !parent.userPickX ? null : parseValue(picked.mouseX.toString(), objType, propertyX) + let newValueY = !parent.userPickY ? null : parseValue(picked.mouseY.toString(), objType, propertyY) let obj = Objects.currentObjectsByName[objName] // Set values - if(parent.pickX && parent.pickY) { + if(parent.userPickX && parent.userPickY) { history.addToHistory(new HistoryLib.EditedPosition( objName, objType, obj[propertyX], newValueX, obj[propertyY], newValueY )) obj[propertyX] = newValueX obj[propertyY] = newValueY - } else if(parent.pickX) { + obj.update() + objectLists.update() + } else if(parent.userPickX) { history.addToHistory(new HistoryLib.EditedProperty( objName, objType, propertyX, obj[propertyX], newValueX )) obj[propertyX] = newValueX - } else if(parent.pickY) { + obj.update() + objectLists.update() + } else if(parent.userPickY) { history.addToHistory(new HistoryLib.EditedProperty( objName, objType, propertyY, obj[propertyY], newValueY )) obj[propertyY] = newValueY + obj.update() + objectLists.update() } - obj.update() - objectLists.update() } pickerRoot.visible = false; } @@ -158,11 +172,19 @@ Item { } Text { - text: qsTr("Snap to grid") + ":" + text: qsTr("Snap to grid:") color: sysPalette.windowText verticalAlignment: Text.AlignVCenter height: pickerSettingsColumn.cellHeight } + + CheckBox { + id: pickXCheckbox + height: pickerSettingsColumn.cellHeight + text: qsTr("Pick X") + checked: pickX + visible: pickX + } } Column { @@ -189,6 +211,14 @@ Item { // text: qsTr("Snap to grid") checked: false } + + CheckBox { + id: pickYCheckbox + height: pickerSettingsColumn.cellHeight + text: qsTr("Pick Y") + checked: pickY + visible: pickY + } } Button { @@ -223,7 +253,7 @@ Item { anchors.top: parent.top anchors.left: parent.left anchors.leftMargin: canvas.x2px(picked.mouseX) - visible: parent.pickX + visible: parent.userPickX } Rectangle { @@ -234,13 +264,14 @@ Item { anchors.top: parent.top anchors.left: parent.left anchors.topMargin: canvas.y2px(picked.mouseY) - visible: parent.pickY + visible: parent.userPickY } Text { id: picked x: picker.mouseX - width - 5 y: picker.mouseY - height - 5 + color: 'black' property double axisX: canvas.xaxisstep1 property double mouseX: { let xpos = canvas.px2x(picker.mouseX) @@ -264,14 +295,15 @@ Item { return ypos.toFixed(parent.precision) } } - color: 'black' text: { - if(parent.pickX && parent.pickY) + if(parent.userPickX && parent.userPickY) return `(${mouseX}, ${mouseY})` - if(parent.pickX) + else if(parent.userPickX) return `X = ${mouseX}` - if(parent.pickY) + else if(parent.userPickY) return `Y = ${mouseY}` + else + return qsTr('(no pick selected)') } }