Skip to content

Commit

Permalink
Fix bitcoin-qt -version output formatting
Browse files Browse the repository at this point in the history
Summary:
> This PR makes command line output of `bitcoin-qt -version` formatted in the same way as `bitcoind -version` output.

This is a backport of Core [[bitcoin/bitcoin#14521 | PR14521]]

Test Plan: `src/qt/bitcoin-qt -version`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8352
  • Loading branch information
hebasto authored and PiRK committed Nov 10, 2020
1 parent 7b2fda0 commit e0818f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bitcoind.cpp
Expand Up @@ -75,7 +75,7 @@ static bool AppInit(int argc, char *argv[]) {
" (" + NETWORK_NAME + " network)\n";

if (gArgs.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo());
strUsage += FormatParagraph(LicenseInfo()) + "\n";
} else {
strUsage += "\nUsage: bitcoind [options] "
"Start " PACKAGE_NAME "\n";
Expand Down
8 changes: 5 additions & 3 deletions src/qt/utilitydialog.cpp
Expand Up @@ -16,6 +16,7 @@
#ifdef ENABLE_BIP70
#include <qt/paymentrequestplus.h>
#endif
#include <util/strencodings.h>
#include <util/system.h>

#include <QCloseEvent>
Expand All @@ -40,9 +41,9 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node &node, QWidget *parent,
if (about) {
setWindowTitle(tr("About %1").arg(PACKAGE_NAME));

std::string licenseInfo = LicenseInfo();
/// HTML-format the license message from the core
QString licenseInfo = QString::fromStdString(LicenseInfo());
QString licenseInfoHTML = licenseInfo;
QString licenseInfoHTML = QString::fromStdString(LicenseInfo());
// Make URLs clickable
QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
uri.setMinimal(true); // use non-greedy matching
Expand All @@ -52,7 +53,8 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node &node, QWidget *parent,

ui->aboutMessage->setTextFormat(Qt::RichText);
ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
text = version + "\n" + licenseInfo;
text = version + "\n" +
QString::fromStdString(FormatParagraph(licenseInfo));
ui->aboutMessage->setText(version + "<br><br>" + licenseInfoHTML);
ui->aboutMessage->setWordWrap(true);
ui->helpMessage->setVisible(false);
Expand Down

0 comments on commit e0818f9

Please sign in to comment.