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
b988a348
Commit
b988a348
authored
8 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fix issues when sending money with higher base
parent
5caa069d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
res/ui/transfer.ui
+4
-1
4 additions, 1 deletion
res/ui/transfer.ui
src/sakia/gui/process_cfg_account.py
+1
-1
1 addition, 1 deletion
src/sakia/gui/process_cfg_account.py
src/sakia/gui/transfer.py
+24
-13
24 additions, 13 deletions
src/sakia/gui/transfer.py
with
29 additions
and
15 deletions
res/ui/transfer.ui
+
4
−
1
View file @
b988a348
...
...
@@ -153,7 +153,7 @@
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
S
&
earch user
</string>
<string>
Search
&
user
</string>
</property>
</widget>
</item>
...
...
@@ -255,6 +255,9 @@
<property
name=
"maximum"
>
<double>
99999999999999991611392.000000000000000
</double>
</property>
<property
name=
"singleStep"
>
<double>
0.100000000000000
</double>
</property>
</widget>
</item>
</layout>
...
...
This diff is collapsed.
Click to expand it.
src/sakia/gui/process_cfg_account.py
+
1
−
1
View file @
b988a348
This diff is collapsed.
Click to expand it.
src/sakia/gui/transfer.py
+
24
−
13
View file @
b988a348
...
...
@@ -5,7 +5,7 @@ Created on 2 févr. 2014
"""
import
asyncio
from
PyQt5.QtWidgets
import
QDialog
,
QApplication
from
PyQt5.QtWidgets
import
QDialog
,
QApplication
,
QDialogButtonBox
from
PyQt5.QtCore
import
QRegExp
,
Qt
,
QObject
from
PyQt5.QtGui
import
QRegExpValidator
...
...
@@ -168,19 +168,27 @@ class TransferMoneyDialog(QObject):
@asyncify
async
def
amount_changed
(
self
,
value
):
dividend
=
await
self
.
community
.
dividend
()
ud_block
=
await
self
.
community
.
get_ud_block
()
dividend
=
ud_block
[
'
dividend
'
]
base
=
ud_block
[
'
unitbase
'
]
relative
=
value
/
dividend
self
.
ui
.
spinbox_relative
.
blockSignals
(
True
)
self
.
ui
.
spinbox_relative
.
setValue
(
relative
)
self
.
ui
.
spinbox_relative
.
blockSignals
(
False
)
correct_amount
=
int
(
pow
(
10
,
base
)
*
round
(
float
(
value
)
/
pow
(
10
,
base
)))
self
.
ui
.
button_box
.
button
(
QDialogButtonBox
.
Ok
).
setEnabled
(
correct_amount
==
value
)
@asyncify
async
def
relative_amount_changed
(
self
,
value
):
dividend
=
await
self
.
community
.
dividend
()
ud_block
=
await
self
.
community
.
get_ud_block
()
dividend
=
ud_block
[
'
dividend
'
]
base
=
ud_block
[
'
unitbase
'
]
amount
=
value
*
dividend
amount
=
int
(
pow
(
10
,
base
)
*
round
(
float
(
amount
)
/
pow
(
10
,
base
)))
self
.
ui
.
spinbox_amount
.
blockSignals
(
True
)
self
.
ui
.
spinbox_amount
.
setValue
(
amount
)
self
.
ui
.
spinbox_amount
.
blockSignals
(
False
)
self
.
ui
.
button_box
.
button
(
QDialogButtonBox
.
Ok
).
setEnabled
(
True
)
@asyncify
async
def
change_current_community
(
self
,
index
):
...
...
@@ -192,11 +200,7 @@ class TransferMoneyDialog(QObject):
international_system
=
self
.
app
.
preferences
[
'
international_system_of_units
'
])
self
.
ui
.
label_total
.
setText
(
"
{0}
"
.
format
(
ref_text
))
self
.
ui
.
spinbox_amount
.
setSuffix
(
"
"
+
self
.
community
.
currency
)
amount
=
await
self
.
wallet
.
value
(
self
.
community
)
dividend
=
await
self
.
community
.
dividend
()
relative
=
amount
/
dividend
self
.
ui
.
spinbox_amount
.
setMaximum
(
amount
)
self
.
ui
.
spinbox_relative
.
setMaximum
(
relative
)
await
self
.
refresh_spinboxes
()
@asyncify
async
def
change_displayed_wallet
(
self
,
index
):
...
...
@@ -206,11 +210,18 @@ class TransferMoneyDialog(QObject):
.
diff_localized
(
units
=
True
,
international_system
=
self
.
app
.
preferences
[
'
international_system_of_units
'
])
self
.
ui
.
label_total
.
setText
(
"
{0}
"
.
format
(
ref_text
))
amount
=
await
self
.
wallet
.
value
(
self
.
community
)
dividend
=
await
self
.
community
.
dividend
()
relative
=
amount
/
dividend
self
.
ui
.
spinbox_amount
.
setMaximum
(
amount
)
self
.
ui
.
spinbox_relative
.
setMaximum
(
relative
)
await
self
.
refresh_spinboxes
()
async
def
refresh_spinboxes
(
self
):
max_amount
=
await
self
.
wallet
.
value
(
self
.
community
)
ud_block
=
await
self
.
community
.
get_ud_block
()
dividend
=
ud_block
[
'
dividend
'
]
base
=
ud_block
[
'
unitbase
'
]
max_amount
=
int
(
pow
(
10
,
base
)
*
round
(
float
(
max_amount
)
/
pow
(
10
,
base
)))
max_relative
=
max_amount
/
dividend
self
.
ui
.
spinbox_amount
.
setMaximum
(
max_amount
)
self
.
ui
.
spinbox_relative
.
setMaximum
(
max_relative
)
self
.
ui
.
spinbox_amount
.
setSingleStep
(
pow
(
10
,
base
))
def
recipient_mode_changed
(
self
,
radio
):
self
.
ui
.
edit_pubkey
.
setEnabled
(
radio
==
"
pubkey
"
)
...
...
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