From 37353e603cac9bd132dd6673bca1a28bc6b18ef4 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 18 Jul 2016 20:01:14 -0700 Subject: [PATCH] Prevent multiple clicks on dialog buttons This can happen on slow touch based systems --- src/QmlControls/QGCView.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/QmlControls/QGCView.qml b/src/QmlControls/QGCView.qml index 4c54ec9b1..0dd6ff6eb 100644 --- a/src/QmlControls/QGCView.qml +++ b/src/QmlControls/QGCView.qml @@ -123,6 +123,9 @@ FactPanel { return } + __rejectButton.enabled = true + __acceptButton.enabled = true + __stopAllAnimations() __dialogCharWidth = charWidth @@ -144,6 +147,9 @@ FactPanel { return } + __rejectButton.enabled = true + __acceptButton.enabled = true + __stopAllAnimations() __dialogCharWidth = showDialogDefaultWidth @@ -302,7 +308,10 @@ FactPanel { anchors.right: __acceptButton.visible ? __acceptButton.left : parent.right anchors.bottom: parent.bottom - onClicked: __dialogComponentLoader.item.reject() + onClicked: { + enabled = false // prevent multiple clicks + __dialogComponentLoader.item.reject() + } } QGCButton { @@ -311,6 +320,7 @@ FactPanel { primary: true onClicked: { + enabled = false // prevent multiple clicks __dialogComponentLoader.item.accept() } } -- 2.22.0