@ -199,8 +199,8 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
@@ -199,8 +199,8 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
unitDisplayControl = new UnitDisplayStatusBarControl ( platformStyle ) ;
labelWalletEncryptionIcon = new QLabel ( ) ;
labelWalletHDStatusIcon = new QLabel ( ) ;
connectionsControl = new NetworkToggleStatusBarContro l( ) ;
labelBlocksIcon = new Q Label( ) ;
connectionsControl = new GUIUtil : : ClickableLabe l( ) ;
labelBlocksIcon = new GUIUtil : : Clickable Label( ) ;
if ( enableWallet )
{
frameBlocksLayout - > addStretch ( ) ;
@ -244,10 +244,14 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
@@ -244,10 +244,14 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
// Subscribe to notifications from core
subscribeToCoreSignals ( ) ;
connect ( connectionsControl , SIGNAL ( clicked ( QPoint ) ) , this , SLOT ( toggleNetworkActive ( ) ) ) ;
modalOverlay = new ModalOverlay ( this - > centralWidget ( ) ) ;
# ifdef ENABLE_WALLET
if ( enableWallet )
if ( enableWallet ) {
connect ( walletFrame , SIGNAL ( requestedSyncWarningInfo ( ) ) , this , SLOT ( showModalOverlay ( ) ) ) ;
connect ( labelBlocksIcon , SIGNAL ( clicked ( QPoint ) ) , this , SLOT ( showModalOverlay ( ) ) ) ;
}
# endif
}
@ -490,7 +494,6 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
@@ -490,7 +494,6 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
}
# endif // ENABLE_WALLET
unitDisplayControl - > setOptionsModel ( _clientModel - > getOptionsModel ( ) ) ;
connectionsControl - > setClientModel ( _clientModel ) ;
OptionsModel * optionsModel = _clientModel - > getOptionsModel ( ) ;
if ( optionsModel )
@ -517,7 +520,6 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
@@ -517,7 +520,6 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
walletFrame - > setClientModel ( nullptr ) ;
# endif // ENABLE_WALLET
unitDisplayControl - > setOptionsModel ( nullptr ) ;
connectionsControl - > setClientModel ( nullptr ) ;
}
}
@ -1171,6 +1173,13 @@ void BitcoinGUI::unsubscribeFromCoreSignals()
@@ -1171,6 +1173,13 @@ void BitcoinGUI::unsubscribeFromCoreSignals()
uiInterface . ThreadSafeQuestion . disconnect ( boost : : bind ( ThreadSafeMessageBox , this , _1 , _3 , _4 ) ) ;
}
void BitcoinGUI : : toggleNetworkActive ( )
{
if ( clientModel ) {
clientModel - > setNetworkActive ( ! clientModel - > getNetworkActive ( ) ) ;
}
}
UnitDisplayStatusBarControl : : UnitDisplayStatusBarControl ( const PlatformStyle * platformStyle ) :
optionsModel ( 0 ) ,
menu ( 0 )
@ -1244,16 +1253,3 @@ void UnitDisplayStatusBarControl::onMenuSelection(QAction* action)
@@ -1244,16 +1253,3 @@ void UnitDisplayStatusBarControl::onMenuSelection(QAction* action)
optionsModel - > setDisplayUnit ( action - > data ( ) ) ;
}
}
void NetworkToggleStatusBarControl : : mousePressEvent ( QMouseEvent * event )
{
if ( clientModel ) {
clientModel - > setNetworkActive ( ! clientModel - > getNetworkActive ( ) ) ;
}
}
/** Lets the control know about the Client Model */
void NetworkToggleStatusBarControl : : setClientModel ( ClientModel * _clientModel )
{
this - > clientModel = _clientModel ;
}