From 9769d14f037450316a54e2b4e89aa2b10ef6a5e9 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 21 Sep 2012 19:31:53 +0200 Subject: [PATCH 01/13] Change hotkey for "Send" button to "e" since "S" is already used for "Settings" menu Partial of upstream da9413d9134a7534369a55422cadc3fdd91ba608 --- src/qt/forms/sendcoinsdialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 04cf404a..7eadec98 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -144,7 +144,7 @@ Confirm the send action - &Send + S&end From 599ec1e1153dc7ff393ebbf029d0669a6207bcbe Mon Sep 17 00:00:00 2001 From: fanquake Date: Sat, 22 Sep 2012 13:32:28 +0800 Subject: [PATCH 02/13] Update Bugreport Links Update Qt Links Revert Qt source link Update Qt links PARTIAL of e1eb3d4 --- doc/readme-qt.rst | 4 ++-- src/qt/bitcoinamountfield.h | 2 +- src/qt/bitcoingui.h | 2 +- src/qt/sendcoinsdialog.h | 2 +- src/qt/sendcoinsentry.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/readme-qt.rst b/doc/readme-qt.rst index 07d59f96..96053716 100644 --- a/doc/readme-qt.rst +++ b/doc/readme-qt.rst @@ -73,7 +73,7 @@ Windows build instructions: - Open the bitcoin-qt.pro file in Qt Creator and build as normal (ctrl-B) -.. _`Qt Windows SDK`: http://qt.nokia.com/downloads/sdk-windows-cpp +.. _`Qt Windows SDK`: http://qt-project.org/downloads/ .. _`dependencies archive`: https://download.visucore.com/bitcoin/qtgui_deps_1.zip .. [#] PGP signature: https://download.visucore.com/bitcoin/qtgui_deps_1.zip.sig (signed with RSA key ID `610945D0`_) .. _`610945D0`: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x610945D0 @@ -95,7 +95,7 @@ Mac OS X - Open the bitcoin-qt.pro file in Qt Creator and build as normal (cmd-B) -.. _`Qt Mac OS X SDK`: http://qt.nokia.com/downloads/sdk-mac-os-cpp +.. _`Qt Mac OS X SDK`: http://qt-project.org/downloads/ .. _`MacPorts`: http://www.macports.org/install.php diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index ca4a888e..66792e00 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -31,7 +31,7 @@ public: /** Make field empty and ready for new input. */ void clear(); - /** Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907), + /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), in these cases we have to set it up manually. */ QWidget *setupTabChain(QWidget *prev); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 313aa06c..65340775 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -117,7 +117,7 @@ public slots: /** 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. - http://bugreports.qt.nokia.com/browse/QTBUG-10440 + https://bugreports.qt-project.org/browse/QTBUG-10440 @param[in] nFeeRequired the required fee @param[out] payFee true to pay the fee, false to not pay the fee diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index ed562141..d26491c5 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -25,7 +25,7 @@ public: void setModel(WalletModel *model); - /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). + /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ QWidget *setupTabChain(QWidget *prev); diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index db6cba0d..0ac14c14 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -27,7 +27,7 @@ public: void setValue(const SendCoinsRecipient &value); - /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). + /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ QWidget *setupTabChain(QWidget *prev); From e25f0f0e53acc42e5c9611a646a3683eaad6cc39 Mon Sep 17 00:00:00 2001 From: fanquake Date: Sat, 22 Sep 2012 13:32:28 +0800 Subject: [PATCH 03/13] Update Bugreport Links Update Qt Links Revert Qt source link Update Qt links PARTIAL of e1eb3d4 --- doc/readme-qt.rst | 8 ++++---- src/qt/bitcoinamountfield.h | 2 +- src/qt/bitcoingui.h | 2 +- src/qt/sendcoinsdialog.h | 2 +- src/qt/sendcoinsentry.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/readme-qt.rst b/doc/readme-qt.rst index f55b9e7b..866b147c 100644 --- a/doc/readme-qt.rst +++ b/doc/readme-qt.rst @@ -40,7 +40,7 @@ Windows build instructions: - Open the bitcoin-qt.pro file in Qt Creator and build as normal (ctrl-B) -.. _`Qt Windows SDK`: http://qt.nokia.com/downloads/sdk-windows-cpp +.. _`Qt Windows SDK`: http://qt-project.org/downloads/ .. _`dependencies archive`: https://download.visucore.com/bitcoin/qtgui_deps_1.zip .. [#] PGP signature: https://download.visucore.com/bitcoin/qtgui_deps_1.zip.sig (signed with RSA key ID `610945D0`_) .. _`610945D0`: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x610945D0 @@ -62,7 +62,7 @@ Mac OS X - Open the bitcoin-qt.pro file in Qt Creator and build as normal (cmd-B) -.. _`Qt Mac OS X SDK`: http://qt.nokia.com/downloads/sdk-mac-os-cpp +.. _`Qt Mac OS X SDK`: http://qt-project.org/downloads/ .. _`MacPorts`: http://www.macports.org/install.php @@ -106,8 +106,8 @@ FreeDesktop notification interface through DBUS using the following qmake option Generation of QR codes ----------------------- -libqrencode may be used to generate QRCode images for payment requests. -It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Pass the USE_QRCODE +libqrencode may be used to generate QRCode images for payment requests. +It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Pass the USE_QRCODE flag to qmake to control this: +--------------+--------------------------------------------------------------------------+ diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index ca4a888e..66792e00 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -31,7 +31,7 @@ public: /** Make field empty and ready for new input. */ void clear(); - /** Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907), + /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), in these cases we have to set it up manually. */ QWidget *setupTabChain(QWidget *prev); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 8bc30d34..d22b8b24 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -121,7 +121,7 @@ public slots: /** 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. - http://bugreports.qt.nokia.com/browse/QTBUG-10440 + https://bugreports.qt-project.org/browse/QTBUG-10440 @param[in] nFeeRequired the required fee @param[out] payFee true to pay the fee, false to not pay the fee diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 2498a9a7..94fa97d2 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -25,7 +25,7 @@ public: void setModel(WalletModel *model); - /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). + /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ QWidget *setupTabChain(QWidget *prev); diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index db6cba0d..0ac14c14 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -27,7 +27,7 @@ public: void setValue(const SendCoinsRecipient &value); - /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). + /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ QWidget *setupTabChain(QWidget *prev); From 207ef3008c28be30fb8ef2b50999d885f7c329c4 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 22 Sep 2012 12:15:41 +0200 Subject: [PATCH 04/13] additional fix for #1843 - a shortcut on "receive coins" was used twice --- src/qt/forms/addressbookpage.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index e47eb57f..15a8f319 100644 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -96,7 +96,7 @@ Sign a message to prove you own this address - &Sign Message + Sign &Message From d1b75909117a22e9d701e8d6717842db0db3244d Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 21 Sep 2012 15:42:38 -0400 Subject: [PATCH 05/13] Compile/link Bitcoin-Qt.app with -pthread --- bitcoin-qt.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index ae895ea9..a3ad4c9e 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -4,6 +4,7 @@ VERSION = 0.5.7 INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB CONFIG += no_include_pwd +CONFIG += thread # for boost 1.37, add -mt to the boost libraries # use: qmake BOOST_LIB_SUFFIX=-mt @@ -269,6 +270,9 @@ macx:LIBS += -framework Foundation -framework ApplicationServices -framework App macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0 macx:ICON = src/qt/res/icons/bitcoin.icns macx:TARGET = "Bitcoin-Qt" +macx:QMAKE_CFLAGS_THREAD += -pthread +macx:QMAKE_LFLAGS_THREAD += -pthread +macx:QMAKE_CXXFLAGS_THREAD += -pthread # Set libraries and includes at end, to use platform-defined defaults if not overridden INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH From 6a9a280ec775a376743f6395170435a6a77c300d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 22 Sep 2012 12:34:45 +0200 Subject: [PATCH 06/13] change last occurance of mac to macx in Qt project-file --- bitcoin-qt.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 135cf380..59f7a471 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -306,7 +306,7 @@ windows:!contains(MINGW_THREAD_BUGFIX, 0) { QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY } -!windows:!mac { +!windows:!macx { DEFINES += LINUX LIBS += -lrt } From cc57473222b8647d091b6aa9da4a000a11e5a221 Mon Sep 17 00:00:00 2001 From: xanatos Date: Fri, 28 Sep 2012 14:57:07 +0300 Subject: [PATCH 07/13] toHTML won't add empty wtx.mapValue elements As the code was before, toHTML added empty elements to mapValue to check for their existance. Now first it check for their existance and then for their non-emptiness. Removed a duplicated identical if There are two equal ifs, one inside another. If the first one is true, then the second one is true. --- src/qt/transactiondesc.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 6ca3ac8c..529a9d6c 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -82,11 +82,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) { strHTML += tr("Source: Generated
"); } - else if (!wtx.mapValue["from"].empty()) + else if (wtx.mapValue.count("from") && !wtx.mapValue["from"].empty()) { // Online transaction - if (!wtx.mapValue["from"].empty()) - strHTML += tr("From: ") + HtmlEscape(wtx.mapValue["from"]) + "
"; + strHTML += tr("From: ") + HtmlEscape(wtx.mapValue["from"]) + "
"; } else { @@ -123,7 +122,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // To // string strAddress; - if (!wtx.mapValue["to"].empty()) + if (wtx.mapValue.count("to") && !wtx.mapValue["to"].empty()) { // Online transaction strAddress = wtx.mapValue["to"]; @@ -180,7 +179,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) if (wallet->IsMine(txout)) continue; - if (wtx.mapValue["to"].empty()) + if (!wtx.mapValue.count("to") || wtx.mapValue["to"].empty()) { // Offline transaction CBitcoinAddress address; @@ -229,9 +228,9 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // // Message // - if (!wtx.mapValue["message"].empty()) + if (wtx.mapValue.count("message") && !wtx.mapValue["message"].empty()) strHTML += QString("
") + tr("Message:") + "
" + HtmlEscape(wtx.mapValue["message"], true) + "
"; - if (!wtx.mapValue["comment"].empty()) + if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty()) strHTML += QString("
") + tr("Comment:") + "
" + HtmlEscape(wtx.mapValue["comment"], true) + "
"; if (wtx.IsCoinBase()) From 135bee074d3eba3cb954535344d94c0099e3a466 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 29 Sep 2012 12:25:22 +0200 Subject: [PATCH 08/13] Windows: fix URI association setting in registry - fix for #1877 - fix was reported to work via https://bitcointalk.org/index.php?topic=110243.msg1230418#msg1230418 --- share/setup.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/setup.nsi b/share/setup.nsi index b49eff30..dff2681c 100644 --- a/share/setup.nsi +++ b/share/setup.nsi @@ -103,7 +103,7 @@ Section -post SEC0001 # WriteRegStr HKCR "bitcoin" "URL Protocol" "" # WriteRegStr HKCR "bitcoin" "" "URL:Bitcoin" # WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\bitcoin-qt.exe - # WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "$$1"' + # WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "%1"' SectionEnd # Macro for selecting uninstaller sections From bced903ae52b63c59ffde51e5c6d5e16dad9aaf5 Mon Sep 17 00:00:00 2001 From: kjj2 Date: Sun, 30 Sep 2012 08:50:59 -0500 Subject: [PATCH 09/13] Add a backup warning to the encryptwallet RPC command --- src/rpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc.cpp b/src/rpc.cpp index c77c5055..67bd88c9 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1479,7 +1479,7 @@ Value encryptwallet(const Array& params, bool fHelp) // slack space in .dat files; that is bad if the old data is // unencrypted private keys. So: CreateThread(Shutdown, NULL); - return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet"; + return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup."; } From a7642282f6465f2d9e2091ec6279fa1db1241cf3 Mon Sep 17 00:00:00 2001 From: "Rune K. Svendsen" Date: Sun, 30 Sep 2012 11:37:45 +0200 Subject: [PATCH 10/13] When encrypting the wallet, warn user that old backups will become useless. Don't include HTML in translation strings. Do split the huge message over several lines. Prettier lines --- src/qt/askpassphrasedialog.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 2126edf0..cae021c9 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -109,7 +109,16 @@ void AskPassphraseDialog::accept() if(model->setWalletEncrypted(true, newpass1)) { QMessageBox::warning(this, tr("Wallet encrypted"), - tr("Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.")); + "" + + tr("Bitcoin will close now to finish the encryption process. " + "Remember that encrypting your wallet cannot fully protect " + "your bitcoins from being stolen by malware infecting your computer.") + + "

" + + tr("IMPORTANT: Any previous backups you have made of your wallet file " + "should be replaced with the newly generated, encrypted wallet file. " + "For security reasons, previous backups of the unencrypted wallet file " + "will become useless as soon as you start using the new, encrypted wallet.") + + "
"); QApplication::quit(); } else From 638cecee77dba4bcffb225627f63658b247709ea Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 4 Oct 2012 07:47:10 +0200 Subject: [PATCH 11/13] When datadir missing, show messagebox instead of printing error to stderr --- src/qt/bitcoin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 0a48b559..836b9f60 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -184,7 +184,10 @@ int main(int argc, char *argv[]) // ... then bitcoin.conf: if (!ReadConfigFile(mapArgs, mapMultiArgs)) { - fprintf(stderr, "Error: Specified directory does not exist\n"); + // This message can not be translated, as translation is not initialized yet + // (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory) + QMessageBox::critical(0, "Bitcoin", + QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } From d37a2fd8080cffde4ffbcb9927a66258e9fef39e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 4 Oct 2012 07:56:57 +0200 Subject: [PATCH 12/13] Send --help message to stdout i.s.o stderr This allows fun stuff such as `bitcoin --help | less`, and more easy piping to files. Looking at other tools such as bash, gcc, they all send their help text to stdout. --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index c6712fa7..5faa6043 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -232,7 +232,7 @@ bool AppInit2(int argc, char* argv[]) #else // Remove tabs strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end()); - fprintf(stderr, "%s", strUsage.c_str()); + fprintf(stdout, "%s", strUsage.c_str()); #endif return false; } From b3f8f6ab9409d3e901d22c09b0346a5a47779496 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 4 Oct 2012 16:35:08 -0400 Subject: [PATCH 13/13] Avoid crashes at shutdown due to printf() in global destructors. --- src/util.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 49415fc3..62fa4c05 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -194,8 +194,14 @@ inline int OutputDebugStringF(const char* pszFormat, ...) if (fileout) { static bool fStartedNewLine = true; - static boost::mutex mutexDebugLog; - boost::mutex::scoped_lock scoped_lock(mutexDebugLog); + + // This routine may be called by global destructors during shutdown. + // Since the order of destruction of static/global objects is undefined, + // allocate mutexDebugLog on the heap the first time this routine + // is called to avoid crashes during shutdown. + static boost::mutex* mutexDebugLog = NULL; + if (mutexDebugLog == NULL) mutexDebugLog = new boost::mutex(); + boost::mutex::scoped_lock scoped_lock(*mutexDebugLog); // Debug print useful for profiling if (fLogTimestamps && fStartedNewLine)