From 7b229dfde9587034a052915dd7605555b9c65c77 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 14:59:04 -0300 Subject: [PATCH] [view] improvement: always displaying the 'any file filter' (*) as the last option for file chooser components --- CHANGELOG.md | 5 +++++ bauh/view/qt/components.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c63f1b06..58a9c9d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.9.20] +### Improvements +- UI: + - always displaying the "any file filter" (*) as the last option for file chooser components [#193](https://github.com/vinifmor/bauh/issues/193) + ### Fixes - AppImage - not displaying the filter for any kind of file (*) when updating imported AppImages [#193](https://github.com/vinifmor/bauh/issues/193) + ## [0.9.19] 2021-08-23 ### Improvements - AppImage diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index b43abeae..ecfab6e3 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -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())