From 51964c4fd7f41e9b1a394d0787897d8cd9ba771e Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 2 Oct 2020 17:33:04 +0200 Subject: [PATCH] Clean up verification pages a bit --- .../AcceptNewVerificationRequest.qml | 22 +++---------------- .../AwaitingVerificationConfirmation.qml | 10 +-------- .../AwaitingVerificationRequest.qml | 10 +-------- .../device-verification/DigitVerification.qml | 22 +++---------------- .../device-verification/EmojiVerification.qml | 20 ++--------------- .../NewVerificationRequest.qml | 22 +++---------------- .../device-verification/PartnerAborted.qml | 12 ++-------- .../qml/device-verification/TimedOut.qml | 11 +--------- .../VerificationSuccess.qml | 10 +-------- 9 files changed, 17 insertions(+), 122 deletions(-) diff --git a/resources/qml/device-verification/AcceptNewVerificationRequest.qml b/resources/qml/device-verification/AcceptNewVerificationRequest.qml index 872fabe..5bdbc4a 100644 --- a/resources/qml/device-verification/AcceptNewVerificationRequest.qml +++ b/resources/qml/device-verification/AcceptNewVerificationRequest.qml @@ -25,15 +25,7 @@ Pane { Button { Layout.alignment: Qt.AlignLeft text: qsTr("Deny") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { flow.cancelVerification(DeviceVerificationFlow.User); deviceVerificationList.remove(tran_id); @@ -46,18 +38,10 @@ Pane { Button { Layout.alignment: Qt.AlignRight text: qsTr("Accept") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { stack.replace(awaitingVerificationRequestAccept); - isRequest?flow.sendVerificationReady():flow.acceptVerificationRequest(); + flow.sender ?flow.sendVerificationReady():flow.acceptVerificationRequest(); } } } diff --git a/resources/qml/device-verification/AwaitingVerificationConfirmation.qml b/resources/qml/device-verification/AwaitingVerificationConfirmation.qml index e078634..aaebba6 100644 --- a/resources/qml/device-verification/AwaitingVerificationConfirmation.qml +++ b/resources/qml/device-verification/AwaitingVerificationConfirmation.qml @@ -25,15 +25,7 @@ Pane { Button { Layout.alignment: Qt.AlignLeft text: qsTr("Cancel") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { flow.cancelVerification(DeviceVerificationFlow.User); deviceVerificationList.remove(tran_id); diff --git a/resources/qml/device-verification/AwaitingVerificationRequest.qml b/resources/qml/device-verification/AwaitingVerificationRequest.qml index 22a504c..b4b9178 100644 --- a/resources/qml/device-verification/AwaitingVerificationRequest.qml +++ b/resources/qml/device-verification/AwaitingVerificationRequest.qml @@ -25,15 +25,7 @@ Pane { Button { Layout.alignment: Qt.AlignLeft text: qsTr("Cancel") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { flow.cancelVerification(DeviceVerificationFlow.User); deviceVerificationList.remove(tran_id); diff --git a/resources/qml/device-verification/DigitVerification.qml b/resources/qml/device-verification/DigitVerification.qml index 241ccbd..f3b1f5c 100644 --- a/resources/qml/device-verification/DigitVerification.qml +++ b/resources/qml/device-verification/DigitVerification.qml @@ -43,15 +43,7 @@ Pane { Button { Layout.alignment: Qt.AlignLeft text: qsTr("They do not match!") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS); deviceVerificationList.remove(tran_id); @@ -64,17 +56,9 @@ Pane { Button { Layout.alignment: Qt.AlignRight text: qsTr("They match!") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { stack.replace(awaitingVerificationConfirmation); flow.sendVerificationMac(); } } } } -} \ No newline at end of file +} diff --git a/resources/qml/device-verification/EmojiVerification.qml b/resources/qml/device-verification/EmojiVerification.qml index fae08f2..19faf1b 100644 --- a/resources/qml/device-verification/EmojiVerification.qml +++ b/resources/qml/device-verification/EmojiVerification.qml @@ -123,15 +123,7 @@ Pane { Button { Layout.alignment: Qt.AlignLeft text: qsTr("They do not match!") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS); deviceVerificationList.remove(tran_id); @@ -144,15 +136,7 @@ Pane { Button { Layout.alignment: Qt.AlignRight text: qsTr("They match!") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { stack.replace(awaitingVerificationConfirmation); flow.sendVerificationMac(); } } } diff --git a/resources/qml/device-verification/NewVerificationRequest.qml b/resources/qml/device-verification/NewVerificationRequest.qml index 06b06cf..ef730b1 100644 --- a/resources/qml/device-verification/NewVerificationRequest.qml +++ b/resources/qml/device-verification/NewVerificationRequest.qml @@ -32,15 +32,7 @@ Pane { Button { Layout.alignment: Qt.AlignLeft text: qsTr("Cancel") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { deviceVerificationList.remove(tran_id); flow.deleteFlow(); @@ -53,19 +45,11 @@ Pane { Button { Layout.alignment: Qt.AlignRight text: qsTr("Start verification") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { stack.replace(awaitingVerificationRequestAccept); flow.sender ?flow.sendVerificationRequest():flow.startVerificationRequest(); } + } } } } -} diff --git a/resources/qml/device-verification/PartnerAborted.qml b/resources/qml/device-verification/PartnerAborted.qml index 62787b1..6174477 100644 --- a/resources/qml/device-verification/PartnerAborted.qml +++ b/resources/qml/device-verification/PartnerAborted.qml @@ -23,15 +23,7 @@ Pane { Button { Layout.alignment: Qt.AlignRight text: qsTr("Close") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { deviceVerificationList.remove(tran_id); dialog.destroy(); @@ -39,4 +31,4 @@ Pane { } } } -} \ No newline at end of file +} diff --git a/resources/qml/device-verification/TimedOut.qml b/resources/qml/device-verification/TimedOut.qml index 4052869..7dd0ab6 100644 --- a/resources/qml/device-verification/TimedOut.qml +++ b/resources/qml/device-verification/TimedOut.qml @@ -21,18 +21,9 @@ Pane { Layout.fillWidth: true } Button { - id: timedOutCancel Layout.alignment: Qt.AlignRight - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } text: qsTr("Close") + onClicked: { deviceVerificationList.remove(tran_id); flow.deleteFlow(); diff --git a/resources/qml/device-verification/VerificationSuccess.qml b/resources/qml/device-verification/VerificationSuccess.qml index c87488d..bc1e64f 100644 --- a/resources/qml/device-verification/VerificationSuccess.qml +++ b/resources/qml/device-verification/VerificationSuccess.qml @@ -23,15 +23,7 @@ Pane { Button { Layout.alignment: Qt.AlignRight text: qsTr("Close") - palette { - button: "white" - } - contentItem: Text { - text: parent.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } + onClicked: { deviceVerificationList.remove(tran_id); if(flow) flow.deleteFlow();