When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen

This commit is contained in:
Luke Dashjr 2016-02-03 05:38:27 +00:00
parent cc2095ecae
commit 027fdb83b4
6 changed files with 25 additions and 16 deletions

View File

@ -17,6 +17,7 @@
#include "httpserver.h"
#include "httprpc.h"
#include "rpcserver.h"
#include "utilstrencodings.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
@ -82,7 +83,7 @@ bool AppInit(int argc, char* argv[])
if (mapArgs.count("-version"))
{
strUsage += LicenseInfo();
strUsage += FormatParagraph(LicenseInfo());
}
else
{

View File

@ -33,7 +33,6 @@
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
#include "utilstrencodings.h"
#include "validationinterface.h"
#ifdef ENABLE_WALLET
#include "wallet/db.h"
@ -513,13 +512,13 @@ std::string HelpMessage(HelpMessageMode mode)
std::string LicenseInfo()
{
// todo: remove urls from translations on next change
return FormatParagraph(strprintf(_("Copyright (C) %i-%i %s"), 2009, COPYRIGHT_YEAR, CopyrightHolders())) + "\n" +
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" +
"\n" +
FormatParagraph(_("This is experimental software.")) + "\n" +
_("This is experimental software.") + "\n" +
"\n" +
FormatParagraph(_("Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.")) + "\n" +
_("Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.") + "\n" +
"\n" +
FormatParagraph(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.")) +
_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.") +
"\n";
}

View File

@ -44,7 +44,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
// define text to place
QString titleText = tr(PACKAGE_NAME);
QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion()));
QString copyrightText = QChar(0xA9)+QString(" %1-%2 ").arg(2009).arg(COPYRIGHT_YEAR) + QString::fromStdString(CopyrightHolders());
QString copyrightText = QString::fromUtf8(CopyrightHolders(strprintf("\xc2\xA9 %u-%u ", 2009, COPYRIGHT_YEAR)).c_str());
QString titleAddText = networkStyle->getTitleAddText();
QString font = QApplication::font().toString();
@ -101,8 +101,13 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText);
// draw copyright stuff
pixPaint.setFont(QFont(font, 10*fontFactor));
pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText);
{
pixPaint.setFont(QFont(font, 10*fontFactor));
const int x = pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight;
const int y = paddingTop+titleCopyrightVSpace;
QRect copyrightRect(x, y, pixmap.width() - x - paddingRight, pixmap.height() - y);
pixPaint.drawText(copyrightRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, copyrightText);
}
// draw additional text if special network
if(!titleAddText.isEmpty()) {

View File

@ -56,7 +56,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
uri.setMinimal(true); // use non-greedy matching
licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
// Replace newlines with HTML breaks
licenseInfoHTML.replace("\n\n", "<br><br>");
licenseInfoHTML.replace("\n", "<br>");
ui->aboutMessage->setTextFormat(Qt::RichText);
ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

View File

@ -834,10 +834,14 @@ int GetNumCores()
#endif
}
std::string CopyrightHolders()
std::string CopyrightHolders(const std::string& strPrefix)
{
std::string strCopyrightHolders = _(COPYRIGHT_HOLDERS);
if (strCopyrightHolders.find("%s") == strCopyrightHolders.npos)
return strCopyrightHolders;
return strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION));
std::string strCopyrightHolders = strPrefix + _(COPYRIGHT_HOLDERS);
if (strCopyrightHolders.find("%s") != strCopyrightHolders.npos) {
strCopyrightHolders = strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION));
}
if (strCopyrightHolders.find("Bitcoin Core developers") == strCopyrightHolders.npos) {
strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers";
}
return strCopyrightHolders;
}

View File

@ -242,6 +242,6 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
}
}
std::string CopyrightHolders();
std::string CopyrightHolders(const std::string& strPrefix);
#endif // BITCOIN_UTIL_H