mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
qt: Make PACKAGE_BUGREPORT link clickable
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
parent
e658b0e49b
commit
af7e365b15
3 changed files with 20 additions and 1 deletions
|
@ -45,10 +45,12 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
|
#include <QLatin1String>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QStringBuilder>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
@ -417,7 +419,10 @@ void BitcoinApplication::shutdownResult()
|
||||||
|
|
||||||
void BitcoinApplication::handleRunawayException(const QString &message)
|
void BitcoinApplication::handleRunawayException(const QString &message)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(nullptr, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. %1 can no longer continue safely and will quit.").arg(PACKAGE_NAME) + QString("<br><br>") + message);
|
QMessageBox::critical(
|
||||||
|
nullptr, tr("Runaway exception"),
|
||||||
|
tr("A fatal error occurred. %1 can no longer continue safely and will quit.").arg(PACKAGE_NAME) %
|
||||||
|
QLatin1String("<br><br>") % GUIUtil::MakeHtmlLink(message, PACKAGE_BUGREPORT));
|
||||||
::exit(EXIT_FAILURE);
|
::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
#include <QLatin1String>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringBuilder>
|
||||||
#include <QTextDocument> // for Qt::mightBeRichText
|
#include <QTextDocument> // for Qt::mightBeRichText
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
|
@ -893,4 +895,11 @@ QImage GetImage(const QLabel* label)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MakeHtmlLink(const QString& source, const QString& link)
|
||||||
|
{
|
||||||
|
return QString(source).replace(
|
||||||
|
link,
|
||||||
|
QLatin1String("<a href=\"") % link % QLatin1String("\">") % link % QLatin1String("</a>"));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace GUIUtil
|
} // namespace GUIUtil
|
||||||
|
|
|
@ -327,6 +327,11 @@ namespace GUIUtil
|
||||||
QObject::connect(&source, &QObject::destroyed, object, std::forward<Fn>(function), connection);
|
QObject::connect(&source, &QObject::destroyed, object, std::forward<Fn>(function), connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces a plain text link with an HTML tagged one.
|
||||||
|
*/
|
||||||
|
QString MakeHtmlLink(const QString& source, const QString& link);
|
||||||
|
|
||||||
} // namespace GUIUtil
|
} // namespace GUIUtil
|
||||||
|
|
||||||
#endif // BITCOIN_QT_GUIUTIL_H
|
#endif // BITCOIN_QT_GUIUTIL_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue