summary refs log tree commit diff
path: root/resources/qml/dialogs/FallbackAuthDialog.qml
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2023-07-13 12:53:51 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2023-07-14 13:16:43 -0400
commit0634d3f09c6e427e0b5091ebd9ba770099057951 (patch)
treedd193ed2d07110ae3b5f0157753fdce96be118e1 /resources/qml/dialogs/FallbackAuthDialog.qml
parentUpdate german translation (diff)
downloadnheko-0634d3f09c6e427e0b5091ebd9ba770099057951.tar.xz
QML the fallback auth dialog
Diffstat (limited to 'resources/qml/dialogs/FallbackAuthDialog.qml')
-rw-r--r--resources/qml/dialogs/FallbackAuthDialog.qml63
1 files changed, 63 insertions, 0 deletions
diff --git a/resources/qml/dialogs/FallbackAuthDialog.qml b/resources/qml/dialogs/FallbackAuthDialog.qml
new file mode 100644

index 00000000..d9a7ac8f --- /dev/null +++ b/resources/qml/dialogs/FallbackAuthDialog.qml
@@ -0,0 +1,63 @@ +// SPDX-FileCopyrightText: Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick +import QtQuick.Controls +import im.nheko + +ApplicationWindow { + id: fallbackRoot + + required property FallbackAuth fallback + + function accept() { + fallback.confirm(); + fallbackRoot.close(); + } + + function reject() { + fallback.cancel(); + fallbackRoot.close(); + } + + color: palette.window + title: qsTr("Fallback authentication") + flags: Qt.Tool | Qt.WindowStaysOnTopHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint + height: msg.implicitHeight + footer.implicitHeight + width: Math.max(msg.implicitWidth, footer.implicitWidth) + + Shortcut { + sequence: StandardKey.Cancel + onActivated: fallbackRoot.reject() + } + + Label { + id: msg + + anchors.fill: parent + padding: 8 + text: qsTr("Open the fallback, follow the steps, and confirm after completing them.") + } + + footer: DialogButtonBox { + onAccepted: fallbackRoot.accept() + onRejected: fallbackRoot.reject() + + Button { + text: qsTr("Open Fallback in Browser") + onClicked: fallback.openFallbackAuth() + } + + Button { + text: qsTr("Cancel") + DialogButtonBox.buttonRole: DialogButtonBox.RejectRole + } + + Button { + text: qsTr("Confirm") + DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole + } + } + +}