def _on_invite_user_success(self, job): assert job.is_finished() assert job.status == "ok" email = job.ret show_info(self, _("TEXT_USER_INVITE_SUCCESS_EMAIL").format(email=email)) self.reset()
def save(self): self.event_bus.send( ClientEvent.GUI_CONFIG_CHANGED, gui_tray_enabled=self.check_box_tray.isChecked(), gui_language=self.combo_languages.currentData(), gui_check_version_at_startup=self.check_box_check_at_startup. isChecked(), ) show_info(self, _("TEXT_SETTINGS_NEED_RESTART"))
def on_get_file_path_clicked(self): files = self.table_files.selected_files() if len(files) != 1: return url = BackendOrganizationFileLinkAddr.build( self.client.device.organization_addr, self.workspace_fs.workspace_id, self.current_directory / files[0].name, ) desktop.copy_to_clipboard(str(url)) show_info(self, _("TEXT_FILE_LINK_COPIED_TO_CLIPBOARD"))
def button_reencrypt_clicked(self): if self.reencryption_needs: if not self.is_owner: show_info(self, message=_("TEXT_WORKSPACE_ONLY_OWNER_CAN_REENCRYPT")) return self.reencrypt_clicked.emit( self.workspace_id, bool(self.reencryption_needs.user_revoked), bool(self.reencryption_needs.role_revoked), bool(self.reencryption_needs.reencryption_already_in_progress), )
def _on_revoke_success(self, job): assert job.is_finished() assert job.status == "ok" user_info = job.ret show_info( self, _("TEXT_USER_REVOKE_SUCCESS_user").format( user=user_info.short_user_display)) for i in range(self.layout_users.count()): item = self.layout_users.itemAt(i) if item: button = item.widget() if (button and isinstance(button, UserButton) and button.user_info.user_id == user_info.user_id): button.user_info = user_info
def change_password(self): if self.line_edit_password.text( ) != self.line_edit_password_check.text(): show_error(self, _("TEXT_CHANGE_PASSWORD_PASSWORD_MISMATCH")) else: key_file = get_key_file(self.client.config.config_dir, self.client.device) try: change_device_password(key_file, self.line_edit_old_password.text(), self.line_edit_password.text()) show_info(self, _("TEXT_CHANGE_PASSWORD_SUCCESS")) self.accepted.emit() except LocalDeviceCryptoError as exc: show_error(self, _("TEXT_CHANGE_PASSWORD_INVALID_PASSWORD"), exception=exc)
def on_bootstrap_success(self): assert self.bootstrap_job assert self.bootstrap_job.is_finished() assert self.bootstrap_job.status == "ok" self.status = self.bootstrap_job.ret self.bootstrap_job = None if self.dialog: self.dialog.accept() elif QApplication.activeModalWidget(): QApplication.activeModalWidget().accept() else: logger.warning("Cannot close dialog when bootstraping") show_info( parent=self, message=_("TEXT_BOOTSTRAP_ORG_SUCCESS_organization").format( organization=self.addr.organization_id), button_text=_("ACTION_CONTINUE"), )
def _on_finished(self, device, password): save_device_with_password(self.config.config_dir, device, password) show_info(self, _("TEXT_CLAIM_DEVICE_SUCCESSFUL")) self.status = (device, password) self.accepted.emit()
def _on_none_clicked(self): show_info(self, _("TEXT_CLAIM_DEVICE_NONE_CODE_CLICKED")) self.failed.emit(None)
def _on_finished(self): show_info(self, _("TEXT_USER_GREET_SUCCESSFUL")) self.accepted.emit()
def _on_none_clicked(self): show_info(self, _("TEXT_GREET_USER_NONE_CODE_CLICKED")) self.failed.emit(None)
def _on_copy_addr_clicked(self): desktop.copy_to_clipboard(self.invite_addr.to_url()) show_info(self, _("TEXT_GREET_DEVICE_ADDR_COPIED_TO_CLIPBOARD"))