diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoinunits.cpp | 5 | ||||
-rw-r--r-- | src/qt/coincontroldialog.cpp | 4 | ||||
-rw-r--r-- | src/qt/paymentserver.cpp | 8 | ||||
-rw-r--r-- | src/qt/test/paymentrequestdata.h | 4 | ||||
-rw-r--r-- | src/qt/test/paymentservertests.cpp | 9 | ||||
-rw-r--r-- | src/qt/test/paymentservertests.h | 8 | ||||
-rw-r--r-- | src/qt/test/test_main.cpp | 7 | ||||
-rw-r--r-- | src/qt/test/uritests.cpp | 4 | ||||
-rw-r--r-- | src/qt/test/uritests.h | 4 | ||||
-rw-r--r-- | src/qt/transactiondesc.cpp | 2 | ||||
-rw-r--r-- | src/qt/walletmodel.cpp | 20 | ||||
-rw-r--r-- | src/qt/walletmodel.h | 1 |
12 files changed, 52 insertions, 24 deletions
diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 6f506d3f25..3215363fa0 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -115,11 +115,6 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle sepa for (int i = 3; i < q_size; i += 3) quotient_str.insert(q_size - i, thin_sp); - int r_size = remainder_str.size(); - if (separators == separatorAlways || (separators == separatorStandard && r_size > 4)) - for (int i = 3, adj = 0; i < r_size ; i += 3, adj++) - remainder_str.insert(i + adj, thin_sp); - if (n < 0) quotient_str.insert(0, '-'); else if (fPlus && n > 0) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 7b30f8de09..d10463fd8f 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -705,7 +705,7 @@ void CoinControlDialog::updateView() QString sAddress = ""; if(ExtractDestination(out.tx->vout[out.i].scriptPubKey, outputAddress)) { - sAddress = CBitcoinAddress(outputAddress).ToString().c_str(); + sAddress = QString::fromStdString(CBitcoinAddress(outputAddress).ToString()); // if listMode or change => show bitcoin address. In tree mode, address is not shown again for direct wallet address outputs if (!treeMode || (!(sAddress == sWalletAddress))) @@ -752,7 +752,7 @@ void CoinControlDialog::updateView() // transaction hash uint256 txhash = out.tx->GetHash(); - itemOutput->setText(COLUMN_TXHASH, txhash.GetHex().c_str()); + itemOutput->setText(COLUMN_TXHASH, QString::fromStdString(txhash.GetHex())); // vout index itemOutput->setText(COLUMN_VOUT_INDEX, QString::number(out.i)); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index f6a4b599de..219a685faf 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -10,6 +10,7 @@ #include "optionsmodel.h" #include "base58.h" +#include "chainparams.h" #include "ui_interface.h" #include "util.h" #include "wallet.h" @@ -200,8 +201,11 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { CBitcoinAddress address(r.address.toStdString()); - SelectParams(CBaseChainParams::MAIN); - if (!address.IsValid()) + if (address.IsValid(Params(CBaseChainParams::MAIN))) + { + SelectParams(CBaseChainParams::MAIN); + } + else if (address.IsValid(Params(CBaseChainParams::TESTNET))) { SelectParams(CBaseChainParams::TESTNET); } diff --git a/src/qt/test/paymentrequestdata.h b/src/qt/test/paymentrequestdata.h index 49558165f0..aeaa7d89a0 100644 --- a/src/qt/test/paymentrequestdata.h +++ b/src/qt/test/paymentrequestdata.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Data for paymentservertests.cpp // diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp index e92a7d2b1a..5d7fe96285 100644 --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "paymentservertests.h" #include "optionsmodel.h" @@ -21,7 +25,6 @@ X509 *parse_b64der_cert(const char* cert_data) return cert; } - // // Test payment request handling // @@ -30,7 +33,7 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vector<unsig { RecipientCatcher sigCatcher; QObject::connect(server, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), - &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); + &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); // Write data to a temp file: QTemporaryFile f; @@ -48,7 +51,7 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vector<unsig QCoreApplication::sendEvent(&object, &event); QObject::disconnect(server, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), - &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); + &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); // Return results from sigCatcher return sigCatcher.recipient; diff --git a/src/qt/test/paymentservertests.h b/src/qt/test/paymentservertests.h index 884e535a60..9b6400b0d5 100644 --- a/src/qt/test/paymentservertests.h +++ b/src/qt/test/paymentservertests.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef PAYMENTSERVERTESTS_H #define PAYMENTSERVERTESTS_H @@ -15,8 +19,8 @@ private slots: }; // Dummy class to receive paymentserver signals. -// If SendCoinsRecipient was a proper QObject, then we could use -// QSignalSpy... but it's not. +// If SendCoinsRecipient was a proper QObject, then +// we could use QSignalSpy... but it's not. class RecipientCatcher : public QObject { Q_OBJECT diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 03a2381c06..f2161c2f79 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -1,11 +1,16 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" #endif +#include "uritests.h" + #ifdef ENABLE_WALLET #include "paymentservertests.h" #endif -#include "uritests.h" #include <QCoreApplication> #include <QObject> diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp index 5c0f4406a7..78a7b1b9b4 100644 --- a/src/qt/test/uritests.cpp +++ b/src/qt/test/uritests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "uritests.h" #include "guiutil.h" diff --git a/src/qt/test/uritests.h b/src/qt/test/uritests.h index 17d4280a90..1ea6d9f075 100644 --- a/src/qt/test/uritests.h +++ b/src/qt/test/uritests.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef URITESTS_H #define URITESTS_H diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 8258e719a3..727b8dc66d 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -11,7 +11,7 @@ #include "db.h" #include "main.h" #include "paymentserver.h" -#include "script.h" +#include "script/script.h" #include "transactionrecord.h" #include "timedata.h" #include "ui_interface.h" diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 92c22f5692..8d2c2e96d8 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -36,6 +36,7 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p { fProcessingQueuedTransactions = false; fHaveWatchOnly = wallet->HaveWatchOnly(); + fForceCheckBalanceChanged = false; addressTableModel = new AddressTableModel(wallet, this); transactionTableModel = new TransactionTableModel(wallet, this); @@ -121,8 +122,10 @@ void WalletModel::pollBalanceChanged() if(!lockWallet) return; - if(chainActive.Height() != cachedNumBlocks) + if(fForceCheckBalanceChanged || chainActive.Height() != cachedNumBlocks) { + fForceCheckBalanceChanged = false; + // Balance and number of transactions might have changed cachedNumBlocks = chainActive.Height(); @@ -167,7 +170,7 @@ void WalletModel::updateTransaction(const QString &hash, int status) transactionTableModel->updateTransaction(hash, status); // Balance and number of transactions might have changed - checkBalanceChanged(); + fForceCheckBalanceChanged = true; } void WalletModel::updateAddressBook(const QString &address, const QString &label, @@ -344,6 +347,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran } emit coinsSent(wallet, rcp, transaction_array); } + checkBalanceChanged(); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits return SendCoinsReturn(OK); } @@ -473,11 +477,6 @@ static void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet, static void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress) { - // emits signal "showProgress" - QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection, - Q_ARG(QString, QString::fromStdString(title)), - Q_ARG(int, nProgress)); - if (nProgress == 0) fQueueNotifications = true; @@ -495,6 +494,11 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int } std::vector<std::pair<uint256, ChangeType> >().swap(vQueueNotifications); // clear } + + // emits signal "showProgress" + QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection, + Q_ARG(QString, QString::fromStdString(title)), + Q_ARG(int, nProgress)); } static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly) @@ -618,7 +622,7 @@ void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins) CTxDestination address; if(!out.fSpendable || !ExtractDestination(cout.tx->vout[cout.i].scriptPubKey, address)) continue; - mapCoins[CBitcoinAddress(address).ToString().c_str()].push_back(out); + mapCoins[QString::fromStdString(CBitcoinAddress(address).ToString())].push_back(out); } } diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 00a011d937..111ae2178c 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -199,6 +199,7 @@ private: CWallet *wallet; bool fProcessingQueuedTransactions; bool fHaveWatchOnly; + bool fForceCheckBalanceChanged; // Wallet has an options model for wallet-specific options // (transaction fee, for example) |