mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-28 18:56:32 +02:00
Merge pull request #119
10348af
History: sorting by blockheight instead of timestamp (Ilya Kitaev)c89c25c
History: keep sorting on page change (Ilya Kitaev)ff02cc0
History: default sorting by timestamp, descending (Ilya Kitaev)
This commit is contained in:
commit
52fcc429cb
@ -40,6 +40,11 @@ Rectangle {
|
|||||||
id: root
|
id: root
|
||||||
property var model
|
property var model
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
property bool initialized: false
|
||||||
|
}
|
||||||
|
|
||||||
color: "#F0EEEE"
|
color: "#F0EEEE"
|
||||||
|
|
||||||
function getSelectedAmount() {
|
function getSelectedAmount() {
|
||||||
@ -59,10 +64,26 @@ Rectangle {
|
|||||||
|
|
||||||
onModelChanged: {
|
onModelChanged: {
|
||||||
if (typeof model !== 'undefined') {
|
if (typeof model !== 'undefined') {
|
||||||
// setup date filter scope according to real transactions
|
|
||||||
fromDatePicker.currentDate = model.transactionHistory.firstDateTime
|
|
||||||
toDatePicker.currentDate = model.transactionHistory.lastDateTime
|
|
||||||
selectedAmount.text = getSelectedAmount()
|
selectedAmount.text = getSelectedAmount()
|
||||||
|
|
||||||
|
if (!d.initialized) {
|
||||||
|
// setup date filter scope according to real transactions
|
||||||
|
fromDatePicker.currentDate = model.transactionHistory.firstDateTime
|
||||||
|
toDatePicker.currentDate = model.transactionHistory.lastDateTime
|
||||||
|
|
||||||
|
/* Default sorting by timestamp desc */
|
||||||
|
/* Sort indicator on table header */
|
||||||
|
/* index of 'sort by blockheight' column */
|
||||||
|
header.activeSortColumn = 2
|
||||||
|
/* Sorting model */
|
||||||
|
|
||||||
|
model.sortRole = TransactionHistoryModel.TransactionBlockHeightRole
|
||||||
|
model.sort(0, Qt.DescendingOrder);
|
||||||
|
d.initialized = true
|
||||||
|
// TODO: public interface for 'Header' item that will cause 'sortRequest' signal
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user