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
Snippets
Deploy
Releases
Container Registry
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
Show more breadcrumbs
Santiago
sakia
Commits
b5b4dae4
Commit
b5b4dae4
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issue
#64
parent
1d5a1caf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
res/ui/transfer.ui
+5
-1
5 additions, 1 deletion
res/ui/transfer.ui
src/cutecoin/core/transfer.py
+1
-1
1 addition, 1 deletion
src/cutecoin/core/transfer.py
src/cutecoin/gui/transfer.py
+21
-15
21 additions, 15 deletions
src/cutecoin/gui/transfer.py
with
27 additions
and
17 deletions
res/ui/transfer.ui
+
5
−
1
View file @
b5b4dae4
...
...
@@ -160,7 +160,11 @@
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<item>
<widget
class=
"QLineEdit"
name=
"edit_message"
/>
<widget
class=
"QLineEdit"
name=
"edit_message"
>
<property
name=
"inputMask"
>
<string/>
</property>
</widget>
</item>
</layout>
</widget>
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/core/transfer.py
+
1
−
1
View file @
b5b4dae4
...
...
@@ -71,7 +71,7 @@ class Transfer(object):
post_args
=
{
'
transaction
'
:
self
.
txdoc
.
signed_raw
()})
self
.
state
=
Transfer
.
AWAITING
except
ValueError
as
e
:
if
'
400
'
in
e
:
if
'
400
'
in
str
(
e
)
:
self
.
state
=
Transfer
.
REFUSED
raise
finally
:
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/transfer.py
+
21
−
15
View file @
b5b4dae4
...
...
@@ -4,6 +4,8 @@ Created on 2 févr. 2014
@author: inso
'''
from
PyQt5.QtWidgets
import
QDialog
,
QMessageBox
from
PyQt5.QtCore
import
QRegExp
from
PyQt5.QtGui
import
QRegExpValidator
,
QValidator
from
..tools.exceptions
import
NotEnoughMoneyError
,
NoPeerAvailable
from
..gen_resources.transfer_uic
import
Ui_TransferMoneyDialog
...
...
@@ -23,24 +25,28 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
'''
super
().
__init__
()
self
.
setupUi
(
self
)
self
.
sender
=
sender
self
.
account
=
sender
self
.
password_asker
=
password_asker
self
.
recipient_trusts
=
[]
self
.
wallet
=
None
self
.
community
=
self
.
sender
.
communities
[
0
]
self
.
wallet
=
self
.
sender
.
wallets
[
0
]
self
.
community
=
self
.
account
.
communities
[
0
]
self
.
wallet
=
self
.
account
.
wallets
[
0
]
self
.
dividend
=
self
.
community
.
dividend
for
community
in
self
.
sender
.
communities
:
regexp
=
QRegExp
(
'
^([ a-zA-Z0-9-_:/;*?\[\]\(\)
\\
\?!^+=@&~#{}|<>%.]{0,255})$
'
)
validator
=
QRegExpValidator
(
regexp
)
self
.
edit_message
.
setValidator
(
validator
)
for
community
in
self
.
account
.
communities
:
self
.
combo_community
.
addItem
(
community
.
currency
)
for
wallet
in
self
.
sender
.
wallets
:
for
wallet
in
self
.
account
.
wallets
:
self
.
combo_wallets
.
addItem
(
wallet
.
name
)
for
contact
in
sender
.
contacts
:
self
.
combo_contact
.
addItem
(
contact
.
name
)
if
len
(
self
.
sender
.
contacts
)
==
0
:
if
len
(
self
.
account
.
contacts
)
==
0
:
self
.
combo_contact
.
setEnabled
(
False
)
self
.
radio_contact
.
setEnabled
(
False
)
self
.
radio_pubkey
.
setChecked
(
True
)
...
...
@@ -50,7 +56,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
if
self
.
radio_contact
.
isChecked
():
index
=
self
.
combo_contact
.
currentIndex
()
recipient
=
self
.
sender
.
contacts
[
index
].
pubkey
recipient
=
self
.
account
.
contacts
[
index
].
pubkey
else
:
recipient
=
self
.
edit_pubkey
.
text
()
amount
=
self
.
spinbox_amount
.
value
()
...
...
@@ -66,7 +72,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
return
try
:
self
.
wallet
.
send_money
(
self
.
sender
.
salt
,
password
,
self
.
community
,
self
.
wallet
.
send_money
(
self
.
account
.
salt
,
password
,
self
.
community
,
recipient
,
amount
,
comment
)
QMessageBox
.
information
(
self
,
"
Money transfer
"
,
"
Success transfering {0} {1} to {2}
"
.
format
(
amount
,
...
...
@@ -88,7 +94,7 @@ Please try again later""")
return
except
Exception
as
e
:
QMessageBox
.
critical
(
self
,
"
Error
"
,
"
{0}
"
.
format
(
e
),
"
{0}
"
.
format
(
str
(
e
)
),
QMessageBox
.
Ok
)
return
super
().
accept
()
...
...
@@ -108,11 +114,11 @@ Please try again later""")
self
.
spinbox_amount
.
blockSignals
(
False
)
def
change_current_community
(
self
,
index
):
self
.
community
=
self
.
sender
.
communities
[
index
]
self
.
community
=
self
.
account
.
communities
[
index
]
self
.
dividend
=
self
.
community
.
dividend
amount
=
self
.
wallet
.
value
(
self
.
community
)
ref_amount
=
self
.
sender
.
units_to_ref
(
amount
,
self
.
community
)
ref_name
=
self
.
sender
.
ref_name
(
self
.
community
.
currency
)
ref_amount
=
self
.
account
.
units_to_ref
(
amount
,
self
.
community
)
ref_name
=
self
.
account
.
ref_name
(
self
.
community
.
currency
)
self
.
label_total
.
setText
(
"
{0} {1}
"
.
format
(
ref_amount
,
ref_name
))
self
.
spinbox_amount
.
setSuffix
(
"
"
+
self
.
community
.
currency
)
self
.
spinbox_amount
.
setValue
(
0
)
...
...
@@ -122,10 +128,10 @@ Please try again later""")
self
.
spinbox_relative
.
setMaximum
(
relative
)
def
change_displayed_wallet
(
self
,
index
):
self
.
wallet
=
self
.
sender
.
wallets
[
index
]
self
.
wallet
=
self
.
account
.
wallets
[
index
]
amount
=
self
.
wallet
.
value
(
self
.
community
)
ref_amount
=
self
.
sender
.
units_to_ref
(
amount
,
self
.
community
)
ref_name
=
self
.
sender
.
ref_name
(
self
.
community
.
currency
)
ref_amount
=
self
.
account
.
units_to_ref
(
amount
,
self
.
community
)
ref_name
=
self
.
account
.
ref_name
(
self
.
community
.
currency
)
self
.
label_total
.
setText
(
"
{0} {1}
"
.
format
(
ref_amount
,
ref_name
))
self
.
spinbox_amount
.
setValue
(
0
)
amount
=
self
.
wallet
.
value
(
self
.
community
)
...
...
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