mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +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
|
|
@ -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