Skip to content
Snippets Groups Projects
Commit 585c5c44 authored by inso's avatar inso
Browse files

Added contacts maangement

parent 36b15d69
Branches
Tags
No related merge requests found
......@@ -143,10 +143,10 @@ class BMAEndpoint(Endpoint):
def inline(self):
return "BASIC_MERKLED_API{DNS}{IPv4}{IPv6}{PORT}" \
.format(DNS=(self.server if self.server else ""),
IPv4=(self.ipv4 if self.ipv4 else ""),
IPv6=(self.ipv6 if self.ipv6 else ""),
PORT=(self.port if self.port else ""))
.format(DNS=(" {0}".format(self.server) if self.server else ""),
IPv4=(" {0}".format(self.ipv4) if self.ipv4 else ""),
IPv6=(" {0}".format(self.ipv6) if self.ipv6 else ""),
PORT=(" {0}".format(self.port) if self.port else ""))
def conn_handler(self):
if self.server:
......
......@@ -92,7 +92,7 @@
<sender>edit_pubkey</sender>
<signal>textChanged(QString)</signal>
<receiver>AddContactDialog</receiver>
<slot>fingerprint_edited()</slot>
<slot>pubkey_edited()</slot>
<hints>
<hint type="sourcelabel">
<x>145</x>
......
......@@ -7,7 +7,6 @@ Created on 1 févr. 2014
from ucoinpy.api import bma
from ucoinpy.api.bma import ConnectionHandler
from ucoinpy.documents.peer import Peer
from ucoinpy.key import SigningKey
import logging
from .wallet import Wallet
from .community import Community
......
......@@ -11,14 +11,12 @@ from ucoinpy.documents.transaction import InputSource, OutputSource, Transaction
from ucoinpy.key import SigningKey
from ..tools.exceptions import NotEnoughMoneyError
import logging
import base64
class Wallet(object):
'''
A wallet is list of coins.
It's only used to sort coins.
A wallet is used to manage money with a unique key.
'''
def __init__(self, walletid, pubkey, currency, name):
......
......@@ -33,6 +33,7 @@ class AddContactDialog(QDialog, Ui_AddContactDialog):
pubkey = self.edit_pubkey.text()
self.account.add_contact(Person(name, pubkey))
self.main_window.menu_contacts_list.addAction(name)
self.main_window.app.save(self.account)
self.close()
def name_edited(self, new_name):
......@@ -43,4 +44,4 @@ class AddContactDialog(QDialog, Ui_AddContactDialog):
pattern = re.compile("([1-9A-Za-z][^OIl]{42,45})")
self.button_box.button(
QDialogButtonBox.Ok).setEnabled(
pattern.match(new_pubkey))
pattern.match(new_pubkey)is not None)
......@@ -40,6 +40,11 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
def accept(self):
message = self.edit_message.text()
recipient = ""
if self.radio_contact.isEnabled():
index = self.combo_contact.currentIndex()
recipient = self.sender.contacts[index].pubkey
else:
recipient = self.edit_key_fingerprint.text()
amount = self.spinbox_amount.value()
password = QInputDialog.getText(self, "Wallet password",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment