[fix][ui] table overwrite effect when updating its content

This commit is contained in:
Vinicius Moreira
2020-06-03 15:13:50 -03:00
parent c98433a740
commit d1fcb19e6e
3 changed files with 11 additions and 2 deletions

View File

@@ -28,6 +28,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Arch - Arch
- uninstall: not checking if the are other installed providers for the target package - uninstall: not checking if the are other installed providers for the target package
- not recursively asking for dependencies providers when installing / upgrading - not recursively asking for dependencies providers when installing / upgrading
- UI
- table overwrite effect when updating its content
## [0.9.4] 2020-05-29 ## [0.9.4] 2020-05-29

View File

@@ -254,7 +254,11 @@ class AppsTable(QTableWidget):
self.window.manager.cache_to_disk(pkg=app.model, icon_bytes=icon_data['bytes'], only_icon=True) self.window.manager.cache_to_disk(pkg=app.model, icon_bytes=icon_data['bytes'], only_icon=True)
def update_packages(self, pkgs: List[PackageView], update_check_enabled: bool = True): def update_packages(self, pkgs: List[PackageView], update_check_enabled: bool = True):
self.setRowCount(len(pkgs) if pkgs else 0) self.setRowCount(0) # removes the overwrite effect when updates the table
if pkgs:
self.setRowCount(len(pkgs))
self.setEnabled(True) self.setEnabled(True)
if pkgs: if pkgs:

View File

@@ -1,6 +1,7 @@
import logging import logging
import time import time
import traceback import traceback
from datetime import datetime
from pathlib import Path from pathlib import Path
from typing import List, Type, Set, Tuple from typing import List, Type, Set, Tuple
@@ -406,16 +407,17 @@ class ManageWindow(QWidget):
self.thread_apply_filters.filters = self._gen_filters() self.thread_apply_filters.filters = self._gen_filters()
self.thread_apply_filters.pkgs = self.pkgs_available self.thread_apply_filters.pkgs = self.pkgs_available
self.thread_apply_filters.start() self.thread_apply_filters.start()
self.table_apps.setEnabled(False)
self.checkbox_only_apps.setEnabled(False) self.checkbox_only_apps.setEnabled(False)
self.combo_categories.setEnabled(False) self.combo_categories.setEnabled(False)
self.combo_filter_type.setEnabled(False) self.combo_filter_type.setEnabled(False)
self.input_name_filter.setEnabled(False) self.input_name_filter.setEnabled(False)
self.checkbox_updates.setEnabled(False) self.checkbox_updates.setEnabled(False)
self.table_apps.setEnabled(False)
self.setFocus(Qt.NoFocusReason) self.setFocus(Qt.NoFocusReason)
def _update_table_and_upgrades(self, pkgs_info: dict): def _update_table_and_upgrades(self, pkgs_info: dict):
self._update_table(pkgs_info=pkgs_info, signal=True) self._update_table(pkgs_info=pkgs_info, signal=True)
self.table_apps.setEnabled(False)
self.update_bt_upgrade(pkgs_info) self.update_bt_upgrade(pkgs_info)
if self.pkgs: if self.pkgs:
@@ -427,6 +429,7 @@ class ManageWindow(QWidget):
self.thread_notify_pkgs_ready.start() self.thread_notify_pkgs_ready.start()
def _finish_apply_filters_async(self, success: bool): def _finish_apply_filters_async(self, success: bool):
self.table_apps.setEnabled(True)
self.checkbox_only_apps.setEnabled(True) self.checkbox_only_apps.setEnabled(True)
self.checkbox_updates.setEnabled(True) self.checkbox_updates.setEnabled(True)
self.combo_categories.setEnabled(True) self.combo_categories.setEnabled(True)