diff --git a/res/ui/community_tab.ui b/res/ui/community_tab.ui index c7fa18c7e511196510002d9b823ed9616ad0c004..82fa382fbb1a3b2675bb43388002ed364df17d24 100644 --- a/res/ui/community_tab.ui +++ b/res/ui/community_tab.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>431</width> + <width>457</width> <height>369</height> </rect> </property> @@ -218,11 +218,28 @@ </hint> </hints> </connection> + <connection> + <sender>button_publish_uid</sender> + <signal>clicked()</signal> + <receiver>CommunityTabWidget</receiver> + <slot>publish_uid()</slot> + <hints> + <hint type="sourcelabel"> + <x>123</x> + <y>334</y> + </hint> + <hint type="destinationlabel"> + <x>228</x> + <y>184</y> + </hint> + </hints> + </connection> </connections> <slots> <slot>identity_context_menu(QPoint)</slot> <slot>send_membership_demand()</slot> <slot>send_membership_leaving()</slot> <slot>search_text()</slot> + <slot>publish_uid()</slot> </slots> </ui> diff --git a/src/cutecoin/gui/certification.py b/src/cutecoin/gui/certification.py index ef778167e77f726302098bcc7b39ad599da5812a..d72e4491c2ec25a248290dae9278256fd59953d5 100644 --- a/src/cutecoin/gui/certification.py +++ b/src/cutecoin/gui/certification.py @@ -7,6 +7,7 @@ from PyQt5.QtWidgets import QDialog, QMessageBox, QDialogButtonBox, QApplication from PyQt5.QtCore import Qt from ..tools.exceptions import NoPeerAvailable from ..gen_resources.certification_uic import Ui_CertificationDialog +from . import toast class CertificationDialog(QDialog, Ui_CertificationDialog): @@ -45,8 +46,8 @@ class CertificationDialog(QDialog, Ui_CertificationDialog): try: QApplication.setOverrideCursor(Qt.WaitCursor) self.account.certify(password, self.community, pubkey) - QMessageBox.information(self, self.tr("Certification"), - self.tr("Success certifying {0} from {1}").format(pubkey, + toast.display(self.tr("Certification"), + self.tr("Success certifying {0} from {1}").format(pubkey, self.community.currency)) except ValueError as e: QMessageBox.critical(self, self.tr("Certification"), diff --git a/src/cutecoin/gui/community_tab.py b/src/cutecoin/gui/community_tab.py index 2def3e5d80c3f5be84f50f0712d336a0b4be9bb4..f42db2b874d05d51137091f7d4b64c1f57799cab 100644 --- a/src/cutecoin/gui/community_tab.py +++ b/src/cutecoin/gui/community_tab.py @@ -230,6 +230,33 @@ The process to join back the community later will have to be done again.""") "{0}".format(e), QMessageBox.Ok) + def publish_uid(self): + reply = QMessageBox.warning(self, self.tr("Warning"), + self.tr("""Are you sure ? +Publishing your UID cannot be canceled.""") +.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) + if reply == QMessageBox.Ok: + password_asker = PasswordAskerDialog(self.account) + password = password_asker.exec_() + if password_asker.result() == QDialog.Rejected: + return + + try: + self.account.send_selfcert(password, self.community) + toast.display(self.tr("UID Publishing"), + self.tr("Success publishing your UID")) + except ValueError as e: + QMessageBox.critical(self, self.tr("Leaving demand error"), + e.message) + except NoPeerAvailable as e: + QMessageBox.critical(self, self.tr("Network error"), + self.tr("Couldn't connect to network : {0}").format(e), + QMessageBox.Ok) + except Exception as e: + QMessageBox.critical(self, self.tr("Error"), + "{0}".format(e), + QMessageBox.Ok) + def search_text(self): """ Search text and display found identities diff --git a/src/cutecoin/gui/transfer.py b/src/cutecoin/gui/transfer.py index 2600560685b249349a14429a6e9697cea8067659..ad0aa4a2991db77427e2607ea0f792d99fd89f17 100644 --- a/src/cutecoin/gui/transfer.py +++ b/src/cutecoin/gui/transfer.py @@ -9,6 +9,7 @@ from PyQt5.QtGui import QRegExpValidator from ..tools.exceptions import NotEnoughMoneyError, NoPeerAvailable from ..gen_resources.transfer_uic import Ui_TransferMoneyDialog +from . import toast class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog): @@ -74,8 +75,8 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog): QApplication.processEvents() self.wallet.send_money(self.account.salt, password, self.community, recipient, amount, comment) - QMessageBox.information(self, self.tr("Money transfer"), - self.tr("Success transfering {0} {1} to {2}").format(amount, + toast.display(self.tr("Money transfer"), + self.tr("Success transfering {0} {1} to {2}").format(amount, self.community.currency, recipient)) except ValueError as e: