From c0ce28e1d683b9994e1e1f5dcce25c9a14c996df Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 14:36:49 -0300 Subject: [PATCH 01/13] [appimage] fix: not displaying the filter for any kind of file (*) when updating imported AppImages --- CHANGELOG.md | 6 ++++++ bauh/gems/appimage/controller.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f6f003..c63f1b06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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] +### 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/gems/appimage/controller.py b/bauh/gems/appimage/controller.py index dcbac937..99b16e9a 100644 --- a/bauh/gems/appimage/controller.py +++ b/bauh/gems/appimage/controller.py @@ -152,7 +152,7 @@ class AppImageManager(SoftwareManager): def update_file(self, pkg: AppImage, root_password: str, watcher: ProcessWatcher): file_chooser = FileChooserComponent(label=self.i18n['file'].capitalize(), - allowed_extensions={'AppImage'}, + allowed_extensions={'AppImage', '*'}, search_path=get_default_manual_installation_file_dir()) input_version = TextInputComponent(label=self.i18n['version'].capitalize()) file_chooser.observers.append(ManualInstallationFileObserver(None, input_version)) From 43b460e6be8e6c5b44deb62af2c29a713405501a Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 14:37:49 -0300 Subject: [PATCH 02/13] refactoring: removing unneeded line --- bauh/api/abstract/view.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bauh/api/abstract/view.py b/bauh/api/abstract/view.py index 7c5940d0..5492776c 100644 --- a/bauh/api/abstract/view.py +++ b/bauh/api/abstract/view.py @@ -235,7 +235,6 @@ class FormComponent(ViewComponent): return comp - class FileChooserComponent(ViewComponent): def __init__(self, allowed_extensions: Optional[Set[str]] = None, label: Optional[str] = None, tooltip: Optional[str] = None, From 7b229dfde9587034a052915dd7605555b9c65c77 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 14:59:04 -0300 Subject: [PATCH 03/13] [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()) From d9d647fdbf8d08957b62c9d33cbbbee1a629e360 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 15:10:28 -0300 Subject: [PATCH 04/13] [appimage] improvement: validating the AppImage file extension when updating imported files --- bauh/gems/appimage/controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bauh/gems/appimage/controller.py b/bauh/gems/appimage/controller.py index 99b16e9a..44d3ce82 100644 --- a/bauh/gems/appimage/controller.py +++ b/bauh/gems/appimage/controller.py @@ -162,7 +162,8 @@ class AppImageManager(SoftwareManager): components=[FormComponent(label='', components=[file_chooser, input_version], spaces=False)], confirmation_label=self.i18n['proceed'].capitalize(), deny_label=self.i18n['cancel'].capitalize()): - if not file_chooser.file_path or not os.path.isfile(file_chooser.file_path): + + if not file_chooser.file_path or not os.path.isfile(file_chooser.file_path) or not file_chooser.file_path.lower().strip().endswith('.appimage'): watcher.request_confirmation(title=self.i18n['error'].capitalize(), body=self.i18n['appimage.custom_action.install_file.invalid_file'], deny_button=False) From d41f04e74e7c676ac10d3a6416f57091d94f6c00 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 15:16:28 -0300 Subject: [PATCH 05/13] [appimage] improvement: not displaying 'imported' besides the imported application name on the table (only for the name tip) --- CHANGELOG.md | 3 +++ bauh/gems/appimage/model.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a9c9d3..2bf9a34a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.9.20] ### Improvements +- AppImage: + - not displaying "imported" besides the imported application name on the table (only for the name tip) + - UI: - always displaying the "any file filter" (*) as the last option for file chooser components [#193](https://github.com/vinifmor/bauh/issues/193) diff --git a/bauh/gems/appimage/model.py b/bauh/gems/appimage/model.py index c77921a0..880268c2 100644 --- a/bauh/gems/appimage/model.py +++ b/bauh/gems/appimage/model.py @@ -102,7 +102,7 @@ class AppImage(SoftwarePackage): def has_screenshots(self): return not self.installed and self.url_screenshot - def get_display_name(self) -> str: + def get_name_tooltip(self) -> str: if self.name and self.imported: return '{} ({})'.format(self.name, self.i18n['imported']) From 1b58963fc612102b074eaf5235ee1f47916b9462 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 15:17:26 -0300 Subject: [PATCH 06/13] bumping version to 0.9.20 --- bauh/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bauh/__init__.py b/bauh/__init__.py index af228711..0cfce0e7 100644 --- a/bauh/__init__.py +++ b/bauh/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.9.19' +__version__ = '0.9.20' __app_name__ = 'bauh' import os From b2f8266bceba90a5b678e3b2bb5ab2187ae7f68f Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 3 Nov 2021 15:37:41 -0300 Subject: [PATCH 07/13] [view] fix: not properly sorting file extensions for the FileChooser component --- bauh/view/qt/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index ecfab6e3..5b0177e3 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -864,7 +864,7 @@ class FormQt(QGroupBox): if '*' in c.allowed_extensions: sorted_exts.append('*') - exts = ';;'.join({f'*.{e}' for e in sorted_exts}) + exts = ';;'.join((f'*.{e}' for e in sorted_exts)) else: exts = '{} (*);;'.format(self.i18n['all_files'].capitalize()) From cea02dcd41ea9a04b4fc7757ef0f3c0a0b658e4a Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 4 Nov 2021 18:08:34 -0300 Subject: [PATCH 08/13] [view] fix: always requesting the password on the initialization dialog when launched by the root user --- CHANGELOG.md | 3 ++- bauh/view/qt/prepare.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bf9a34a..72c3ebe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes - AppImage - not displaying the filter for any kind of file (*) when updating imported AppImages [#193](https://github.com/vinifmor/bauh/issues/193) - +- UI + - always requesting the password on the initialization dialog when launched by the root user [#195](https://github.com/vinifmor/bauh/issues/195) ## [0.9.19] 2021-08-23 diff --git a/bauh/view/qt/prepare.py b/bauh/view/qt/prepare.py index 9998afaa..67f29b34 100644 --- a/bauh/view/qt/prepare.py +++ b/bauh/view/qt/prepare.py @@ -13,6 +13,7 @@ from bauh import __app_name__ from bauh.api.abstract.context import ApplicationContext from bauh.api.abstract.controller import SoftwareManager, SoftwareAction from bauh.api.abstract.handler import TaskManager +from bauh.commons import user from bauh.view.qt.components import new_spacer, QCustomToolbar from bauh.view.qt.qt_utils import centralize from bauh.view.qt.root import RootDialog @@ -55,7 +56,7 @@ class Prepare(QThread, TaskManager): def run(self): root_pwd = None - if self.manager.requires_root(SoftwareAction.PREPARE, None): + if not user.is_root() and self.manager.requires_root(SoftwareAction.PREPARE, None): ok, root_pwd = self.ask_password() if not ok: From a6c065efb658fcc78716c31f410a101b37258c6b Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 5 Nov 2021 13:48:51 -0300 Subject: [PATCH 09/13] [flatpak] fix: not listing installed packages for Flatpak 1.2 --- CHANGELOG.md | 2 ++ bauh/gems/flatpak/flatpak.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72c3ebe3..7a7b44a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes - AppImage - not displaying the filter for any kind of file (*) when updating imported AppImages [#193](https://github.com/vinifmor/bauh/issues/193) +- Flatpak + - not listing installed packages for Flatpak 1.2 [#201](https://github.com/vinifmor/bauh/issues/201) - UI - always requesting the password on the initialization dialog when launched by the root user [#195](https://github.com/vinifmor/bauh/issues/195) diff --git a/bauh/gems/flatpak/flatpak.py b/bauh/gems/flatpak/flatpak.py index b9240c64..b185ea42 100755 --- a/bauh/gems/flatpak/flatpak.py +++ b/bauh/gems/flatpak/flatpak.py @@ -93,7 +93,7 @@ def get_commit(app_id: str, branch: str, installation: str) -> Optional[str]: def list_installed(version: Version) -> List[dict]: apps = [] - if version < VERSION_1_3: + if version < VERSION_1_2: app_list = new_subprocess(['flatpak', 'list', '-d']) for o in app_list.stdout: From 75e16056c0c6d8b06fd7f099ffd282f892de7541 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 5 Nov 2021 14:17:03 -0300 Subject: [PATCH 10/13] [flatpak] fix: nost listing updates for Flatpak 1.2 --- CHANGELOG.md | 1 + bauh/gems/flatpak/controller.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7b44a4..fa1b52bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - not displaying the filter for any kind of file (*) when updating imported AppImages [#193](https://github.com/vinifmor/bauh/issues/193) - Flatpak - not listing installed packages for Flatpak 1.2 [#201](https://github.com/vinifmor/bauh/issues/201) + - not listing updates for Flatpak 1.2 - UI - always requesting the password on the initialization dialog when launched by the root user [#195](https://github.com/vinifmor/bauh/issues/195) diff --git a/bauh/gems/flatpak/controller.py b/bauh/gems/flatpak/controller.py index 10c8ed0e..56bd9633 100644 --- a/bauh/gems/flatpak/controller.py +++ b/bauh/gems/flatpak/controller.py @@ -22,7 +22,7 @@ from bauh.commons.boot import CreateConfigFile from bauh.commons.html import strip_html, bold from bauh.commons.system import ProcessHandler from bauh.gems.flatpak import flatpak, SUGGESTIONS_FILE, CONFIG_FILE, UPDATES_IGNORED_FILE, CONFIG_DIR, EXPORTS_PATH, \ - get_icon_path, VERSION_1_5, VERSION_1_4 + get_icon_path, VERSION_1_5, VERSION_1_2 from bauh.gems.flatpak.config import FlatpakConfigManager from bauh.gems.flatpak.constants import FLATHUB_API_URL from bauh.gems.flatpak.model import FlatpakApplication @@ -143,7 +143,7 @@ class FlatpakManager(SoftwareManager): models.append(model) if update_map and (update_map['full'] or update_map['partial']): - if version >= VERSION_1_4: + if version >= VERSION_1_2: update_id = '{}/{}/{}'.format(app_json['id'], app_json['branch'], app_json['installation']) if update_map['full'] and update_id in update_map['full']: From f0c29d40892035d3f2a2a4ea004a4d2ea11d7d67 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 5 Nov 2021 14:48:53 -0300 Subject: [PATCH 11/13] [common] fix: some backend commands could hang when require user interaction --- CHANGELOG.md | 2 ++ bauh/commons/system.py | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa1b52bb..6ca37430 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - always displaying the "any file filter" (*) as the last option for file chooser components [#193](https://github.com/vinifmor/bauh/issues/193) ### Fixes +- Arch + - not able to install packages when launched by the root user - AppImage - not displaying the filter for any kind of file (*) when updating imported AppImages [#193](https://github.com/vinifmor/bauh/issues/193) - Flatpak diff --git a/bauh/commons/system.py b/bauh/commons/system.py index 77735ed0..d3b106c1 100644 --- a/bauh/commons/system.py +++ b/bauh/commons/system.py @@ -89,15 +89,13 @@ class SimpleProcess: args = { "stdout": subprocess.PIPE, "stderr": subprocess.STDOUT, + "stdin": stdin if stdin else subprocess.DEVNULL, "bufsize": -1, "cwd": cwd, "env": gen_env(global_interpreter, lang, extra_paths=extra_paths), "shell": self.shell } - if stdin: - args['stdin'] = stdin - return subprocess.Popen(args=[' '.join(cmd)] if self.shell else cmd, **args) From c5aac8f3217fdd1ac086c29d8de87f45b7c3d898 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 5 Nov 2021 16:09:29 -0300 Subject: [PATCH 12/13] Updating CHANGELOG --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ca37430..19dd770f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - always displaying the "any file filter" (*) as the last option for file chooser components [#193](https://github.com/vinifmor/bauh/issues/193) ### Fixes -- Arch - - not able to install packages when launched by the root user +- General + - some backend commands could hang when require user interaction - AppImage - not displaying the filter for any kind of file (*) when updating imported AppImages [#193](https://github.com/vinifmor/bauh/issues/193) - Flatpak From e21850022acefbee58339e362461618e35b75f89 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 5 Nov 2021 16:47:37 -0300 Subject: [PATCH 13/13] Updating CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19dd770f..e04623d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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] +## [0.9.20] 2021-11-05 ### Improvements - AppImage: - not displaying "imported" besides the imported application name on the table (only for the name tip)