@ -125,6 +125,7 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
@@ -125,6 +125,7 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
ui - > treeWidget - > setColumnHidden ( COLUMN_VOUT_INDEX , true ) ; // store vout index in this column, but dont show it
ui - > treeWidget - > setColumnHidden ( COLUMN_AMOUNT_INT64 , true ) ; // store amount int64 in this column, but dont show it
ui - > treeWidget - > setColumnHidden ( COLUMN_PRIORITY_INT64 , true ) ; // store priority int64 in this column, but dont show it
ui - > treeWidget - > setColumnHidden ( COLUMN_DATE_INT64 , true ) ; // store date int64 in this column, but dont show it
// default view is sorted by amount desc
sortView ( COLUMN_AMOUNT_INT64 , Qt : : DescendingOrder ) ;
@ -327,7 +328,7 @@ void CoinControlDialog::sortView(int column, Qt::SortOrder order)
@@ -327,7 +328,7 @@ void CoinControlDialog::sortView(int column, Qt::SortOrder order)
sortColumn = column ;
sortOrder = order ;
ui - > treeWidget - > sortItems ( column , order ) ;
ui - > treeWidget - > header ( ) - > setSortIndicator ( ( sortColumn = = COLUMN_AMOUNT_INT64 ? COLUMN_AMOUNT : ( sortColumn = = COLUMN_PRIORITY_INT64 ? COLUMN_PRIORITY : sortColumn ) ) , sortOrder ) ;
ui - > treeWidget - > header ( ) - > setSortIndicator ( getMappedColumn ( sortColumn ) , sortOrder ) ;
}
// treeview: clicked on header
@ -335,22 +336,18 @@ void CoinControlDialog::headerSectionClicked(int logicalIndex)
@@ -335,22 +336,18 @@ void CoinControlDialog::headerSectionClicked(int logicalIndex)
{
if ( logicalIndex = = COLUMN_CHECKBOX ) // click on most left column -> do nothing
{
ui - > treeWidget - > header ( ) - > setSortIndicator ( ( sortColumn = = COLUMN_AMOUNT_INT64 ? COLUMN_AMOUNT : ( sortColumn = = COLUMN_PRIORITY_INT64 ? COLUMN_PRIORITY : sortColumn ) ) , sortOrder ) ;
ui - > treeWidget - > header ( ) - > setSortIndicator ( getMappedColumn ( sortColumn ) , sortOrder ) ;
}
else
{
if ( logicalIndex = = COLUMN_AMOUNT ) // sort by amount
logicalIndex = COLUMN_AMOUNT_INT64 ;
if ( logicalIndex = = COLUMN_PRIORITY ) // sort by priority
logicalIndex = COLUMN_PRIORITY_INT64 ;
logicalIndex = getMappedColumn ( logicalIndex , false ) ;
if ( sortColumn = = logicalIndex )
sortOrder = ( ( sortOrder = = Qt : : AscendingOrder ) ? Qt : : DescendingOrder : Qt : : AscendingOrder ) ;
else
{
sortColumn = logicalIndex ;
sortOrder = ( ( sortColumn = = COLUMN_AMOUNT_INT64 | | sortColumn = = COLUMN_PRIORITY_INT64 | | sortColumn = = COLUMN_DATE | | sortColumn = = COLUMN_CONFIRMATION S ) ? Qt : : De scendingOrder : Qt : : AscendingOrder ) ; // if amount,date,conf,priority then default => desc, else default => a sc
sortOrder = ( ( sortColumn = = COLUMN_LABEL | | sortColumn = = COLUMN_ADDRES S ) ? Qt : : A scendingOrder : Qt : : DescendingOrder ) ; // if label or address then default => asc, else default => de sc
}
sortView ( sortColumn , sortOrder ) ;
@ -731,6 +728,7 @@ void CoinControlDialog::updateView()
@@ -731,6 +728,7 @@ void CoinControlDialog::updateView()
// date
itemOutput - > setText ( COLUMN_DATE , GUIUtil : : dateTimeStr ( out . tx - > GetTxTime ( ) ) ) ;
itemOutput - > setText ( COLUMN_DATE_INT64 , strPad ( QString : : number ( out . tx - > GetTxTime ( ) ) , 20 , " " ) ) ;
// confirmations
itemOutput - > setText ( COLUMN_CONFIRMATIONS , strPad ( QString : : number ( out . nDepth ) , 8 , " " ) ) ;