From: Luke Dashjr Date: Wed, 4 Apr 2012 19:43:29 +0000 (-0400) Subject: Merge branch '0.5.x' into 0.6.0.x X-Git-Tag: v0.4.0-unstable~129^2~1^2~18^2~28 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=fe1725a141334dab82ca007fb6fc983c358e35b2;hp=1376cd9d7f1d7df4395d5d686450bde44e260785 Merge branch '0.5.x' into 0.6.0.x Conflicts: src/bitcoinrpc.cpp --- diff --git a/contrib/gitian-downloader/linux-download-config b/contrib/gitian-downloader/linux-download-config index 36f5f68..88e48e2 100644 --- a/contrib/gitian-downloader/linux-download-config +++ b/contrib/gitian-downloader/linux-download-config @@ -15,9 +15,13 @@ signers: weight: 40 name: Devrandom key: devrandom + E463A93F5F3117EEDE6C7316BD02942421F4889F: + weight: 40 + name: Luke-Jr + key: luke-jr D762373D24904A3E42F33B08B9A408E71DAAC974: weight: 40 - name: Sipa + name: "Pieter Wuille" key: sipa 77E72E69DA7EE0A148C06B21B34821D4944DE5F7: weight: 40 diff --git a/contrib/gitian-downloader/luke-jr-key.pgp b/contrib/gitian-downloader/luke-jr-key.pgp new file mode 100644 index 0000000..c40917d Binary files /dev/null and b/contrib/gitian-downloader/luke-jr-key.pgp differ diff --git a/contrib/gitian-downloader/sipa-key.pgp b/contrib/gitian-downloader/sipa-key.pgp index 086c9eb..a52a5de 100644 Binary files a/contrib/gitian-downloader/sipa-key.pgp and b/contrib/gitian-downloader/sipa-key.pgp differ diff --git a/contrib/gitian-downloader/win32-download-config b/contrib/gitian-downloader/win32-download-config index b1e1c73..595626f 100644 --- a/contrib/gitian-downloader/win32-download-config +++ b/contrib/gitian-downloader/win32-download-config @@ -15,9 +15,13 @@ signers: weight: 40 name: Devrandom key: devrandom + E463A93F5F3117EEDE6C7316BD02942421F4889F: + weight: 40 + name: Luke-Jr + key: luke-jr D762373D24904A3E42F33B08B9A408E71DAAC974: weight: 40 - name: Sipa + name: "Pieter Wuille" key: sipa 77E72E69DA7EE0A148C06B21B34821D4944DE5F7: weight: 40 diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index d8b9782..a246677 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -2371,7 +2371,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\""); - ::error( + ThreadSafeMessageBox(strprintf( _("%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" @@ -2380,7 +2380,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 458fc64..8888db6 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 68f750d..3450bb4 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -36,12 +36,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 7bce128..d735c14 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -551,10 +551,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 dbc3264..d221f6b 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -117,7 +117,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 b863546..480d4ac 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 9791ba5..7987370 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