Warning, /network/neochat/src/qml/RemoveChildDialog.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 import QtQuick
0005 import QtQuick.Layouts
0006 
0007 import org.kde.kirigami as Kirigami
0008 import org.kde.kirigamiaddons.formcard as FormCard
0009 
0010 import org.kde.neochat
0011 
0012 Kirigami.Dialog {
0013     id: root
0014 
0015     required property NeoChatRoom parentRoom
0016 
0017     required property string roomId
0018 
0019     required property string displayName
0020 
0021     required property string parentDisplayName
0022 
0023     required property bool canSetParent
0024 
0025     required property bool isDeclaredParent
0026 
0027     title: i18nc("@title", "Remove Child")
0028 
0029     width: Math.min(applicationWindow().width, Kirigami.Units.gridUnit * 24)
0030 
0031     standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
0032 
0033     onAccepted: parentRoom.removeChild(root.roomId, removeOfficalCheck.checked)
0034 
0035     contentItem: FormCard.FormCardPage {
0036         FormCard.FormCard {
0037             Layout.topMargin: Kirigami.Units.largeSpacing
0038             FormCard.FormTextDelegate {
0039                 text: i18n("The child %1 will be removed from the space %2", root.displayName, root.parentDisplayName)
0040                 textItem.wrapMode: Text.Wrap
0041             }
0042             FormCard.FormCheckDelegate {
0043                 id: removeOfficalCheck
0044                 visible: root.isDeclaredParent
0045                 enabled: root.canSetParent
0046                 text: i18n("The current space is the official parent of this room, should this be cleared?")
0047                 checked: root.canSetParent
0048             }
0049         }
0050     }
0051 }