Merge pull request #4802
6fd546dRemove CChainParams::NetworkID() (jtimon)cc97210Add fTestnetToBeDeprecatedFieldRPC to CChainParams (jtimon)e11712dMove checkpoint data selection to chainparams (jtimon)6de50c3qt: add network-specific style object (Wladimir J. van der Laan)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "clientversion.h"
|
||||
#include "init.h"
|
||||
#include "networkstyle.h"
|
||||
#include "ui_interface.h"
|
||||
#include "util.h"
|
||||
#include "version.h"
|
||||
@@ -19,7 +20,7 @@
|
||||
#include <QDesktopWidget>
|
||||
#include <QPainter>
|
||||
|
||||
SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) :
|
||||
SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) :
|
||||
QWidget(0, f), curAlignment(0)
|
||||
{
|
||||
// set reference point, paddings
|
||||
@@ -34,17 +35,12 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) :
|
||||
QString titleText = tr("Bitcoin Core");
|
||||
QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion()));
|
||||
QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers"));
|
||||
QString testnetAddText = QString(tr("[testnet]")); // define text to place as single text object
|
||||
QString titleAddText = networkStyle->getTitleAddText();
|
||||
|
||||
QString font = "Arial";
|
||||
|
||||
// load the bitmap for writing some text over it
|
||||
if(isTestNet) {
|
||||
pixmap = QPixmap(":/images/splash_testnet");
|
||||
}
|
||||
else {
|
||||
pixmap = QPixmap(":/images/splash");
|
||||
}
|
||||
pixmap = networkStyle->getSplashImage();
|
||||
|
||||
QPainter pixPaint(&pixmap);
|
||||
pixPaint.setPen(QColor(100,100,100));
|
||||
@@ -78,23 +74,20 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) :
|
||||
pixPaint.setFont(QFont(font, 10*fontFactor));
|
||||
pixPaint.drawText(pixmap.width()-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText);
|
||||
|
||||
// draw testnet string if testnet is on
|
||||
if(isTestNet) {
|
||||
// draw additional text if special network
|
||||
if(!titleAddText.isEmpty()) {
|
||||
QFont boldFont = QFont(font, 10*fontFactor);
|
||||
boldFont.setWeight(QFont::Bold);
|
||||
pixPaint.setFont(boldFont);
|
||||
fm = pixPaint.fontMetrics();
|
||||
int testnetAddTextWidth = fm.width(testnetAddText);
|
||||
pixPaint.drawText(pixmap.width()-testnetAddTextWidth-10,15,testnetAddText);
|
||||
int titleAddTextWidth = fm.width(titleAddText);
|
||||
pixPaint.drawText(pixmap.width()-titleAddTextWidth-10,15,titleAddText);
|
||||
}
|
||||
|
||||
pixPaint.end();
|
||||
|
||||
// Set window title
|
||||
if(isTestNet)
|
||||
setWindowTitle(titleText + " " + testnetAddText);
|
||||
else
|
||||
setWindowTitle(titleText);
|
||||
setWindowTitle(titleText + " " + titleAddText);
|
||||
|
||||
// Resize window and move to center of desktop, disallow resizing
|
||||
QRect r(QPoint(), pixmap.size());
|
||||
|
||||
Reference in New Issue
Block a user