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
ddf1577a
Commit
ddf1577a
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Added a transfer to wallet feature
parent
71ea58c2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cutecoin/core/watchers/network.py
+0
-1
0 additions, 1 deletion
src/cutecoin/core/watchers/network.py
src/cutecoin/gui/currency_tab.py
+4
-2
4 additions, 2 deletions
src/cutecoin/gui/currency_tab.py
src/cutecoin/gui/wallets_tab.py
+29
-7
29 additions, 7 deletions
src/cutecoin/gui/wallets_tab.py
with
33 additions
and
10 deletions
src/cutecoin/core/watchers/network.py
+
0
−
1
View file @
ddf1577a
...
@@ -19,7 +19,6 @@ class NetworkWatcher(QObject):
...
@@ -19,7 +19,6 @@ class NetworkWatcher(QObject):
@pyqtSlot
()
@pyqtSlot
()
def
watch
(
self
):
def
watch
(
self
):
#self.community.network.moveToThread(self.thread())
self
.
community
.
network
.
start_perpetual_crawling
()
self
.
community
.
network
.
start_perpetual_crawling
()
@pyqtSlot
()
@pyqtSlot
()
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/currency_tab.py
+
4
−
2
View file @
ddf1577a
...
@@ -46,7 +46,8 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
...
@@ -46,7 +46,8 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
self
.
password_asker
)
self
.
password_asker
)
self
.
tab_wallets
=
WalletsTabWidget
(
self
.
app
,
self
.
tab_wallets
=
WalletsTabWidget
(
self
.
app
,
self
.
app
.
current_account
,
self
.
app
.
current_account
,
self
.
community
)
self
.
community
,
self
.
password_asker
)
self
.
tab_network
=
NetworkTabWidget
(
self
.
community
)
self
.
tab_network
=
NetworkTabWidget
(
self
.
community
)
...
@@ -131,7 +132,8 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
...
@@ -131,7 +132,8 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
self
.
tab_wallets
=
WalletsTabWidget
(
self
.
app
,
self
.
tab_wallets
=
WalletsTabWidget
(
self
.
app
,
self
.
app
.
current_account
,
self
.
app
.
current_account
,
self
.
community
)
self
.
community
,
self
.
password_asker
)
self
.
tabs_account
.
addTab
(
self
.
tab_wallets
,
self
.
tabs_account
.
addTab
(
self
.
tab_wallets
,
QIcon
(
'
:/icons/wallet_icon
'
),
QIcon
(
'
:/icons/wallet_icon
'
),
"
Wallets
"
)
"
Wallets
"
)
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/wallets_tab.py
+
29
−
7
View file @
ddf1577a
...
@@ -5,12 +5,13 @@ Created on 15 févr. 2015
...
@@ -5,12 +5,13 @@ Created on 15 févr. 2015
'''
'''
import
logging
import
logging
from
PyQt5.QtWidgets
import
QWidget
,
QMenu
,
QAction
,
QApplication
from
PyQt5.QtWidgets
import
QWidget
,
QMenu
,
QAction
,
QApplication
,
QDialog
from
PyQt5.QtCore
import
QDateTime
,
QModelIndex
,
Qt
from
PyQt5.QtCore
import
QDateTime
,
QModelIndex
,
Qt
from
PyQt5.QtGui
import
QCursor
from
PyQt5.QtGui
import
QCursor
from
..core.person
import
Person
from
..core.person
import
Person
from
..core.wallet
import
Wallet
from
..core.wallet
import
Wallet
from
..models.wallets
import
WalletsTableModel
,
WalletsFilterProxyModel
from
..models.wallets
import
WalletsTableModel
,
WalletsFilterProxyModel
from
.transfer
import
TransferMoneyDialog
from
..tools.exceptions
import
MembershipNotFoundError
from
..tools.exceptions
import
MembershipNotFoundError
from
..gen_resources.wallets_tab_uic
import
Ui_WalletsTab
from
..gen_resources.wallets_tab_uic
import
Ui_WalletsTab
...
@@ -20,7 +21,7 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
...
@@ -20,7 +21,7 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
classdocs
classdocs
'''
'''
def
__init__
(
self
,
app
,
account
,
community
):
def
__init__
(
self
,
app
,
account
,
community
,
password_asker
):
'''
'''
Constructor
Constructor
'''
'''
...
@@ -29,6 +30,7 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
...
@@ -29,6 +30,7 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
self
.
app
=
app
self
.
app
=
app
self
.
account
=
account
self
.
account
=
account
self
.
community
=
community
self
.
community
=
community
self
.
password_asker
=
password_asker
self
.
refresh
()
self
.
refresh
()
...
@@ -82,11 +84,12 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
...
@@ -82,11 +84,12 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
<tr><td align=
"
right
"
><b>{:}</b></td><td>{:}</td></tr>
<tr><td align=
"
right
"
><b>{:}</b></td><td>{:}</td></tr>
</table>
</table>
"""
.
format
(
"
Your money share :
"
,
"
{:.2f}%
"
.
format
(
amount
/
maximum
*
100
),
"""
.
format
(
"
Your money share :
"
,
"
{:.2f}%
"
.
format
(
amount
/
maximum
*
100
),
"
Your part :
"
,
"
{:.2f} {:} in [{:.2f} - {:.2f}] {:}
"
.
format
(
self
.
get_referential_value
(
amount
),
"
Your part :
"
,
"
{:.2f} {:} in [{:.2f} - {:.2f}] {:}
"
self
.
get_referential_name
(),
.
format
(
self
.
get_referential_value
(
amount
),
self
.
get_referential_value
(
0
),
self
.
get_referential_name
(),
self
.
get_referential_value
(
maximum
),
self
.
get_referential_value
(
0
),
self
.
get_referential_name
())
self
.
get_referential_value
(
maximum
),
self
.
get_referential_name
())
)
)
)
)
...
@@ -130,8 +133,17 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
...
@@ -130,8 +133,17 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
copy_pubkey
.
triggered
.
connect
(
self
.
copy_pubkey_to_clipboard
)
copy_pubkey
.
triggered
.
connect
(
self
.
copy_pubkey_to_clipboard
)
copy_pubkey
.
setData
(
pubkey
)
copy_pubkey
.
setData
(
pubkey
)
transfer_to
=
QMenu
()
transfer_to
.
setTitle
(
"
Transfer to...
"
)
for
w
in
self
.
account
.
wallets
:
transfer_action
=
QAction
(
w
.
name
,
self
)
transfer_action
.
triggered
.
connect
(
self
.
transfer_to_wallet
)
transfer_action
.
setData
(
w
)
transfer_to
.
addAction
(
transfer_action
)
menu
.
addAction
(
rename
)
menu
.
addAction
(
rename
)
menu
.
addAction
(
copy_pubkey
)
menu
.
addAction
(
copy_pubkey
)
menu
.
addMenu
(
transfer_to
)
# Show the context menu.
# Show the context menu.
menu
.
exec_
(
QCursor
.
pos
())
menu
.
exec_
(
QCursor
.
pos
())
...
@@ -151,3 +163,13 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
...
@@ -151,3 +163,13 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
clipboard
.
setText
(
data
.
pubkey
)
clipboard
.
setText
(
data
.
pubkey
)
elif
data
.
__class__
is
str
:
elif
data
.
__class__
is
str
:
clipboard
.
setText
(
data
)
clipboard
.
setText
(
data
)
def
transfer_to_wallet
(
self
):
wallet
=
self
.
sender
().
data
()
dialog
=
TransferMoneyDialog
(
self
.
account
,
self
.
password_asker
)
dialog
.
edit_pubkey
.
setText
(
wallet
.
pubkey
)
dialog
.
combo_community
.
setCurrentText
(
self
.
community
.
name
)
dialog
.
radio_pubkey
.
setChecked
(
True
)
if
dialog
.
exec_
()
==
QDialog
.
Accepted
:
currency_tab
=
self
.
window
().
currencies_tabwidget
.
currentWidget
()
currency_tab
.
table_history
.
model
().
invalidate
()
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