diff options
| author | Riccardo Spagni <ric@spagni.net> | 2016-11-11 12:41:09 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2016-11-11 12:41:09 +0200 |
| commit | 52fcc429cb368580b91ab98dba7f9ff2589c0fea (patch) | |
| tree | 13345f624789bbd18cfdeac960e5b36a1702b8fb | |
| parent | 523764759763d2008c3934417b0dd82233323270 (diff) | |
| parent | 10348af88a41a90464817bcdbb1e9f182bddf1be (diff) | |
| download | monzero-gui-52fcc429cb368580b91ab98dba7f9ff2589c0fea.tar.gz monzero-gui-52fcc429cb368580b91ab98dba7f9ff2589c0fea.tar.xz monzero-gui-52fcc429cb368580b91ab98dba7f9ff2589c0fea.zip | |
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)
| -rw-r--r-- | pages/History.qml | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/pages/History.qml b/pages/History.qml index a6c216bf..e31473ae 100644 --- a/pages/History.qml +++ b/pages/History.qml @@ -40,6 +40,11 @@ Rectangle { id: root property var model + QtObject { + id: d + property bool initialized: false + } + color: "#F0EEEE" function getSelectedAmount() { @@ -59,10 +64,26 @@ Rectangle { onModelChanged: { 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() + + 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 + } + } } |
