mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
qtui.h/noui.h interface cleanup
- rename wxMessageBox, remove redundant arguments to noui/qtui calls - also, add flag to force blocking, modal dialog box for disk space warning etc - clarify function naming - no more special MessageBox needed from AppInit2, as window object is created before calling AppInit2
This commit is contained in:
18
src/init.cpp
18
src/init.cpp
@@ -237,7 +237,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end());
|
||||
#if defined(QT_GUI) && defined(WIN32)
|
||||
// On windows, show a message box, as there is no stderr
|
||||
wxMessageBox(strUsage, "Usage");
|
||||
ThreadSafeMessageBox(strUsage, _("Usage"), wxOK | wxMODAL);
|
||||
#else
|
||||
fprintf(stderr, "%s", strUsage.c_str());
|
||||
#endif
|
||||
@@ -326,7 +326,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
static boost::interprocess::file_lock lock(strLockFile.c_str());
|
||||
if (!lock.try_lock())
|
||||
{
|
||||
wxMessageBox(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin is probably already running."), GetDataDir().c_str()), "Bitcoin");
|
||||
ThreadSafeMessageBox(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin is probably already running."), GetDataDir().c_str()), _("Bitcoin"), wxOK|wxMODAL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
{
|
||||
strErrors << _("Wallet needed to be rewritten: restart Bitcoin to complete") << "\n";
|
||||
printf("%s", strErrors.str().c_str());
|
||||
wxMessageBox(strErrors.str(), "Bitcoin", wxOK | wxICON_ERROR);
|
||||
ThreadSafeMessageBox(strErrors.str(), _("Bitcoin"), wxOK | wxICON_ERROR | wxMODAL);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -440,7 +440,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
|
||||
if (!strErrors.str().empty())
|
||||
{
|
||||
wxMessageBox(strErrors.str(), "Bitcoin", wxOK | wxICON_ERROR);
|
||||
ThreadSafeMessageBox(strErrors.str(), _("Bitcoin"), wxOK | wxICON_ERROR | wxMODAL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
addrProxy = CService(mapArgs["-proxy"], 9050);
|
||||
if (!addrProxy.IsValid())
|
||||
{
|
||||
wxMessageBox(_("Invalid -proxy address"), "Bitcoin");
|
||||
ThreadSafeMessageBox(_("Invalid -proxy address"), _("Bitcoin"), wxOK | wxMODAL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -527,7 +527,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
std::string strError;
|
||||
if (!BindListenPort(strError))
|
||||
{
|
||||
wxMessageBox(strError, "Bitcoin");
|
||||
ThreadSafeMessageBox(strError, _("Bitcoin"), wxOK | wxMODAL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -547,11 +547,11 @@ bool AppInit2(int argc, char* argv[])
|
||||
{
|
||||
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
|
||||
{
|
||||
wxMessageBox(_("Invalid amount for -paytxfee=<amount>"), "Bitcoin");
|
||||
ThreadSafeMessageBox(_("Invalid amount for -paytxfee=<amount>"), _("Bitcoin"), wxOK | wxMODAL);
|
||||
return false;
|
||||
}
|
||||
if (nTransactionFee > 0.25 * COIN)
|
||||
wxMessageBox(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."), "Bitcoin", wxOK | wxICON_EXCLAMATION);
|
||||
ThreadSafeMessageBox(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."), _("Bitcoin"), wxOK | wxICON_EXCLAMATION | wxMODAL);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -563,7 +563,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
RandAddSeedPerfmon();
|
||||
|
||||
if (!CreateThread(StartNode, NULL))
|
||||
wxMessageBox(_("Error: CreateThread(StartNode) failed"), "Bitcoin");
|
||||
ThreadSafeMessageBox(_("Error: CreateThread(StartNode) failed"), _("Bitcoin"), wxOK | wxMODAL);
|
||||
|
||||
if (fServer)
|
||||
CreateThread(ThreadRPCServer, NULL);
|
||||
|
||||
Reference in New Issue
Block a user