mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
qt: Add BitcoinApplication::handleNonFatalException function
This helper function will be used in the following commits. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
parent
af7e365b15
commit
64a8755af3
2 changed files with 16 additions and 0 deletions
|
@ -426,6 +426,16 @@ void BitcoinApplication::handleRunawayException(const QString &message)
|
|||
::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void BitcoinApplication::handleNonFatalException(const QString& message)
|
||||
{
|
||||
assert(QThread::currentThread() == thread());
|
||||
QMessageBox::warning(
|
||||
nullptr, tr("Internal error"),
|
||||
tr("An internal error occurred. %1 will attempt to continue safely. This is "
|
||||
"an unexpected bug which can be reported as described below.").arg(PACKAGE_NAME) %
|
||||
QLatin1String("<br><br>") % GUIUtil::MakeHtmlLink(message, PACKAGE_BUGREPORT));
|
||||
}
|
||||
|
||||
WId BitcoinApplication::getMainWinId() const
|
||||
{
|
||||
if (!window)
|
||||
|
|
|
@ -99,6 +99,12 @@ public Q_SLOTS:
|
|||
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
|
||||
void handleRunawayException(const QString &message);
|
||||
|
||||
/**
|
||||
* A helper function that shows a message box
|
||||
* with details about a non-fatal exception.
|
||||
*/
|
||||
void handleNonFatalException(const QString& message);
|
||||
|
||||
Q_SIGNALS:
|
||||
void requestedInitialize();
|
||||
void requestedShutdown();
|
||||
|
|
Loading…
Add table
Reference in a new issue