matrixion/resources/qml/dialogs/FallbackAuthDialog.qml

61 lines
1.4 KiB
QML
Raw Normal View History

2023-07-13 19:53:51 +03:00
// 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
flags: Qt.Tool | Qt.WindowStaysOnTopHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
height: msg.implicitHeight + footer.implicitHeight
2023-10-31 05:11:03 +03:00
title: qsTr("Fallback authentication")
2023-07-13 19:53:51 +03:00
width: Math.max(msg.implicitWidth, footer.implicitWidth)
footer: DialogButtonBox {
onAccepted: fallbackRoot.accept()
onRejected: fallbackRoot.reject()
Button {
text: qsTr("Open Fallback in Browser")
2023-10-31 05:11:03 +03:00
2023-07-13 19:53:51 +03:00
onClicked: fallback.openFallbackAuth()
}
Button {
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
2023-10-31 05:11:03 +03:00
text: qsTr("Cancel")
2023-07-13 19:53:51 +03:00
}
Button {
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
2023-10-31 05:11:03 +03:00
text: qsTr("Confirm")
2023-07-13 19:53:51 +03:00
}
}
2023-10-31 05:11:03 +03:00
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.")
}
2023-07-13 19:53:51 +03:00
}