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
c1362522
Commit
c1362522
authored
8 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Add log in transfer to help for issue
#482
parent
a0cdc1e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sakia/gui/transfer.py
+10
-1
10 additions, 1 deletion
src/sakia/gui/transfer.py
with
10 additions
and
1 deletion
src/sakia/gui/transfer.py
+
10
−
1
View file @
c1362522
...
...
@@ -4,6 +4,7 @@ Created on 2 févr. 2014
@author: inso
"""
import
asyncio
import
logging
from
PyQt5.QtWidgets
import
QDialog
,
QApplication
,
QDialogButtonBox
from
PyQt5.QtCore
import
QRegExp
,
Qt
,
QObject
...
...
@@ -110,9 +111,11 @@ class TransferMoneyDialog(QObject):
@asyncify
async
def
accept
(
self
):
logging
.
debug
(
"
Accept transfer action...
"
)
self
.
ui
.
button_box
.
setEnabled
(
False
)
comment
=
self
.
ui
.
edit_message
.
text
()
logging
.
debug
(
"
checking recipient mode...
"
)
if
self
.
ui
.
radio_contact
.
isChecked
():
for
contact
in
self
.
account
.
contacts
:
if
contact
[
'
name
'
]
==
self
.
ui
.
combo_contact
.
currentText
():
...
...
@@ -127,29 +130,34 @@ class TransferMoneyDialog(QObject):
recipient
=
self
.
ui
.
edit_pubkey
.
text
()
amount
=
self
.
ui
.
spinbox_amount
.
value
()
logging
.
debug
(
"
checking amount...
"
)
if
not
amount
:
await
QAsyncMessageBox
.
critical
(
self
.
widget
,
self
.
tr
(
"
Money transfer
"
),
self
.
tr
(
"
No amount. Please give the transfert amount
"
),
QMessageBox
.
Ok
)
self
.
ui
.
button_box
.
setEnabled
(
True
)
return
logging
.
debug
(
"
Showing password dialog...
"
)
password
=
await
self
.
password_asker
.
async_exec
()
if
self
.
password_asker
.
result
()
==
QDialog
.
Rejected
:
self
.
ui
.
button_box
.
setEnabled
(
True
)
return
logging
.
debug
(
"
Setting cursor...
"
)
QApplication
.
setOverrideCursor
(
Qt
.
WaitCursor
)
logging
.
debug
(
"
Send money...
"
)
result
=
await
self
.
wallet
.
send_money
(
self
.
account
.
salt
,
password
,
self
.
community
,
recipient
,
amount
,
comment
)
if
result
[
0
]:
logging
.
debug
(
"
Checking result to display...
"
)
if
self
.
app
.
preferences
[
'
notifications
'
]:
toast
.
display
(
self
.
tr
(
"
Transfer
"
),
self
.
tr
(
"
Success sending money to {0}
"
).
format
(
recipient
))
else
:
await
QAsyncMessageBox
.
information
(
self
.
widget
,
self
.
tr
(
"
Transfer
"
),
self
.
tr
(
"
Success sending money to {0}
"
).
format
(
recipient
))
logging
.
debug
(
"
Restore cursor...
"
)
QApplication
.
restoreOverrideCursor
()
# If we sent back a transaction we cancel the first one
...
...
@@ -158,6 +166,7 @@ class TransferMoneyDialog(QObject):
self
.
app
.
refresh_transfers
.
emit
()
self
.
widget
.
accept
()
else
:
logging
.
debug
(
"
Error occured...
"
)
if
self
.
app
.
preferences
[
'
notifications
'
]:
toast
.
display
(
self
.
tr
(
"
Transfer
"
),
"
Error : {0}
"
.
format
(
result
[
1
]))
else
:
...
...
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