mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #2541 from BigRoy/family_filter_include_exclude
This commit is contained in:
commit
6238d63ef8
3 changed files with 10 additions and 3 deletions
|
|
@ -308,6 +308,7 @@
|
|||
"family_filter_profiles": [
|
||||
{
|
||||
"hosts": [],
|
||||
"is_include": true,
|
||||
"task_types": [],
|
||||
"filter_families": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,7 +267,9 @@
|
|||
"label": "Task types"
|
||||
},
|
||||
{
|
||||
"type": "splitter"
|
||||
"type": "boolean",
|
||||
"key": "is_include",
|
||||
"label": "Exclude / Include"
|
||||
},
|
||||
{
|
||||
"type": "template",
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ class FamilyConfigCache:
|
|||
self.dbcon = dbcon
|
||||
self.family_configs = {}
|
||||
self._family_filters_set = False
|
||||
self._family_filters_is_include = True
|
||||
self._require_refresh = True
|
||||
|
||||
@classmethod
|
||||
|
|
@ -252,7 +253,7 @@ class FamilyConfigCache:
|
|||
"icon": self.default_icon()
|
||||
}
|
||||
if self._family_filters_set:
|
||||
item["state"] = False
|
||||
item["state"] = not self._family_filters_is_include
|
||||
return item
|
||||
|
||||
def refresh(self, force=False):
|
||||
|
|
@ -316,20 +317,23 @@ class FamilyConfigCache:
|
|||
matching_item = filter_profiles(profiles, profiles_filter)
|
||||
|
||||
families = []
|
||||
is_include = True
|
||||
if matching_item:
|
||||
families = matching_item["filter_families"]
|
||||
is_include = matching_item["is_include"]
|
||||
|
||||
if not families:
|
||||
return
|
||||
|
||||
self._family_filters_set = True
|
||||
self._family_filters_is_include = is_include
|
||||
|
||||
# Replace icons with a Qt icon we can use in the user interfaces
|
||||
for family in families:
|
||||
family_info = {
|
||||
"name": family,
|
||||
"icon": self.default_icon(),
|
||||
"state": True
|
||||
"state": is_include
|
||||
}
|
||||
|
||||
self.family_configs[family] = family_info
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue