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

Add the possibility to publish the UID later + Toasts instead of MessageBox

parent f18dd360
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......@@ -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,7 +46,7 @@ class CertificationDialog(QDialog, Ui_CertificationDialog):
try:
QApplication.setOverrideCursor(Qt.WaitCursor)
self.account.certify(password, self.community, pubkey)
QMessageBox.information(self, self.tr("Certification"),
toast.display(self.tr("Certification"),
self.tr("Success certifying {0} from {1}").format(pubkey,
self.community.currency))
except ValueError as e:
......
......@@ -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
......
......@@ -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,7 +75,7 @@ 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"),
toast.display(self.tr("Money transfer"),
self.tr("Success transfering {0} {1} to {2}").format(amount,
self.community.currency,
recipient))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment