5#if defined(HAVE_CONFIG_H)
6#include <config/bitcoin-config.h>
15#include <qt/forms/ui_helpmessagedialog.h>
36 QString version = QString{PACKAGE_NAME} +
" " + tr(
"version") +
" " +
40 setWindowTitle(tr(
"About %1").arg(PACKAGE_NAME));
44 QString licenseInfoHTML = QString::fromStdString(
LicenseInfo());
46 QRegExp uri(
"<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
48 licenseInfoHTML.replace(uri,
"<a href=\"\\1\">\\1</a>");
50 licenseInfoHTML.replace(
"\n",
"<br>");
52 ui->aboutMessage->setTextFormat(Qt::RichText);
53 ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
54 text = version +
"\n" +
56 ui->aboutMessage->setText(version +
"<br><br>" + licenseInfoHTML);
57 ui->aboutMessage->setWordWrap(
true);
58 ui->helpMessage->setVisible(
false);
60 setWindowTitle(tr(
"Command-line options"));
62 "Usage: bitcoin-qt [command-line options] \n";
63 QTextCursor cursor(
ui->helpMessage->document());
64 cursor.insertText(version);
66 cursor.insertText(header);
70 QString coreOptions = QString::fromStdString(strUsage);
71 text = version +
"\n\n" + header +
"\n" + coreOptions;
74 tf.setBorderStyle(QTextFrameFormat::BorderStyle_None);
76 QVector<QTextLength> widths;
77 widths << QTextLength(QTextLength::PercentageLength, 35);
78 widths << QTextLength(QTextLength::PercentageLength, 65);
79 tf.setColumnWidthConstraints(widths);
82 bold.setFontWeight(QFont::Bold);
84 for (
const QString &line : coreOptions.split(
"\n")) {
85 if (line.startsWith(
" -")) {
86 cursor.currentTable()->appendRows(1);
87 cursor.movePosition(QTextCursor::PreviousCell);
88 cursor.movePosition(QTextCursor::NextRow);
89 cursor.insertText(line.trimmed());
90 cursor.movePosition(QTextCursor::NextCell);
91 }
else if (line.startsWith(
" ")) {
92 cursor.insertText(line.trimmed() +
' ');
93 }
else if (line.size() > 0) {
95 if (cursor.currentTable()) {
96 cursor.currentTable()->appendRows(1);
98 cursor.movePosition(QTextCursor::Down);
99 cursor.insertText(line.trimmed(), bold);
100 cursor.insertTable(1, 2, tf);
104 ui->helpMessage->moveCursor(QTextCursor::Start);
105 ui->scrollArea->setVisible(
false);
106 ui->aboutLogo->setVisible(
false);
139 QVBoxLayout *layout =
new QVBoxLayout();
140 layout->addWidget(
new QLabel(
141 tr(
"%1 is shutting down...").arg(PACKAGE_NAME) +
"<br /><br />" +
142 tr(
"Do not shut down the computer until this window disappears.")));
149 assert(window !=
nullptr);
153 shutdownWindow->setWindowTitle(window->windowTitle());
156 const QPoint global = window->mapToGlobal(window->rect().center());
157 shutdownWindow->move(global.x() - shutdownWindow->width() / 2,
158 global.y() - shutdownWindow->height() / 2);
159 shutdownWindow->show();
160 return shutdownWindow;
std::string GetHelpMessage() const
Get the help string.
"Help message" dialog box
void on_okButton_accepted()
HelpMessageDialog(QWidget *parent, bool about)
"Help message" or "About" dialog box
Ui::HelpMessageDialog * ui
void closeEvent(QCloseEvent *event) override
static QWidget * showShutdownWindow(QMainWindow *window)
ShutdownWindow(QWidget *parent=nullptr)
"Shutdown" window
std::string FormatFullVersion()
std::string LicenseInfo()
Returns licensing information (for -version)
void handleCloseWindowShortcut(QWidget *w)
std::string FormatParagraph(std::string_view in, size_t width, size_t indent)
Format a paragraph of text to a fixed width, adding spaces for indentation to any added line.