@ -697,30 +697,25 @@ void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
* payFee = ( retval = = QMessageBox : : Yes ) ;
* payFee = ( retval = = QMessageBox : : Yes ) ;
}
}
void BitcoinGUI : : incomingTransaction ( const QModelIndex & parent , int start , int end )
void BitcoinGUI : : incomingTransaction ( const QModelIndex & parent , int start , int /*end*/ )
{
{
if ( ! walletModel | | ! clientModel )
// Prevent balloon-spam when initial block download is in progress
if ( ! walletModel | | ! clientModel | | clientModel - > inInitialBlockDownload ( ) )
return ;
return ;
TransactionTableModel * ttm = walletModel - > getTransactionTableModel ( ) ;
TransactionTableModel * ttm = walletModel - > getTransactionTableModel ( ) ;
qint64 amount = ttm - > index ( start , TransactionTableModel : : Amount , parent )
. data ( Qt : : EditRole ) . toULongLong ( ) ;
if ( ! clientModel - > inInitialBlockDownload ( ) )
{
// On new transaction, make an info balloon
// Unless the initial block download is in progress, to prevent balloon-spam
QString date = ttm - > index ( start , TransactionTableModel : : Date , parent )
QString date = ttm - > index ( start , TransactionTableModel : : Date , parent )
. data ( ) . toString ( ) ;
. data ( ) . toString ( ) ;
qint64 amount = ttm - > index ( start , TransactionTableModel : : Amount , parent )
. data ( Qt : : EditRole ) . toULongLong ( ) ;
QString type = ttm - > index ( start , TransactionTableModel : : Type , parent )
QString type = ttm - > index ( start , TransactionTableModel : : Type , parent )
. data ( ) . toString ( ) ;
. data ( ) . toString ( ) ;
QString address = ttm - > index ( start , TransactionTableModel : : ToAddress , parent )
QString address = ttm - > index ( start , TransactionTableModel : : ToAddress , parent )
. data ( ) . toString ( ) ;
. data ( ) . toString ( ) ;
QIcon icon = qvariant_cast < QIcon > ( ttm - > index ( start ,
TransactionTableModel : : ToAddress , parent )
. data ( Qt : : DecorationRole ) ) ;
notificator - > notify ( Notificator : : Information ,
// On new transaction, make an info balloon
( amount ) < 0 ? tr ( " Sent transaction " ) :
message ( ( amount ) < 0 ? tr ( " Sent transaction " ) : tr ( " Incoming transaction " ) ,
tr ( " Incoming transaction " ) ,
tr ( " Date: %1 \n "
tr ( " Date: %1 \n "
" Amount: %2 \n "
" Amount: %2 \n "
" Type: %3 \n "
" Type: %3 \n "
@ -728,8 +723,7 @@ void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int
. arg ( date )
. arg ( date )
. arg ( BitcoinUnits : : formatWithUnit ( walletModel - > getOptionsModel ( ) - > getDisplayUnit ( ) , amount , true ) )
. arg ( BitcoinUnits : : formatWithUnit ( walletModel - > getOptionsModel ( ) - > getDisplayUnit ( ) , amount , true ) )
. arg ( type )
. arg ( type )
. arg ( address ) , icon ) ;
. arg ( address ) , CClientUIInterface : : MSG_INFORMATION ) ;
}
}
}
void BitcoinGUI : : gotoOverviewPage ( )
void BitcoinGUI : : gotoOverviewPage ( )
@ -821,7 +815,8 @@ void BitcoinGUI::dropEvent(QDropEvent *event)
if ( nValidUrisFound )
if ( nValidUrisFound )
gotoSendCoinsPage ( ) ;
gotoSendCoinsPage ( ) ;
else
else
notificator - > notify ( Notificator : : Warning , tr ( " URI handling " ) , tr ( " URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. " ) ) ;
message ( tr ( " URI handling " ) , tr ( " URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. " ) ,
CClientUIInterface : : ICON_WARNING ) ;
}
}
event - > acceptProposedAction ( ) ;
event - > acceptProposedAction ( ) ;
@ -848,7 +843,8 @@ void BitcoinGUI::handleURI(QString strURI)
gotoSendCoinsPage ( ) ;
gotoSendCoinsPage ( ) ;
}
}
else
else
notificator - > notify ( Notificator : : Warning , tr ( " URI handling " ) , tr ( " URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. " ) ) ;
message ( tr ( " URI handling " ) , tr ( " URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. " ) ,
CClientUIInterface : : ICON_WARNING ) ;
}
}
void BitcoinGUI : : setEncryptionStatus ( int status )
void BitcoinGUI : : setEncryptionStatus ( int status )
@ -898,8 +894,12 @@ void BitcoinGUI::backupWallet()
QString filename = QFileDialog : : getSaveFileName ( this , tr ( " Backup Wallet " ) , saveDir , tr ( " Wallet Data (*.dat) " ) ) ;
QString filename = QFileDialog : : getSaveFileName ( this , tr ( " Backup Wallet " ) , saveDir , tr ( " Wallet Data (*.dat) " ) ) ;
if ( ! filename . isEmpty ( ) ) {
if ( ! filename . isEmpty ( ) ) {
if ( ! walletModel - > backupWallet ( filename ) ) {
if ( ! walletModel - > backupWallet ( filename ) ) {
QMessageBox : : warning ( this , tr ( " Backup Failed " ) , tr ( " There was an error trying to save the wallet data to the new location. " ) ) ;
message ( tr ( " Backup Failed " ) , tr ( " There was an error trying to save the wallet data to the new location. " ) ,
CClientUIInterface : : MSG_ERROR ) ;
}
}
else
message ( tr ( " Backup Successful " ) , tr ( " The wallet data was successfully saved to the new location. " ) ,
CClientUIInterface : : MSG_INFORMATION ) ;
}
}
}
}