mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-17 08:17:59 +00:00
History: keep sorting on page change
This commit is contained in:
parent
ff02cc0821
commit
c89c25c8ed
1 changed files with 22 additions and 11 deletions
|
@ -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,20 +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()
|
||||||
|
|
||||||
/* Default sorting by timestamp desc */
|
if (!d.initialized) {
|
||||||
/* Sort indicator on table header */
|
// setup date filter scope according to real transactions
|
||||||
/* index of 'sort by blockheight' column */
|
fromDatePicker.currentDate = model.transactionHistory.firstDateTime
|
||||||
header.activeSortColumn = 1
|
toDatePicker.currentDate = model.transactionHistory.lastDateTime
|
||||||
/* Sorting model */
|
|
||||||
|
/* Default sorting by timestamp desc */
|
||||||
|
/* Sort indicator on table header */
|
||||||
|
/* index of 'sort by blockheight' column */
|
||||||
|
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue