13
13
#include " openuridialog.h"
14
14
#include " optionsdialog.h"
15
15
#include " optionsmodel.h"
16
+ #include " platformstyle.h"
16
17
#include " rpcconsole.h"
17
- #include " scicon.h"
18
18
#include " utilitydialog.h"
19
19
20
20
#ifdef ENABLE_WALLET
60
60
61
61
const QString BitcoinGUI::DEFAULT_WALLET = " ~Default" ;
62
62
63
- BitcoinGUI::BitcoinGUI (const NetworkStyle *networkStyle, QWidget *parent) :
63
+ BitcoinGUI::BitcoinGUI (const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
64
64
QMainWindow(parent),
65
65
clientModel(0 ),
66
66
walletFrame(0 ),
@@ -98,7 +98,8 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
98
98
notificator(0 ),
99
99
rpcConsole(0 ),
100
100
prevBlocks(0 ),
101
- spinnerFrame(0 )
101
+ spinnerFrame(0 ),
102
+ platformStyle(platformStyle)
102
103
{
103
104
GUIUtil::restoreWindowGeometry (" nWindow" , QSize (850 , 550 ), this );
104
105
@@ -130,12 +131,12 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
130
131
setUnifiedTitleAndToolBarOnMac (true );
131
132
#endif
132
133
133
- rpcConsole = new RPCConsole (0 );
134
+ rpcConsole = new RPCConsole (platformStyle, 0 );
134
135
#ifdef ENABLE_WALLET
135
136
if (enableWallet)
136
137
{
137
138
/* * Create wallet frame and make it the central widget */
138
- walletFrame = new WalletFrame (this );
139
+ walletFrame = new WalletFrame (platformStyle, this );
139
140
setCentralWidget (walletFrame);
140
141
} else
141
142
#endif // ENABLE_WALLET
@@ -175,7 +176,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
175
176
QHBoxLayout *frameBlocksLayout = new QHBoxLayout (frameBlocks);
176
177
frameBlocksLayout->setContentsMargins (3 ,0 ,3 ,0 );
177
178
frameBlocksLayout->setSpacing (3 );
178
- unitDisplayControl = new UnitDisplayStatusBarControl ();
179
+ unitDisplayControl = new UnitDisplayStatusBarControl (platformStyle );
179
180
labelEncryptionIcon = new QLabel ();
180
181
labelConnectionsIcon = new QLabel ();
181
182
labelBlocksIcon = new QLabel ();
@@ -247,36 +248,36 @@ void BitcoinGUI::createActions()
247
248
{
248
249
QActionGroup *tabGroup = new QActionGroup (this );
249
250
250
- overviewAction = new QAction (SingleColorIcon (" :/icons/overview" ), tr (" &Overview" ), this );
251
+ overviewAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/overview" ), tr (" &Overview" ), this );
251
252
overviewAction->setStatusTip (tr (" Show general overview of wallet" ));
252
253
overviewAction->setToolTip (overviewAction->statusTip ());
253
254
overviewAction->setCheckable (true );
254
255
overviewAction->setShortcut (QKeySequence (Qt::ALT + Qt::Key_1));
255
256
tabGroup->addAction (overviewAction);
256
257
257
- sendCoinsAction = new QAction (SingleColorIcon (" :/icons/send" ), tr (" &Send" ), this );
258
+ sendCoinsAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/send" ), tr (" &Send" ), this );
258
259
sendCoinsAction->setStatusTip (tr (" Send coins to a Bitcoin address" ));
259
260
sendCoinsAction->setToolTip (sendCoinsAction->statusTip ());
260
261
sendCoinsAction->setCheckable (true );
261
262
sendCoinsAction->setShortcut (QKeySequence (Qt::ALT + Qt::Key_2));
262
263
tabGroup->addAction (sendCoinsAction);
263
264
264
- sendCoinsMenuAction = new QAction (TextColorIcon (" :/icons/send" ), sendCoinsAction->text (), this );
265
+ sendCoinsMenuAction = new QAction (platformStyle-> TextColorIcon (" :/icons/send" ), sendCoinsAction->text (), this );
265
266
sendCoinsMenuAction->setStatusTip (sendCoinsAction->statusTip ());
266
267
sendCoinsMenuAction->setToolTip (sendCoinsMenuAction->statusTip ());
267
268
268
- receiveCoinsAction = new QAction (SingleColorIcon (" :/icons/receiving_addresses" ), tr (" &Receive" ), this );
269
+ receiveCoinsAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/receiving_addresses" ), tr (" &Receive" ), this );
269
270
receiveCoinsAction->setStatusTip (tr (" Request payments (generates QR codes and bitcoin: URIs)" ));
270
271
receiveCoinsAction->setToolTip (receiveCoinsAction->statusTip ());
271
272
receiveCoinsAction->setCheckable (true );
272
273
receiveCoinsAction->setShortcut (QKeySequence (Qt::ALT + Qt::Key_3));
273
274
tabGroup->addAction (receiveCoinsAction);
274
275
275
- receiveCoinsMenuAction = new QAction (TextColorIcon (" :/icons/receiving_addresses" ), receiveCoinsAction->text (), this );
276
+ receiveCoinsMenuAction = new QAction (platformStyle-> TextColorIcon (" :/icons/receiving_addresses" ), receiveCoinsAction->text (), this );
276
277
receiveCoinsMenuAction->setStatusTip (receiveCoinsAction->statusTip ());
277
278
receiveCoinsMenuAction->setToolTip (receiveCoinsMenuAction->statusTip ());
278
279
279
- historyAction = new QAction (SingleColorIcon (" :/icons/history" ), tr (" &Transactions" ), this );
280
+ historyAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/history" ), tr (" &Transactions" ), this );
280
281
historyAction->setStatusTip (tr (" Browse transaction history" ));
281
282
historyAction->setToolTip (historyAction->statusTip ());
282
283
historyAction->setCheckable (true );
@@ -300,46 +301,46 @@ void BitcoinGUI::createActions()
300
301
connect (historyAction, SIGNAL (triggered ()), this , SLOT (gotoHistoryPage ()));
301
302
#endif // ENABLE_WALLET
302
303
303
- quitAction = new QAction (TextColorIcon (" :/icons/quit" ), tr (" E&xit" ), this );
304
+ quitAction = new QAction (platformStyle-> TextColorIcon (" :/icons/quit" ), tr (" E&xit" ), this );
304
305
quitAction->setStatusTip (tr (" Quit application" ));
305
306
quitAction->setShortcut (QKeySequence (Qt::CTRL + Qt::Key_Q));
306
307
quitAction->setMenuRole (QAction::QuitRole);
307
- aboutAction = new QAction (TextColorIcon (" :/icons/about" ), tr (" &About Bitcoin Core" ), this );
308
+ aboutAction = new QAction (platformStyle-> TextColorIcon (" :/icons/about" ), tr (" &About Bitcoin Core" ), this );
308
309
aboutAction->setStatusTip (tr (" Show information about Bitcoin Core" ));
309
310
aboutAction->setMenuRole (QAction::AboutRole);
310
- aboutQtAction = new QAction (TextColorIcon (" :/icons/about_qt" ), tr (" About &Qt" ), this );
311
+ aboutQtAction = new QAction (platformStyle-> TextColorIcon (" :/icons/about_qt" ), tr (" About &Qt" ), this );
311
312
aboutQtAction->setStatusTip (tr (" Show information about Qt" ));
312
313
aboutQtAction->setMenuRole (QAction::AboutQtRole);
313
- optionsAction = new QAction (TextColorIcon (" :/icons/options" ), tr (" &Options..." ), this );
314
+ optionsAction = new QAction (platformStyle-> TextColorIcon (" :/icons/options" ), tr (" &Options..." ), this );
314
315
optionsAction->setStatusTip (tr (" Modify configuration options for Bitcoin Core" ));
315
316
optionsAction->setMenuRole (QAction::PreferencesRole);
316
- toggleHideAction = new QAction (TextColorIcon (" :/icons/about" ), tr (" &Show / Hide" ), this );
317
+ toggleHideAction = new QAction (platformStyle-> TextColorIcon (" :/icons/about" ), tr (" &Show / Hide" ), this );
317
318
toggleHideAction->setStatusTip (tr (" Show or hide the main Window" ));
318
319
319
- encryptWalletAction = new QAction (TextColorIcon (" :/icons/lock_closed" ), tr (" &Encrypt Wallet..." ), this );
320
+ encryptWalletAction = new QAction (platformStyle-> TextColorIcon (" :/icons/lock_closed" ), tr (" &Encrypt Wallet..." ), this );
320
321
encryptWalletAction->setStatusTip (tr (" Encrypt the private keys that belong to your wallet" ));
321
322
encryptWalletAction->setCheckable (true );
322
- backupWalletAction = new QAction (TextColorIcon (" :/icons/filesave" ), tr (" &Backup Wallet..." ), this );
323
+ backupWalletAction = new QAction (platformStyle-> TextColorIcon (" :/icons/filesave" ), tr (" &Backup Wallet..." ), this );
323
324
backupWalletAction->setStatusTip (tr (" Backup wallet to another location" ));
324
- changePassphraseAction = new QAction (TextColorIcon (" :/icons/key" ), tr (" &Change Passphrase..." ), this );
325
+ changePassphraseAction = new QAction (platformStyle-> TextColorIcon (" :/icons/key" ), tr (" &Change Passphrase..." ), this );
325
326
changePassphraseAction->setStatusTip (tr (" Change the passphrase used for wallet encryption" ));
326
- signMessageAction = new QAction (TextColorIcon (" :/icons/edit" ), tr (" Sign &message..." ), this );
327
+ signMessageAction = new QAction (platformStyle-> TextColorIcon (" :/icons/edit" ), tr (" Sign &message..." ), this );
327
328
signMessageAction->setStatusTip (tr (" Sign messages with your Bitcoin addresses to prove you own them" ));
328
- verifyMessageAction = new QAction (TextColorIcon (" :/icons/verify" ), tr (" &Verify message..." ), this );
329
+ verifyMessageAction = new QAction (platformStyle-> TextColorIcon (" :/icons/verify" ), tr (" &Verify message..." ), this );
329
330
verifyMessageAction->setStatusTip (tr (" Verify messages to ensure they were signed with specified Bitcoin addresses" ));
330
331
331
- openRPCConsoleAction = new QAction (TextColorIcon (" :/icons/debugwindow" ), tr (" &Debug window" ), this );
332
+ openRPCConsoleAction = new QAction (platformStyle-> TextColorIcon (" :/icons/debugwindow" ), tr (" &Debug window" ), this );
332
333
openRPCConsoleAction->setStatusTip (tr (" Open debugging and diagnostic console" ));
333
334
334
- usedSendingAddressesAction = new QAction (TextColorIcon (" :/icons/address-book" ), tr (" &Sending addresses..." ), this );
335
+ usedSendingAddressesAction = new QAction (platformStyle-> TextColorIcon (" :/icons/address-book" ), tr (" &Sending addresses..." ), this );
335
336
usedSendingAddressesAction->setStatusTip (tr (" Show the list of used sending addresses and labels" ));
336
- usedReceivingAddressesAction = new QAction (TextColorIcon (" :/icons/address-book" ), tr (" &Receiving addresses..." ), this );
337
+ usedReceivingAddressesAction = new QAction (platformStyle-> TextColorIcon (" :/icons/address-book" ), tr (" &Receiving addresses..." ), this );
337
338
usedReceivingAddressesAction->setStatusTip (tr (" Show the list of used receiving addresses and labels" ));
338
339
339
- openAction = new QAction (TextColorIcon (" :/icons/open" ), tr (" Open &URI..." ), this );
340
+ openAction = new QAction (platformStyle-> TextColorIcon (" :/icons/open" ), tr (" Open &URI..." ), this );
340
341
openAction->setStatusTip (tr (" Open a bitcoin: URI or payment request" ));
341
342
342
- showHelpMessageAction = new QAction (TextColorIcon (" :/icons/info" ), tr (" &Command-line options" ), this );
343
+ showHelpMessageAction = new QAction (platformStyle-> TextColorIcon (" :/icons/info" ), tr (" &Command-line options" ), this );
343
344
showHelpMessageAction->setMenuRole (QAction::NoRole);
344
345
showHelpMessageAction->setStatusTip (tr (" Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options" ));
345
346
@@ -650,7 +651,7 @@ void BitcoinGUI::setNumConnections(int count)
650
651
case 7 : case 8 : case 9 : icon = " :/icons/connect_3" ; break ;
651
652
default : icon = " :/icons/connect_4" ; break ;
652
653
}
653
- labelConnectionsIcon->setPixmap (SingleColorIcon (icon).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
654
+ labelConnectionsIcon->setPixmap (platformStyle-> SingleColorIcon (icon).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
654
655
labelConnectionsIcon->setToolTip (tr (" %n active connection(s) to Bitcoin network" , " " , count));
655
656
}
656
657
@@ -691,7 +692,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate)
691
692
if (secs < 90 *60 )
692
693
{
693
694
tooltip = tr (" Up to date" ) + QString (" .<br>" ) + tooltip;
694
- labelBlocksIcon->setPixmap (SingleColorIcon (" :/icons/synced" ).pixmap (STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
695
+ labelBlocksIcon->setPixmap (platformStyle-> SingleColorIcon (" :/icons/synced" ).pixmap (STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
695
696
696
697
#ifdef ENABLE_WALLET
697
698
if (walletFrame)
@@ -737,7 +738,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate)
737
738
tooltip = tr (" Catching up..." ) + QString (" <br>" ) + tooltip;
738
739
if (count != prevBlocks)
739
740
{
740
- labelBlocksIcon->setPixmap (SingleColorIcon (QString (
741
+ labelBlocksIcon->setPixmap (platformStyle-> SingleColorIcon (QString (
741
742
" :/movies/spinner-%1" ).arg (spinnerFrame, 3 , 10 , QChar (' 0' )))
742
743
.pixmap (STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
743
744
spinnerFrame = (spinnerFrame + 1 ) % SPINNER_FRAMES;
@@ -931,15 +932,15 @@ void BitcoinGUI::setEncryptionStatus(int status)
931
932
break ;
932
933
case WalletModel::Unlocked:
933
934
labelEncryptionIcon->show ();
934
- labelEncryptionIcon->setPixmap (SingleColorIcon (" :/icons/lock_open" ).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
935
+ labelEncryptionIcon->setPixmap (platformStyle-> SingleColorIcon (" :/icons/lock_open" ).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
935
936
labelEncryptionIcon->setToolTip (tr (" Wallet is <b>encrypted</b> and currently <b>unlocked</b>" ));
936
937
encryptWalletAction->setChecked (true );
937
938
changePassphraseAction->setEnabled (true );
938
939
encryptWalletAction->setEnabled (false ); // TODO: decrypt currently not supported
939
940
break ;
940
941
case WalletModel::Locked:
941
942
labelEncryptionIcon->show ();
942
- labelEncryptionIcon->setPixmap (SingleColorIcon (" :/icons/lock_closed" ).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
943
+ labelEncryptionIcon->setPixmap (platformStyle-> SingleColorIcon (" :/icons/lock_closed" ).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
943
944
labelEncryptionIcon->setToolTip (tr (" Wallet is <b>encrypted</b> and currently <b>locked</b>" ));
944
945
encryptWalletAction->setChecked (true );
945
946
changePassphraseAction->setEnabled (true );
@@ -1041,7 +1042,7 @@ void BitcoinGUI::unsubscribeFromCoreSignals()
1041
1042
uiInterface.ThreadSafeMessageBox .disconnect (boost::bind (ThreadSafeMessageBox, this , _1, _2, _3));
1042
1043
}
1043
1044
1044
- UnitDisplayStatusBarControl::UnitDisplayStatusBarControl () :
1045
+ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl (const PlatformStyle *platformStyle ) :
1045
1046
optionsModel(0 ),
1046
1047
menu(0 )
1047
1048
{
@@ -1056,7 +1057,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() :
1056
1057
}
1057
1058
setMinimumSize (max_width, 0 );
1058
1059
setAlignment (Qt::AlignRight | Qt::AlignVCenter);
1059
- setStyleSheet (QString (" QLabel { color : %1 }" ).arg (SingleColor ().name ()));
1060
+ setStyleSheet (QString (" QLabel { color : %1 }" ).arg (platformStyle-> SingleColor ().name ()));
1060
1061
}
1061
1062
1062
1063
/* * So that it responds to button clicks */
0 commit comments