aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 524c68138c..0ddcd558a1 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -23,6 +23,7 @@ using namespace std;
using namespace boost;
CWallet* pwalletMain;
+CClientUIInterface uiInterface;
//////////////////////////////////////////////////////////////////////////////
//
@@ -91,17 +92,6 @@ void HandleSIGTERM(int)
// Start
//
#if !defined(QT_GUI)
-int main(int argc, char* argv[])
-{
- bool fRet = false;
- fRet = AppInit(argc, argv);
-
- if (fRet && fDaemon)
- return 0;
-
- return 1;
-}
-
bool AppInit(int argc, char* argv[])
{
bool fRet = false;
@@ -157,17 +147,33 @@ bool AppInit(int argc, char* argv[])
Shutdown(NULL);
return fRet;
}
+
+extern void noui_connect();
+int main(int argc, char* argv[])
+{
+ bool fRet = false;
+
+ // Connect bitcoind signal handlers
+ noui_connect();
+
+ fRet = AppInit(argc, argv);
+
+ if (fRet && fDaemon)
+ return 0;
+
+ return 1;
+}
#endif
bool static InitError(const std::string &str)
{
- ThreadSafeMessageBox(str, _("Bitcoin"), wxOK | wxMODAL);
+ uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::MODAL);
return false;
}
bool static InitWarning(const std::string &str)
{
- ThreadSafeMessageBox(str, _("Bitcoin"), wxOK | wxICON_EXCLAMATION | wxMODAL);
+ uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL);
return true;
}
@@ -368,7 +374,7 @@ bool AppInit2()
fprintf(stdout, "Bitcoin server starting\n");
int64 nStart;
- InitMessage(_("Loading addresses..."));
+ uiInterface.InitMessage(_("Loading addresses..."));
printf("Loading addresses...\n");
nStart = GetTimeMillis();
@@ -381,7 +387,7 @@ bool AppInit2()
printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n",
addrman.size(), GetTimeMillis() - nStart);
- InitMessage(_("Loading block index..."));
+ uiInterface.InitMessage(_("Loading block index..."));
printf("Loading block index...\n");
nStart = GetTimeMillis();
if (!LoadBlockIndex())
@@ -407,7 +413,7 @@ bool AppInit2()
}
}
- InitMessage(_("Loading wallet..."));
+ uiInterface.InitMessage(_("Loading wallet..."));
printf("Loading wallet...\n");
nStart = GetTimeMillis();
bool fFirstRun;
@@ -475,14 +481,14 @@ bool AppInit2()
}
if (pindexBest != pindexRescan)
{
- InitMessage(_("Rescanning..."));
+ uiInterface.InitMessage(_("Rescanning..."));
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
}
- InitMessage(_("Done loading"));
+ uiInterface.InitMessage(_("Done loading"));
printf("Done loading\n");
//// debug print
@@ -651,7 +657,7 @@ bool AppInit2()
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"].c_str()));
if (nTransactionFee > 0.25 * COIN)
- InitWarning(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."));
+ InitWarning(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."));
}
//