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

Added contacts maangement

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