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

Integrating fixes from mocks branch

parent d0bfe589
Branches
Tags
No related merge requests found
......@@ -298,7 +298,7 @@ class Account(QObject):
key = SigningKey(self.salt, password)
selfcert.sign([key])
logging.debug("Key publish : {0}".format(selfcert.signed_raw()))
replies = community.broadcast(qtbma.wot.Add, {}, {'pubkey': self.pubkey,
replies = community.bma_access.broadcast(qtbma.wot.Add, {}, {'pubkey': self.pubkey,
'self_': selfcert.signed_raw(),
'other': []})
for r in replies:
......
......@@ -126,7 +126,14 @@ class API(object):
logging.debug("POST : {0}".format(kwargs))
post_data = QUrlQuery()
for k, v in kwargs.items():
post_data.addQueryItem(k.replace("+", "%2b"), v.replace("+", "%2b"))
if type(k) is str:
k = k.replace("+", "%2b")
if type(v) is str:
v = v.replace("+", "%2b")
else:
v = json.dumps(v)
v = v.replace("+", "%2b")
post_data.addQueryItem(k, v)
url = QUrl(self.reverse_url(path))
url.setQuery(post_data)
......
......@@ -210,13 +210,23 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog):
QApplication.restoreOverrideCursor()
self.add_community_and_close()
@pyqtSlot(int, str)
def handle_broadcast(self, error_code, text):
if self.app.preferences['notifications']:
toast.display(self.tr("UID broadcast"), self.tr("Identity broadcasted to the network"))
else:
QMessageBox.information(self, self.tr("UID broadcast"), self.tr("Identity broadcasted to the network"))
self.account.certification_broadcasted.disconnect()
self.account.broadcast_error.disconnect(self.handle_error)
QApplication.restoreOverrideCursor()
@pyqtSlot(int, str)
def handle_error(self, error_code, text):
if self.app.preferences['notifications']:
toast.display(self.tr("Error"), self.tr("{0} : {1}".format(error_code, text)))
else:
QMessageBox.critical(self, self.tr("Error"), self.tr("{0} : {1}".format(error_code, text)))
self.account.certification_broadcasted.disconnect()
self.account.selfcert_broadcasted.disconnect()
self.account.broadcast_error.disconnect(self.handle_error)
QApplication.restoreOverrideCursor()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment