// SPDX-FileCopyrightText: 2026 Matvey Shcherbinin // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL import QtQuick import QtQuick.Layouts import QtQuick.Controls as QQC2 import org.kde.kirigami as Kirigami import org.kde.kirigamiaddons.components as Components import koutnet.app // Ask for consent before saving an incoming file. Kirigami.PromptDialog { id: root property string senderName: "" property string senderSource: "" property string fileName: "" property string fileSize: "" // Dialogs already define accepted()/rejected(), so the consent signals get // their own names instead of re-declaring the superclass ones. signal acceptRequested() signal declineRequested() Kirigami.Theme.inherit: false title: i18nc("@title:window", "Incoming file transfer") showCloseButton: false standardButtons: QQC2.Dialog.NoButton customFooterActions: [ Kirigami.Action { text: i18nc("@action:button save the incoming file", "Accept") icon.name: "document-save" onTriggered: { root.acceptRequested() root.close() } }, Kirigami.Action { text: i18nc("@action:button refuse the incoming file", "Decline") icon.name: "dialog-cancel" onTriggered: { root.declineRequested() root.close() } } ] RowLayout { spacing: Kirigami.Units.largeSpacing Components.Avatar { implicitWidth: Kirigami.Units.gridUnit * 4 implicitHeight: Kirigami.Units.gridUnit * 4 Layout.alignment: Qt.AlignVCenter name: root.senderName } ColumnLayout { Layout.fillWidth: true spacing: 0 Kirigami.Heading { Layout.fillWidth: true level: 2 elide: Text.ElideRight text: root.senderName } QQC2.Label { Layout.fillWidth: true elide: Text.ElideRight text: root.senderSource font: Kirigami.Theme.smallFont color: AppPalette.disabledText } QQC2.Label { Layout.fillWidth: true wrapMode: Text.WordWrap text: i18nc("@info:status %1 is the file name, %2 its size", "%1 (%2) is being sent to you", root.fileName, root.fileSize) font: Kirigami.Theme.smallFont } } } }