NDEVR
API Documentation
QTErrorDialog.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: QTErrorDialog
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/LogView.h>
35#include <NDEVR/QCustomTabWidget.h>
36#include <NDEVR/Dictionary.h>
37#include <NDEVR/Exception.h>
38#include <NDEVR/UUID.h>
39#include <QDialog>
40namespace Ui
41{
42 class ErrorDialogUI;
43}
44namespace NDEVR
45{
46 class CrashManager;
47 class QTErrorDialog;
48 class CrashManager;
53 class NDEVR_WIDGETS_API QTErrorDialog : public QWidget
54 {
55 Q_OBJECT
56 public:
63 QTErrorDialog(const Exception& exception, LogPtr log = LogPtr(), QWidget* parent = nullptr);
69 QSize sizeHint() const override;
74 QSize minimumSizeHint() const override;
75 public slots:
79 void onAccept();
83 void onIgnore();
84 signals:
87 public:
93 static void CreateErrorDialog(Exception exception, LogPtr log = LogPtr());
97 static void ErrorHandlingInit();
101 static void ErrorHandlingStop();
106 protected:
107 Ui::ErrorDialogUI* ui;
111 protected:
118 };
119
124 class NDEVR_WIDGETS_API QTErrorBrowser : public QCustomTabWidget
125 {
126 Q_OBJECT
127 public:
128 QTErrorBrowser();
133 QSize sizeHint() const override;
143 static QTErrorBrowser* defaultInstance();
144 };
145}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Manages crash handling, exception reporting, and mini-dump creation.
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
Provides consistent interface to handle errors through the throw expression.
Definition Exception.hpp:47
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
A table showing a specific log that allows the user to scroll around to view various log entries.
Definition LogView.h:57
QCustomTabWidget(QWidget *parent=nullptr)
Constructs a tab widget.
static QTErrorBrowser * defaultInstance()
Returns the singleton instance of the error browser.
QSize sizeHint() const override
Returns the recommended size for the error browser widget.
void addErrorDialog(QTErrorDialog *dialog)
Adds an error dialog as a new tab in the browser.
A dialog typically shown as a tab that displays an exception to the user.
static void ErrorHandlingInit()
Initializes the global error handling system.
LogPtr m_log
The log associated with this error dialog.
Ui::ErrorDialogUI * ui
The auto-generated UI form for the error dialog.
QTErrorDialog(const Exception &exception, LogPtr log=LogPtr(), QWidget *parent=nullptr)
Constructs an error dialog for the given exception.
void onIgnoreSignal()
Signal emitted when the user ignores the error.
UUID m_exception_id
Unique identifier for the exception being displayed.
LogView * m_log_dock
Widget displaying log entries related to the error.
QSize sizeHint() const override
Returns the recommended size for this dialog.
QSize minimumSizeHint() const override
Returns the minimum recommended size for this dialog.
static void CreateErrorDialog(Exception exception, LogPtr log=LogPtr())
Creates and shows an error dialog for the given exception.
static bool s_is_manager_active
Whether the error handling manager is currently active.
static void HandlePendingExceptions()
Processes and displays any exceptions that were queued while dialogs were at capacity.
static void ErrorHandlingStop()
Stops the global error handling system.
void onAccept()
Slot invoked when the user accepts or acknowledges the error.
static Dictionary< UUID, uint04 > s_ignored_messages
Tracks how many times each exception has been ignored by UUID.
static Buffer< Exception > s_pending_exceptions
Queue of exceptions waiting to be shown.
static uint04 s_number_of_active_dialogs
Current number of visible error dialogs.
void onIgnore()
Slot invoked when the user chooses to ignore the error.
static CrashManager * s_global_crash_manager
Global crash manager instance for fatal error handling.
void onAcceptSignal()
Signal emitted when the user accepts or acknowledges the error.
static uint04 s_max_num_of_active_dialogs
Maximum number of error dialogs allowed simultaneously.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...