From 9552b41bc47bd3fef6e57470a783bb682ba3ab3f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 29 Oct 2021 18:49:00 +0200 Subject: [PATCH] added base of strictness validation --- openpype/tools/context_dialog/window.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openpype/tools/context_dialog/window.py b/openpype/tools/context_dialog/window.py index 393ac5b8a8..07263e85fc 100644 --- a/openpype/tools/context_dialog/window.py +++ b/openpype/tools/context_dialog/window.py @@ -137,6 +137,10 @@ class ContextDialog(QtWidgets.QDialog): "task": None } + def set_strict(self, strict): + self._strict = strict + self._validate_strict() + def _on_asset_refresh_timer(self): self._assets_widget.refresh() @@ -158,6 +162,15 @@ class ContextDialog(QtWidgets.QDialog): self.accept() + def _validate_strict(self): + if not self._strict: + if not self._ok_btn.isEnabled(): + self._ok_btn.setEnabled(True) + return + + enabled = True + self._ok_btn.setEnabled(enabled) + def set_context(self, project_name=None, asset_name=None): if project_name is None: asset_name = None