[ui] small refactoring

This commit is contained in:
Vinicius Moreira
2020-06-03 18:13:26 -03:00
parent d1fcb19e6e
commit 9dcfa89e24
3 changed files with 5 additions and 8 deletions

View File

@@ -18,7 +18,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- minor improvements
- download clients parameters
### Fixes
- regressions (from **0.9.4**)
- resetting the main configuration when tray mode is active [#118](https://github.com/vinifmor/bauh/issues/118)
@@ -31,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- UI
- table overwrite effect when updating its content
## [0.9.4] 2020-05-29
### Features

View File

@@ -254,14 +254,12 @@ class AppsTable(QTableWidget):
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):
self.setRowCount(0) # removes the overwrite effect when updates the table
self.setRowCount(0) # removes the overwrite effect when updates the table
self.setEnabled(True)
if pkgs:
self.setRowCount(len(pkgs))
self.setEnabled(True)
if pkgs:
for idx, pkg in enumerate(pkgs):
pkg.table_index = idx

View File

@@ -1,7 +1,6 @@
import logging
import time
import traceback
from datetime import datetime
from pathlib import Path
from typing import List, Type, Set, Tuple
@@ -777,7 +776,7 @@ class ManageWindow(QWidget):
if old_installed and types:
for pkgv in old_installed:
if not pkgv.model.__class__ in types:
if pkgv.model.__class__ not in types:
commons.update_info(pkgv, pkgs_info)
commons.apply_filters(pkgv, filters, pkgs_info)
@@ -826,7 +825,7 @@ class ManageWindow(QWidget):
if self.pkgs_installed:
self.ref_bt_installed.setVisible(not as_installed and not self.recent_installation)
self._resize(accept_lower_width=self.pkgs_installed)
self._resize(accept_lower_width=bool(self.pkgs_installed))
if self.first_refresh:
qt_utils.centralize(self)