Browse Source

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)
0.10
Philip Kaufmann 11 years ago
parent
commit
0689f46cc7
  1. 4
      src/coincontrol.h
  2. 18
      src/qt/coincontroldialog.cpp
  3. 4
      src/qt/coincontroldialog.h
  4. 4
      src/qt/coincontroltreewidget.cpp
  5. 7
      src/qt/coincontroltreewidget.h
  6. 53
      src/qt/forms/coincontroldialog.ui
  7. 2
      src/qt/forms/optionsdialog.ui
  8. 8
      src/qt/optionsmodel.cpp
  9. 2
      src/qt/optionsmodel.h
  10. 7
      src/qt/sendcoinsdialog.cpp
  11. 1
      src/qt/sendcoinsentry.cpp
  12. 15
      src/qt/walletmodel.h
  13. 2
      src/wallet.cpp
  14. 2
      src/wallet.h

4
src/coincontrol.h

@ -1,3 +1,7 @@ @@ -1,3 +1,7 @@
// 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

18
src/qt/coincontroldialog.cpp

@ -1,19 +1,23 @@ @@ -1,19 +1,23 @@
// 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) : @@ -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

4
src/qt/coincontroldialog.h

@ -1,3 +1,7 @@ @@ -1,3 +1,7 @@
// 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

4
src/qt/coincontroltreewidget.cpp

@ -1,3 +1,7 @@ @@ -1,3 +1,7 @@
// 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"

7
src/qt/coincontroltreewidget.h

@ -1,10 +1,15 @@ @@ -1,10 +1,15 @@
// 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 {
class CoinControlTreeWidget : public QTreeWidget
{
Q_OBJECT
public:

53
src/qt/forms/coincontroldialog.ui

@ -11,7 +11,7 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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>

2
src/qt/forms/optionsdialog.ui

@ -369,7 +369,7 @@ @@ -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>

8
src/qt/optionsmodel.cpp

@ -292,11 +292,10 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in @@ -292,11 +292,10 @@ 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;
default:
break;
@ -312,11 +311,6 @@ qint64 OptionsModel::getTransactionFee() @@ -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", "");

2
src/qt/optionsmodel.h

@ -55,7 +55,7 @@ public: @@ -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;

7
src/qt/sendcoinsdialog.cpp

@ -5,17 +5,17 @@ @@ -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) : @@ -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

1
src/qt/sendcoinsentry.cpp

@ -27,7 +27,6 @@ SendCoinsEntry::SendCoinsEntry(QWidget *parent) : @@ -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

15
src/qt/walletmodel.h

@ -10,22 +10,23 @@ @@ -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;

2
src/wallet.cpp

@ -6,8 +6,8 @@ @@ -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>

2
src/wallet.h

@ -24,11 +24,11 @@ @@ -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

Loading…
Cancel
Save