Warning, /plasma/drkonqi/src/qml/SentryPage.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: 2021-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.Page {
0012 globalToolBarStyle: actions.size > 0 ? undefined : Kirigami.ApplicationHeaderStyle.None
0013
0014 actions: [
0015 Kirigami.Action {
0016 icon.name: "system-reboot-symbolic"
0017 text: i18nc("@action %1 is an application name e.g. kwrite", "Restart %1", CrashedApplication.name)
0018 visible: !CrashedApplication.hasBeenRestarted
0019 onTriggered: CrashedApplication.restart()
0020 }
0021 ]
0022
0023 ColumnLayout {
0024 anchors.fill: parent
0025
0026 Item {
0027 Layout.fillHeight: true
0028 }
0029
0030 QQC2.Label {
0031 Layout.alignment: Qt.AlignHCenter
0032 text: i18nc("@label", "Collecting crash data…")
0033 visible: !reportInterface.crashEventSent
0034 }
0035
0036 QQC2.ProgressBar {
0037 id: progressBar
0038 Layout.alignment: Qt.AlignHCenter
0039 indeterminate: true
0040 visible: !reportInterface.crashEventSent
0041 }
0042
0043 ColumnLayout {
0044 Layout.alignment: Qt.AlignHCenter
0045 visible: !progressBar.visible
0046 Kirigami.Icon {
0047 Layout.alignment: Qt.AlignHCenter
0048 source: "data-success"
0049 width: Kirigami.Units.iconSizes.enormous
0050 height: width
0051 }
0052 QQC2.Label {
0053 text: i18nc("@label", "Crash Report Sent")
0054 }
0055 }
0056
0057 QQC2.CheckBox {
0058 Layout.alignment: Qt.AlignHCenter
0059 checked: Settings.sentry
0060 text: i18nc("@label", "Always report crashes automatically in the future")
0061 onToggled: {
0062 Settings.sentry = checked
0063 Settings.save()
0064 }
0065
0066 QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
0067 QQC2.ToolTip.visible: hovered
0068 QQC2.ToolTip.text: i18nc("@info:tooltip",
0069 `Always automatically submit a crash report to KDE's crash tracking system. No manual input required.
0070 You will not receive any more crash notifications.`)
0071 }
0072
0073 QQC2.ScrollView {
0074 id: detailView
0075 Layout.fillWidth: true
0076 Layout.fillHeight: true
0077
0078 QQC2.TextArea {
0079 id: detailArea
0080 placeholderText: i18nc("@label placeholder text in TextArea", "Tell us more about the crash…")
0081 wrapMode: Text.Wrap
0082 }
0083 }
0084
0085 QQC2.Button {
0086 Layout.alignment: Qt.AlignRight
0087 visible: detailView.visible
0088 action: Kirigami.Action {
0089 enabled: detailArea.text.length > 3
0090 icon.name: "document-send-symbolic"
0091 text: i18nc("@action:button", "Send Message")
0092 onTriggered: {
0093 reportInterface.createCrashMessage(detailArea.text)
0094 detailView.visible = false
0095 }
0096 }
0097 }
0098
0099 Item {
0100 visible: !detailView.visible
0101 Layout.fillHeight: true
0102 }
0103 }
0104 }