5#if defined(HAVE_CONFIG_H)
45 QString licenseInfoHTML = QString::fromStdString(
LicenseInfo());
47 QRegExp uri(
"<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
49 licenseInfoHTML.replace(uri,
"<a href=\"\\1\">\\1</a>");
51 licenseInfoHTML.replace(
"\n",
"<br>");
54 ui->
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
60 setWindowTitle(tr(
"Command-line options"));
61 QString header =
"Usage: bitcoin-qt [command-line options] \n";
63 cursor.insertText(version);
65 cursor.insertText(header);
69 QString coreOptions = QString::fromStdString(strUsage);
70 text = version +
"\n\n" + header +
"\n" + coreOptions;
73 tf.setBorderStyle(QTextFrameFormat::BorderStyle_None);
75 QVector<QTextLength> widths;
76 widths << QTextLength(QTextLength::PercentageLength, 35);
77 widths << QTextLength(QTextLength::PercentageLength, 65);
78 tf.setColumnWidthConstraints(widths);
81 bold.setFontWeight(QFont::Bold);
83 for (
const QString &line : coreOptions.split(
"\n")) {
84 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);
97 cursor.movePosition(QTextCursor::Down);
98 cursor.insertText(line.trimmed(), bold);
99 cursor.insertTable(1, 2, tf);
143 QVBoxLayout *layout =
new QVBoxLayout();
144 layout->addWidget(
new QLabel(
145 tr(
"%1 is shutting down…").arg(
PACKAGE_NAME) +
"<br /><br />" +
146 tr(
"Do not shut down the computer until this window disappears.")));
154 assert(window !=
nullptr);
158 shutdownWindow->setWindowTitle(window->windowTitle());
161 const QPoint global = window->mapToGlobal(window->rect().center());
162 shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2);
163 shutdownWindow->show();
164 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
ShutdownWindow(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::Widget)
"Shutdown" window
void closeEvent(QCloseEvent *event) override
static QWidget * showShutdownWindow(QMainWindow *window)
void setupUi(QDialog *HelpMessageDialog)
std::string FormatFullVersion()
std::string LicenseInfo()
Returns licensing information (for -version)
Utility functions used by the Bitcoin Qt UI.
void handleCloseWindowShortcut(QWidget *w)
constexpr auto dialog_flags
std::string FormatParagraph(const std::string &in, size_t width, size_t indent)
Format a paragraph of text to a fixed width, adding spaces for indentation to any added line.