Skip to content

Commit ade639c

Browse files
committed
qt: Drop PlatformStyle
1 parent 4e14429 commit ade639c

35 files changed

+111
-441
lines changed

src/Makefile.qt.include

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ BITCOIN_QT_H = \
155155
qt/paymentrequestplus.h \
156156
qt/paymentserver.h \
157157
qt/peertablemodel.h \
158-
qt/platformstyle.h \
159158
qt/qrdialog.h \
160159
qt/qvalidatedlineedit.h \
161160
qt/qvaluecombobox.h \
@@ -253,7 +252,6 @@ BITCOIN_QT_BASE_CPP = \
253252
qt/optionsdialog.cpp \
254253
qt/optionsmodel.cpp \
255254
qt/peertablemodel.cpp \
256-
qt/platformstyle.cpp \
257255
qt/qvalidatedlineedit.cpp \
258256
qt/qvaluecombobox.cpp \
259257
qt/rpcconsole.cpp \

src/qt/addressbookpage.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <qt/editaddressdialog.h>
1717
#include <qt/guiutil.h>
1818
#include <qt/optionsmodel.h>
19-
#include <qt/platformstyle.h>
2019
#include <qt/qrdialog.h>
2120

2221
#include <QIcon>
@@ -59,7 +58,7 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
5958
}
6059
};
6160

62-
AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode, Tabs _tab, QWidget *parent) :
61+
AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
6362
QDialog(parent),
6463
ui(new Ui::AddressBookPage),
6564
model(0),
@@ -68,11 +67,6 @@ AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode,
6867
{
6968
ui->setupUi(this);
7069

71-
ui->newAddress->setIcon(platformStyle->Icon(":/icons/add"));
72-
ui->copyAddress->setIcon(platformStyle->Icon(":/icons/editcopy"));
73-
ui->deleteAddress->setIcon(platformStyle->Icon(":/icons/remove"));
74-
ui->exportButton->setIcon(platformStyle->Icon(":/icons/export"));
75-
7670
ui->showAddressQRCode->setIcon(QIcon());
7771

7872
switch(mode)

src/qt/addressbookpage.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
class AddressBookSortFilterProxyModel;
1111
class AddressTableModel;
12-
class PlatformStyle;
1312

1413
namespace Ui {
1514
class AddressBookPage;
@@ -38,7 +37,7 @@ class AddressBookPage : public QDialog
3837
ForEditing /**< Open address book for editing */
3938
};
4039

41-
explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);
40+
explicit AddressBookPage(Mode mode, Tabs tab, QWidget* parent);
4241
~AddressBookPage();
4342

4443
void setModel(AddressTableModel *model);

src/qt/bitcoingui.cpp

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <qt/openuridialog.h>
1616
#include <qt/optionsdialog.h>
1717
#include <qt/optionsmodel.h>
18-
#include <qt/platformstyle.h>
1918
#include <qt/rpcconsole.h>
2019
#include <qt/utilitydialog.h>
2120

@@ -74,7 +73,7 @@ const std::string BitcoinGUI::DEFAULT_UIPLATFORM =
7473
* collisions in the future with additional wallets */
7574
const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
7675

77-
BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
76+
BitcoinGUI::BitcoinGUI(const NetworkStyle* networkStyle, QWidget* parent) :
7877
QMainWindow(parent),
7978
enableWallet(false),
8079
clientModel(0),
@@ -122,8 +121,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
122121
modalOverlay(0),
123122
tabGroup(0),
124123
prevBlocks(0),
125-
spinnerFrame(0),
126-
platformStyle(_platformStyle)
124+
spinnerFrame(0)
127125
{
128126
GUIUtil::loadStyleSheet(this);
129127

@@ -150,13 +148,13 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
150148
setWindowIcon(networkStyle->getTrayAndWindowIcon());
151149
setWindowTitle(windowTitle);
152150

153-
rpcConsole = new RPCConsole(_platformStyle, this);
151+
rpcConsole = new RPCConsole(this);
154152
helpMessageDialog = new HelpMessageDialog(this, HelpMessageDialog::cmdline);
155153
#ifdef ENABLE_WALLET
156154
if(enableWallet)
157155
{
158156
/** Create wallet frame*/
159-
walletFrame = new WalletFrame(_platformStyle, this);
157+
walletFrame = new WalletFrame(this);
160158
} else
161159
#endif // ENABLE_WALLET
162160
{
@@ -195,7 +193,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
195193
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
196194
frameBlocksLayout->setContentsMargins(3,0,3,0);
197195
frameBlocksLayout->setSpacing(3);
198-
unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle);
196+
unitDisplayControl = new UnitDisplayStatusBarControl();
199197
labelWalletEncryptionIcon = new QLabel();
200198
labelWalletHDStatusIcon = new QLabel();
201199
labelConnectionsIcon = new GUIUtil::ClickableLabel();
@@ -312,7 +310,7 @@ void BitcoinGUI::createActions()
312310
#endif
313311
tabGroup->addButton(sendCoinsAction);
314312

315-
sendCoinsMenuAction = new QAction(platformStyle->Icon(":/icons/send"), sendCoinsAction->text(), this);
313+
sendCoinsMenuAction = new QAction(sendCoinsAction->text(), this);
316314
sendCoinsMenuAction->setStatusTip(sendCoinsAction->statusTip());
317315
sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip());
318316

@@ -328,7 +326,7 @@ void BitcoinGUI::createActions()
328326
#endif
329327
tabGroup->addButton(privateSendCoinsAction);
330328

331-
privateSendCoinsMenuAction = new QAction(platformStyle->Icon(":/icons/send"), privateSendCoinsAction->text(), this);
329+
privateSendCoinsMenuAction = new QAction(privateSendCoinsAction->text(), this);
332330
privateSendCoinsMenuAction->setStatusTip(privateSendCoinsAction->statusTip());
333331
privateSendCoinsMenuAction->setToolTip(privateSendCoinsMenuAction->statusTip());
334332

@@ -344,7 +342,7 @@ void BitcoinGUI::createActions()
344342
#endif
345343
tabGroup->addButton(receiveCoinsAction);
346344

347-
receiveCoinsMenuAction = new QAction(platformStyle->Icon(":/icons/receiving_addresses"), receiveCoinsAction->text(), this);
345+
receiveCoinsMenuAction = new QAction(receiveCoinsAction->text(), this);
348346
receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip());
349347
receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip());
350348

@@ -404,54 +402,54 @@ void BitcoinGUI::createActions()
404402
connect(tabGroup, SIGNAL(buttonToggled(QAbstractButton *, bool)), this, SLOT(highlightTabButton(QAbstractButton *, bool)));
405403
#endif // ENABLE_WALLET
406404

407-
quitAction = new QAction(platformStyle->Icon(":/icons/quit"), tr("E&xit"), this);
405+
quitAction = new QAction(tr("E&xit"), this);
408406
quitAction->setStatusTip(tr("Quit application"));
409407
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
410408
quitAction->setMenuRole(QAction::QuitRole);
411-
aboutAction = new QAction(platformStyle->Icon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this);
409+
aboutAction = new QAction(tr("&About %1").arg(tr(PACKAGE_NAME)), this);
412410
aboutAction->setStatusTip(tr("Show information about Dash Core"));
413411
aboutAction->setMenuRole(QAction::AboutRole);
414412
aboutAction->setEnabled(false);
415-
aboutQtAction = new QAction(platformStyle->Icon(":/icons/about_qt"), tr("About &Qt"), this);
413+
aboutQtAction = new QAction(tr("About &Qt"), this);
416414
aboutQtAction->setStatusTip(tr("Show information about Qt"));
417415
aboutQtAction->setMenuRole(QAction::AboutQtRole);
418-
optionsAction = new QAction(platformStyle->Icon(":/icons/options"), tr("&Options..."), this);
416+
optionsAction = new QAction(tr("&Options..."), this);
419417
optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME)));
420418
optionsAction->setMenuRole(QAction::PreferencesRole);
421419
optionsAction->setEnabled(false);
422-
toggleHideAction = new QAction(platformStyle->Icon(":/icons/about"), tr("&Show / Hide"), this);
420+
toggleHideAction = new QAction(tr("&Show / Hide"), this);
423421
toggleHideAction->setStatusTip(tr("Show or hide the main Window"));
424422

425-
encryptWalletAction = new QAction(platformStyle->Icon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this);
423+
encryptWalletAction = new QAction(tr("&Encrypt Wallet..."), this);
426424
encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet"));
427425
encryptWalletAction->setCheckable(true);
428-
backupWalletAction = new QAction(platformStyle->Icon(":/icons/filesave"), tr("&Backup Wallet..."), this);
426+
backupWalletAction = new QAction(tr("&Backup Wallet..."), this);
429427
backupWalletAction->setStatusTip(tr("Backup wallet to another location"));
430-
changePassphraseAction = new QAction(platformStyle->Icon(":/icons/key"), tr("&Change Passphrase..."), this);
428+
changePassphraseAction = new QAction(tr("&Change Passphrase..."), this);
431429
changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption"));
432430
unlockWalletAction = new QAction(tr("&Unlock Wallet..."), this);
433431
unlockWalletAction->setToolTip(tr("Unlock wallet"));
434432
lockWalletAction = new QAction(tr("&Lock Wallet"), this);
435-
signMessageAction = new QAction(platformStyle->Icon(":/icons/edit"), tr("Sign &message..."), this);
433+
signMessageAction = new QAction(tr("Sign &message..."), this);
436434
signMessageAction->setStatusTip(tr("Sign messages with your Dash addresses to prove you own them"));
437-
verifyMessageAction = new QAction(platformStyle->Icon(":/icons/transaction_0"), tr("&Verify message..."), this);
435+
verifyMessageAction = new QAction(tr("&Verify message..."), this);
438436
verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Dash addresses"));
439437

440-
openInfoAction = new QAction(platformStyle->Icon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation)), tr("&Information"), this);
438+
openInfoAction = new QAction(tr("&Information"), this);
441439
openInfoAction->setStatusTip(tr("Show diagnostic information"));
442-
openRPCConsoleAction = new QAction(platformStyle->Icon(":/icons/debugwindow"), tr("&Debug console"), this);
440+
openRPCConsoleAction = new QAction(tr("&Debug console"), this);
443441
openRPCConsoleAction->setStatusTip(tr("Open debugging console"));
444-
openGraphAction = new QAction(platformStyle->Icon(":/icons/connect_4"), tr("&Network Monitor"), this);
442+
openGraphAction = new QAction(tr("&Network Monitor"), this);
445443
openGraphAction->setStatusTip(tr("Show network monitor"));
446-
openPeersAction = new QAction(platformStyle->Icon(":/icons/connect_4"), tr("&Peers list"), this);
444+
openPeersAction = new QAction(tr("&Peers list"), this);
447445
openPeersAction->setStatusTip(tr("Show peers info"));
448-
openRepairAction = new QAction(platformStyle->Icon(":/icons/options"), tr("Wallet &Repair"), this);
446+
openRepairAction = new QAction(tr("Wallet &Repair"), this);
449447
openRepairAction->setStatusTip(tr("Show wallet repair options"));
450-
openConfEditorAction = new QAction(platformStyle->Icon(":/icons/edit"), tr("Open Wallet &Configuration File"), this);
448+
openConfEditorAction = new QAction(tr("Open Wallet &Configuration File"), this);
451449
openConfEditorAction->setStatusTip(tr("Open configuration file"));
452450
// override TextHeuristicRole set by default which confuses this action with application settings
453451
openConfEditorAction->setMenuRole(QAction::NoRole);
454-
showBackupsAction = new QAction(platformStyle->Icon(":/icons/browse"), tr("Show Automatic &Backups"), this);
452+
showBackupsAction = new QAction(tr("Show Automatic &Backups"), this);
455453
showBackupsAction->setStatusTip(tr("Show automatically created wallet backups"));
456454
// initially disable the debug window menu items
457455
openInfoAction->setEnabled(false);
@@ -460,19 +458,19 @@ void BitcoinGUI::createActions()
460458
openPeersAction->setEnabled(false);
461459
openRepairAction->setEnabled(false);
462460

463-
usedSendingAddressesAction = new QAction(platformStyle->Icon(":/icons/address-book"), tr("&Sending addresses..."), this);
461+
usedSendingAddressesAction = new QAction(tr("&Sending addresses..."), this);
464462
usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels"));
465-
usedReceivingAddressesAction = new QAction(platformStyle->Icon(":/icons/address-book"), tr("&Receiving addresses..."), this);
463+
usedReceivingAddressesAction = new QAction(tr("&Receiving addresses..."), this);
466464
usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels"));
467465

468-
openAction = new QAction(platformStyle->Icon(QApplication::style()->standardIcon(QStyle::SP_DirOpenIcon)), tr("Open &URI..."), this);
466+
openAction = new QAction(tr("Open &URI..."), this);
469467
openAction->setStatusTip(tr("Open a dash: URI or payment request"));
470468

471-
showHelpMessageAction = new QAction(platformStyle->Icon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation)), tr("&Command-line options"), this);
469+
showHelpMessageAction = new QAction(tr("&Command-line options"), this);
472470
showHelpMessageAction->setMenuRole(QAction::NoRole);
473471
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Dash command-line options").arg(tr(PACKAGE_NAME)));
474472

475-
showPrivateSendHelpAction = new QAction(platformStyle->Icon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation)), tr("&PrivateSend information"), this);
473+
showPrivateSendHelpAction = new QAction(tr("&PrivateSend information"), this);
476474
showPrivateSendHelpAction->setMenuRole(QAction::NoRole);
477475
showPrivateSendHelpAction->setStatusTip(tr("Show the PrivateSend basic information"));
478476

@@ -1000,7 +998,7 @@ void BitcoinGUI::updateNetworkState()
1000998
icon = ":/icons/network_disabled";
1001999
}
10021000

1003-
labelConnectionsIcon->setPixmap(platformStyle->SingleColorIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
1001+
labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
10041002
}
10051003

10061004
void BitcoinGUI::setNumConnections(int count)
@@ -1116,7 +1114,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
11161114
tooltip = tr("Catching up...") + QString("<br>") + tooltip;
11171115
if(count != prevBlocks)
11181116
{
1119-
labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(QString(
1117+
labelBlocksIcon->setPixmap(QIcon(QString(
11201118
":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')))
11211119
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
11221120
spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES;
@@ -1175,7 +1173,7 @@ void BitcoinGUI::setAdditionalDataSyncProgress(double nSyncProgress)
11751173
labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
11761174
} else {
11771175

1178-
labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(QString(
1176+
labelBlocksIcon->setPixmap(QIcon(QString(
11791177
":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')))
11801178
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
11811179
spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES;
@@ -1445,7 +1443,7 @@ bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)
14451443

14461444
void BitcoinGUI::setHDStatus(int hdEnabled)
14471445
{
1448-
labelWalletHDStatusIcon->setPixmap(platformStyle->SingleColorIcon(hdEnabled ? ":/icons/hd_enabled" : ":/icons/hd_disabled").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
1446+
labelWalletHDStatusIcon->setPixmap(QIcon(hdEnabled ? ":/icons/hd_enabled" : ":/icons/hd_disabled").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
14491447
labelWalletHDStatusIcon->setToolTip(hdEnabled ? tr("HD key generation is <b>enabled</b>") : tr("HD key generation is <b>disabled</b>"));
14501448

14511449
// eventually disable the QLabel to set its opacity to 50%
@@ -1607,7 +1605,7 @@ void BitcoinGUI::handleRestart(QStringList args)
16071605
Q_EMIT requestedRestart(args);
16081606
}
16091607

1610-
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *platformStyle) :
1608+
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() :
16111609
optionsModel(0),
16121610
menu(0)
16131611
{

src/qt/bitcoingui.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class ClientModel;
2727
class NetworkStyle;
2828
class Notificator;
2929
class OptionsModel;
30-
class PlatformStyle;
3130
class RPCConsole;
3231
class SendCoinsRecipient;
3332
class UnitDisplayStatusBarControl;
@@ -55,7 +54,7 @@ class BitcoinGUI : public QMainWindow
5554
static const QString DEFAULT_WALLET;
5655
static const std::string DEFAULT_UIPLATFORM;
5756

58-
explicit BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent = 0);
57+
explicit BitcoinGUI(const NetworkStyle* networkStyle, QWidget* parent = 0);
5958
~BitcoinGUI();
6059

6160
/** Set the client model.
@@ -147,8 +146,6 @@ class BitcoinGUI : public QMainWindow
147146
int prevBlocks;
148147
int spinnerFrame;
149148

150-
const PlatformStyle *platformStyle;
151-
152149
struct IncomingTransactionMessage {
153150
QString date;
154151
int unit;
@@ -313,7 +310,7 @@ class UnitDisplayStatusBarControl : public QLabel
313310
Q_OBJECT
314311

315312
public:
316-
explicit UnitDisplayStatusBarControl(const PlatformStyle *platformStyle);
313+
explicit UnitDisplayStatusBarControl();
317314
/** Lets the control know about the Options Model (and its signals) */
318315
void setOptionsModel(OptionsModel *optionsModel);
319316

src/qt/coincontroldialog.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <qt/bitcoinunits.h>
1111
#include <qt/guiutil.h>
1212
#include <qt/optionsmodel.h>
13-
#include <qt/platformstyle.h>
1413
#include <txmempool.h>
1514
#include <qt/walletmodel.h>
1615

@@ -43,11 +42,10 @@ bool CCoinControlWidgetItem::operator<(const QTreeWidgetItem &other) const {
4342
return QTreeWidgetItem::operator<(other);
4443
}
4544

46-
CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
45+
CoinControlDialog::CoinControlDialog(QWidget* parent) :
4746
QDialog(parent),
4847
ui(new Ui::CoinControlDialog),
49-
model(0),
50-
platformStyle(_platformStyle)
48+
model(0)
5149
{
5250
ui->setupUi(this);
5351

src/qt/coincontroldialog.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <QString>
1717
#include <QTreeWidgetItem>
1818

19-
class PlatformStyle;
2019
class WalletModel;
2120

2221
class CCoinControl;
@@ -43,7 +42,7 @@ class CoinControlDialog : public QDialog
4342
Q_OBJECT
4443

4544
public:
46-
explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
45+
explicit CoinControlDialog(QWidget* parent = 0);
4746
~CoinControlDialog();
4847

4948
void setModel(WalletModel *model);
@@ -67,8 +66,6 @@ class CoinControlDialog : public QDialog
6766
QAction *lockAction;
6867
QAction *unlockAction;
6968

70-
const PlatformStyle *platformStyle;
71-
7269
void sortView(int, Qt::SortOrder);
7370
void updateView();
7471

0 commit comments

Comments
 (0)