extend to filter also the values

This commit is contained in:
un-pogaz 2025-01-29 23:42:34 +01:00
parent 01610583cf
commit 9a20755d70
2 changed files with 7 additions and 2 deletions

View File

@ -354,6 +354,7 @@ class TbIconRulesTab(LazyConfigWidgetBase, Ui_Form):
def populate_content(self):
field_metadata = self.gui.current_db.field_metadata
category_icons = self.gui.tags_view.model().category_custom_icons
only_current_library = self.show_only_current_library.isChecked()
v = gprefs['tags_browser_value_icons']
row = 0
@ -363,11 +364,15 @@ class TbIconRulesTab(LazyConfigWidgetBase, Ui_Form):
for category,vdict in v.items():
if category in field_metadata:
display_name = field_metadata[category]['name']
elif self.show_only_current_library.isChecked():
all_values = self.gui.current_db.new_api.all_field_names(category)
elif only_current_library:
continue
else:
display_name = category.removeprefix('#')
all_values = ()
for item_value in vdict:
if only_current_library and item_value != TEMPLATE_ICON_INDICATOR and item_value not in all_values:
continue
t.setRowCount(row + 1)
d = v[category][item_value]
t.setItem(row, DELETED_COLUMN, StateTableWidgetItem(''))

View File

@ -54,7 +54,7 @@ are defined per-user, not per-library.&lt;/p&gt;</string>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="show_only_current_library">
<property name="text">
<string>Show only category available in the current library</string>
<string>Show only categories and values available in the current library</string>
</property>
</widget>
</item>