Changeset View
Changeset View
Standalone View
Standalone View
src/qt/utilitydialog.cpp
Show All 31 Lines | |||||
#include <cstdio> | #include <cstdio> | ||||
/** "Help message" or "About" dialog box */ | /** "Help message" or "About" dialog box */ | ||||
HelpMessageDialog::HelpMessageDialog(interfaces::Node &node, QWidget *parent, | HelpMessageDialog::HelpMessageDialog(interfaces::Node &node, QWidget *parent, | ||||
bool about) | bool about) | ||||
: QDialog(parent), ui(new Ui::HelpMessageDialog) { | : QDialog(parent), ui(new Ui::HelpMessageDialog) { | ||||
ui->setupUi(this); | ui->setupUi(this); | ||||
QString version = tr(PACKAGE_NAME) + " " + tr("version") + " " + | QString version = QString{PACKAGE_NAME} + " " + tr("version") + " " + | ||||
QString::fromStdString(FormatFullVersion()); | QString::fromStdString(FormatFullVersion()); | ||||
/** | /** | ||||
* On x86 add a bit specifier to the version so that users can distinguish | * On x86 add a bit specifier to the version so that users can distinguish | ||||
* between 32 and 64 bit builds. On other architectures, 32/64 bit may be more | * between 32 and 64 bit builds. On other architectures, 32/64 bit may be more | ||||
* ambiguous. | * ambiguous. | ||||
*/ | */ | ||||
#if defined(__x86_64__) | #if defined(__x86_64__) | ||||
version += " " + tr("(%1-bit)").arg(64); | version += " " + tr("(%1-bit)").arg(64); | ||||
#elif defined(__i386__) | #elif defined(__i386__) | ||||
version += " " + tr("(%1-bit)").arg(32); | version += " " + tr("(%1-bit)").arg(32); | ||||
#endif | #endif | ||||
if (about) { | if (about) { | ||||
setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME))); | setWindowTitle(tr("About %1").arg(PACKAGE_NAME)); | ||||
/// HTML-format the license message from the core | /// HTML-format the license message from the core | ||||
QString licenseInfo = QString::fromStdString(LicenseInfo()); | QString licenseInfo = QString::fromStdString(LicenseInfo()); | ||||
QString licenseInfoHTML = licenseInfo; | QString licenseInfoHTML = licenseInfo; | ||||
// Make URLs clickable | // Make URLs clickable | ||||
QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); | QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); | ||||
uri.setMinimal(true); // use non-greedy matching | uri.setMinimal(true); // use non-greedy matching | ||||
licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>"); | licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>"); | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | void HelpMessageDialog::on_okButton_accepted() { | ||||
close(); | close(); | ||||
} | } | ||||
/** "Shutdown" window */ | /** "Shutdown" window */ | ||||
ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f) | ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f) | ||||
: QWidget(parent, f) { | : QWidget(parent, f) { | ||||
QVBoxLayout *layout = new QVBoxLayout(); | QVBoxLayout *layout = new QVBoxLayout(); | ||||
layout->addWidget(new QLabel( | layout->addWidget(new QLabel( | ||||
tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" + | tr("%1 is shutting down...").arg(PACKAGE_NAME) + "<br /><br />" + | ||||
tr("Do not shut down the computer until this window disappears."))); | tr("Do not shut down the computer until this window disappears."))); | ||||
setLayout(layout); | setLayout(layout); | ||||
} | } | ||||
QWidget *ShutdownWindow::showShutdownWindow(BitcoinGUI *window) { | QWidget *ShutdownWindow::showShutdownWindow(BitcoinGUI *window) { | ||||
if (!window) { | if (!window) { | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
Show All 16 Lines |