mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 14:24:15 +02:00
[window] improvement: categories combo auto-adjusting size | [i18n] categories | [window] fix: uninstall refresh when there is only one app of a given type
This commit is contained in:
@@ -132,6 +132,7 @@ class ManageWindow(QWidget):
|
|||||||
self.cache_type_filter_icons = {}
|
self.cache_type_filter_icons = {}
|
||||||
self.combo_filter_type = QComboBox()
|
self.combo_filter_type = QComboBox()
|
||||||
self.combo_filter_type.setStyleSheet('QLineEdit { height: 2px; }')
|
self.combo_filter_type.setStyleSheet('QLineEdit { height: 2px; }')
|
||||||
|
self.combo_filter_type.setSizeAdjustPolicy(QComboBox.AdjustToContents)
|
||||||
self.combo_filter_type.setEditable(True)
|
self.combo_filter_type.setEditable(True)
|
||||||
self.combo_filter_type.lineEdit().setReadOnly(True)
|
self.combo_filter_type.lineEdit().setReadOnly(True)
|
||||||
self.combo_filter_type.lineEdit().setAlignment(Qt.AlignCenter)
|
self.combo_filter_type.lineEdit().setAlignment(Qt.AlignCenter)
|
||||||
@@ -141,7 +142,8 @@ class ManageWindow(QWidget):
|
|||||||
|
|
||||||
self.any_category_filter = 'any'
|
self.any_category_filter = 'any'
|
||||||
self.combo_categories = QComboBox()
|
self.combo_categories = QComboBox()
|
||||||
self.combo_categories.setStyleSheet('QLineEdit { height: 2px; width: 50px; }')
|
self.combo_categories.setStyleSheet('QLineEdit { height: 2px; }')
|
||||||
|
self.combo_categories.setSizeAdjustPolicy(QComboBox.AdjustToContents)
|
||||||
self.combo_categories.setEditable(True)
|
self.combo_categories.setEditable(True)
|
||||||
self.combo_categories.lineEdit().setReadOnly(True)
|
self.combo_categories.lineEdit().setReadOnly(True)
|
||||||
self.combo_categories.lineEdit().setAlignment(Qt.AlignCenter)
|
self.combo_categories.lineEdit().setAlignment(Qt.AlignCenter)
|
||||||
@@ -393,7 +395,6 @@ class ManageWindow(QWidget):
|
|||||||
|
|
||||||
def _handle_category_filter(self, idx: int):
|
def _handle_category_filter(self, idx: int):
|
||||||
self.category_filter = self.combo_categories.itemData(idx)
|
self.category_filter = self.combo_categories.itemData(idx)
|
||||||
self.combo_categories.adjustSize()
|
|
||||||
self.apply_filters_async()
|
self.apply_filters_async()
|
||||||
|
|
||||||
def _notify_model_data_change(self):
|
def _notify_model_data_change(self):
|
||||||
@@ -481,7 +482,8 @@ class ManageWindow(QWidget):
|
|||||||
if self._can_notify_user():
|
if self._can_notify_user():
|
||||||
util.notify_user('{} ({}) {}'.format(pkgv.model.name, pkgv.model.get_type(), self.i18n['uninstalled']))
|
util.notify_user('{} ({}) {}'.format(pkgv.model.name, pkgv.model.get_type(), self.i18n['uninstalled']))
|
||||||
|
|
||||||
self.refresh_apps(pkg_types={pkgv.model.__class__} if len(self.pkgs) > 1 else None)
|
only_pkg_type = len([p for p in self.pkgs if p.model.get_type() == pkgv.model.get_type()]) >= 2
|
||||||
|
self.refresh_apps(pkg_types={pkgv.model.__class__} if only_pkg_type else None)
|
||||||
else:
|
else:
|
||||||
if self._can_notify_user():
|
if self._can_notify_user():
|
||||||
util.notify_user('{}: {}'.format(pkgv.model.name, self.i18n['notification.uninstall.failed']))
|
util.notify_user('{}: {}'.format(pkgv.model.name, self.i18n['notification.uninstall.failed']))
|
||||||
@@ -498,7 +500,7 @@ class ManageWindow(QWidget):
|
|||||||
if self._can_notify_user():
|
if self._can_notify_user():
|
||||||
util.notify_user('{} {}'.format(res['app'], self.i18n['downgraded']))
|
util.notify_user('{} {}'.format(res['app'], self.i18n['downgraded']))
|
||||||
|
|
||||||
self.refresh_apps(pkg_types={res['app'].model.__class__})
|
self.refresh_apps(pkg_types={res['app'].model.__class__} if len(self.pkgs) > 1 else None)
|
||||||
|
|
||||||
if self.tray_icon:
|
if self.tray_icon:
|
||||||
self.tray_icon.verify_updates(notify_user=False)
|
self.tray_icon.verify_updates(notify_user=False)
|
||||||
|
|||||||
@@ -134,6 +134,12 @@ screenshots.bt_back.label=previous
|
|||||||
instantmessaging=messaging
|
instantmessaging=messaging
|
||||||
2dgraphics=2d graphics
|
2dgraphics=2d graphics
|
||||||
vectorgraphics=vector graphics
|
vectorgraphics=vector graphics
|
||||||
|
audiovideo=audio / video
|
||||||
|
webdevelopment=web development
|
||||||
|
filetransfer=file transfer
|
||||||
|
packagemanager=package manager
|
||||||
|
sportsgame=sports game
|
||||||
|
arcadegame=arcade game
|
||||||
screenshots,download.running=downloading image
|
screenshots,download.running=downloading image
|
||||||
screenshots.download.no_content=No content to display
|
screenshots.download.no_content=No content to display
|
||||||
screenshots.download.no_response=Image not found
|
screenshots.download.no_response=Image not found
|
||||||
@@ -174,6 +174,13 @@ vectorgraphics=gráficos vectoriales
|
|||||||
office=oficina
|
office=oficina
|
||||||
devices=dispositivos
|
devices=dispositivos
|
||||||
security=seguridad
|
security=seguridad
|
||||||
|
audiovideo=audio / video
|
||||||
|
amusement=diversión
|
||||||
|
webdevelopment=desarrollo web
|
||||||
|
filetransfer=transferencia de archivos
|
||||||
|
packagemanager=administrador de paquetes
|
||||||
|
sportsgame=juego de deportes
|
||||||
|
arcadegame=juego arcade
|
||||||
screenshots.bt_next.label=próxima
|
screenshots.bt_next.label=próxima
|
||||||
screenshots.bt_back.label=anterior
|
screenshots.bt_back.label=anterior
|
||||||
screenshots,download.running=descargando imagen
|
screenshots,download.running=descargando imagen
|
||||||
|
|||||||
@@ -176,6 +176,14 @@ vectorgraphics=gráficos vetoriais
|
|||||||
office=escritório
|
office=escritório
|
||||||
devices=dispositivos
|
devices=dispositivos
|
||||||
security=segurança
|
security=segurança
|
||||||
|
audiovideo=áudio / vídeo
|
||||||
|
amusement=diversão
|
||||||
|
webdevelopment=desenvolvimento web
|
||||||
|
filetransfer=transferência de arquivos
|
||||||
|
viewer=visualizador
|
||||||
|
packagemanager=gerenciador de pacotes
|
||||||
|
sportsgame=jogo de esportes
|
||||||
|
arcadegame=jogo arcade
|
||||||
screenshots.bt_next.label=próxima
|
screenshots.bt_next.label=próxima
|
||||||
screenshots.bt_back.label=anterior
|
screenshots.bt_back.label=anterior
|
||||||
screenshots,download.running=baixando imagem
|
screenshots,download.running=baixando imagem
|
||||||
|
|||||||
Reference in New Issue
Block a user