mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
removed with_arguments key from path schema
This commit is contained in:
parent
f4a3f43088
commit
ea75b495a0
3 changed files with 9 additions and 42 deletions
|
|
@ -366,13 +366,8 @@ class PathInput(InputEntity):
|
|||
schema_types = ["path-input"]
|
||||
|
||||
def _item_initalization(self):
|
||||
self.with_arguments = self.schema_data.get("with_arguments", False)
|
||||
if self.with_arguments:
|
||||
self.valid_value_types = (list, )
|
||||
self.value_on_not_set = ["", ""]
|
||||
else:
|
||||
self.valid_value_types = (STRING_TYPE, )
|
||||
self.value_on_not_set = ""
|
||||
self.valid_value_types = (STRING_TYPE, )
|
||||
self.value_on_not_set = ""
|
||||
|
||||
|
||||
class RawJsonEntity(InputEntity):
|
||||
|
|
|
|||
|
|
@ -53,15 +53,13 @@ class PathEntity(ItemEntity):
|
|||
|
||||
self.multiplatform = self.schema_data.get("multiplatform", False)
|
||||
self.multipath = self.schema_data.get("multipath", False)
|
||||
self.with_arguments = self.schema_data.get("with_arguments", False)
|
||||
|
||||
# Create child object
|
||||
if not self.multiplatform and not self.multipath:
|
||||
valid_value_types = (STRING_TYPE, )
|
||||
item_schema = {
|
||||
"type": "path-input",
|
||||
"key": self.key,
|
||||
"with_arguments": self.with_arguments
|
||||
"key": self.key
|
||||
}
|
||||
|
||||
elif not self.multiplatform:
|
||||
|
|
@ -69,10 +67,7 @@ class PathEntity(ItemEntity):
|
|||
item_schema = {
|
||||
"type": "list",
|
||||
"key": self.key,
|
||||
"object_type": {
|
||||
"type": "path-input",
|
||||
"with_arguments": self.with_arguments
|
||||
}
|
||||
"object_type": "path-input"
|
||||
}
|
||||
|
||||
else:
|
||||
|
|
@ -91,13 +86,9 @@ class PathEntity(ItemEntity):
|
|||
}
|
||||
if self.multipath:
|
||||
child_item["type"] = "list"
|
||||
child_item["object_type"] = {
|
||||
"type": "path-input",
|
||||
"with_arguments": self.with_arguments
|
||||
}
|
||||
child_item["object_type"] = "path-input"
|
||||
else:
|
||||
child_item["type"] = "path-input"
|
||||
child_item["with_arguments"] = self.with_arguments
|
||||
|
||||
item_schema["children"].append(child_item)
|
||||
|
||||
|
|
|
|||
|
|
@ -623,40 +623,21 @@ class PathWidget(BaseWidget):
|
|||
class PathInputWidget(InputWidget):
|
||||
def _add_inputs_to_layout(self):
|
||||
self.input_field = QtWidgets.QLineEdit(self.content_widget)
|
||||
self.args_input_field = None
|
||||
if self.entity.with_arguments:
|
||||
self.input_field.setPlaceholderText("Executable path")
|
||||
self.args_input_field = QtWidgets.QLineEdit(self)
|
||||
self.args_input_field.setPlaceholderText("Arguments")
|
||||
self.input_field.setPlaceholderText("Executable path")
|
||||
|
||||
self.setFocusProxy(self.input_field)
|
||||
self.content_layout.addWidget(self.input_field, 8)
|
||||
self.content_layout.addWidget(self.input_field)
|
||||
self.input_field.textChanged.connect(self._on_value_change)
|
||||
|
||||
if self.args_input_field:
|
||||
self.content_layout.addWidget(self.args_input_field, 2)
|
||||
self.args_input_field.textChanged.connect(self._on_value_change)
|
||||
|
||||
def _on_entity_change(self):
|
||||
if self.entity.value != self.input_value():
|
||||
self.set_entity_value()
|
||||
|
||||
def set_entity_value(self):
|
||||
value = self.entity.value
|
||||
args = ""
|
||||
if isinstance(value, list):
|
||||
value, args = value
|
||||
self.input_field.setText(value)
|
||||
if self.args_input_field:
|
||||
self.args_input_field.setText(args)
|
||||
self.input_field.setText(self.entity.value)
|
||||
|
||||
def input_value(self):
|
||||
path_value = self.input_field.text()
|
||||
if self.entity.with_arguments:
|
||||
value = [path_value, self.args_input_field.text()]
|
||||
else:
|
||||
value = path_value
|
||||
return value
|
||||
return self.input_field.text()
|
||||
|
||||
def _on_value_change(self):
|
||||
if self.ignore_input_changes:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue