Commit 4a0a266c authored by Philip Kaufmann's avatar Philip Kaufmann
Browse files

Coincontrol cleanup (e.g. add missing license)

- add missing license headers
- make compatible with Qt5
- enforce header cleanup style
- small code style cleanups
- rename Coin Control dialog into Coin Control Address Selection
- use default font for the windows labels (no monospace)
parent d1d73c22
master 14.0.0-testnet-require-standard 206-keys-hashes-opcodes 206-reg-spec-tx 211-agent-voting 89-merge-0.11-1st-stage 89-merge-bitcoin-latest-changes Current-dev NFT_HANG_HOT_FIX Testbranch add-testnet-option-to-script arm64 ashot-dev ashot-mn bitcoin-merge bitcoin-merge-wjf bitcore bitcore-current-dev bitcore-current-dev-fix-261 bitcore-v0.12.5.2 bitcore-v0.12.5.2-rc bug-template-updates build-experiments buildenv cherry-pick-61110e8c cherry-pick-9cf6a77a crown-ui current-dev-fix-261 develop-0.15 develop-platform difficulty-adjust docker-experiment evo-upgrade feature-350-asterisk-for-height fix-crown-cli fix-pi-build fix_depends_boost_location fontconfcheck issue-340-bionic-depends issue_115 issue_173 issue_371 main-testnet-integration mn-pos-fix pablon pablon-build-env patch-release-v0.12.5.3 patch_v0.13.4.1 printblock reduce-testnet-difficulty resolve-wallet-freeze spendfrom-enhancements testnet-stability v0.10.3-fix v0.14.2 v0.14.2rc2 v0.14.2rc1 v0.14.1 v0.14.1rc2 v0.14.1rc1 v0.14.0.4 v0.14.0.3 v0.14.0.2-Emerald v0.14.0.1-Emerald v0.14.0.0-Emerald v0.14.0 v0.14.0rc3 v0.14.0rc2 v0.14.0rc1 v0.13.4.0 v0.13.2.0 v0.13.2 v0.13.2rc1 v0.13.1 v0.13.1rc3 v0.13.1rc2 v0.13.1rc1 v0.13.0 v0.13.0rc3 v0.13.0rc2 v0.13.0rc1 v0.12.5.3 v0.12.5.2 v0.12.5.1 v0.12.5.0 v0.12.4.1 v0.12.4.0 v0.12.2.0 v0.12.1.0 v0.12.1 v0.12.1rc2 v0.12.1rc1 v0.12.0.61 v0.12.0 v0.12.0rc5 v0.12.0rc4 v0.12.0rc3 v0.12.0rc2 v0.12.0rc1 v0.11.3 v0.11.2 v0.11.2rc1 v0.11.1 v0.11.1rc2 v0.11.1rc1 v0.11.0 v0.11.0rc3 v0.11.0rc2 v0.11.0rc1 v0.10.5 v0.10.4 v0.10.4rc1 v0.10.3 v0.10.3rc2 v0.10.3rc1 v0.10.2 v0.10.2rc1 v0.10.1 v0.10.1rc3 v0.10.1rc2 v0.10.1rc1 v0.10.0 v0.10.0rc4 v0.10.0rc3 v0.10.0rc2 v0.10.0rc1 v0.9.5 v0.9.5rc2 v0.9.5rc1 v0.9.4 v0.9.3.5 v0.9.3 v0.9.3rc2 v0.9.3rc1 v0.9.2.1 v0.9.2 v0.9.2rc2 v0.9.2rc1 v0.9.1 v0.9.0 v0.9.0rc3 v0.9.0rc2 v0.9.0rc1 bitcore-bin-006 bitcore-bin-005 bitcore-bin-004 bitcore-bin-003 bitcore-bin-002 bitcore-bin-001
No related merge requests found
Showing with 71 additions and 104 deletions
+71 -104
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef COINCONTROL_H
#define COINCONTROL_H
......
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "coincontroldialog.h"
#include "ui_coincontroldialog.h"
#include "init.h"
#include "bitcoinunits.h"
#include "walletmodel.h"
#include "addresstablemodel.h"
#include "optionsmodel.h"
#include "bitcoinunits.h"
#include "guiutil.h"
#include "init.h"
#include "optionsmodel.h"
#include "walletmodel.h"
#include "coincontrol.h"
#include "main.h"
#include "wallet.h"
#include <QApplication>
#include <QCheckBox>
#include <QClipboard>
#include <QColor>
#include <QCursor>
#include <QDateTime>
......@@ -98,7 +102,11 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
connect(ui->treeWidget, SIGNAL(itemChanged( QTreeWidgetItem*, int)), this, SLOT(viewItemChanged( QTreeWidgetItem*, int)));
// click on header
#if QT_VERSION < 0x050000
ui->treeWidget->header()->setClickable(true);
#else
ui->treeWidget->header()->setSectionsClickable(true);
#endif
connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int)));
// ok button
......
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef COINCONTROLDIALOG_H
#define COINCONTROLDIALOG_H
......
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "coincontroltreewidget.h"
#include "coincontroldialog.h"
......
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef COINCONTROLTREEWIDGET_H
#define COINCONTROLTREEWIDGET_H
#include <QKeyEvent>
#include <QTreeWidget>
class CoinControlTreeWidget : public QTreeWidget {
Q_OBJECT
class CoinControlTreeWidget : public QTreeWidget
{
Q_OBJECT
public:
explicit CoinControlTreeWidget(QWidget *parent = 0);
protected:
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
};
#endif // COINCONTROLTREEWIDGET_H
\ No newline at end of file
......@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Coin Control</string>
<string>Coin Control Address Selection</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
......@@ -48,12 +48,6 @@
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelCoinControlQuantity">
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
......@@ -80,12 +74,6 @@
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelCoinControlBytes">
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
......@@ -128,12 +116,6 @@
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelCoinControlAmount">
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
......@@ -160,21 +142,12 @@
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelCoinControlPriority">
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="text">
<string/>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
......@@ -208,12 +181,6 @@
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelCoinControlFee">
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
......@@ -246,12 +213,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
......@@ -294,12 +255,6 @@
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelCoinControlAfterFee">
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
......@@ -332,12 +287,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Monospace</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
......
......@@ -369,7 +369,7 @@
<string>Whether to show coin control features or not.</string>
</property>
<property name="text">
<string>Display coin &amp;control features (experts only!)</string>
<string>Display coin &amp;control features (experts only)</string>
</property>
</widget>
</item>
......
......@@ -292,12 +292,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
case Language:
settings.setValue("language", value);
break;
case CoinControlFeatures: {
case CoinControlFeatures:
fCoinControlFeatures = value.toBool();
settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
emit coinControlFeaturesChanged(fCoinControlFeatures);
}
break;
break;
default:
break;
}
......@@ -312,11 +311,6 @@ qint64 OptionsModel::getTransactionFee()
return (qint64) nTransactionFee;
}
bool OptionsModel::getCoinControlFeatures()
{
return fCoinControlFeatures;
}
bool OptionsModel::getProxySettings(QString& proxyIP, quint16 &proxyPort) const
{
std::string proxy = GetArg("-proxy", "");
......
......@@ -21,19 +21,19 @@ public:
explicit OptionsModel(QObject *parent = 0);
enum OptionID {
StartAtStartup, // bool
MinimizeToTray, // bool
MapPortUPnP, // bool
MinimizeOnClose, // bool
ProxyUse, // bool
ProxyIP, // QString
ProxyPort, // int
ProxySocksVersion, // int
Fee, // qint64
DisplayUnit, // BitcoinUnits::Unit
DisplayAddresses, // bool
Language, // QString
CoinControlFeatures, // bool
StartAtStartup, // bool
MinimizeToTray, // bool
MapPortUPnP, // bool
MinimizeOnClose, // bool
ProxyUse, // bool
ProxyIP, // QString
ProxyPort, // int
ProxySocksVersion, // int
Fee, // qint64
DisplayUnit, // BitcoinUnits::Unit
DisplayAddresses, // bool
Language, // QString
CoinControlFeatures, // bool
OptionIDRowCount,
};
......@@ -55,7 +55,7 @@ public:
bool getDisplayAddresses() { return bDisplayAddresses; }
QString getLanguage() { return language; }
bool getProxySettings(QString& proxyIP, quint16 &proxyPort) const;
bool getCoinControlFeatures();
bool getCoinControlFeatures() { return fCoinControlFeatures; }
private:
int nDisplayUnit;
......
......@@ -5,17 +5,17 @@
#include "sendcoinsdialog.h"
#include "ui_sendcoinsdialog.h"
#include "addresstablemodel.h"
#include "bitcoinunits.h"
#include "coincontroldialog.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include "sendcoinsentry.h"
#include "walletmodel.h"
#include "coincontroldialog.h"
#include "addresstablemodel.h"
#include "base58.h"
#include "ui_interface.h"
#include "coincontrol.h"
#include "ui_interface.h"
#include <QMessageBox>
#include <QScrollBar>
......@@ -34,7 +34,6 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
ui->sendButton->setIcon(QIcon());
#endif
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
ui->lineEditCoinControlChange->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
#endif
......
......@@ -27,7 +27,6 @@ SendCoinsEntry::SendCoinsEntry(QWidget *parent) :
ui->payToLayout->setSpacing(4);
#endif
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
ui->payTo->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
#endif
......
......@@ -10,22 +10,23 @@
#include "allocators.h" /* for SecureString */
#include <QObject>
#include <vector>
#include <map>
#include <vector>
#include <QObject>
class AddressTableModel;
class OptionsModel;
class TransactionTableModel;
class WalletModelTransaction;
class CCoinControl;
class CKeyID;
class CPubKey;
class COutput;
class COutPoint;
class uint256;
class CCoinControl;
class COutput;
class CPubKey;
class CWallet;
class uint256;
QT_BEGIN_NAMESPACE
class QTimer;
......@@ -88,7 +89,7 @@ public:
AddressTableModel *getAddressTableModel();
TransactionTableModel *getTransactionTableModel();
qint64 getBalance(const CCoinControl *coinControl=NULL) const;
qint64 getBalance(const CCoinControl *coinControl = NULL) const;
qint64 getUnconfirmedBalance() const;
qint64 getImmatureBalance() const;
int getNumTransactions() const;
......@@ -100,13 +101,13 @@ public:
// Return status record for SendCoins, contains error id + information
struct SendCoinsReturn
{
SendCoinsReturn(StatusCode status=Aborted):
SendCoinsReturn(StatusCode status = Aborted):
status(status) {}
StatusCode status;
};
// prepare transaction for getting txfee before sending coins
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl=NULL);
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl = NULL);
// Send coins to a list of recipients
SendCoinsReturn sendCoins(WalletModelTransaction &transaction);
......
......@@ -6,8 +6,8 @@
#include "wallet.h"
#include "base58.h"
#include "net.h"
#include "coincontrol.h"
#include "net.h"
#include <inttypes.h>
#include <stdint.h>
......
......@@ -24,11 +24,11 @@
#include <vector>
class CAccountingEntry;
class CCoinControl;
class COutput;
class CReserveKey;
class CScript;
class CWalletTx;
class CCoinControl;
/** (client) version numbers for particular wallet features */
enum WalletFeature
......@@ -88,7 +88,7 @@ public:
class CWallet : public CCryptoKeyStore, public CWalletInterface
{
private:
bool SelectCoins(int64_t nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet, const CCoinControl *coinControl=NULL) const;
bool SelectCoins(int64_t nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet, const CCoinControl *coinControl = NULL) const;
CWalletDB *pwalletdbEncryption;
......@@ -153,7 +153,7 @@ public:
// check whether we are allowed to upgrade (or already support) to the named feature
bool CanSupportFeature(enum WalletFeature wf) { return nWalletMaxVersion >= wf; }
void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl=NULL) const;
void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl = NULL) const;
bool SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet) const;
bool IsLockedCoin(uint256 hash, unsigned int n) const;
void LockCoin(COutPoint& output);
......@@ -213,9 +213,9 @@ public:
int64_t GetUnconfirmedBalance() const;
int64_t GetImmatureBalance() const;
bool CreateTransaction(const std::vector<std::pair<CScript, int64_t> >& vecSend,
CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl=NULL);
CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL);
bool CreateTransaction(CScript scriptPubKey, int64_t nValue,
CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl=NULL);
CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL);
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
std::string SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew, bool fAskFee=false);
std::string SendMoneyToDestination(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew, bool fAskFee=false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment