@ -32,7 +32,6 @@
@@ -32,7 +32,6 @@
WalletView : : WalletView ( QWidget * parent ) :
QStackedWidget ( parent ) ,
gui ( 0 ) ,
clientModel ( 0 ) ,
walletModel ( 0 )
{
@ -70,6 +69,9 @@ WalletView::WalletView(QWidget *parent):
@@ -70,6 +69,9 @@ WalletView::WalletView(QWidget *parent):
// Clicking on "Export" allows to export the transaction list
connect ( exportButton , SIGNAL ( clicked ( ) ) , transactionView , SLOT ( exportClicked ( ) ) ) ;
// Pass through messages from sendCoinsPage
connect ( sendCoinsPage , SIGNAL ( message ( QString , QString , unsigned int ) ) , this , SIGNAL ( message ( QString , QString , unsigned int ) ) ) ;
}
WalletView : : ~ WalletView ( )
@ -78,8 +80,6 @@ WalletView::~WalletView()
@@ -78,8 +80,6 @@ WalletView::~WalletView()
void WalletView : : setBitcoinGUI ( BitcoinGUI * gui )
{
this - > gui = gui ;
if ( gui )
{
// Clicking on a transaction on the overview page sends you to the transactions tab
@ -87,26 +87,25 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui)
@@ -87,26 +87,25 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui)
// Receive and report messages
connect ( this , SIGNAL ( message ( QString , QString , unsigned int ) ) , gui , SLOT ( message ( QString , QString , unsigned int ) ) ) ;
connect ( sendCoinsPage , SIGNAL ( message ( QString , QString , unsigned int ) ) , gui , SLOT ( message ( QString , QString , unsigned int ) ) ) ;
// Pass through encryption status changed signals
connect ( this , SIGNAL ( encryptionStatusChanged ( int ) ) , gui , SLOT ( setEncryptionStatus ( int ) ) ) ;
// Pass through transaction notifications
connect ( this , SIGNAL ( incomingTransaction ( QString , int , qint64 , QString , QString ) ) , gui , SLOT ( incomingTransaction ( QString , int , qint64 , QString , QString ) ) ) ;
}
}
void WalletView : : setClientModel ( ClientModel * clientModel )
{
this - > clientModel = clientModel ;
if ( clientModel )
{
overviewPage - > setClientModel ( clientModel ) ;
}
}
void WalletView : : setWalletModel ( WalletModel * walletModel )
{
this - > walletModel = walletModel ;
if ( walletModel & & gui )
{
// Receive and report messages from wallet thread
connect ( walletModel , SIGNAL ( message ( QString , QString , unsigned int ) ) , gui , SLOT ( message ( QString , QString , unsigned int ) ) ) ;
// Put transaction list in tabs
transactionView - > setModel ( walletModel ) ;
@ -114,19 +113,25 @@ void WalletView::setWalletModel(WalletModel *walletModel)
@@ -114,19 +113,25 @@ void WalletView::setWalletModel(WalletModel *walletModel)
receiveCoinsPage - > setModel ( walletModel ) ;
sendCoinsPage - > setModel ( walletModel ) ;
setEncryptionStatus ( ) ;
connect ( walletModel , SIGNAL ( encryptionStatusChanged ( int ) ) , gui , SLOT ( setEncryptionStatus ( int ) ) ) ;
if ( walletModel )
{
// Receive and report messages from wallet thread
connect ( walletModel , SIGNAL ( message ( QString , QString , unsigned int ) ) , this , SIGNAL ( message ( QString , QString , unsigned int ) ) ) ;
// Handle changes in encryption status
connect ( walletModel , SIGNAL ( encryptionStatusChanged ( int ) ) , this , SIGNAL ( encryptionStatusChanged ( int ) ) ) ;
updateEncryptionStatus ( ) ;
// Balloon pop-up for new transaction
connect ( walletModel - > getTransactionTableModel ( ) , SIGNAL ( rowsInserted ( QModelIndex , int , int ) ) ,
this , SLOT ( incomingTransaction ( QModelIndex , int , int ) ) ) ;
this , SLOT ( processNew Transaction( QModelIndex , int , int ) ) ) ;
// Ask for passphrase if needed
connect ( walletModel , SIGNAL ( requireUnlock ( ) ) , this , SLOT ( unlockWallet ( ) ) ) ;
}
}
void WalletView : : incoming Transaction( const QModelIndex & parent , int start , int /*end*/ )
void WalletView : : processNew Transaction( const QModelIndex & parent , int start , int /*end*/ )
{
// Prevent balloon-spam when initial block download is in progress
if ( ! walletModel | | ! clientModel | | clientModel - > inInitialBlockDownload ( ) )
@ -139,7 +144,7 @@ void WalletView::incomingTransaction(const QModelIndex& parent, int start, int /
@@ -139,7 +144,7 @@ void WalletView::incomingTransaction(const QModelIndex& parent, int start, int /
QString type = ttm - > index ( start , TransactionTableModel : : Type , parent ) . data ( ) . toString ( ) ;
QString address = ttm - > index ( start , TransactionTableModel : : ToAddress , parent ) . data ( ) . toString ( ) ;
gui - > incomingTransaction ( date , walletModel - > getOptionsModel ( ) - > getDisplayUnit ( ) , amount , type , address ) ;
emit incomingTransaction ( date , walletModel - > getOptionsModel ( ) - > getDisplayUnit ( ) , amount , type , address ) ;
}
void WalletView : : gotoOverviewPage ( )
@ -199,9 +204,9 @@ void WalletView::showOutOfSyncWarning(bool fShow)
@@ -199,9 +204,9 @@ void WalletView::showOutOfSyncWarning(bool fShow)
overviewPage - > showOutOfSyncWarning ( fShow ) ;
}
void WalletView : : set EncryptionStatus( )
void WalletView : : update EncryptionStatus( )
{
gui - > setEncryptionStatus ( walletModel - > getEncryptionStatus ( ) ) ;
emit encryptionStatusChanged ( walletModel - > getEncryptionStatus ( ) ) ;
}
void WalletView : : encryptWallet ( bool status )
@ -212,7 +217,7 @@ void WalletView::encryptWallet(bool status)
@@ -212,7 +217,7 @@ void WalletView::encryptWallet(bool status)
dlg . setModel ( walletModel ) ;
dlg . exec ( ) ;
set EncryptionStatus( ) ;
update EncryptionStatus( ) ;
}
void WalletView : : backupWallet ( )