@ -62,10 +62,35 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) :
QMainWindow ( parent ) ,
QMainWindow ( parent ) ,
clientModel ( 0 ) ,
clientModel ( 0 ) ,
walletFrame ( 0 ) ,
walletFrame ( 0 ) ,
unitDisplayControl ( 0 ) ,
labelEncryptionIcon ( 0 ) ,
labelConnectionsIcon ( 0 ) ,
labelBlocksIcon ( 0 ) ,
progressBarLabel ( 0 ) ,
progressBar ( 0 ) ,
progressDialog ( 0 ) ,
appMenuBar ( 0 ) ,
overviewAction ( 0 ) ,
historyAction ( 0 ) ,
quitAction ( 0 ) ,
sendCoinsAction ( 0 ) ,
usedSendingAddressesAction ( 0 ) ,
usedReceivingAddressesAction ( 0 ) ,
signMessageAction ( 0 ) ,
verifyMessageAction ( 0 ) ,
aboutAction ( 0 ) ,
receiveCoinsAction ( 0 ) ,
optionsAction ( 0 ) ,
toggleHideAction ( 0 ) ,
encryptWalletAction ( 0 ) ,
encryptWalletAction ( 0 ) ,
backupWalletAction ( 0 ) ,
changePassphraseAction ( 0 ) ,
changePassphraseAction ( 0 ) ,
aboutQtAction ( 0 ) ,
aboutQtAction ( 0 ) ,
openRPCConsoleAction ( 0 ) ,
openAction ( 0 ) ,
showHelpMessageAction ( 0 ) ,
trayIcon ( 0 ) ,
trayIcon ( 0 ) ,
trayIconMenu ( 0 ) ,
notificator ( 0 ) ,
notificator ( 0 ) ,
rpcConsole ( 0 ) ,
rpcConsole ( 0 ) ,
prevBlocks ( 0 ) ,
prevBlocks ( 0 ) ,
@ -426,8 +451,12 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
walletFrame - > setClientModel ( clientModel ) ;
walletFrame - > setClientModel ( clientModel ) ;
}
}
# endif
# endif
unitDisplayControl - > setOptionsModel ( clientModel - > getOptionsModel ( ) ) ;
this - > unitDisplayControl - > setOptionsModel ( clientModel - > getOptionsModel ( ) ) ;
} else {
// Disable possibility to show main window via action
toggleHideAction - > setEnabled ( false ) ;
// Disable context menu on tray icon
trayIconMenu - > clear ( ) ;
}
}
}
}
@ -496,7 +525,6 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet)
void BitcoinGUI : : createTrayIconMenu ( )
void BitcoinGUI : : createTrayIconMenu ( )
{
{
QMenu * trayIconMenu ;
# ifndef Q_OS_MAC
# ifndef Q_OS_MAC
// return if trayIcon is unset (only on non-Mac OSes)
// return if trayIcon is unset (only on non-Mac OSes)
if ( ! trayIcon )
if ( ! trayIcon )
@ -537,7 +565,7 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
if ( reason = = QSystemTrayIcon : : Trigger )
if ( reason = = QSystemTrayIcon : : Trigger )
{
{
// Click on system tray icon triggers show/hide of the main window
// Click on system tray icon triggers show/hide of the main window
toggleHideActio n - > trigger ( ) ;
toggleHidd en ( ) ;
}
}
}
}
# endif
# endif
@ -923,6 +951,7 @@ void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
{
{
if ( ! clientModel )
if ( ! clientModel )
return ;
return ;
// activateWindow() (sometimes) helps with keyboard focus on Windows
// activateWindow() (sometimes) helps with keyboard focus on Windows
if ( isHidden ( ) )
if ( isHidden ( ) )
{
{
@ -1007,9 +1036,10 @@ void BitcoinGUI::unsubscribeFromCoreSignals()
uiInterface . ThreadSafeMessageBox . disconnect ( boost : : bind ( ThreadSafeMessageBox , this , _1 , _2 , _3 ) ) ;
uiInterface . ThreadSafeMessageBox . disconnect ( boost : : bind ( ThreadSafeMessageBox , this , _1 , _2 , _3 ) ) ;
}
}
UnitDisplayStatusBarControl : : UnitDisplayStatusBarControl ( ) : QLabel ( )
UnitDisplayStatusBarControl : : UnitDisplayStatusBarControl ( ) :
optionsModel ( 0 ) ,
menu ( 0 )
{
{
optionsModel = 0 ;
createContextMenu ( ) ;
createContextMenu ( ) ;
setToolTip ( tr ( " Unit to show amounts in. Click to select another unit. " ) ) ;
setToolTip ( tr ( " Unit to show amounts in. Click to select another unit. " ) ) ;
}
}
@ -1069,4 +1099,3 @@ void UnitDisplayStatusBarControl::onMenuSelection(QAction* action)
optionsModel - > setDisplayUnit ( action - > data ( ) ) ;
optionsModel - > setDisplayUnit ( action - > data ( ) ) ;
}
}
}
}