@ -10,6 +10,7 @@
# include "transactiondescdialog.h"
# include "transactiondescdialog.h"
# include "editaddressdialog.h"
# include "editaddressdialog.h"
# include "optionsmodel.h"
# include "optionsmodel.h"
# include "guiutil.h"
# include <QScrollBar>
# include <QScrollBar>
# include <QComboBox>
# include <QComboBox>
@ -100,7 +101,6 @@ TransactionView::TransactionView(QWidget *parent) :
QVBoxLayout * vlayout = new QVBoxLayout ( this ) ;
QVBoxLayout * vlayout = new QVBoxLayout ( this ) ;
vlayout - > setContentsMargins ( 0 , 0 , 0 , 0 ) ;
vlayout - > setContentsMargins ( 0 , 0 , 0 , 0 ) ;
vlayout - > setSpacing ( 0 ) ;
vlayout - > setSpacing ( 0 ) ;
//vlayout->addLayout(hlayout2);
QTableView * view = new QTableView ( this ) ;
QTableView * view = new QTableView ( this ) ;
vlayout - > addLayout ( hlayout ) ;
vlayout - > addLayout ( hlayout ) ;
@ -124,12 +124,14 @@ TransactionView::TransactionView(QWidget *parent) :
// Actions
// Actions
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 * editLabelAction = new QAction ( tr ( " Edit label " ) , this ) ;
QAction * editLabelAction = new QAction ( tr ( " Edit label " ) , this ) ;
QAction * showDetailsAction = new QAction ( tr ( " Show details... " ) , this ) ;
QAction * showDetailsAction = new QAction ( tr ( " Show details... " ) , this ) ;
contextMenu = new QMenu ( ) ;
contextMenu = new QMenu ( ) ;
contextMenu - > addAction ( copyAddressAction ) ;
contextMenu - > addAction ( copyAddressAction ) ;
contextMenu - > addAction ( copyLabelAction ) ;
contextMenu - > addAction ( copyLabelAction ) ;
contextMenu - > addAction ( copyAmountAction ) ;
contextMenu - > addAction ( editLabelAction ) ;
contextMenu - > addAction ( editLabelAction ) ;
contextMenu - > addAction ( showDetailsAction ) ;
contextMenu - > addAction ( showDetailsAction ) ;
@ -140,14 +142,11 @@ TransactionView::TransactionView(QWidget *parent) :
connect ( amountWidget , SIGNAL ( textChanged ( QString ) ) , this , SLOT ( changedAmount ( QString ) ) ) ;
connect ( amountWidget , SIGNAL ( textChanged ( QString ) ) , this , SLOT ( changedAmount ( QString ) ) ) ;
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 ( 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 ( ) ) ) ;
connect ( copyAmountAction , SIGNAL ( triggered ( ) ) , this , SLOT ( copyAmount ( ) ) ) ;
connect ( editLabelAction , SIGNAL ( triggered ( ) ) , this , SLOT ( editLabel ( ) ) ) ;
connect ( editLabelAction , SIGNAL ( triggered ( ) ) , this , SLOT ( editLabel ( ) ) ) ;
connect ( showDetailsAction , SIGNAL ( triggered ( ) ) , this , SLOT ( showDetails ( ) ) ) ;
connect ( showDetailsAction , SIGNAL ( triggered ( ) ) , this , SLOT ( showDetails ( ) ) ) ;
}
}
@ -303,24 +302,17 @@ void TransactionView::contextualMenu(const QPoint &point)
void TransactionView : : copyAddress ( )
void TransactionView : : copyAddress ( )
{
{
if ( ! transactionView - > selectionModel ( ) )
GUIUtil : : copyEntryData ( transactionView , 0 , TransactionTableModel : : AddressRole ) ;
return ;
QModelIndexList selection = transactionView - > selectionModel ( ) - > selectedRows ( ) ;
if ( ! selection . isEmpty ( ) )
{
QApplication : : clipboard ( ) - > setText ( selection . at ( 0 ) . data ( TransactionTableModel : : AddressRole ) . toString ( ) ) ;
}
}
}
void TransactionView : : copyLabel ( )
void TransactionView : : copyLabel ( )
{
{
if ( ! transactionView - > selectionModel ( ) )
GUIUtil : : copyEntryData ( transactionView , 0 , TransactionTableModel : : LabelRole ) ;
return ;
}
QModelIndexList selection = transactionView - > selectionModel ( ) - > selectedRows ( ) ;
if ( ! selection . isEmpty ( ) )
void TransactionView : : copyAmount ( )
{
{
QApplication : : clipboard ( ) - > setText ( selection . at ( 0 ) . data ( TransactionTableModel : : LabelRole ) . toString ( ) ) ;
GUIUtil : : copyEntryData ( transactionView , 0 , TransactionTableModel : : FormattedAmountRole ) ;
}
}
}
void TransactionView : : editLabel ( )
void TransactionView : : editLabel ( )