aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-04-04 15:41:07 -0400
committerLuke Dashjr <luke-jr+git@utopios.org>2012-04-04 15:41:07 -0400
commit658cf0b1be93e08eee400b0bd1e9d3485313475d (patch)
treeb36d3fbc1fa71d2c85486c09a1ed6a75de4f3e9f /src
parentef9ab3c2a0c5f2d8862e7315a01f9cfd7bee242d (diff)
parenta37092fcf427956e31d76aac6bd52e3e3459155f (diff)
downloadbitcoin-658cf0b1be93e08eee400b0bd1e9d3485313475d.tar.xz
Merge branch '0.5.0.x' into 0.5.x
Conflicts: src/qt/bitcoingui.h
Diffstat (limited to 'src')
-rw-r--r--src/bitcoinrpc.cpp5
-rw-r--r--src/noui.h2
-rw-r--r--src/qt/bitcoin.cpp9
-rw-r--r--src/qt/bitcoingui.cpp9
-rw-r--r--src/qt/bitcoingui.h2
-rw-r--r--src/qt/transactiontablemodel.cpp7
-rw-r--r--src/qtui.h2
7 files changed, 26 insertions, 10 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 102fa14496..f10de69c8e 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -2174,7 +2174,7 @@ void ThreadRPCServer2(void* parg)
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-daemon\"");
- PrintConsole(
+ ThreadSafeMessageBox(strprintf(
_("Error: %s, you must set a rpcpassword in the configuration file:\n %s\n"
"It is recommended you use the following random password:\n"
"rpcuser=bitcoinrpc\n"
@@ -2183,7 +2183,8 @@ void ThreadRPCServer2(void* parg)
"If the file does not exist, create it with owner-readable-only file permissions.\n"),
strWhatAmI.c_str(),
GetConfigFile().c_str(),
- EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str());
+ EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
+ _("Error"), wxOK | wxMODAL);
#ifndef QT_GUI
CreateThread(Shutdown, NULL);
#endif
diff --git a/src/noui.h b/src/noui.h
index 754c2225fc..0bbf45a72a 100644
--- a/src/noui.h
+++ b/src/noui.h
@@ -36,6 +36,8 @@ typedef void wxWindow;
#define wxHELP 0x00008000
#define wxMORE 0x00010000
#define wxSETUP 0x00020000
+// Force blocking, modal message box dialog (not just notification)
+#define wxMODAL 0x00040000
inline int MyMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index b68eb821bb..4fed781ebb 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -41,12 +41,19 @@ int MyMessageBox(const std::string& message, const std::string& caption, int sty
int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style, wxWindow* parent, int x, int y)
{
+ bool modal = style & wxMODAL;
+
+ if (modal)
+ while (!guiref)
+ sleep(1);
+
// Message from network thread
if(guiref)
{
QMetaObject::invokeMethod(guiref, "error", Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(caption)),
- Q_ARG(QString, QString::fromStdString(message)));
+ Q_ARG(QString, QString::fromStdString(message)),
+ Q_ARG(bool, modal));
}
else
{
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 78becafe5b..ed891f369d 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -516,10 +516,15 @@ void BitcoinGUI::refreshStatusBar()
setNumBlocks(clientModel->getNumBlocks());
}
-void BitcoinGUI::error(const QString &title, const QString &message)
+void BitcoinGUI::error(const QString &title, const QString &message, bool modal)
{
// Report errors from network/worker thread
- notificator->notify(Notificator::Critical, title, message);
+ if (modal)
+ {
+ QMessageBox::critical(this, title, message, QMessageBox::Ok, QMessageBox::Ok);
+ } else {
+ notificator->notify(Notificator::Critical, title, message);
+ }
}
void BitcoinGUI::changeEvent(QEvent *e)
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index a0905e44ad..0fcb72a3ee 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -113,7 +113,7 @@ public slots:
void refreshStatusBar();
/** Notify the user of an error in the network or transaction handling code. */
- void error(const QString &title, const QString &message);
+ void error(const QString &title, const QString &message, bool modal = false);
/** Asks the user whether to pay the transaction fee or to cancel the transaction.
It is currently not possible to pass a return value to another thread through
BlockingQueuedConnection, so an indirected pointer is used.
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp
index b863546691..480d4ac25e 100644
--- a/src/qt/transactiontablemodel.cpp
+++ b/src/qt/transactiontablemodel.cpp
@@ -288,20 +288,19 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons
}
if(wtx->type == TransactionRecord::Generated)
{
- status += "\n";
switch(wtx->status.maturity)
{
case TransactionStatus::Immature:
- status += tr("Mined balance will be available in %n more blocks", "",
+ status += "\n" + tr("Mined balance will be available in %n more blocks", "",
wtx->status.matures_in);
break;
case TransactionStatus::Mature:
break;
case TransactionStatus::MaturesWarning:
- status += tr("This block was not received by any other nodes and will probably not be accepted!");
+ status += "\n" + tr("This block was not received by any other nodes and will probably not be accepted!");
break;
case TransactionStatus::NotAccepted:
- status += tr("Generated but not accepted");
+ status += "\n" + tr("Generated but not accepted");
break;
}
}
diff --git a/src/qtui.h b/src/qtui.h
index 17fc44e94b..193f849249 100644
--- a/src/qtui.h
+++ b/src/qtui.h
@@ -35,6 +35,8 @@ typedef void wxWindow;
#define wxHELP 0x00008000
#define wxMORE 0x00010000
#define wxSETUP 0x00020000
+// Force blocking, modal message box dialog (not just notification)
+#define wxMODAL 0x00040000
extern int MyMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
#define wxMessageBox MyMessageBox