Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
75192da6
Commit
75192da6
authored
10 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in minimum datetime transactions filter
Time was the time from the block 0, not 00:00:00.
parent
8e3403ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cutecoin/gui/transactions_tab.py
+8
-7
8 additions, 7 deletions
src/cutecoin/gui/transactions_tab.py
src/cutecoin/models/txhistory.py
+6
-4
6 additions, 4 deletions
src/cutecoin/models/txhistory.py
with
14 additions
and
11 deletions
src/cutecoin/gui/transactions_tab.py
+
8
−
7
View file @
75192da6
from
PyQt5.QtWidgets
import
QWidget
,
QAbstractItemView
,
QHeaderView
,
QDialog
,
\
from
PyQt5.QtWidgets
import
QWidget
,
QAbstractItemView
,
QHeaderView
,
QDialog
,
\
QMenu
,
QAction
,
QApplication
,
QMessageBox
QMenu
,
QAction
,
QApplication
,
QMessageBox
from
PyQt5.QtCore
import
Qt
,
QDateTime
,
QModelIndex
,
QLocale
from
PyQt5.QtCore
import
Qt
,
QDateTime
,
QTime
,
QModelIndex
,
QLocale
from
PyQt5.QtGui
import
QCursor
from
PyQt5.QtGui
import
QCursor
from
..gen_resources.transactions_tab_uic
import
Ui_transactionsTabWidget
from
..gen_resources.transactions_tab_uic
import
Ui_transactionsTabWidget
from
..models.txhistory
import
HistoryTableModel
,
TxFilterProxyModel
from
..models.txhistory
import
HistoryTableModel
,
TxFilterProxyModel
...
@@ -11,6 +11,7 @@ from .transfer import TransferMoneyDialog
...
@@ -11,6 +11,7 @@ from .transfer import TransferMoneyDialog
import
logging
import
logging
class
TransactionsTabWidget
(
QWidget
,
Ui_transactionsTabWidget
):
class
TransactionsTabWidget
(
QWidget
,
Ui_transactionsTabWidget
):
"""
"""
classdocs
classdocs
...
@@ -27,7 +28,6 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
...
@@ -27,7 +28,6 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
:return:
:return:
"""
"""
super
().
__init__
()
super
().
__init__
()
self
.
setupUi
(
self
)
self
.
setupUi
(
self
)
self
.
app
=
app
self
.
app
=
app
...
@@ -37,14 +37,15 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
...
@@ -37,14 +37,15 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
self
.
refresh
()
self
.
refresh
()
def
refresh
(
self
):
def
refresh
(
self
):
blockchain_init
=
QDateTime
()
minimum_datetime
=
QDateTime
()
blockchain_init
.
setTime_t
(
self
.
community
.
get_block
(
1
).
mediantime
)
minimum_datetime
.
setTime_t
(
self
.
community
.
get_block
(
1
).
mediantime
)
minimum_datetime
.
setTime
(
QTime
(
0
,
0
))
self
.
date_from
.
setMinimumDateTime
(
blockchain_init
)
self
.
date_from
.
setMinimumDateTime
(
minimum_datetime
)
self
.
date_from
.
setDateTime
(
blockchain_init
)
self
.
date_from
.
setDateTime
(
minimum_datetime
)
self
.
date_from
.
setMaximumDateTime
(
QDateTime
().
currentDateTime
())
self
.
date_from
.
setMaximumDateTime
(
QDateTime
().
currentDateTime
())
self
.
date_to
.
setMinimumDateTime
(
blockchain_init
)
self
.
date_to
.
setMinimumDateTime
(
minimum_datetime
)
tomorrow_datetime
=
QDateTime
().
currentDateTime
().
addDays
(
1
)
tomorrow_datetime
=
QDateTime
().
currentDateTime
().
addDays
(
1
)
self
.
date_to
.
setDateTime
(
tomorrow_datetime
)
self
.
date_to
.
setDateTime
(
tomorrow_datetime
)
self
.
date_to
.
setMaximumDateTime
(
tomorrow_datetime
)
self
.
date_to
.
setMaximumDateTime
(
tomorrow_datetime
)
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/models/txhistory.py
+
6
−
4
View file @
75192da6
...
@@ -4,12 +4,11 @@ Created on 5 févr. 2014
...
@@ -4,12 +4,11 @@ Created on 5 févr. 2014
@author: inso
@author: inso
'''
'''
import
datetime
import
logging
import
logging
from
..core.transfer
import
Transfer
,
Received
from
..core.transfer
import
Transfer
,
Received
from
..core.person
import
Person
from
..tools.exceptions
import
PersonNotFoundError
from
PyQt5.QtCore
import
QAbstractTableModel
,
Qt
,
QVariant
,
QSortFilterProxyModel
,
\
from
PyQt5.QtCore
import
QAbstractTableModel
,
Qt
,
QVariant
,
QSortFilterProxyModel
,
\
QDateTime
,
QLocale
,
QModelIndex
QDateTime
,
QLocale
from
PyQt5.QtGui
import
QFont
,
QColor
from
PyQt5.QtGui
import
QFont
,
QColor
...
@@ -28,7 +27,10 @@ class TxFilterProxyModel(QSortFilterProxyModel):
...
@@ -28,7 +27,10 @@ class TxFilterProxyModel(QSortFilterProxyModel):
"""
"""
Filter table by given timestamps
Filter table by given timestamps
"""
"""
logging
.
debug
(
"
Filtering from {0} to {1}
"
.
format
(
ts_from
,
ts_to
))
logging
.
debug
(
"
Filtering from {0} to {1}
"
.
format
(
datetime
.
datetime
.
fromtimestamp
(
ts_from
).
isoformat
(
'
'
),
datetime
.
datetime
.
fromtimestamp
(
ts_to
).
isoformat
(
'
'
))
)
self
.
ts_from
=
ts_from
self
.
ts_from
=
ts_from
self
.
ts_to
=
ts_to
self
.
ts_to
=
ts_to
self
.
modelReset
.
emit
()
self
.
modelReset
.
emit
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment