1313#include " openuridialog.h"
1414#include " optionsdialog.h"
1515#include " optionsmodel.h"
16+ #include " platformstyle.h"
1617#include " rpcconsole.h"
17- #include " scicon.h"
1818#include " utilitydialog.h"
1919
2020#ifdef ENABLE_WALLET
6060
6161const QString BitcoinGUI::DEFAULT_WALLET = " ~Default" ;
6262
63- BitcoinGUI::BitcoinGUI (const NetworkStyle *networkStyle, QWidget *parent) :
63+ BitcoinGUI::BitcoinGUI (const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
6464 QMainWindow(parent),
6565 clientModel(0 ),
6666 walletFrame(0 ),
@@ -98,7 +98,8 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
9898 notificator(0 ),
9999 rpcConsole(0 ),
100100 prevBlocks(0 ),
101- spinnerFrame(0 )
101+ spinnerFrame(0 ),
102+ platformStyle(platformStyle)
102103{
103104 GUIUtil::restoreWindowGeometry (" nWindow" , QSize (850 , 550 ), this );
104105
@@ -130,12 +131,12 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
130131 setUnifiedTitleAndToolBarOnMac (true );
131132#endif
132133
133- rpcConsole = new RPCConsole (0 );
134+ rpcConsole = new RPCConsole (platformStyle, 0 );
134135#ifdef ENABLE_WALLET
135136 if (enableWallet)
136137 {
137138 /* * Create wallet frame and make it the central widget */
138- walletFrame = new WalletFrame (this );
139+ walletFrame = new WalletFrame (platformStyle, this );
139140 setCentralWidget (walletFrame);
140141 } else
141142#endif // ENABLE_WALLET
@@ -175,7 +176,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
175176 QHBoxLayout *frameBlocksLayout = new QHBoxLayout (frameBlocks);
176177 frameBlocksLayout->setContentsMargins (3 ,0 ,3 ,0 );
177178 frameBlocksLayout->setSpacing (3 );
178- unitDisplayControl = new UnitDisplayStatusBarControl ();
179+ unitDisplayControl = new UnitDisplayStatusBarControl (platformStyle );
179180 labelEncryptionIcon = new QLabel ();
180181 labelConnectionsIcon = new QLabel ();
181182 labelBlocksIcon = new QLabel ();
@@ -247,36 +248,36 @@ void BitcoinGUI::createActions()
247248{
248249 QActionGroup *tabGroup = new QActionGroup (this );
249250
250- overviewAction = new QAction (SingleColorIcon (" :/icons/overview" ), tr (" &Overview" ), this );
251+ overviewAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/overview" ), tr (" &Overview" ), this );
251252 overviewAction->setStatusTip (tr (" Show general overview of wallet" ));
252253 overviewAction->setToolTip (overviewAction->statusTip ());
253254 overviewAction->setCheckable (true );
254255 overviewAction->setShortcut (QKeySequence (Qt::ALT + Qt::Key_1));
255256 tabGroup->addAction (overviewAction);
256257
257- sendCoinsAction = new QAction (SingleColorIcon (" :/icons/send" ), tr (" &Send" ), this );
258+ sendCoinsAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/send" ), tr (" &Send" ), this );
258259 sendCoinsAction->setStatusTip (tr (" Send coins to a Bitcoin address" ));
259260 sendCoinsAction->setToolTip (sendCoinsAction->statusTip ());
260261 sendCoinsAction->setCheckable (true );
261262 sendCoinsAction->setShortcut (QKeySequence (Qt::ALT + Qt::Key_2));
262263 tabGroup->addAction (sendCoinsAction);
263264
264- sendCoinsMenuAction = new QAction (TextColorIcon (" :/icons/send" ), sendCoinsAction->text (), this );
265+ sendCoinsMenuAction = new QAction (platformStyle-> TextColorIcon (" :/icons/send" ), sendCoinsAction->text (), this );
265266 sendCoinsMenuAction->setStatusTip (sendCoinsAction->statusTip ());
266267 sendCoinsMenuAction->setToolTip (sendCoinsMenuAction->statusTip ());
267268
268- receiveCoinsAction = new QAction (SingleColorIcon (" :/icons/receiving_addresses" ), tr (" &Receive" ), this );
269+ receiveCoinsAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/receiving_addresses" ), tr (" &Receive" ), this );
269270 receiveCoinsAction->setStatusTip (tr (" Request payments (generates QR codes and bitcoin: URIs)" ));
270271 receiveCoinsAction->setToolTip (receiveCoinsAction->statusTip ());
271272 receiveCoinsAction->setCheckable (true );
272273 receiveCoinsAction->setShortcut (QKeySequence (Qt::ALT + Qt::Key_3));
273274 tabGroup->addAction (receiveCoinsAction);
274275
275- receiveCoinsMenuAction = new QAction (TextColorIcon (" :/icons/receiving_addresses" ), receiveCoinsAction->text (), this );
276+ receiveCoinsMenuAction = new QAction (platformStyle-> TextColorIcon (" :/icons/receiving_addresses" ), receiveCoinsAction->text (), this );
276277 receiveCoinsMenuAction->setStatusTip (receiveCoinsAction->statusTip ());
277278 receiveCoinsMenuAction->setToolTip (receiveCoinsMenuAction->statusTip ());
278279
279- historyAction = new QAction (SingleColorIcon (" :/icons/history" ), tr (" &Transactions" ), this );
280+ historyAction = new QAction (platformStyle-> SingleColorIcon (" :/icons/history" ), tr (" &Transactions" ), this );
280281 historyAction->setStatusTip (tr (" Browse transaction history" ));
281282 historyAction->setToolTip (historyAction->statusTip ());
282283 historyAction->setCheckable (true );
@@ -300,46 +301,46 @@ void BitcoinGUI::createActions()
300301 connect (historyAction, SIGNAL (triggered ()), this , SLOT (gotoHistoryPage ()));
301302#endif // ENABLE_WALLET
302303
303- quitAction = new QAction (TextColorIcon (" :/icons/quit" ), tr (" E&xit" ), this );
304+ quitAction = new QAction (platformStyle-> TextColorIcon (" :/icons/quit" ), tr (" E&xit" ), this );
304305 quitAction->setStatusTip (tr (" Quit application" ));
305306 quitAction->setShortcut (QKeySequence (Qt::CTRL + Qt::Key_Q));
306307 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 );
308309 aboutAction->setStatusTip (tr (" Show information about Bitcoin Core" ));
309310 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 );
311312 aboutQtAction->setStatusTip (tr (" Show information about Qt" ));
312313 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 );
314315 optionsAction->setStatusTip (tr (" Modify configuration options for Bitcoin Core" ));
315316 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 );
317318 toggleHideAction->setStatusTip (tr (" Show or hide the main Window" ));
318319
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 );
320321 encryptWalletAction->setStatusTip (tr (" Encrypt the private keys that belong to your wallet" ));
321322 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 );
323324 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 );
325326 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 );
327328 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 );
329330 verifyMessageAction->setStatusTip (tr (" Verify messages to ensure they were signed with specified Bitcoin addresses" ));
330331
331- openRPCConsoleAction = new QAction (TextColorIcon (" :/icons/debugwindow" ), tr (" &Debug window" ), this );
332+ openRPCConsoleAction = new QAction (platformStyle-> TextColorIcon (" :/icons/debugwindow" ), tr (" &Debug window" ), this );
332333 openRPCConsoleAction->setStatusTip (tr (" Open debugging and diagnostic console" ));
333334
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 );
335336 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 );
337338 usedReceivingAddressesAction->setStatusTip (tr (" Show the list of used receiving addresses and labels" ));
338339
339- openAction = new QAction (TextColorIcon (" :/icons/open" ), tr (" Open &URI..." ), this );
340+ openAction = new QAction (platformStyle-> TextColorIcon (" :/icons/open" ), tr (" Open &URI..." ), this );
340341 openAction->setStatusTip (tr (" Open a bitcoin: URI or payment request" ));
341342
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 );
343344 showHelpMessageAction->setMenuRole (QAction::NoRole);
344345 showHelpMessageAction->setStatusTip (tr (" Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options" ));
345346
@@ -650,7 +651,7 @@ void BitcoinGUI::setNumConnections(int count)
650651 case 7 : case 8 : case 9 : icon = " :/icons/connect_3" ; break ;
651652 default : icon = " :/icons/connect_4" ; break ;
652653 }
653- labelConnectionsIcon->setPixmap (SingleColorIcon (icon).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
654+ labelConnectionsIcon->setPixmap (platformStyle-> SingleColorIcon (icon).pixmap (STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
654655 labelConnectionsIcon->setToolTip (tr (" %n active connection(s) to Bitcoin network" , " " , count));
655656}
656657
@@ -691,7 +692,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate)
691692 if (secs < 90 *60 )
692693 {
693694 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));
695696
696697#ifdef ENABLE_WALLET
697698 if (walletFrame)
@@ -737,7 +738,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate)
737738 tooltip = tr (" Catching up..." ) + QString (" <br>" ) + tooltip;
738739 if (count != prevBlocks)
739740 {
740- labelBlocksIcon->setPixmap (SingleColorIcon (QString (
741+ labelBlocksIcon->setPixmap (platformStyle-> SingleColorIcon (QString (
741742 " :/movies/spinner-%1" ).arg (spinnerFrame, 3 , 10 , QChar (' 0' )))
742743 .pixmap (STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
743744 spinnerFrame = (spinnerFrame + 1 ) % SPINNER_FRAMES;
@@ -931,15 +932,15 @@ void BitcoinGUI::setEncryptionStatus(int status)
931932 break ;
932933 case WalletModel::Unlocked:
933934 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));
935936 labelEncryptionIcon->setToolTip (tr (" Wallet is <b>encrypted</b> and currently <b>unlocked</b>" ));
936937 encryptWalletAction->setChecked (true );
937938 changePassphraseAction->setEnabled (true );
938939 encryptWalletAction->setEnabled (false ); // TODO: decrypt currently not supported
939940 break ;
940941 case WalletModel::Locked:
941942 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));
943944 labelEncryptionIcon->setToolTip (tr (" Wallet is <b>encrypted</b> and currently <b>locked</b>" ));
944945 encryptWalletAction->setChecked (true );
945946 changePassphraseAction->setEnabled (true );
@@ -1041,7 +1042,7 @@ void BitcoinGUI::unsubscribeFromCoreSignals()
10411042 uiInterface.ThreadSafeMessageBox .disconnect (boost::bind (ThreadSafeMessageBox, this , _1, _2, _3));
10421043}
10431044
1044- UnitDisplayStatusBarControl::UnitDisplayStatusBarControl () :
1045+ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl (const PlatformStyle *platformStyle ) :
10451046 optionsModel(0 ),
10461047 menu(0 )
10471048{
@@ -1056,7 +1057,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() :
10561057 }
10571058 setMinimumSize (max_width, 0 );
10581059 setAlignment (Qt::AlignRight | Qt::AlignVCenter);
1059- setStyleSheet (QString (" QLabel { color : %1 }" ).arg (SingleColor ().name ()));
1060+ setStyleSheet (QString (" QLabel { color : %1 }" ).arg (platformStyle-> SingleColor ().name ()));
10601061}
10611062
10621063/* * So that it responds to button clicks */
0 commit comments