Browse Source

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

0.13
Luke Dashjr 9 years ago
parent
commit
027fdb83b4
  1. 3
      src/bitcoind.cpp
  2. 9
      src/init.cpp
  3. 11
      src/qt/splashscreen.cpp
  4. 2
      src/qt/utilitydialog.cpp
  5. 14
      src/util.cpp
  6. 2
      src/util.h

3
src/bitcoind.cpp

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

9
src/init.cpp

@ -33,7 +33,6 @@
#include "ui_interface.h" #include "ui_interface.h"
#include "util.h" #include "util.h"
#include "utilmoneystr.h" #include "utilmoneystr.h"
#include "utilstrencodings.h"
#include "validationinterface.h" #include "validationinterface.h"
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
#include "wallet/db.h" #include "wallet/db.h"
@ -513,13 +512,13 @@ std::string HelpMessage(HelpMessageMode mode)
std::string LicenseInfo() std::string LicenseInfo()
{ {
// todo: remove urls from translations on next change // 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" + "\n" +
FormatParagraph(_("This is experimental software.")) + "\n" + _("This is experimental software.") + "\n" +
"\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" + "\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"; "\n";
} }

11
src/qt/splashscreen.cpp

@ -44,7 +44,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
// define text to place // define text to place
QString titleText = tr(PACKAGE_NAME); QString titleText = tr(PACKAGE_NAME);
QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); 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 titleAddText = networkStyle->getTitleAddText();
QString font = QApplication::font().toString(); 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); pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText);
// draw copyright stuff // 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 // draw additional text if special network
if(!titleAddText.isEmpty()) { if(!titleAddText.isEmpty()) {

2
src/qt/utilitydialog.cpp

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

14
src/util.cpp

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

2
src/util.h

@ -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 #endif // BITCOIN_UTIL_H

Loading…
Cancel
Save