2020-09-24 09:57:54 +10:00
|
|
|
// Copyright Mirage authors & contributors <https://github.com/mirukana/mirage>
|
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-07-12 12:52:14 +10:00
|
|
|
import "../Base/Buttons"
|
2020-08-03 15:19:08 +10:00
|
|
|
import "../PythonBridge" as PythonBridge
|
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-07-12 12:52:14 +10:00
|
|
|
page.footer: AutoDirectionLayout {
|
|
|
|
PositiveButton {
|
2020-06-25 22:32:08 +10:00
|
|
|
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-26 04:54:03 +10:00
|
|
|
focusItemOnTab: 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 ?
|
2020-08-03 15:19:08 +10:00
|
|
|
PythonBridge.Globals.hideErrorTypes.add(errorType) :
|
|
|
|
PythonBridge.Globals.hideErrorTypes.delete(errorType)
|
2019-12-27 00:20:51 +11:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
}
|