@ -11,6 +11,7 @@
# include "guiutil.h"
# include "guiutil.h"
# include "optionsmodel.h"
# include "optionsmodel.h"
# include "platformstyle.h"
# include "platformstyle.h"
# include "sendcoinsdialog.h"
# include "transactiondescdialog.h"
# include "transactiondescdialog.h"
# include "transactionfilterproxy.h"
# include "transactionfilterproxy.h"
# include "transactionrecord.h"
# include "transactionrecord.h"
@ -37,7 +38,7 @@
TransactionView : : TransactionView ( const PlatformStyle * platformStyle , QWidget * parent ) :
TransactionView : : TransactionView ( const PlatformStyle * platformStyle , QWidget * parent ) :
QWidget ( parent ) , model ( 0 ) , transactionProxyModel ( 0 ) ,
QWidget ( parent ) , model ( 0 ) , transactionProxyModel ( 0 ) ,
transactionView ( 0 ) , abandonAction ( 0 ) , columnResizingFixer ( 0 )
transactionView ( 0 ) , abandonAction ( 0 ) , bumpFeeAction ( 0 ) , columnResizingFixer ( 0 )
{
{
// Build filter row
// Build filter row
setContentsMargins ( 0 , 0 , 0 , 0 ) ;
setContentsMargins ( 0 , 0 , 0 , 0 ) ;
@ -138,6 +139,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
// Actions
// Actions
abandonAction = new QAction ( tr ( " Abandon transaction " ) , this ) ;
abandonAction = new QAction ( tr ( " Abandon transaction " ) , this ) ;
bumpFeeAction = new QAction ( tr ( " Increase transaction fee " ) , this ) ;
QAction * copyAddressAction = new QAction ( tr ( " Copy address " ) , this ) ;
QAction * copyAddressAction = new QAction ( tr ( " Copy address " ) , this ) ;
QAction * copyLabelAction = new QAction ( tr ( " Copy label " ) , this ) ;
QAction * copyLabelAction = new QAction ( tr ( " Copy label " ) , this ) ;
QAction * copyAmountAction = new QAction ( tr ( " Copy amount " ) , this ) ;
QAction * copyAmountAction = new QAction ( tr ( " Copy amount " ) , this ) ;
@ -156,6 +158,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
contextMenu - > addAction ( copyTxPlainText ) ;
contextMenu - > addAction ( copyTxPlainText ) ;
contextMenu - > addAction ( showDetailsAction ) ;
contextMenu - > addAction ( showDetailsAction ) ;
contextMenu - > addSeparator ( ) ;
contextMenu - > addSeparator ( ) ;
contextMenu - > addAction ( bumpFeeAction ) ;
contextMenu - > addAction ( abandonAction ) ;
contextMenu - > addAction ( abandonAction ) ;
contextMenu - > addAction ( editLabelAction ) ;
contextMenu - > addAction ( editLabelAction ) ;
@ -173,6 +176,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
connect ( view , SIGNAL ( doubleClicked ( QModelIndex ) ) , this , SIGNAL ( doubleClicked ( QModelIndex ) ) ) ;
connect ( view , SIGNAL ( doubleClicked ( QModelIndex ) ) , this , SIGNAL ( doubleClicked ( QModelIndex ) ) ) ;
connect ( view , SIGNAL ( customContextMenuRequested ( QPoint ) ) , this , SLOT ( contextualMenu ( QPoint ) ) ) ;
connect ( view , SIGNAL ( customContextMenuRequested ( QPoint ) ) , this , SLOT ( contextualMenu ( QPoint ) ) ) ;
connect ( bumpFeeAction , SIGNAL ( triggered ( ) ) , this , SLOT ( bumpFee ( ) ) ) ;
connect ( abandonAction , SIGNAL ( triggered ( ) ) , this , SLOT ( abandonTx ( ) ) ) ;
connect ( abandonAction , SIGNAL ( triggered ( ) ) , this , SLOT ( abandonTx ( ) ) ) ;
connect ( copyAddressAction , SIGNAL ( triggered ( ) ) , this , SLOT ( copyAddress ( ) ) ) ;
connect ( copyAddressAction , SIGNAL ( triggered ( ) ) , this , SLOT ( copyAddress ( ) ) ) ;
connect ( copyLabelAction , SIGNAL ( triggered ( ) ) , this , SLOT ( copyLabel ( ) ) ) ;
connect ( copyLabelAction , SIGNAL ( triggered ( ) ) , this , SLOT ( copyLabel ( ) ) ) ;
@ -372,6 +376,7 @@ void TransactionView::contextualMenu(const QPoint &point)
uint256 hash ;
uint256 hash ;
hash . SetHex ( selection . at ( 0 ) . data ( TransactionTableModel : : TxHashRole ) . toString ( ) . toStdString ( ) ) ;
hash . SetHex ( selection . at ( 0 ) . data ( TransactionTableModel : : TxHashRole ) . toString ( ) . toStdString ( ) ) ;
abandonAction - > setEnabled ( model - > transactionCanBeAbandoned ( hash ) ) ;
abandonAction - > setEnabled ( model - > transactionCanBeAbandoned ( hash ) ) ;
bumpFeeAction - > setEnabled ( model - > transactionSignalsRBF ( hash ) ) ;
if ( index . isValid ( ) )
if ( index . isValid ( ) )
{
{
@ -397,6 +402,24 @@ void TransactionView::abandonTx()
model - > getTransactionTableModel ( ) - > updateTransaction ( hashQStr , CT_UPDATED , false ) ;
model - > getTransactionTableModel ( ) - > updateTransaction ( hashQStr , CT_UPDATED , false ) ;
}
}
void TransactionView : : bumpFee ( )
{
if ( ! transactionView | | ! transactionView - > selectionModel ( ) )
return ;
QModelIndexList selection = transactionView - > selectionModel ( ) - > selectedRows ( 0 ) ;
// get the hash from the TxHashRole (QVariant / QString)
uint256 hash ;
QString hashQStr = selection . at ( 0 ) . data ( TransactionTableModel : : TxHashRole ) . toString ( ) ;
hash . SetHex ( hashQStr . toStdString ( ) ) ;
// Bump tx fee over the walletModel
if ( model - > bumpFee ( hash ) ) {
// Update the table
model - > getTransactionTableModel ( ) - > updateTransaction ( hashQStr , CT_UPDATED , false ) ;
}
}
void TransactionView : : copyAddress ( )
void TransactionView : : copyAddress ( )
{
{
GUIUtil : : copyEntryData ( transactionView , 0 , TransactionTableModel : : AddressRole ) ;
GUIUtil : : copyEntryData ( transactionView , 0 , TransactionTableModel : : AddressRole ) ;