Browse Source

add InitMessage() to noui and use debug.log for GUI

- this pull adds an InitMessage() function to noui.cpp, which outputs init
  messages to debug.log (this allows to remove some printf() calls from
  init.cpp)
- change InitMessage() in bitcoin.cpp to also write init messages to
  debug.log to ensure nothting is missing in the log because of the
  removal of printf() calls in init.cpp
miguelfreitas
Philip Kaufmann 12 years ago
parent
commit
bb41a87d57
  1. 7
      src/init.cpp
  2. 6
      src/noui.cpp
  3. 1
      src/qt/bitcoin.cpp

7
src/init.cpp

@ -742,7 +742,7 @@ bool AppInit2()
nCoinCacheSize = nTotalCache / 300; // coins in memory require around 300 bytes nCoinCacheSize = nTotalCache / 300; // coins in memory require around 300 bytes
uiInterface.InitMessage(_("Loading block index...")); uiInterface.InitMessage(_("Loading block index..."));
printf("Loading block index...\n");
nStart = GetTimeMillis(); nStart = GetTimeMillis();
pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex); pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex);
pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex); pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex);
@ -799,7 +799,7 @@ bool AppInit2()
// ********************************************************* Step 8: load wallet // ********************************************************* Step 8: load wallet
uiInterface.InitMessage(_("Loading wallet...")); uiInterface.InitMessage(_("Loading wallet..."));
printf("Loading wallet...\n");
nStart = GetTimeMillis(); nStart = GetTimeMillis();
bool fFirstRun = true; bool fFirstRun = true;
pwalletMain = new CWallet("wallet.dat"); pwalletMain = new CWallet("wallet.dat");
@ -897,7 +897,7 @@ bool AppInit2()
// ********************************************************* Step 10: load peers // ********************************************************* Step 10: load peers
uiInterface.InitMessage(_("Loading addresses...")); uiInterface.InitMessage(_("Loading addresses..."));
printf("Loading addresses...\n");
nStart = GetTimeMillis(); nStart = GetTimeMillis();
{ {
@ -932,7 +932,6 @@ bool AppInit2()
// ********************************************************* Step 12: finished // ********************************************************* Step 12: finished
uiInterface.InitMessage(_("Done loading")); uiInterface.InitMessage(_("Done loading"));
printf("Done loading\n");
if (!strErrors.str().empty()) if (!strErrors.str().empty())
return InitError(strErrors.str()); return InitError(strErrors.str());

6
src/noui.cpp

@ -37,9 +37,15 @@ static bool noui_ThreadSafeAskFee(int64 /*nFeeRequired*/)
return true; return true;
} }
static void noui_InitMessage(const std::string &message)
{
printf("init message: %s\n", message.c_str());
}
void noui_connect() void noui_connect()
{ {
// Connect bitcoind signal handlers // Connect bitcoind signal handlers
uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox); uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee); uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee);
uiInterface.InitMessage.connect(noui_InitMessage);
} }

1
src/qt/bitcoin.cpp

@ -86,6 +86,7 @@ static void InitMessage(const std::string &message)
splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(255,255,200)); splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(255,255,200));
QApplication::instance()->processEvents(); QApplication::instance()->processEvents();
} }
printf("init message: %s\n", message.c_str());
} }
static void QueueShutdown() static void QueueShutdown()

Loading…
Cancel
Save