From d00ab69047a6ba8a6357dce57e2b06e90cd81b9c Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 1 Oct 2019 11:20:53 -0300 Subject: [PATCH] fix: Installed button available after a recent installation if a new search is done --- CHANGELOG.md | 1 + bauh/view/qt/window.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b698f512..d3af6cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes - Update-check daemon not showing notifications +- Installed button available after a recent installation if a new search is done ## [0.6.1] 2019-09-26 ### Improvements diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index 05693f66..39a0dee3 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -261,6 +261,7 @@ class ManageWindow(QWidget): self.filter_updates = False self._maximized = False self.progress_controll_enabled = True + self.recent_installation = False self.dialog_about = None self.first_refresh = suggestions @@ -403,6 +404,7 @@ class ManageWindow(QWidget): self.textarea_output.hide() def refresh_apps(self, keep_console: bool = True, top_app: PackageView = None, pkg_types: Set[Type[SoftwarePackage]] = None): + self.recent_installation = False self.type_filter = None self.input_search.clear() @@ -417,11 +419,11 @@ class ManageWindow(QWidget): self.thread_refresh.pkg_types = pkg_types self.thread_refresh.start() - def _finish_refresh_apps(self, res: dict): + def _finish_refresh_apps(self, res: dict, as_installed: bool = True): self.finish_action() self.ref_checkbox_only_apps.setVisible(bool(res['installed'])) self.ref_bt_upgrade.setVisible(True) - self.update_pkgs(res['installed'], as_installed=True, types=res['types']) + self.update_pkgs(res['installed'], as_installed=as_installed, types=res['types']) self.first_refresh = False def uninstall_app(self, app: PackageView): @@ -618,7 +620,7 @@ class ManageWindow(QWidget): self.thread_verify_models.start() if self.pkgs_installed: - self.ref_bt_installed.setVisible(not as_installed) + self.ref_bt_installed.setVisible(not as_installed and not self.recent_installation) self.resize_and_center(accept_lower_width=self.pkgs_installed) @@ -892,6 +894,7 @@ class ManageWindow(QWidget): self.textarea_output.appendPlainText("[warning] Could not write install log file to '{}'".format(log_path)) if res['success']: + self.recent_installation = True if self._can_notify_user(): util.notify_user(msg='{} ({}) {}'.format(res['pkg'].model.name, res['pkg'].model.get_type(), self.i18n['installed']))