def import_(self): path_to_open = open_dialog(self._view, "Импорт публичного ключа") if not path_to_open: return with open(path_to_open) as file: public_key = file.read() path_to_open = open_dialog(self._view, "Импорт приватного ключа") if not path_to_open: return with open(path_to_open) as file: private_key = file.read() CipherKeyPair.create(account=self._current_account, address=self._view.address, public=public_key, private=private_key) self._view.accept()
def import_(self): path_to_open = open_dialog(self._view, "Импорт ключа") if not path_to_open: return with open(path_to_open) as file: public_key = file.read() CipherForeignKey.create(account=self._current_account, address=self._view.address, key=public_key) self._view.accept()
def setups(self): # Setup UI self.ui.action_about.triggered.connect( lambda: open_dialog(Ui_dialog_about)) self.ui.action_new.triggered.connect( lambda: DialogCreateDataFile(parent=self).exec()) self.ui.action_open.triggered.connect(self.open_existing_file) self.ui.action_close.triggered.connect(self.close_current_file) self.ui.action_exit.triggered.connect(self.close_app) if self.data_path == "" or not os.path.exists(self.data_path): self.setup_options_menu() self.ui.action_close.setEnabled(False) else: self.setup_tabs() self.ui.action_close.setEnabled(True) self.update_window_title()
def attach_file(self): path_to_open = open_dialog(self._view, "Загрузка вложения") if path_to_open: self._view.set_attach(path_to_open)
def addfile(ev): file=utils.open_dialog(desktop.main_window,'*.*') if file: brw['files'].append(file)