<commit_before>// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif

#include <qt/utilitydialog.h>

#include <clientversion.h>
#include <init.h>
#include <qt/bitcoingui.h>
#include <qt/forms/ui_helpmessagedialog.h>
#ifdef ENABLE_BIP70
#include <qt/paymentrequestplus.h>
#endif
#include <util/system.h>

#include <QCloseEvent>
#include <QLabel>
#include <QRegExp>
#include <QTextCursor>
#include <QTextTable>
#include <QVBoxLayout>

#include <cstdio>

/** "Help message" or "About" dialog box */
HelpMessageDialog::HelpMessageDialog(interfaces::Node &node, QWidget *parent,
                                     bool about)
    : QDialog(parent), ui(new Ui::HelpMessageDialog) {
    ui->setupUi(this);

    QString version = QString{PACKAGE_NAME} + " " + tr("version") + " " +
                      QString::fromStdString(FormatFullVersion());
/**
 * 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
 * ambiguous.
 */
#if defined(__x86_64__)
    version += " " + tr("(%1-bit)").arg(64);
#elif defined(__i386__)
    version += " " + tr("(%1-bit)").arg(32);
#endif

    if (about) {
        setWindowTitle(tr("About %1").arg(PACKAGE_NAME));

        /// HTML-format the license message from the core
        QString licenseInfo = QString::fromStdString(LicenseInfo());
        QString licenseInfoHTML = licenseInfo;
        // Make URLs clickable
        QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
        uri.setMinimal(true); // use non-greedy matching
        licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
        // Replace newlines with HTML breaks
        licenseInfoHTML.replace("\n", "<br>");

        ui->aboutMessage->setTextFormat(Qt::RichText);
        ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
        text = version + "\n" + licenseInfo;
        ui->aboutMessage->setText(version + "<br><br>" + licenseInfoHTML);
        ui->aboutMessage->setWordWrap(true);<commit_msg>doc: Remove bitness from bitcoin-qt help message and manpage<commit_after>// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif

#include <qt/utilitydialog.h>

#include <clientversion.h>
#include <init.h>
#include <qt/bitcoingui.h>
#include <qt/forms/ui_helpmessagedialog.h>
#ifdef ENABLE_BIP70
#include <qt/paymentrequestplus.h>
#endif
#include <util/system.h>

#include <QCloseEvent>
#include <QLabel>
#include <QRegExp>
#include <QTextCursor>
#include <QTextTable>
#include <QVBoxLayout>

#include <cstdio>

/** "Help message" or "About" dialog box */
HelpMessageDialog::HelpMessageDialog(interfaces::Node &node, QWidget *parent,
                                     bool about)
    : QDialog(parent), ui(new Ui::HelpMessageDialog) {
    ui->setupUi(this);

    QString version = QString{PACKAGE_NAME} + " " + tr("version") + " " +
                      QString::fromStdString(FormatFullVersion());

    if (about) {
        setWindowTitle(tr("About %1").arg(PACKAGE_NAME));

        /// HTML-format the license message from the core
        QString licenseInfo = QString::fromStdString(LicenseInfo());
        QString licenseInfoHTML = licenseInfo;
        // Make URLs clickable
        QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
        uri.setMinimal(true); // use non-greedy matching
        licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
        // Replace newlines with HTML breaks
        licenseInfoHTML.replace("\n", "<br>");

        ui->aboutMessage->setTextFormat(Qt::RichText);
        ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
        text = version + "\n" + licenseInfo;
        ui->aboutMessage->setText(version + "<br><br>" + licenseInfoHTML);
        ui->aboutMessage->setWordWrap(true);
{'fraction_non_alphanumeric': 0.1463472485768501, 'fraction_numerical': 0.012096774193548387, 'mean_word_length': 3.524678111587983, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7116477', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1292, 'n_words': 297}