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
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
Tags containing commit
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 @@
...
@@ -160,7 +160,11 @@
</property>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<item>
<item>
<widget
class=
"QLineEdit"
name=
"edit_message"
/>
<widget
class=
"QLineEdit"
name=
"edit_message"
>
<property
name=
"inputMask"
>
<string/>
</property>
</widget>
</item>
</item>
</layout>
</layout>
</widget>
</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):
...
@@ -71,7 +71,7 @@ class Transfer(object):
post_args
=
{
'
transaction
'
:
self
.
txdoc
.
signed_raw
()})
post_args
=
{
'
transaction
'
:
self
.
txdoc
.
signed_raw
()})
self
.
state
=
Transfer
.
AWAITING
self
.
state
=
Transfer
.
AWAITING
except
ValueError
as
e
:
except
ValueError
as
e
:
if
'
400
'
in
e
:
if
'
400
'
in
str
(
e
)
:
self
.
state
=
Transfer
.
REFUSED
self
.
state
=
Transfer
.
REFUSED
raise
raise
finally
:
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
...
@@ -4,6 +4,8 @@ Created on 2 févr. 2014
@author: inso
@author: inso
'''
'''
from
PyQt5.QtWidgets
import
QDialog
,
QMessageBox
from
PyQt5.QtWidgets
import
QDialog
,
QMessageBox
from
PyQt5.QtCore
import
QRegExp
from
PyQt5.QtGui
import
QRegExpValidator
,
QValidator
from
..tools.exceptions
import
NotEnoughMoneyError
,
NoPeerAvailable
from
..tools.exceptions
import
NotEnoughMoneyError
,
NoPeerAvailable
from
..gen_resources.transfer_uic
import
Ui_TransferMoneyDialog
from
..gen_resources.transfer_uic
import
Ui_TransferMoneyDialog
...
@@ -23,24 +25,28 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
...
@@ -23,24 +25,28 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
'''
'''
super
().
__init__
()
super
().
__init__
()
self
.
setupUi
(
self
)
self
.
setupUi
(
self
)
self
.
sender
=
sender
self
.
account
=
sender
self
.
password_asker
=
password_asker
self
.
password_asker
=
password_asker
self
.
recipient_trusts
=
[]
self
.
recipient_trusts
=
[]
self
.
wallet
=
None
self
.
wallet
=
None
self
.
community
=
self
.
sender
.
communities
[
0
]
self
.
community
=
self
.
account
.
communities
[
0
]
self
.
wallet
=
self
.
sender
.
wallets
[
0
]
self
.
wallet
=
self
.
account
.
wallets
[
0
]
self
.
dividend
=
self
.
community
.
dividend
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
)
self
.
combo_community
.
addItem
(
community
.
currency
)
for
wallet
in
self
.
sender
.
wallets
:
for
wallet
in
self
.
account
.
wallets
:
self
.
combo_wallets
.
addItem
(
wallet
.
name
)
self
.
combo_wallets
.
addItem
(
wallet
.
name
)
for
contact
in
sender
.
contacts
:
for
contact
in
sender
.
contacts
:
self
.
combo_contact
.
addItem
(
contact
.
name
)
self
.
combo_contact
.
addItem
(
contact
.
name
)
if
len
(
self
.
sender
.
contacts
)
==
0
:
if
len
(
self
.
account
.
contacts
)
==
0
:
self
.
combo_contact
.
setEnabled
(
False
)
self
.
combo_contact
.
setEnabled
(
False
)
self
.
radio_contact
.
setEnabled
(
False
)
self
.
radio_contact
.
setEnabled
(
False
)
self
.
radio_pubkey
.
setChecked
(
True
)
self
.
radio_pubkey
.
setChecked
(
True
)
...
@@ -50,7 +56,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
...
@@ -50,7 +56,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
if
self
.
radio_contact
.
isChecked
():
if
self
.
radio_contact
.
isChecked
():
index
=
self
.
combo_contact
.
currentIndex
()
index
=
self
.
combo_contact
.
currentIndex
()
recipient
=
self
.
sender
.
contacts
[
index
].
pubkey
recipient
=
self
.
account
.
contacts
[
index
].
pubkey
else
:
else
:
recipient
=
self
.
edit_pubkey
.
text
()
recipient
=
self
.
edit_pubkey
.
text
()
amount
=
self
.
spinbox_amount
.
value
()
amount
=
self
.
spinbox_amount
.
value
()
...
@@ -66,7 +72,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
...
@@ -66,7 +72,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
return
return
try
:
try
:
self
.
wallet
.
send_money
(
self
.
sender
.
salt
,
password
,
self
.
community
,
self
.
wallet
.
send_money
(
self
.
account
.
salt
,
password
,
self
.
community
,
recipient
,
amount
,
comment
)
recipient
,
amount
,
comment
)
QMessageBox
.
information
(
self
,
"
Money transfer
"
,
QMessageBox
.
information
(
self
,
"
Money transfer
"
,
"
Success transfering {0} {1} to {2}
"
.
format
(
amount
,
"
Success transfering {0} {1} to {2}
"
.
format
(
amount
,
...
@@ -88,7 +94,7 @@ Please try again later""")
...
@@ -88,7 +94,7 @@ Please try again later""")
return
return
except
Exception
as
e
:
except
Exception
as
e
:
QMessageBox
.
critical
(
self
,
"
Error
"
,
QMessageBox
.
critical
(
self
,
"
Error
"
,
"
{0}
"
.
format
(
e
),
"
{0}
"
.
format
(
str
(
e
)
),
QMessageBox
.
Ok
)
QMessageBox
.
Ok
)
return
return
super
().
accept
()
super
().
accept
()
...
@@ -108,11 +114,11 @@ Please try again later""")
...
@@ -108,11 +114,11 @@ Please try again later""")
self
.
spinbox_amount
.
blockSignals
(
False
)
self
.
spinbox_amount
.
blockSignals
(
False
)
def
change_current_community
(
self
,
index
):
def
change_current_community
(
self
,
index
):
self
.
community
=
self
.
sender
.
communities
[
index
]
self
.
community
=
self
.
account
.
communities
[
index
]
self
.
dividend
=
self
.
community
.
dividend
self
.
dividend
=
self
.
community
.
dividend
amount
=
self
.
wallet
.
value
(
self
.
community
)
amount
=
self
.
wallet
.
value
(
self
.
community
)
ref_amount
=
self
.
sender
.
units_to_ref
(
amount
,
self
.
community
)
ref_amount
=
self
.
account
.
units_to_ref
(
amount
,
self
.
community
)
ref_name
=
self
.
sender
.
ref_name
(
self
.
community
.
currency
)
ref_name
=
self
.
account
.
ref_name
(
self
.
community
.
currency
)
self
.
label_total
.
setText
(
"
{0} {1}
"
.
format
(
ref_amount
,
ref_name
))
self
.
label_total
.
setText
(
"
{0} {1}
"
.
format
(
ref_amount
,
ref_name
))
self
.
spinbox_amount
.
setSuffix
(
"
"
+
self
.
community
.
currency
)
self
.
spinbox_amount
.
setSuffix
(
"
"
+
self
.
community
.
currency
)
self
.
spinbox_amount
.
setValue
(
0
)
self
.
spinbox_amount
.
setValue
(
0
)
...
@@ -122,10 +128,10 @@ Please try again later""")
...
@@ -122,10 +128,10 @@ Please try again later""")
self
.
spinbox_relative
.
setMaximum
(
relative
)
self
.
spinbox_relative
.
setMaximum
(
relative
)
def
change_displayed_wallet
(
self
,
index
):
def
change_displayed_wallet
(
self
,
index
):
self
.
wallet
=
self
.
sender
.
wallets
[
index
]
self
.
wallet
=
self
.
account
.
wallets
[
index
]
amount
=
self
.
wallet
.
value
(
self
.
community
)
amount
=
self
.
wallet
.
value
(
self
.
community
)
ref_amount
=
self
.
sender
.
units_to_ref
(
amount
,
self
.
community
)
ref_amount
=
self
.
account
.
units_to_ref
(
amount
,
self
.
community
)
ref_name
=
self
.
sender
.
ref_name
(
self
.
community
.
currency
)
ref_name
=
self
.
account
.
ref_name
(
self
.
community
.
currency
)
self
.
label_total
.
setText
(
"
{0} {1}
"
.
format
(
ref_amount
,
ref_name
))
self
.
label_total
.
setText
(
"
{0} {1}
"
.
format
(
ref_amount
,
ref_name
))
self
.
spinbox_amount
.
setValue
(
0
)
self
.
spinbox_amount
.
setValue
(
0
)
amount
=
self
.
wallet
.
value
(
self
.
community
)
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