2019-12-27 00:20:51 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
2020-05-30 06:35:27 +10:00
|
|
|
import QtQuick.Controls 2.12
|
2019-12-27 00:20:51 +11:00
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import "../Base"
|
2020-06-25 22:32:08 +10:00
|
|
|
import "../Base/ButtonLayout"
|
2019-12-27 00:20:51 +11:00
|
|
|
|
2020-06-25 22:32:08 +10:00
|
|
|
HColumnPopup {
|
|
|
|
id: popup
|
2019-12-27 00:20:51 +11:00
|
|
|
|
|
|
|
|
|
|
|
property string errorType
|
2019-12-27 01:05:01 +11:00
|
|
|
property string message: ""
|
2019-12-27 00:20:51 +11:00
|
|
|
property string traceback: ""
|
|
|
|
|
|
|
|
|
2020-06-25 22:32:08 +10:00
|
|
|
page.footer: ButtonLayout {
|
|
|
|
ApplyButton {
|
|
|
|
text: qsTr("Report")
|
|
|
|
icon.name: "report-error"
|
|
|
|
enabled: false // TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
CancelButton {
|
|
|
|
id: cancelButton
|
|
|
|
text: qsTr("Ignore")
|
|
|
|
onClicked: popup.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onOpened: cancelButton.forceActiveFocus()
|
|
|
|
|
|
|
|
|
|
|
|
SummaryLabel {
|
|
|
|
text: qsTr("Unexpected error occured: <i>%1</i>").arg(errorType)
|
|
|
|
textFormat: Text.StyledText
|
|
|
|
}
|
|
|
|
|
2020-06-23 03:57:49 +10:00
|
|
|
HScrollView {
|
2020-06-25 22:32:08 +10:00
|
|
|
clip: true
|
|
|
|
|
2019-12-27 00:20:51 +11:00
|
|
|
Layout.fillWidth: true
|
2020-06-25 22:32:08 +10:00
|
|
|
Layout.fillHeight: true
|
2020-05-30 06:35:27 +10:00
|
|
|
|
|
|
|
HTextArea {
|
|
|
|
text: [message, traceback].join("\n\n") || qsTr("No info available")
|
|
|
|
readOnly: true
|
|
|
|
font.family: theme.fontFamily.mono
|
2020-06-25 22:32:08 +10:00
|
|
|
focusOnTab: hideCheckBox
|
2020-05-30 06:35:27 +10:00
|
|
|
}
|
2019-12-27 00:20:51 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
HCheckBox {
|
2020-06-25 22:32:08 +10:00
|
|
|
id: hideCheckBox
|
2019-12-27 00:20:51 +11:00
|
|
|
text: qsTr("Hide this type of error until restart")
|
|
|
|
onCheckedChanged:
|
|
|
|
checked ?
|
|
|
|
window.hideErrorTypes.add(errorType) :
|
|
|
|
window.hideErrorTypes.delete(errorType)
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
}
|