diff options
Diffstat (limited to 'src/qt/splashscreen.cpp')
-rw-r--r-- | src/qt/splashscreen.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 4fe610794f..b4b81440ca 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -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()); @@ -177,5 +170,6 @@ void SplashScreen::paintEvent(QPaintEvent *event) void SplashScreen::closeEvent(QCloseEvent *event) { + StartShutdown(); // allows an "emergency" shutdown during startup event->ignore(); } |