Warning, /plasma/drkonqi/src/qml/PerfectDuplicatePage.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0002 // SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org>
0003 
0004 import QtQuick 2.15
0005 import QtQuick.Layouts 1.15
0006 import QtQuick.Controls 2.15 as QQC2
0007 import org.kde.kirigami 2.19 as Kirigami
0008 
0009 import org.kde.drkonqi 1.0
0010 
0011 Kirigami.ScrollablePage {
0012     id: page
0013 
0014     title: i18nc("@title", "Problem is Already Reported")
0015 
0016     property var id: null
0017     property var duplicateOf: null
0018     property var alreadyClosed: null
0019 
0020     ColumnLayout {
0021         QQC2.Label {
0022             Layout.fillWidth: true
0023             wrapMode: Text.Wrap
0024             text: {
0025                 const bugNumber = String(reportInterface.duplicateId)
0026                 const bugUrl = Globals.bugUrl(bugNumber)
0027                 if (alreadyClosed) {
0028                     if (duplicateOf !== null) {
0029                         return xi18nc("@info", "Your crash has already been reported as <link url=\"%1\">Bug %1</link>, which is a duplicate of the <emphasis strong='true'>closed</emphasis> <link url=\"%2\">Bug %2</link>.",
0030                         bugUrl, bugNumber,
0031                         Globals.bugUrl(duplicateOf), String(duplicateOf)
0032                         )
0033                     }
0034                     return xi18nc("@info", "Your crash has already been reported as <link url=\"%1\">Bug %1</link> which has been <emphasis strong='true'>closed</emphasis>.",
0035                     bugUrl, bugNumber)
0036                 }
0037 
0038                 if (duplicateOf !== null) {
0039                     return xi18nc("@info", "Your crash has already been reported as <link url=\"%1\">Bug %1</link>, which is a <emphasis strong='true'>duplicate</emphasis> of <link url=\"%2\">Bug %2</link>",
0040                     bugUrl, bugNumber,
0041                     Globals.bugUrl(duplicateOf), String(duplicateOf))
0042                 }
0043                 return xi18nc("@info", "Your crash is a <emphasis strong='true'>duplicate</emphasis> and has already been reported as <link url=\"%1\">Bug %2</link>.",
0044                 bugUrl, bugNumber)
0045             }
0046             onLinkActivated: Qt.openUrlExternally(link)
0047         }
0048         QQC2.Label {
0049             visible: alreadyClosed !== null
0050             Layout.fillWidth: true
0051             wrapMode: Text.Wrap
0052             text: xi18nc("@label", "You may choose to add additional information, but you should only do so if you have new or requested information.");
0053         }
0054     }
0055 
0056     footer: FooterActionBar {
0057         actions: [
0058             Kirigami.Action {
0059                 // FIXME is there a kstandardguiitem thing for qml?
0060                 text: i18nc("@action:button", "Close")
0061                 onTriggered: Qt.quit()
0062             },
0063             Kirigami.Action {
0064                 iconName: "mail-attachment"
0065                 text: i18nc("@action:button", "Attach Additional Information")
0066                 onTriggered: {
0067                     reportInterface.attachToBugNumber = reportInterface.duplicateId
0068                     pageStack.push('qrc:/ui/ReportPage.qml')
0069                 }
0070             }
0071         ]
0072     }
0073 }