mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-09 19:13:28 +02: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:
@@ -426,6 +426,16 @@ void BitcoinApplication::handleRunawayException(const QString &message)
|
|||||||
::exit(EXIT_FAILURE);
|
::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
|
WId BitcoinApplication::getMainWinId() const
|
||||||
{
|
{
|
||||||
if (!window)
|
if (!window)
|
||||||
|
@@ -99,6 +99,12 @@ public Q_SLOTS:
|
|||||||
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
|
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
|
||||||
void handleRunawayException(const QString &message);
|
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:
|
Q_SIGNALS:
|
||||||
void requestedInitialize();
|
void requestedInitialize();
|
||||||
void requestedShutdown();
|
void requestedShutdown();
|
||||||
|
Reference in New Issue
Block a user