def create_workspace_clicked(self): workspace_name = get_text_input( parent=self, title=_("TEXT_WORKSPACE_NEW_TITLE"), message=_("TEXT_WORKSPACE_NEW_INSTRUCTIONS"), placeholder=_("TEXT_WORKSPACE_NEW_PLACEHOLDER"), button_text=_("ACTION_WORKSPACE_NEW_CREATE"), validator=validators.WorkspaceNameValidator(), ) if not workspace_name: return self.jobs_ctx.submit_job( ThreadSafeQtSignal(self, "create_success", QtToTrioJob), ThreadSafeQtSignal(self, "create_error", QtToTrioJob), _do_workspace_create, core=self.core, workspace_name=workspace_name, )
def rename_workspace(self, workspace_button): new_name = get_text_input( self, _("TEXT_WORKSPACE_RENAME_TITLE"), _("TEXT_WORKSPACE_RENAME_INSTRUCTIONS"), placeholder=_("TEXT_WORKSPACE_RENAME_PLACEHOLDER"), default_text=workspace_button.name, button_text=_("ACTION_WORKSPACE_RENAME_CONFIRM"), validator=validators.WorkspaceNameValidator(), ) if not new_name: return self.jobs_ctx.submit_job( ThreadSafeQtSignal(self, "rename_success", QtToTrioJob), ThreadSafeQtSignal(self, "rename_error", QtToTrioJob), _do_workspace_rename, core=self.core, workspace_id=workspace_button.workspace_fs.workspace_id, new_name=new_name, button=workspace_button, )