Fix `bitcoin-qt -version` output formatting

pull/643/head
Hennadii Stepanov 6 years ago
parent 13d98ea0d7
commit 60ae463a68
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

@ -77,7 +77,7 @@ static bool AppInit(int argc, char* argv[])
if (gArgs.IsArgSet("-version")) if (gArgs.IsArgSet("-version"))
{ {
strUsage += FormatParagraph(LicenseInfo()); strUsage += FormatParagraph(LicenseInfo()) + "\n";
} }
else else
{ {

@ -23,6 +23,7 @@
#include <init.h> #include <init.h>
#include <interfaces/node.h> #include <interfaces/node.h>
#include <util/system.h> #include <util/system.h>
#include <util/strencodings.h>
#include <stdio.h> #include <stdio.h>
@ -54,9 +55,9 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, bo
{ {
setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME))); setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME)));
std::string licenseInfo = LicenseInfo();
/// HTML-format the license message from the core /// HTML-format the license message from the core
QString licenseInfo = QString::fromStdString(LicenseInfo()); QString licenseInfoHTML = QString::fromStdString(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
@ -66,7 +67,7 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, bo
ui->aboutMessage->setTextFormat(Qt::RichText); ui->aboutMessage->setTextFormat(Qt::RichText);
ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); 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->setText(version + "<br><br>" + licenseInfoHTML);
ui->aboutMessage->setWordWrap(true); ui->aboutMessage->setWordWrap(true);
ui->helpMessage->setVisible(false); ui->helpMessage->setVisible(false);

Loading…
Cancel
Save