aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-11-06 15:33:41 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-11-10 22:56:30 +0300
commitc89c25c8edd35aec983202b287c02358708180fe (patch)
treeb7b29fa7bf0efa0ce0006965311d6d89114944bd
parentff02cc082195536437f66c4d96b352cbe149fa49 (diff)
downloadmonzero-gui-c89c25c8edd35aec983202b287c02358708180fe.tar.gz
monzero-gui-c89c25c8edd35aec983202b287c02358708180fe.tar.xz
monzero-gui-c89c25c8edd35aec983202b287c02358708180fe.zip
History: keep sorting on page change
-rw-r--r--pages/History.qml31
1 files changed, 21 insertions, 10 deletions
diff --git a/pages/History.qml b/pages/History.qml
index adf7e72f..3d96d1af 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,20 +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()
- /* Default sorting by timestamp desc */
- /* Sort indicator on table header */
+ 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 = 1
- /* Sorting model */
+ header.activeSortColumn = 1
+ /* Sorting model */
+
+ model.sortRole = TransactionHistoryModel.TransactionTimeStampRole
+ model.sort(0, Qt.DescendingOrder);
+ d.initialized = true
+ // TODO: public interface for 'Header' item that will cause 'sortRequest' signal
+ }
- model.sortRole = TransactionHistoryModel.TransactionTimeStampRole
- model.sort(0, Qt.DescendingOrder);
- // TODO: public interface for 'Header' item that will cause 'sortRequest' signal
}
}