From 5fd331e4e0d1581cb9720d1e6fa5ef0f326d0a5e Mon Sep 17 00:00:00 2001 From: zathras-crypto Date: Wed, 25 Mar 2015 19:38:33 -0700 Subject: [PATCH] PortUI-0.0.10 - bitcoin code --- src/qt/bitcoin.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index f30df348c5ffc..3b713101a3abf 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -33,6 +33,8 @@ #include "wallet.h" #endif +#include "omnicore_init.h" + #include #include @@ -159,7 +161,7 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons } #endif -/** Class encapsulating Bitcoin Core startup and shutdown. +/** Class encapsulating Omni Core startup and shutdown. * Allows running startup and shutdown in a different thread from the UI thread. */ class BitcoinCore: public QObject @@ -552,14 +554,14 @@ int main(int argc, char *argv[]) /// - Do not call GetDataDir(true) before this step finishes if (!boost::filesystem::is_directory(GetDataDir(false))) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), + QMessageBox::critical(0, QObject::tr("Omni Core"), QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } try { ReadConfigFile(mapArgs, mapMultiArgs); } catch(std::exception &e) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), + QMessageBox::critical(0, QObject::tr("Omni Core"), QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); return false; } @@ -572,7 +574,7 @@ int main(int argc, char *argv[]) // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), QObject::tr("Error: Invalid combination of -regtest and -testnet.")); + QMessageBox::critical(0, QObject::tr("Omni Core"), QObject::tr("Error: Invalid combination of -regtest and -testnet.")); return 1; } #ifdef ENABLE_WALLET @@ -625,12 +627,16 @@ int main(int argc, char *argv[]) if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false)) app.createSplashScreen(networkStyle.data()); + // Initialize Omni Core and quit on failure + if (!OmniCore::Initialize()) + return 1; + try { app.createWindow(networkStyle.data()); app.requestInitialize(); #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 - WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Bitcoin Core didn't yet exit safely..."), (HWND)app.getMainWinId()); + WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Omni Core didn't yet exit safely..."), (HWND)app.getMainWinId()); #endif app.exec(); app.requestShutdown();