Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
sakia
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
78
Issues
78
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
clients
python
sakia
Commits
133b2574
Commit
133b2574
authored
Mar 31, 2020
by
Vincent Texier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh]
#798
fix bad source amount in transfer view and transaction sent field in db
parent
9b7affb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
src/sakia/gui/sub/transfer/controller.py
src/sakia/gui/sub/transfer/controller.py
+19
-11
No files found.
src/sakia/gui/sub/transfer/controller.py
View file @
133b2574
...
...
@@ -114,8 +114,7 @@ class TransferController(QObject):
controller
.
view
.
label_source_identifier
.
setText
(
"{}:{}"
.
format
(
source
.
identifier
,
source
.
noffset
)
)
amount
=
source
.
amount
*
(
10
**
source
.
base
)
/
100
controller
.
view
.
spinbox_amount
.
setValue
(
amount
)
controller
.
set_amount_value
(
source
.
amount
,
source
.
base
)
controller
.
view
.
spinbox_amount
.
setDisabled
(
True
)
controller
.
view
.
spinbox_relative
.
setDisabled
(
True
)
controller
.
view
.
button_source_check
.
setEnabled
(
True
)
...
...
@@ -174,15 +173,8 @@ class TransferController(QObject):
controller
.
refresh
()
current_base
=
controller
.
model
.
current_base
()
current_base_amount
=
resent_transfer
.
amount
/
pow
(
10
,
resent_transfer
.
amount_base
-
current_base
)
relative
=
controller
.
model
.
quant_to_rel
(
current_base_amount
/
100
)
controller
.
view
.
set_spinboxes_parameters
(
current_base_amount
/
100
,
relative
)
controller
.
view
.
change_relative_amount
(
relative
)
controller
.
view
.
change_quantitative_amount
(
current_base_amount
/
100
)
# display transaction amount
controller
.
set_amount_value
(
resent_transfer
.
amount
,
resent_transfer
.
amount_base
)
connections_processor
=
ConnectionsProcessor
.
instanciate
(
app
)
wallet_index
=
connections_processor
.
connections
().
index
(
connection
)
...
...
@@ -382,3 +374,19 @@ class TransferController(QObject):
qmessagebox
.
setWindowTitle
(
"Check source condition"
)
qmessagebox
.
setText
(
message
)
qmessagebox
.
exec
()
def
set_amount_value
(
self
,
amount
,
base
):
"""
Set quantitative and relative amounts from amount and base given
:param int amount: Amount to display
:param int base: Base of the amount given
:return:
"""
# calculate amount for current base
current_base
=
self
.
model
.
current_base
()
current_base_amount
=
amount
/
pow
(
10
,
base
-
current_base
)
# display quantitative and relative amounts
relative
=
self
.
model
.
quant_to_rel
(
current_base_amount
/
100
)
self
.
view
.
set_spinboxes_parameters
(
current_base_amount
/
100
,
relative
)
self
.
view
.
change_relative_amount
(
relative
)
self
.
view
.
change_quantitative_amount
(
current_base_amount
/
100
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment