From 699c2dbec89dddbc6ab5eb5b71286368f6ae3cdd Mon Sep 17 00:00:00 2001 From: mattmcw Date: Sun, 30 Jul 2023 22:26:05 -0400 Subject: [PATCH] UI cleanup 1: confirm setting the exposure --- app/lib/ui/cam.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/lib/ui/cam.js b/app/lib/ui/cam.js index 16f6525..51348fa 100644 --- a/app/lib/ui/cam.js +++ b/app/lib/ui/cam.js @@ -91,13 +91,23 @@ cam.end = function (c, id, ms) { } }; -cam.exposure = function (exposure) { +cam.exposure = async function (exposure) { var obj = { id : uuid(), exposure }; - log.info(`Setting exposure: ${exposure}`); - ipcRenderer.sendSync(cam.id, obj); + var change = false; + try { + change = await gui.confirm(`Are you sure you want to set camera exposure to ${exposure}ms?`); + } catch (err) { + log.error(err); + } + if (change) { + log.info(`Setting exposure: ${exposure}`); + ipcRenderer.sendSync(cam.id, obj); + } else { + timing.updateUI('#cam_time', timing.data['cam']); + } } cam.listen = function () {