| 
									
										
										
										
											2019-12-26 09:20:51 -04:00
										 |  |  | // SPDX-License-Identifier: LGPL-3.0-or-later
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import QtQuick 2.12 | 
					
						
							| 
									
										
										
										
											2020-05-29 16:35:27 -04:00
										 |  |  | import QtQuick.Controls 2.12 | 
					
						
							| 
									
										
										
										
											2019-12-26 09:20:51 -04:00
										 |  |  | import QtQuick.Layouts 1.12 | 
					
						
							|  |  |  | import "../Base" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BoxPopup { | 
					
						
							|  |  |  |     summary.text: qsTr("Unexpected error occured: <i>%1</i>").arg(errorType) | 
					
						
							|  |  |  |     summary.textFormat: Text.StyledText | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     okText: qsTr("Report") | 
					
						
							|  |  |  |     okIcon: "report-error" | 
					
						
							|  |  |  |     okEnabled: false  // TODO
 | 
					
						
							|  |  |  |     cancelText: qsTr("Ignore") | 
					
						
							|  |  |  |     box.focusButton: "cancel" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     property string errorType | 
					
						
							| 
									
										
										
										
											2019-12-26 10:05:01 -04:00
										 |  |  |     property string message: "" | 
					
						
							| 
									
										
										
										
											2019-12-26 09:20:51 -04:00
										 |  |  |     property string traceback: "" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-22 13:57:49 -04:00
										 |  |  |     HScrollView { | 
					
						
							| 
									
										
										
										
											2019-12-26 09:20:51 -04:00
										 |  |  |         Layout.fillWidth: true | 
					
						
							| 
									
										
										
										
											2020-05-29 16:35:27 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |         HTextArea { | 
					
						
							|  |  |  |             text: [message, traceback].join("\n\n") || qsTr("No info available") | 
					
						
							|  |  |  |             readOnly: true | 
					
						
							|  |  |  |             font.family: theme.fontFamily.mono | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2019-12-26 09:20:51 -04:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     HCheckBox { | 
					
						
							|  |  |  |         text: qsTr("Hide this type of error until restart") | 
					
						
							|  |  |  |         onCheckedChanged: | 
					
						
							|  |  |  |             checked ? | 
					
						
							|  |  |  |             window.hideErrorTypes.add(errorType) : | 
					
						
							|  |  |  |             window.hideErrorTypes.delete(errorType) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         Layout.fillWidth: true | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |