Skip to content

Commit 0689f46

Browse files
author
Philip Kaufmann
committed
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)
1 parent af6e093 commit 0689f46

14 files changed

+71
-104
lines changed

src/coincontrol.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (c) 2011-2013 The Bitcoin developers
2+
// Distributed under the MIT/X11 software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
15
#ifndef COINCONTROL_H
26
#define COINCONTROL_H
37

src/qt/coincontroldialog.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1+
// Copyright (c) 2011-2013 The Bitcoin developers
2+
// Distributed under the MIT/X11 software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
15
#include "coincontroldialog.h"
26
#include "ui_coincontroldialog.h"
37

4-
#include "init.h"
5-
#include "bitcoinunits.h"
6-
#include "walletmodel.h"
78
#include "addresstablemodel.h"
8-
#include "optionsmodel.h"
9+
#include "bitcoinunits.h"
910
#include "guiutil.h"
11+
#include "init.h"
12+
#include "optionsmodel.h"
13+
#include "walletmodel.h"
14+
1015
#include "coincontrol.h"
1116
#include "main.h"
1217
#include "wallet.h"
1318

1419
#include <QApplication>
1520
#include <QCheckBox>
16-
#include <QClipboard>
1721
#include <QColor>
1822
#include <QCursor>
1923
#include <QDateTime>
@@ -98,7 +102,11 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
98102
connect(ui->treeWidget, SIGNAL(itemChanged( QTreeWidgetItem*, int)), this, SLOT(viewItemChanged( QTreeWidgetItem*, int)));
99103

100104
// click on header
105+
#if QT_VERSION < 0x050000
101106
ui->treeWidget->header()->setClickable(true);
107+
#else
108+
ui->treeWidget->header()->setSectionsClickable(true);
109+
#endif
102110
connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int)));
103111

104112
// ok button

src/qt/coincontroldialog.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (c) 2011-2013 The Bitcoin developers
2+
// Distributed under the MIT/X11 software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
15
#ifndef COINCONTROLDIALOG_H
26
#define COINCONTROLDIALOG_H
37

src/qt/coincontroltreewidget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (c) 2011-2013 The Bitcoin developers
2+
// Distributed under the MIT/X11 software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
15
#include "coincontroltreewidget.h"
26
#include "coincontroldialog.h"
37

src/qt/coincontroltreewidget.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
// Copyright (c) 2011-2013 The Bitcoin developers
2+
// Distributed under the MIT/X11 software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
15
#ifndef COINCONTROLTREEWIDGET_H
26
#define COINCONTROLTREEWIDGET_H
37

48
#include <QKeyEvent>
59
#include <QTreeWidget>
610

7-
class CoinControlTreeWidget : public QTreeWidget {
8-
Q_OBJECT
11+
class CoinControlTreeWidget : public QTreeWidget
12+
{
13+
Q_OBJECT
914

1015
public:
1116
explicit CoinControlTreeWidget(QWidget *parent = 0);
1217

1318
protected:
14-
virtual void keyPressEvent(QKeyEvent *event);
19+
virtual void keyPressEvent(QKeyEvent *event);
1520
};
1621

1722
#endif // COINCONTROLTREEWIDGET_H

src/qt/forms/coincontroldialog.ui

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string>Coin Control</string>
14+
<string>Coin Control Address Selection</string>
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout">
1717
<item>
@@ -48,12 +48,6 @@
4848
</item>
4949
<item row="0" column="1">
5050
<widget class="QLabel" name="labelCoinControlQuantity">
51-
<property name="font">
52-
<font>
53-
<family>Monospace</family>
54-
<pointsize>10</pointsize>
55-
</font>
56-
</property>
5751
<property name="cursor">
5852
<cursorShape>IBeamCursor</cursorShape>
5953
</property>
@@ -80,12 +74,6 @@
8074
</item>
8175
<item row="1" column="1">
8276
<widget class="QLabel" name="labelCoinControlBytes">
83-
<property name="font">
84-
<font>
85-
<family>Monospace</family>
86-
<pointsize>10</pointsize>
87-
</font>
88-
</property>
8977
<property name="cursor">
9078
<cursorShape>IBeamCursor</cursorShape>
9179
</property>
@@ -128,12 +116,6 @@
128116
</item>
129117
<item row="0" column="1">
130118
<widget class="QLabel" name="labelCoinControlAmount">
131-
<property name="font">
132-
<font>
133-
<family>Monospace</family>
134-
<pointsize>10</pointsize>
135-
</font>
136-
</property>
137119
<property name="cursor">
138120
<cursorShape>IBeamCursor</cursorShape>
139121
</property>
@@ -160,21 +142,12 @@
160142
</item>
161143
<item row="1" column="1">
162144
<widget class="QLabel" name="labelCoinControlPriority">
163-
<property name="font">
164-
<font>
165-
<family>Monospace</family>
166-
<pointsize>10</pointsize>
167-
</font>
168-
</property>
169145
<property name="cursor">
170146
<cursorShape>IBeamCursor</cursorShape>
171147
</property>
172148
<property name="contextMenuPolicy">
173149
<enum>Qt::ActionsContextMenu</enum>
174150
</property>
175-
<property name="text">
176-
<string/>
177-
</property>
178151
<property name="textInteractionFlags">
179152
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
180153
</property>
@@ -208,12 +181,6 @@
208181
</item>
209182
<item row="0" column="1">
210183
<widget class="QLabel" name="labelCoinControlFee">
211-
<property name="font">
212-
<font>
213-
<family>Monospace</family>
214-
<pointsize>10</pointsize>
215-
</font>
216-
</property>
217184
<property name="cursor">
218185
<cursorShape>IBeamCursor</cursorShape>
219186
</property>
@@ -246,12 +213,6 @@
246213
<property name="enabled">
247214
<bool>false</bool>
248215
</property>
249-
<property name="font">
250-
<font>
251-
<family>Monospace</family>
252-
<pointsize>10</pointsize>
253-
</font>
254-
</property>
255216
<property name="cursor">
256217
<cursorShape>IBeamCursor</cursorShape>
257218
</property>
@@ -294,12 +255,6 @@
294255
</item>
295256
<item row="0" column="1">
296257
<widget class="QLabel" name="labelCoinControlAfterFee">
297-
<property name="font">
298-
<font>
299-
<family>Monospace</family>
300-
<pointsize>10</pointsize>
301-
</font>
302-
</property>
303258
<property name="cursor">
304259
<cursorShape>IBeamCursor</cursorShape>
305260
</property>
@@ -332,12 +287,6 @@
332287
<property name="enabled">
333288
<bool>false</bool>
334289
</property>
335-
<property name="font">
336-
<font>
337-
<family>Monospace</family>
338-
<pointsize>10</pointsize>
339-
</font>
340-
</property>
341290
<property name="cursor">
342291
<cursorShape>IBeamCursor</cursorShape>
343292
</property>

src/qt/forms/optionsdialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
<string>Whether to show coin control features or not.</string>
370370
</property>
371371
<property name="text">
372-
<string>Display coin &amp;control features (experts only!)</string>
372+
<string>Display coin &amp;control features (experts only)</string>
373373
</property>
374374
</widget>
375375
</item>

src/qt/optionsmodel.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
292292
case Language:
293293
settings.setValue("language", value);
294294
break;
295-
case CoinControlFeatures: {
295+
case CoinControlFeatures:
296296
fCoinControlFeatures = value.toBool();
297297
settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
298298
emit coinControlFeaturesChanged(fCoinControlFeatures);
299-
}
300-
break;
299+
break;
301300
default:
302301
break;
303302
}
@@ -312,11 +311,6 @@ qint64 OptionsModel::getTransactionFee()
312311
return (qint64) nTransactionFee;
313312
}
314313

315-
bool OptionsModel::getCoinControlFeatures()
316-
{
317-
return fCoinControlFeatures;
318-
}
319-
320314
bool OptionsModel::getProxySettings(QString& proxyIP, quint16 &proxyPort) const
321315
{
322316
std::string proxy = GetArg("-proxy", "");

src/qt/optionsmodel.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ class OptionsModel : public QAbstractListModel
2121
explicit OptionsModel(QObject *parent = 0);
2222

2323
enum OptionID {
24-
StartAtStartup, // bool
25-
MinimizeToTray, // bool
26-
MapPortUPnP, // bool
27-
MinimizeOnClose, // bool
28-
ProxyUse, // bool
29-
ProxyIP, // QString
30-
ProxyPort, // int
31-
ProxySocksVersion, // int
32-
Fee, // qint64
33-
DisplayUnit, // BitcoinUnits::Unit
34-
DisplayAddresses, // bool
35-
Language, // QString
36-
CoinControlFeatures, // bool
24+
StartAtStartup, // bool
25+
MinimizeToTray, // bool
26+
MapPortUPnP, // bool
27+
MinimizeOnClose, // bool
28+
ProxyUse, // bool
29+
ProxyIP, // QString
30+
ProxyPort, // int
31+
ProxySocksVersion, // int
32+
Fee, // qint64
33+
DisplayUnit, // BitcoinUnits::Unit
34+
DisplayAddresses, // bool
35+
Language, // QString
36+
CoinControlFeatures, // bool
3737
OptionIDRowCount,
3838
};
3939

@@ -55,7 +55,7 @@ class OptionsModel : public QAbstractListModel
5555
bool getDisplayAddresses() { return bDisplayAddresses; }
5656
QString getLanguage() { return language; }
5757
bool getProxySettings(QString& proxyIP, quint16 &proxyPort) const;
58-
bool getCoinControlFeatures();
58+
bool getCoinControlFeatures() { return fCoinControlFeatures; }
5959

6060
private:
6161
int nDisplayUnit;

src/qt/sendcoinsdialog.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
#include "sendcoinsdialog.h"
66
#include "ui_sendcoinsdialog.h"
77

8+
#include "addresstablemodel.h"
89
#include "bitcoinunits.h"
10+
#include "coincontroldialog.h"
911
#include "guiutil.h"
1012
#include "optionsmodel.h"
1113
#include "sendcoinsentry.h"
1214
#include "walletmodel.h"
13-
#include "coincontroldialog.h"
14-
#include "addresstablemodel.h"
1515

1616
#include "base58.h"
17-
#include "ui_interface.h"
1817
#include "coincontrol.h"
18+
#include "ui_interface.h"
1919

2020
#include <QMessageBox>
2121
#include <QScrollBar>
@@ -34,7 +34,6 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
3434
ui->sendButton->setIcon(QIcon());
3535
#endif
3636
#if QT_VERSION >= 0x040700
37-
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
3837
ui->lineEditCoinControlChange->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
3938
#endif
4039

0 commit comments

Comments
 (0)