mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-03-12 09:36:59 +00:00
Merge remote-tracking branch 'mbg033/fix-sort-by-date'
This commit is contained in:
commit
7028893e60
1 changed files with 28 additions and 10 deletions
|
@ -1,21 +1,21 @@
|
|||
// Copyright (c) 2014-2015, The Monero Project
|
||||
//
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
|
@ -40,6 +40,11 @@ Rectangle {
|
|||
id: root
|
||||
property var model
|
||||
|
||||
QtObject {
|
||||
id: d
|
||||
property bool initialized: false
|
||||
}
|
||||
|
||||
color: "#F0EEEE"
|
||||
|
||||
function getSelectedAmount() {
|
||||
|
@ -59,10 +64,23 @@ 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
|
||||
selectedAmount.text = getSelectedAmount()
|
||||
|
||||
/* 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 a new issue