[view] improvement: always displaying the 'any file filter' (*) as the last option for file chooser components

This commit is contained in:
Vinicius Moreira
2021-11-03 14:59:04 -03:00
parent 43b460e6be
commit 7b229dfde9
2 changed files with 12 additions and 1 deletions

View File

@@ -858,7 +858,13 @@ class FormQt(QGroupBox):
def open_chooser(e):
if c.allowed_extensions:
exts = ';;'.join({'*.{}'.format(e) for e in c.allowed_extensions})
sorted_exts = [e for e in c.allowed_extensions if e != '*']
sorted_exts.sort()
if '*' in c.allowed_extensions:
sorted_exts.append('*')
exts = ';;'.join({f'*.{e}' for e in sorted_exts})
else:
exts = '{} (*);;'.format(self.i18n['all_files'].capitalize())