Skip to content

Commit

Permalink
Merge pull request #171 from saeugetier/feature/131-automatic-return-…
Browse files Browse the repository at this point in the history
…to-front-page-when-idling-too-long-in-snapshot-mode

implemented timeout timer
  • Loading branch information
saeugetier authored Jun 19, 2024
2 parents 27a7218 + c6caaed commit d85fb61
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions qml/SnapshotMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ SnapshotMenuForm {

countdown: snapshotSettings.countdown

Timer
{
id: snapshotTimeoutTimer
interval: 1000 * 60 * 10 //going inactive after 10 minutes
onTriggered:
{
console.log("Snapshot timeout return to main menu")
snapshotTimeoutTimer.stop()
abort()
}
}

cameraRenderer.onPhotoProcessingChanged:
{
console.log("photo processing: " + Boolean(cameraRenderer.photoProcessing).toString())
Expand All @@ -25,6 +37,19 @@ SnapshotMenuForm {
value: 0.0
}

onSnapshotTimeoutEnableChanged:
{
if(state == "activated" && snapshotTimeoutEnable == true)
{
snapshotTimeoutTimer.start()
console.log("Snapshot timeout timer started")
}
else
{
snapshotTimeoutTimer.stop()
}
}

onStateChanged:
{
console.log("Snapshot menu state changed: " + state)
Expand All @@ -34,6 +59,16 @@ SnapshotMenuForm {
}
else
{
if(state == "activated" && snapshotTimeoutEnable == true)
{
snapshotTimeoutTimer.start()
console.log("Snapshot timeout timer started")
}
else
{
snapshotTimeoutTimer.stop()
}

shutterButton.reset()
ledEnablePin.value = 1.0
}
Expand Down

0 comments on commit d85fb61

Please sign in to comment.