Commit 86be9096 authored by Janet Blackquill's avatar Janet Blackquill 🌈 Committed by Nate Graham
Browse files

Add button to view contents of AppletError

parent f4ddcdae
......@@ -18,6 +18,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Window 2.15
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
......@@ -34,49 +35,83 @@ Item {
clip: true
ColumnLayout {
PlasmaComponents.ToolButton {
icon.name: "arrow-up"
visible: !dialog.visible
onClicked: dialog.visible = true
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
bottom: parent.bottom
right: parent.right
}
}
PlasmaCore.IconItem {
Layout.minimumWidth: PlasmaCore.Units.iconSizes.huge
Layout.minimumHeight: PlasmaCore.Units.iconSizes.huge
source: "dialog-error"
Layout.alignment: Qt.AlignHCenter
}
RowLayout {
anchors.fill: parent
PlasmaExtras.Heading {
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Sorry! There was an error loading %1.", root.errorInformation.appletName)
level: 2
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
ColumnLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.fillWidth: true
}
PlasmaComponents.Button {
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Copy Error Details to Clipboard")
icon.name: "edit-copy"
PlasmaCore.IconItem {
Layout.minimumWidth: PlasmaCore.Units.iconSizes.huge
Layout.minimumHeight: PlasmaCore.Units.iconSizes.huge
source: "dialog-error"
Layout.alignment: Qt.AlignHCenter
}
PlasmaExtras.Heading {
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Sorry! There was an error loading %1.", root.errorInformation.appletName)
level: 2
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
}
onClicked: copyHelper.copyText()
Layout.alignment: Qt.AlignHCenter
}
PlasmaComponents.Button {
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Copy Error Details to Clipboard")
icon.name: "edit-copy"
PlasmaComponents.TextArea {
id: copyHelper
visible: root.errorInformation.isDebugMode
onClicked: copyHelper.copyText()
Layout.alignment: Qt.AlignHCenter
}
text: root.errorInformation.errors.join("\n\n")
readOnly: true
Layout.fillHeight: true
Layout.fillWidth: true
Window {
id: dialog
function copyText() {
selectAll()
copy()
width: PlasmaCore.Units.gridUnit * 20
height: PlasmaCore.Units.gridUnit * 20
visible: false
color: PlasmaCore.Theme.backgroundColor
PlasmaComponents.TextArea {
anchors.fill: parent
text: root.errorInformation.errors.join("\n\n")
readOnly: true
wrapMode: TextEdit.Wrap
background: null
}
}
PlasmaComponents.TextArea {
id: copyHelper
visible: root.errorInformation.isDebugMode
wrapMode: TextEdit.Wrap
text: root.errorInformation.errors.join("\n\n")
readOnly: true
Layout.fillHeight: true
Layout.fillWidth: true
function copyText() {
selectAll()
copy()
}
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment