Browse Source

CURA-4643 Allow using the ESC/ENTER keys for reject or accept the
user agreement

Diego Prado Gesto 7 years ago
parent
commit
b425672ad0
1 changed files with 5 additions and 8 deletions
  1. 5 8
      plugins/UserAgreementPlugin/UserAgreement.qml

+ 5 - 8
plugins/UserAgreementPlugin/UserAgreement.qml

@@ -15,8 +15,6 @@ UM.Dialog
     height: minimumHeight
     title: catalog.i18nc("@title:window", "User Agreement")
 
-    disableKeyButtons: true
-
     TextArea
     {
         anchors.top: parent.top
@@ -45,7 +43,7 @@ UM.Dialog
             anchors.right: parent.right
             text: catalog.i18nc("@action:button", "I understand and agree")
             onClicked: {
-                manager.didAgree(true)
+                baseDialog.accepted()
             }
         }
 
@@ -54,13 +52,12 @@ UM.Dialog
             anchors.left: parent.left
             text: catalog.i18nc("@action:button", "I don't agree")
             onClicked: {
-                manager.didAgree(false)
+                baseDialog.rejected()
             }
         }
-
     }
 
-    onClosing: {
-        manager.didAgree(false)
-    }
+    onAccepted: manager.didAgree(true)
+    onRejected: manager.didAgree(false)
+    onClosing: manager.didAgree(false)
 }