Finally got rid of the camelCase2Readable Utils function.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adsooi 2024-10-26 05:55:34 +02:00
parent 2594fd6844
commit c39498c60f
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
35 changed files with 20 additions and 32 deletions

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1 @@
../common/appearance.svg

View file

@ -0,0 +1 @@
../common/appearance.svg

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1 @@
../common/arrow.svg

View file

@ -0,0 +1 @@
../common/position.svg

View file

@ -0,0 +1 @@
../common/angle.svg

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1 @@
../common/angle.svg

View file

@ -0,0 +1 @@
../common/appearance.svg

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1 @@
../common/target.svg

View file

@ -0,0 +1 @@
../common/position.svg

View file

@ -0,0 +1 @@
../common/label.svg

View file

@ -0,0 +1 @@
../common/angle.svg

View file

@ -0,0 +1 @@
../common/position.svg

View file

@ -0,0 +1 @@
../common/position.svg

View file

@ -1 +0,0 @@
../../common/appearance.svg

View file

@ -1 +0,0 @@
../../common/appearance.svg

View file

@ -1 +0,0 @@
../../common/arrow.svg

View file

@ -1 +0,0 @@
../../common/position.svg

View file

@ -1 +0,0 @@
../../common/angle.svg

View file

@ -1 +0,0 @@
../../common/appearance.svg

View file

@ -1 +0,0 @@
../../common/target.svg

View file

@ -1 +0,0 @@
../../common/position.svg

View file

@ -1 +0,0 @@
../../common/label.svg

View file

@ -1 +0,0 @@
../../common/angle.svg

View file

@ -1 +0,0 @@
../../common/position.svg

View file

@ -1 +0,0 @@
../../common/position.svg

View file

@ -1 +0,0 @@
../../common/angle.svg

View file

@ -401,18 +401,6 @@ export function parseName(str, removeUnallowed = true) {
return str return str
} }
/**
* Transforms camel case strings to a space separated one.
*
* @deprecated
* @param {string} label - Camel case to parse
* @returns {string} Parsed label.
*/
export function camelCase2readable(label) {
let parsed = parseName(label, false)
return parsed.charAt(0).toLatinUppercase() + parsed.slice(1).replace(/([A-Z])/g, " $1")
}
/** /**
* Creates a randomized color string. * Creates a randomized color string.
* @returns {string} * @returns {string}

View file

@ -104,7 +104,7 @@ def get_platform_qt_style(os) -> str:
def register_icon_directories() -> None: def register_icon_directories() -> None:
icon_fallbacks = QIcon.fallbackSearchPaths() icon_fallbacks = QIcon.fallbackSearchPaths()
base_icon_path = path.join(logarithmplotter_path, "qml", "eu", "ad5001", "LogarithmPlotter", "icons") base_icon_path = path.join(logarithmplotter_path, "qml", "eu", "ad5001", "LogarithmPlotter", "icons")
paths = [["common"], ["objects"], ["history"], ["settings"], ["settings", "custom"]] paths = [["common"], ["objects"], ["history"], ["settings"], ["properties"]]
for p in paths: for p in paths:
icon_fallbacks.append(path.realpath(path.join(base_icon_path, *p))) icon_fallbacks.append(path.realpath(path.join(base_icon_path, *p)))
QIcon.setFallbackSearchPaths(icon_fallbacks) QIcon.setFallbackSearchPaths(icon_fallbacks)

View file

@ -74,7 +74,7 @@ Repeater {
Setting.ExpressionEditor { Setting.ExpressionEditor {
height: 30 height: 30
label: propertyLabel label: propertyLabel
icon: `settings/custom/${propertyIcon}.svg` icon: `properties/${propertyIcon}.svg`
defValue: JS.Utils.simplifyExpression(obj[propertyName].toEditableString()) defValue: JS.Utils.simplifyExpression(obj[propertyName].toEditableString())
self: obj.name self: obj.name
variables: propertyType.variables variables: propertyType.variables
@ -99,7 +99,7 @@ Repeater {
Setting.TextSetting { Setting.TextSetting {
height: 30 height: 30
label: propertyLabel label: propertyLabel
icon: `settings/custom/${propertyIcon}.svg` icon: `properties/${propertyIcon}.svg`
min: propertyType == "int" ? 0 : -Infinity min: propertyType == "int" ? 0 : -Infinity
isInt: propertyType == "int" isInt: propertyType == "int"
isDouble: propertyType == "number" isDouble: propertyType == "number"
@ -159,7 +159,7 @@ Repeater {
CheckBox { CheckBox {
height: 20 height: 20
text: propertyLabel text: propertyLabel
//icon: `settings/custom/${propertyIcon}.svg` //icon: `properties/${propertyIcon}.svg`
checked: { checked: {
//if(obj[propertyName] == null) { //if(obj[propertyName] == null) {
@ -185,7 +185,7 @@ Repeater {
Setting.ComboBoxSetting { Setting.ComboBoxSetting {
height: 30 height: 30
label: propertyLabel label: propertyLabel
icon: `settings/custom/${propertyIcon}.svg` icon: `properties/${propertyIcon}.svg`
// True to select an object of type, false for enums. // True to select an object of type, false for enums.
property bool selectObjMode: paramTypeIn(propertyType, ['ObjectType']) property bool selectObjMode: paramTypeIn(propertyType, ['ObjectType'])
property bool isRealObject: !selectObjMode || (propertyType.objType != "ExecutableObject" && propertyType.objType != "DrawableObject") property bool isRealObject: !selectObjMode || (propertyType.objType != "ExecutableObject" && propertyType.objType != "DrawableObject")
@ -246,7 +246,7 @@ Repeater {
Setting.ListSetting { Setting.ListSetting {
label: propertyLabel label: propertyLabel
//icon: `settings/custom/${propertyIcon}.svg` //icon: `properties/${propertyIcon}.svg`
dictionaryMode: paramTypeIn(propertyType, ['Dict']) dictionaryMode: paramTypeIn(propertyType, ['Dict'])
keyType: dictionaryMode ? propertyType.keyType : 'string' keyType: dictionaryMode ? propertyType.keyType : 'string'
valueType: propertyType.valueType valueType: propertyType.valueType
@ -283,7 +283,7 @@ Repeater {
property string propertyName: modelData[0] property string propertyName: modelData[0]
property var propertyType: modelData[1] property var propertyType: modelData[1]
property string propertyLabel: qsTranslate('prop',propertyName) property string propertyLabel: qsTranslate('prop',propertyName)
property string propertyIcon: JS.Utils.camelCase2readable(propertyName) property string propertyIcon: propertyName
sourceComponent: { sourceComponent: {
if(propertyName.startsWith('comment')) if(propertyName.startsWith('comment'))