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

Message when saving revokation document

parent 734de63f
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ from PyQt5.QtWidgets import QWidget, QMessageBox, QDialog, QPushButton, QTabBar, ...@@ -13,7 +13,7 @@ from PyQt5.QtWidgets import QWidget, QMessageBox, QDialog, QPushButton, QTabBar,
from .graphs.wot_tab import WotTabWidget from .graphs.wot_tab import WotTabWidget
from .widgets import toast from .widgets import toast
from .widgets.dialogs import QAsyncMessageBox, QAsyncFileDialog from .widgets.dialogs import QAsyncMessageBox, QAsyncFileDialog, dialog_async_exec
from .identities_tab import IdentitiesTabWidget from .identities_tab import IdentitiesTabWidget
from .informations_tab import InformationsTabWidget from .informations_tab import InformationsTabWidget
from .network_tab import NetworkTabWidget from .network_tab import NetworkTabWidget
...@@ -186,9 +186,20 @@ class CommunityWidget(QWidget, Ui_CommunityWidget): ...@@ -186,9 +186,20 @@ class CommunityWidget(QWidget, Ui_CommunityWidget):
selected_files = await QAsyncFileDialog.get_save_filename(self, self.tr("Save a revokation document"), selected_files = await QAsyncFileDialog.get_save_filename(self, self.tr("Save a revokation document"),
"", self.tr("All text files (*.txt)")) "", self.tr("All text files (*.txt)"))
if selected_files: if selected_files:
with open(selected_files[0], 'w') as save_file: path = selected_files[0]
if not path.endswith('.txt'):
path = "{0}.txt".format(path)
with open(path, 'w') as save_file:
save_file.write(raw_document) save_file.write(raw_document)
dialog = QMessageBox(QMessageBox.Information, self.tr("Revokation file"),
self.tr("""<div>Your revokation document has been saved.</div>
<div><b>Please keep it in a safe place.</b></div>
The publication of this document will remove your identity from the network.</p>"""), QMessageBox.Ok,
self)
dialog.setTextFormat(Qt.RichText)
await dialog_async_exec(dialog)
@once_at_a_time @once_at_a_time
@asyncify @asyncify
async def refresh_block(self, block_number): async def refresh_block(self, block_number):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment