This commit is contained in:
Kovid Goyal 2025-01-25 17:31:50 +05:30
commit c78cfdd926
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -708,7 +708,7 @@ class TagsView(QTreeView): # {{{
# global_vars=None, all_functions=None, builtin_functions=None,
# python_context_object=None, dialog_number=None,
formatter=EvalFormatter, icon_dir='tb_icons/template_icons')
if d.exec():
if d.exec() == QDialog.DialogCode.Accepted:
self._model.set_value_icon(key, TEMPLATE_ICON_INDICATOR, d.rule[2], False)
self.recount()
return
@ -722,7 +722,8 @@ class TagsView(QTreeView): # {{{
_('Change icon for: %s')%key, filters=[
('Images', ['png', 'gif', 'jpg', 'jpeg'])],
all_files=False, select_only_single_file=True)
if path:
if not path:
return
path = path[0]
p = QIcon(path).pixmap(QSize(128, 128))
d = os.path.join(config_dir, 'tb_icons')
@ -732,6 +733,7 @@ class TagsView(QTreeView): # {{{
f.write(pixmap_to_data(p, format='PNG'))
except:
traceback.print_exc()
return
else:
# Already have an icon. User wants to change whether it applies to children
icon_file_name = desired_file_name