From 545f39cf7598ed0360bd328750feaa72d52a7c89 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 30 May 2017 13:35:15 +0200 Subject: [PATCH] Moved ZRTP token authentication into it's own component --- linphone-desktop/assets/languages/en.ts | 43 +++++---- linphone-desktop/assets/languages/fr.ts | 43 +++++---- linphone-desktop/resources.qrc | 1 + .../ui/views/App/Calls/Incall.qml | 84 +--------------- .../App/Calls/ZrtpTokenAuthentication.qml | 96 +++++++++++++++++++ 5 files changed, 144 insertions(+), 123 deletions(-) create mode 100644 linphone-desktop/ui/views/App/Calls/ZrtpTokenAuthentication.qml diff --git a/linphone-desktop/assets/languages/en.ts b/linphone-desktop/assets/languages/en.ts index 3518c737f..3faad01b3 100644 --- a/linphone-desktop/assets/languages/en.ts +++ b/linphone-desktop/assets/languages/en.ts @@ -731,26 +731,6 @@ Server url not configured. pendingRequestLabel Please to wait, a request is pending. - - Say: - Say: - - - Your correspondent should say: - Your correspondent should say: - - - Deny - DENY - - - Accept - ACCEPT - - - Confirm the following SAS with peer: - Confirm the following SAS with peer: - InviteFriends @@ -1365,4 +1345,27 @@ your friend's SIP address or username. Transport + + ZrtpTokenAuthentication + + Confirm the following SAS with peer: + Confirm the following SAS with peer: + + + Say: + Say: + + + Your correspondent should say: + Your correspondent should say: + + + Deny + DENY + + + Accept + ACCEPT + + diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts index 23c45e1d1..ad8905d6d 100644 --- a/linphone-desktop/assets/languages/fr.ts +++ b/linphone-desktop/assets/languages/fr.ts @@ -731,26 +731,6 @@ Url du serveur non configurée. pendingRequestLabel Merci de patienter, une requête est en attente. - - Say: - Dites : - - - Your correspondent should say: - Votre interlocuteur devrait dire : - - - Deny - REJETER - - - Accept - VALIDER - - - Confirm the following SAS with peer: - Confirmez le SAS suivant avec votre interlocuteur : - InviteFriends @@ -1364,4 +1344,27 @@ un chat ou ajouter un contact. Transport + + ZrtpTokenAuthentication + + Confirm the following SAS with peer: + Confirmez le SAS suivant avec votre interlocuteur : + + + Say: + Dites : + + + Your correspondent should say: + Votre interlocuteur devrait dire : + + + Deny + REJETER + + + Accept + VALIDER + + diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc index bc822f0d9..3ac829775 100644 --- a/linphone-desktop/resources.qrc +++ b/linphone-desktop/resources.qrc @@ -371,6 +371,7 @@ ui/views/App/Calls/Incall.qml ui/views/App/Calls/IncomingCall.qml ui/views/App/Calls/OutgoingCall.qml + ui/views/App/Calls/ZrtpTokenAuthentication.qml ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithEmail.qml ui/views/App/Main/Assistant/AssistantAbstractView.qml ui/views/App/Main/Assistant/AssistantHome.qml diff --git a/linphone-desktop/ui/views/App/Calls/Incall.qml b/linphone-desktop/ui/views/App/Calls/Incall.qml index 1fd01ac0e..8b7997250 100644 --- a/linphone-desktop/ui/views/App/Calls/Incall.qml +++ b/linphone-desktop/ui/views/App/Calls/Incall.qml @@ -249,90 +249,8 @@ Rectangle { } } - Item { + ZrtpTokenAuthentication { id: zrtp - height: CallStyle.zrtpArea.height - visible: false - Layout.fillWidth: true - anchors.top: container.bottom - Layout.margins: CallStyle.container.margins - - GridLayout { - anchors.centerIn: parent - columns: 1 - - Text { - Layout.fillWidth: true - anchors.horizontalCenter: parent.horizontalCenter - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - text: qsTr("Confirm the following SAS with peer:") - elide: Text.ElideRight - font.pointSize: CallStyle.zrtpArea.fontSize - font.bold: true - color: Colors.j - } - - RowLayout { - anchors.horizontalCenter: parent.horizontalCenter - spacing: CallStyle.zrtpArea.vu.spacing - Layout.fillWidth: true - - Text { - text: qsTr("Say:") - font.pointSize: CallStyle.zrtpArea.fontSize - color: Colors.j - } - - Text { - text: incall.call.localSAS - font.pointSize: CallStyle.zrtpArea.fontSize - font.bold: true - color: Colors.i - } - - Text { - text: "-" - font.pointSize: CallStyle.zrtpArea.fontSize - color: Colors.j - } - - Text { - text: qsTr("Your correspondent should say:") - font.pointSize: CallStyle.zrtpArea.fontSize - color: Colors.j - } - - Text { - text: incall.call.remoteSAS - font.pointSize: CallStyle.zrtpArea.fontSize - font.bold: true - color: Colors.i - } - } - - RowLayout { - anchors.horizontalCenter: parent.horizontalCenter - spacing: CallStyle.zrtpArea.vu.spacing - Layout.fillWidth: true - - TextButtonA { - text: qsTr('Deny') - onClicked: { - zrtp.visible = false - incall.call.verifyAuthenticationToken(false) - } - } - - TextButtonB { - text: qsTr('Accept') - onClicked: { - zrtp.visible = false - incall.call.verifyAuthenticationToken(true) - } - } - } - } } // ------------------------------------------------------------------------- diff --git a/linphone-desktop/ui/views/App/Calls/ZrtpTokenAuthentication.qml b/linphone-desktop/ui/views/App/Calls/ZrtpTokenAuthentication.qml new file mode 100644 index 000000000..da07ebb3e --- /dev/null +++ b/linphone-desktop/ui/views/App/Calls/ZrtpTokenAuthentication.qml @@ -0,0 +1,96 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.1 +import QtQuick.Layouts 1.3 + +import Common 1.0 +import Common.Styles 1.0 +import Linphone 1.0 +import LinphoneUtils 1.0 +import Utils 1.0 + +import App.Styles 1.0 + +Item { + height: CallStyle.zrtpArea.height + visible: false + Layout.fillWidth: true + anchors.top: container.bottom + Layout.margins: CallStyle.container.margins + + GridLayout { + anchors.centerIn: parent + columns: 1 + + Text { + Layout.fillWidth: true + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: qsTr("Confirm the following SAS with peer:") + elide: Text.ElideRight + font.pointSize: CallStyle.zrtpArea.fontSize + font.bold: true + color: Colors.j + } + + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: CallStyle.zrtpArea.vu.spacing + Layout.fillWidth: true + + Text { + text: qsTr("Say:") + font.pointSize: CallStyle.zrtpArea.fontSize + color: Colors.j + } + + Text { + text: incall.call.localSAS + font.pointSize: CallStyle.zrtpArea.fontSize + font.bold: true + color: Colors.i + } + + Text { + text: "-" + font.pointSize: CallStyle.zrtpArea.fontSize + color: Colors.j + } + + Text { + text: qsTr("Your correspondent should say:") + font.pointSize: CallStyle.zrtpArea.fontSize + color: Colors.j + } + + Text { + text: incall.call.remoteSAS + font.pointSize: CallStyle.zrtpArea.fontSize + font.bold: true + color: Colors.i + } + } + + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: CallStyle.zrtpArea.vu.spacing + Layout.fillWidth: true + + TextButtonA { + text: qsTr('Deny') + onClicked: { + zrtp.visible = false + incall.call.verifyAuthenticationToken(false) + } + } + + TextButtonB { + text: qsTr('Accept') + onClicked: { + zrtp.visible = false + incall.call.verifyAuthenticationToken(true) + } + } + } + } +} \ No newline at end of file