summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-11-01 22:20:15 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-11-01 22:20:15 +0100
commit2aabe9dcacbef4f753761f6df840da4292561d11 (patch)
tree283b6ee93d7f3c9d4d670e4de08ccfad0bfb0160 /resources
parentSome people consider Nheko not an AAAAA title (diff)
downloadnheko-2aabe9dcacbef4f753761f6df840da4292561d11.tar.xz
Prompt user when there are unverified devices
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/RoomList.qml80
-rw-r--r--resources/qml/SelfVerificationCheck.qml4
-rw-r--r--resources/qml/device-verification/NewVerificationRequest.qml5
3 files changed, 88 insertions, 1 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml

index 85087bc4..72ac49e1 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml
@@ -502,6 +502,86 @@ Page { Layout.fillWidth: true } + Rectangle { + id: unverifiedStuffBubble + color: Qt.lighter(Nheko.theme.orange, verifyButtonHovered.hovered ? 1.2 : 1.0) + Layout.fillWidth: true + implicitHeight: explanation.height + Nheko.paddingMedium * 2 + visible: SelfVerificationStatus.status != SelfVerificationStatus.AllVerified + + RowLayout { + id: unverifiedStuffBubbleContainer + width: parent.width + height: explanation.height + Nheko.paddingMedium * 2 + spacing: 0 + + Label { + id: explanation + Layout.margins: Nheko.paddingMedium + Layout.rightMargin: Nheko.paddingSmall + color: Nheko.colors.buttonText + Layout.fillWidth: true + text: switch(SelfVerificationStatus.status) { + case SelfVerificationStatus.NoMasterKey: + //: Cross-signing setup has not run yet. + return qsTr("Encryption not set up"); + case SelfVerificationStatus.UnverifiedMasterKey: + //: The user just signed in with this device and hasn't verified their master key. + return qsTr("Unverified login"); + case SelfVerificationStatus.UnverifiedDevices: + //: There are unverified devices signed in to this account. + return qsTr("Please verify your other devices"); + default: + return "" + } + textFormat: Text.PlainText + wrapMode: Text.Wrap + } + + ImageButton { + id: closeUnverifiedBubble + + Layout.rightMargin: Nheko.paddingMedium + Layout.topMargin: Nheko.paddingMedium + Layout.alignment: Qt.AlignRight | Qt.AlignTop + hoverEnabled: true + width: fontMetrics.font.pixelSize + height: fontMetrics.font.pixelSize + image: ":/icons/icons/ui/remove-symbol.png" + ToolTip.visible: closeUnverifiedBubble.hovered + ToolTip.text: qsTr("Close") + onClicked: unverifiedStuffBubble.visible = false + } + + } + + HoverHandler { + id: verifyButtonHovered + enabled: !closeUnverifiedBubble.hovered + + acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad + } + + TapHandler { + enabled: !closeUnverifiedBubble.hovered + acceptedButtons: Qt.LeftButton + onSingleTapped: { + if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedDevices) { + SelfVerificationStatus.verifyUnverifiedDevices(); + } else { + SelfVerificationStatus.statusChanged(); + } + } + } + } + + Rectangle { + color: Nheko.theme.separator + height: 1 + Layout.fillWidth: true + visible: unverifiedStuffBubble.visible + } + } footer: ColumnLayout { diff --git a/resources/qml/SelfVerificationCheck.qml b/resources/qml/SelfVerificationCheck.qml
index 26af82b3..a7502d8d 100644 --- a/resources/qml/SelfVerificationCheck.qml +++ b/resources/qml/SelfVerificationCheck.qml
@@ -277,6 +277,10 @@ Item { bootstrapCrosssigning.open(); else if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedMasterKey) verifyMasterKey.open(); + else { + bootstrapCrosssigning.close(); + verifyMasterKey.close(); + } } diff --git a/resources/qml/device-verification/NewVerificationRequest.qml b/resources/qml/device-verification/NewVerificationRequest.qml
index 5ae2d25b..7e521605 100644 --- a/resources/qml/device-verification/NewVerificationRequest.qml +++ b/resources/qml/device-verification/NewVerificationRequest.qml
@@ -23,7 +23,10 @@ Pane { text: { if (flow.sender) { if (flow.isSelfVerification) - return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify %1 now?").arg(flow.deviceId); + if (flow.isMultiDeviceVerification) + return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify an unverified device now? (Please make sure you have one of those devices available.)"); + else + return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify %1 now?").arg(flow.deviceId); else return qsTr("To ensure that no malicious user can eavesdrop on your encrypted communications you can verify the other party."); } else {