diff --git a/src/core/positioning/geofencer.cpp b/src/core/positioning/geofencer.cpp index 23df333026..ddc76c1b17 100644 --- a/src/core/positioning/geofencer.cpp +++ b/src/core/positioning/geofencer.cpp @@ -241,7 +241,7 @@ void Geofencer::applyProjectSettings( QgsProject *project ) if ( project ) { - active = project->readBoolEntry( QStringLiteral( "qfieldsync" ), QStringLiteral( "geofencingActive" ), false ); + active = project->readBoolEntry( QStringLiteral( "qfieldsync" ), QStringLiteral( "geofencingIsActive" ), false ); const QString layerId = project->readEntry( QStringLiteral( "qfieldsync" ), QStringLiteral( "geofencingLayer" ) ); if ( !layerId.isEmpty() ) { diff --git a/src/qml/QFieldCamera.qml b/src/qml/QFieldCamera.qml index e8f76b5451..b9302077e2 100644 --- a/src/qml/QFieldCamera.qml +++ b/src/qml/QFieldCamera.qml @@ -63,7 +63,7 @@ Popup { if (!cameraPicked) { camera.cameraDevice = mediaDevices.defaultVideoInput; } - camera.applyCameraFormat(); + camera.applyCameraFormat(false); } QfCameraPermission { @@ -113,9 +113,10 @@ Popup { camera: Camera { id: camera - active: cameraItem.visible && cameraPermission.status === Qt.PermissionStatus.Granted + property bool restarting: false + active: cameraItem.visible && cameraPermission.status === Qt.PermissionStatus.Granted && !restarting - function applyCameraFormat() { + function applyCameraFormat(restart) { if (cameraSettings.pixelFormat != 0) { let fallbackIndex = -1; let i = 0; @@ -133,6 +134,10 @@ Popup { if (fallbackIndex >= 0) { camera.cameraFormat = camera.cameraDevice.videoFormats[fallbackIndex]; } + if (restart) { + camera.restarting = true; + camera.restarting = false; + } } } @@ -663,7 +668,7 @@ Popup { if (checked && cameraSettings.deviceId !== modelData.id) { cameraSettings.deviceId = modelData.id; camera.cameraDevice = modelData; - camera.applyCameraFormat(); + camera.applyCameraFormat(true); } } } @@ -747,7 +752,7 @@ Popup { if (checked && (cameraSettings.resolution != resolution || cameraSettings.pixelFormat != pixelFormat)) { cameraSettings.resolution = resolution; cameraSettings.pixelFormat = pixelFormat; - camera.applyCameraFormat(); + camera.applyCameraFormat(true); } } } diff --git a/src/qml/processingparameterwidgets/distance.qml b/src/qml/processingparameterwidgets/distance.qml index 075087e952..5fbd4f653a 100644 --- a/src/qml/processingparameterwidgets/distance.qml +++ b/src/qml/processingparameterwidgets/distance.qml @@ -136,10 +136,10 @@ ProcessingParameterWidgetBase { visible: enabled onClicked: { - decreaseValue(); + adjustValue(-1); } onDoubleClicked: { - decreaseValue(); + adjustValue(-1); } onPressAndHold: { changeValueTimer.increase = false; @@ -167,10 +167,10 @@ ProcessingParameterWidgetBase { visible: enabled onClicked: { - increaseValue(); + adjustValue(1); } onDoubleClicked: { - increaseValue(); + adjustValue(1); } onPressAndHold: { changeValueTimer.increase = true; @@ -216,7 +216,7 @@ ProcessingParameterWidgetBase { var newValue; if (!isNaN(currentValue)) { newValue = currentValue + (distanceItem.step * direction); - prepareValueChangeRequest(Math.min(distanceItem.max(Math.max(distanceItem.min, newValue)))); + prepareValueChangeRequest(Math.min(distanceItem.max, Math.max(distanceItem.min, newValue))); } else { newValue = 0; prepareValueChangeRequest(newValue, false); diff --git a/src/qml/processingparameterwidgets/number.qml b/src/qml/processingparameterwidgets/number.qml index 02136d1801..074f7bf501 100644 --- a/src/qml/processingparameterwidgets/number.qml +++ b/src/qml/processingparameterwidgets/number.qml @@ -63,10 +63,10 @@ ProcessingParameterWidgetBase { visible: enabled onClicked: { - decreaseValue(); + adjustValue(-1); } onDoubleClicked: { - decreaseValue(); + adjustValue(-1); } onPressAndHold: { changeValueTimer.increase = false; @@ -94,10 +94,10 @@ ProcessingParameterWidgetBase { visible: enabled onClicked: { - increaseValue(); + adjustValue(1); } onDoubleClicked: { - increaseValue(); + adjustValue(1); } onPressAndHold: { changeValueTimer.increase = true; @@ -123,11 +123,11 @@ ProcessingParameterWidgetBase { onTriggered: { var hitBoundary = false; if (increase) { - increaseValue(); - hitBoundary = textField.text == numberItem.max; + adjustValue(1); + hitBoundary = parseFloat(textField.text) === numberItem.max; } else { - decreaseValue(); - hitBoundary = textField.text == numberItem.min; + adjustValue(-1); + hitBoundary = parseFloat(textField.text) === numberItem.min; } if (!hitBoundary) { if (interval > 50) @@ -138,30 +138,18 @@ ProcessingParameterWidgetBase { } } - function decreaseValue() { - var currentValue = Number.parseFloat(textField.text); + function adjustValue(direction) { + var currentValue = parseFloat(textField.text); var newValue; if (!isNaN(currentValue)) { - newValue = currentValue - numberItem.step; - valueChangeRequested(Math.max(numberItem.min, newValue)); + newValue = currentValue + (numberItem.step * direction); + valueChangeRequested(Math.min(numberItem.max, Math.max(numberItem.min, newValue))); } else { newValue = 0; valueChangeRequested(newValue, false); } } - function increaseValue() { - var currentValue = Number.parseFloat(textField.text); - var newValue; - if (!isNaN(currentValue)) { - newValue = currentValue + numberItem.step; - valueChangeRequested(Math.min(numberItem.max, newValue)); - } else { - newValue = 0; - valueChangeRequested(newValue); - } - } - FontMetrics { id: fontMetrics font: textField.font