mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-27 04:55:54 +00:00
History: keep sorting on page change
This commit is contained in:
parent
de7d97db85
commit
a803c1efb1
1 changed files with 19 additions and 10 deletions
|
@ -40,22 +40,31 @@ Rectangle {
|
||||||
id: root
|
id: root
|
||||||
property var model
|
property var model
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
property bool initialized: false
|
||||||
|
}
|
||||||
|
|
||||||
color: "#F0EEEE"
|
color: "#F0EEEE"
|
||||||
onModelChanged: {
|
onModelChanged: {
|
||||||
if (typeof model !== 'undefined') {
|
if (typeof model !== 'undefined') {
|
||||||
// setup date filter scope according to real transactions
|
if (!d.initialized) {
|
||||||
fromDatePicker.currentDate = model.transactionHistory.firstDateTime
|
// setup date filter scope according to real transactions
|
||||||
toDatePicker.currentDate = model.transactionHistory.lastDateTime
|
fromDatePicker.currentDate = model.transactionHistory.firstDateTime
|
||||||
|
toDatePicker.currentDate = model.transactionHistory.lastDateTime
|
||||||
|
|
||||||
/* Default sorting by timestamp desc */
|
/* Default sorting by timestamp desc */
|
||||||
/* Sort indicator on table header */
|
/* Sort indicator on table header */
|
||||||
/* index of 'sort by blockheight' column */
|
/* index of 'sort by blockheight' column */
|
||||||
header.activeSortColumn = 1
|
header.activeSortColumn = 1
|
||||||
/* Sorting model */
|
/* 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