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

Enhancement #323

parent 83030f6a
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,8 @@ class CertificationDialog(QDialog, Ui_CertificationDialog):
for community in self.account.communities:
self.combo_community.addItem(community.currency)
for contact in certifier.contacts:
self.combo_contact.addItem(contact['name'])
for contact_name in sorted([c['name'] for c in certifier.contacts], key=str.lower):
self.combo_contact.addItem(contact_name)
if len(certifier.contacts) == 0:
self.radio_pubkey.setChecked(True)
self.radio_contact.setEnabled(False)
......@@ -55,8 +55,10 @@ class CertificationDialog(QDialog, Ui_CertificationDialog):
@asyncio.coroutine
def accept(self):
if self.radio_contact.isChecked():
index = self.combo_contact.currentIndex()
pubkey = self.account.contacts[index]['pubkey']
for contact in self.account.contacts:
if contact['name'] == self.combo_contact.currentText():
pubkey = contact['pubkey']
break
else:
pubkey = self.edit_pubkey.text()
......
......@@ -51,8 +51,8 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
for wallet in self.account.wallets:
self.combo_wallets.addItem(wallet.name)
for contact in sender.contacts:
self.combo_contact.addItem(contact['name'])
for contact_name in sorted([c['name'] for c in sender.contacts], key=str.lower):
self.combo_contact.addItem(contact_name)
if len(self.account.contacts) == 0:
self.combo_contact.setEnabled(False)
......@@ -96,8 +96,10 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
comment = self.edit_message.text()
if self.radio_contact.isChecked():
index = self.combo_contact.currentIndex()
recipient = self.account.contacts[index]['pubkey']
for contact in self.account.contacts:
if contact['name'] == self.combo_contact.currentText():
recipient = contact['pubkey']
break
else:
recipient = self.edit_pubkey.text()
amount = self.spinbox_amount.value()
......
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