Move consent sheet to separate file

This commit is contained in:
Tobias Fella
2024-04-30 22:21:55 +02:00
parent 55b29f645b
commit 8554898e45
3 changed files with 43 additions and 33 deletions

39
src/qml/ConsentDialog.qml Normal file
View File

@@ -0,0 +1,39 @@
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
import QtQuick
import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami
import org.kde.neochat
Kirigami.Dialog {
id: root
required property string url
width: Math.min(Kirigami.Units.gridUnit * 24, QQC2.ApplicationWindow.window.width)
height: Kirigami.Units.gridUnit * 8
leftPadding: Kirigami.Units.largeSpacing
rightPadding: Kirigami.Units.largeSpacing
title: i18nc("@title:dialog", "User Consent")
contentItem: QQC2.Label {
text: i18nc("@info", "Your homeserver requires you to agree to its terms and conditions before being able to use it. Please click the button below to read them.")
wrapMode: Text.WordWrap
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
}
customFooterActions: [
Kirigami.Action {
text: i18nc("@action:button", "Open")
icon.name: "internet-services"
onTriggered: {
UrlHelper.openUrl(root.url);
root.close();
}
}
]
}