Skip to content

Commit

Permalink
PortUI-0.0.10 - bitcoin code
Browse files Browse the repository at this point in the history
  • Loading branch information
zathras-crypto committed Mar 26, 2015
1 parent 1089c95 commit 5fd331e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "wallet.h"
#endif

#include "omnicore_init.h"

#include <stdint.h>

#include <boost/filesystem/operations.hpp>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand All @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 5fd331e

Please sign in to comment.