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
2877a799
Commit
2877a799
authored
5 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
[enh]
#798
Underline transactions with special conditions in tx history
parent
d5674c3d
No related branches found
No related tags found
1 merge request
!778
Release 0.51.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sakia/gui/navigation/txhistory/sql_adapter.py
+13
-6
13 additions, 6 deletions
src/sakia/gui/navigation/txhistory/sql_adapter.py
src/sakia/gui/navigation/txhistory/table_model.py
+13
-3
13 additions, 3 deletions
src/sakia/gui/navigation/txhistory/table_model.py
with
26 additions
and
9 deletions
src/sakia/gui/navigation/txhistory/sql_adapter.py
+
13
−
6
View file @
2877a799
...
...
@@ -6,13 +6,16 @@ TX_HISTORY_REQUEST = """
SELECT
transactions.ts,
transactions.pubkey,
total_amount((amount * -1), amountbase) as amount,
total_amount((
transactions.
amount * -1),
transactions.
amountbase) as amount,
transactions.comment ,
transactions.sha_hash,
transactions.written_on,
transactions.txid
transactions.txid,
sources.conditions
FROM
transactions
LEFT JOIN sources ON sources.identifier = transactions.sha_hash and
(sources.conditions LIKE
"
%&&%
"
OR sources.conditions LIKE
"
%||%
"
)
WHERE
transactions.currency = ?
and transactions.pubkey = ?
...
...
@@ -24,13 +27,16 @@ UNION ALL
SELECT
transactions.ts,
transactions.pubkey,
total_amount(
amount,
amountbase) as amount,
total_amount(
transactions.amount, transactions.
amountbase) as amount,
transactions.comment ,
transactions.sha_hash,
transactions.written_on,
transactions.txid
transactions.txid,
sources.conditions
FROM
transactions
LEFT JOIN sources ON sources.identifier = transactions.sha_hash and
(sources.conditions LIKE
"
%&&%
"
OR sources.conditions LIKE
"
%||%
"
)
WHERE
transactions.currency = ?
and transactions.pubkey = ?
...
...
@@ -42,11 +48,12 @@ UNION ALL
SELECT
dividends.timestamp as ts,
dividends.pubkey ,
total_amount(
amount,
base) as amount,
total_amount(
dividends.amount, dividends.
base) as amount,
NULL as comment,
NULL as sha_hash,
dividends.block_number AS written_on,
0 as txid
0 as txid,
NULL
FROM
dividends
WHERE
...
...
This diff is collapsed.
Click to expand it.
src/sakia/gui/navigation/txhistory/table_model.py
+
13
−
3
View file @
2877a799
...
...
@@ -39,6 +39,7 @@ class HistoryTableModel(QAbstractTableModel):
"
block_number
"
,
"
txhash
"
,
"
raw_data
"
,
"
conditions
"
,
)
columns_to_sql
=
{
...
...
@@ -232,6 +233,7 @@ class HistoryTableModel(QAbstractTableModel):
block_number
,
transfer
.
sha_hash
,
transfer
,
transfer
.
conditions
,
)
def
data_sent
(
self
,
transfer
):
...
...
@@ -267,6 +269,7 @@ class HistoryTableModel(QAbstractTableModel):
block_number
,
transfer
.
sha_hash
,
transfer
,
transfer
.
conditions
,
)
def
data_dividend
(
self
,
dividend
):
...
...
@@ -299,6 +302,7 @@ class HistoryTableModel(QAbstractTableModel):
block_number
,
""
,
dividend
,
dividend
.
conditions
,
)
def
init_transfers
(
self
):
...
...
@@ -312,7 +316,7 @@ class HistoryTableModel(QAbstractTableModel):
pubkey
=
self
.
connection
.
pubkey
,
sha_hash
=
data
[
4
],
)
transfer
.
conditions
=
data
[
7
]
if
transfer
.
state
!=
Transaction
.
DROPPED
:
if
data
[
4
]
==
STOPLINE_HASH
:
self
.
transfers_data
.
append
(
self
.
data_stopline
(
transfer
))
...
...
@@ -327,6 +331,7 @@ class HistoryTableModel(QAbstractTableModel):
pubkey
=
self
.
connection
.
pubkey
,
block_number
=
data
[
5
],
)
dividend
.
conditions
=
data
[
7
]
self
.
transfers_data
.
append
(
self
.
data_dividend
(
dividend
))
self
.
endResetModel
()
...
...
@@ -334,7 +339,7 @@ class HistoryTableModel(QAbstractTableModel):
return
len
(
self
.
transfers_data
)
def
columnCount
(
self
,
parent
):
return
len
(
HistoryTableModel
.
columns_types
)
-
6
return
4
def
sort
(
self
,
main_column
,
order
):
self
.
main_column_id
=
self
.
columns_types
[
main_column
]
...
...
@@ -374,7 +379,9 @@ class HistoryTableModel(QAbstractTableModel):
block_data
=
self
.
transfers_data
[
row
][
HistoryTableModel
.
columns_types
.
index
(
"
block_number
"
)
]
conditions_data
=
self
.
transfers_data
[
row
][
HistoryTableModel
.
columns_types
.
index
(
"
conditions
"
)
]
if
state_data
==
Transaction
.
VALIDATED
and
block_data
:
current_confirmations
=
(
self
.
blockchain_processor
.
current_buid
(
self
.
app
.
currency
).
number
...
...
@@ -428,6 +435,9 @@ class HistoryTableModel(QAbstractTableModel):
font
.
setItalic
(
True
)
else
:
font
.
setItalic
(
False
)
# if special lock conditions on a source coming from this transaction...
if
conditions_data
is
not
None
:
font
.
setUnderline
(
True
)
return
font
if
role
==
Qt
.
ForegroundRole
:
...
...
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