mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
Merge branch 'staging' into modules
# Conflicts: # fpakman/resources/locale/en # fpakman/resources/locale/es # fpakman/resources/locale/pt # fpakman/view/qt/apps_table.py
This commit is contained in:
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- search results sorting takes an average of 35% less time, reaching 60% in some scenarios
|
||||
- app boot takes an average of 80% less time
|
||||
- showing a warning popup after initialization when no Flatpak remotes are set
|
||||
- installed / uninstalled icons replaced by install / uninstall button
|
||||
### Fixes:
|
||||
- apps table not showing empty descriptions
|
||||
- replacing default app icons by null icons
|
||||
|
||||
@@ -6,6 +6,8 @@ manage_window.apps_table.row.actions.history=History
|
||||
manage_window.apps_table.row.actions.uninstall=Uninstall
|
||||
manage_window.apps_table.row.actions.uninstall.popup.title=Uninstall
|
||||
manage_window.apps_table.row.actions.uninstall.popup.body=Remove {} ?
|
||||
manage_window.apps_table.row.actions.install.popup.title=Installation
|
||||
manage_window.apps_table.row.actions.install.popup.body=Do you wish to install {} ?
|
||||
manage_window.apps_table.row.actions.downgrade=Downgrade
|
||||
manage_window.apps_table.row.actions.downgrade.popup.body=Do you really want to downgrade {} ?
|
||||
manage_window.apps_table.row.actions.install=Install
|
||||
@@ -75,3 +77,5 @@ version.installed_outdated=the installed version is outdated
|
||||
version.unknown=not informed
|
||||
app.name=application name
|
||||
warning=warning
|
||||
install=install
|
||||
uninstall=uninstall
|
||||
|
||||
@@ -7,6 +7,8 @@ manage_window.apps_table.row.actions.history=Historia
|
||||
manage_window.apps_table.row.actions.uninstall=Desinstalar
|
||||
manage_window.apps_table.row.actions.uninstall.popup.title=Desinstalación
|
||||
manage_window.apps_table.row.actions.uninstall.popup.body=¿Eliminar {}?
|
||||
manage_window.apps_table.row.actions.install.popup.title=Instalación
|
||||
manage_window.apps_table.row.actions.install.popup.body=Desea instalar {} ?
|
||||
manage_window.apps_table.row.actions.downgrade=Revertir versión
|
||||
manage_window.apps_table.row.actions.downgrade.popup.body=¿Realmente quieres revertir la versión actual de {}?
|
||||
manage_window.apps_table.row.actions.install=Instalar
|
||||
@@ -76,3 +78,5 @@ version.installed_outdated=la versión instalada está desactualizada
|
||||
version.unknown=versión no informada
|
||||
app.name=nombre del aplicativo
|
||||
warning=aviso
|
||||
install=instalar
|
||||
uninstall=desinstalar
|
||||
|
||||
@@ -7,6 +7,8 @@ manage_window.apps_table.row.actions.history=Histórico
|
||||
manage_window.apps_table.row.actions.uninstall=Desinstalar
|
||||
manage_window.apps_table.row.actions.uninstall.popup.title=Desinstalação
|
||||
manage_window.apps_table.row.actions.uninstall.popup.body=Remover {} ?
|
||||
manage_window.apps_table.row.actions.install.popup.title=Instalação
|
||||
manage_window.apps_table.row.actions.install.popup.body=Deseja instalar {} ?
|
||||
manage_window.apps_table.row.actions.downgrade=Reverter versão
|
||||
manage_window.apps_table.row.actions.downgrade.popup.body=Você realmente quer reverter a versão atual de {} ?
|
||||
manage_window.apps_table.row.actions.install=Instalar
|
||||
@@ -76,3 +78,5 @@ version.installed_outdated=a versão instalada está desatualizada
|
||||
version.unknown=versão não informada
|
||||
app.name=nome do aplicativo
|
||||
warning=aviso
|
||||
install=instalar
|
||||
uninstall=desinstalar
|
||||
|
||||
@@ -6,7 +6,7 @@ from PyQt5.QtCore import Qt, QUrl
|
||||
from PyQt5.QtGui import QPixmap, QIcon, QCursor
|
||||
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest
|
||||
from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QToolButton, QWidget, \
|
||||
QHeaderView, QLabel, QHBoxLayout
|
||||
QHeaderView, QLabel, QHBoxLayout, QPushButton
|
||||
from fpakman_api.abstract.model import ApplicationStatus
|
||||
|
||||
from fpakman.core import resource
|
||||
@@ -16,6 +16,8 @@ from fpakman.util import util
|
||||
from fpakman.view.qt import dialog
|
||||
from fpakman.view.qt.view_model import ApplicationView, ApplicationViewStatus
|
||||
|
||||
INSTALL_BT_STYLE = 'background: {back}; color: white; margin-top: 6px; padding: 1px; font-size: 9px; font-weight: bold'
|
||||
|
||||
|
||||
class UpdateToggleButton(QToolButton):
|
||||
|
||||
@@ -77,12 +79,6 @@ class AppsTable(QTableWidget):
|
||||
|
||||
menu_row = QMenu()
|
||||
|
||||
if not app.model.installed and app.model.can_be_installed():
|
||||
action_install = QAction(self.window.locale_keys["manage_window.apps_table.row.actions.install"])
|
||||
action_install.setIcon(QIcon(resource.get_path('img/install.svg')))
|
||||
action_install.triggered.connect(self._install_app)
|
||||
menu_row.addAction(action_install)
|
||||
|
||||
if app.model.has_info():
|
||||
action_info = QAction(self.window.locale_keys["manage_window.apps_table.row.actions.info"])
|
||||
action_info.setIcon(QIcon(resource.get_path('img/info.svg')))
|
||||
@@ -103,12 +99,6 @@ class AppsTable(QTableWidget):
|
||||
action_history.triggered.connect(self._get_app_history)
|
||||
menu_row.addAction(action_history)
|
||||
|
||||
if app.model.can_be_uninstalled():
|
||||
action_uninstall = QAction(self.window.locale_keys["manage_window.apps_table.row.actions.uninstall"])
|
||||
action_uninstall.setIcon(QIcon(resource.get_path('img/uninstall.svg')))
|
||||
action_uninstall.triggered.connect(self._uninstall_app)
|
||||
menu_row.addAction(action_uninstall)
|
||||
|
||||
if app.model.can_be_downgraded():
|
||||
action_downgrade = QAction(self.window.locale_keys["manage_window.apps_table.row.actions.downgrade"])
|
||||
action_downgrade.triggered.connect(self._downgrade_app)
|
||||
@@ -150,7 +140,7 @@ class AppsTable(QTableWidget):
|
||||
selected_app = self.get_selected_app()
|
||||
|
||||
if dialog.ask_confirmation(title=self.window.locale_keys['manage_window.apps_table.row.actions.uninstall.popup.title'],
|
||||
body=self.window.locale_keys['manage_window.apps_table.row.actions.uninstall.popup.body'].format(selected_app.model.base_data.name),
|
||||
body=self.window.locale_keys['manage_window.apps_table.row.actions.uninstall.popup.body'].format(selected_app),
|
||||
locale_keys=self.window.locale_keys):
|
||||
self.window.uninstall_app(selected_app)
|
||||
|
||||
@@ -172,6 +162,13 @@ class AppsTable(QTableWidget):
|
||||
self.window.get_app_history(self.get_selected_app())
|
||||
|
||||
def _install_app(self):
|
||||
selected_app = self.get_selected_app()
|
||||
|
||||
if dialog.ask_confirmation(
|
||||
title=self.window.locale_keys['manage_window.apps_table.row.actions.install.popup.title'],
|
||||
body=self.window.locale_keys['manage_window.apps_table.row.actions.install.popup.body'].format(selected_app),
|
||||
locale_keys=self.window.locale_keys):
|
||||
|
||||
self.window.install_app(self.get_selected_app())
|
||||
|
||||
def _load_icon_and_cache(self, http_response):
|
||||
@@ -222,20 +219,29 @@ class AppsTable(QTableWidget):
|
||||
self.setCellWidget(idx, 5, col_update)
|
||||
|
||||
def _set_col_installed(self, idx: int, app_v: ApplicationView):
|
||||
col_installed = QLabel()
|
||||
|
||||
if app_v.model.installed:
|
||||
img_name = 'checked'
|
||||
tooltip = self.window.locale_keys['installed']
|
||||
if app_v.model.can_be_uninstalled():
|
||||
col = QPushButton()
|
||||
col.setText(self.window.locale_keys['uninstall'].capitalize())
|
||||
col.setStyleSheet('QPushButton { ' + INSTALL_BT_STYLE.format(back='#cc0000') + '}')
|
||||
col.setMaximumHeight(20)
|
||||
col.clicked.connect(self._uninstall_app)
|
||||
else:
|
||||
img_name = 'red_cross'
|
||||
tooltip = self.window.locale_keys['not_installed']
|
||||
col = QLabel()
|
||||
col.setPixmap((QPixmap(resource.get_path('img/checked.svg'))))
|
||||
col.setAlignment(Qt.AlignCenter)
|
||||
col.setToolTip(self.window.locale_keys['installed'])
|
||||
elif app_v.model.can_be_installed():
|
||||
col = QPushButton()
|
||||
col.setText(self.window.locale_keys['install'].capitalize())
|
||||
col.setStyleSheet('QPushButton { ' + INSTALL_BT_STYLE.format(back='green') + '}')
|
||||
col.setMaximumHeight(20)
|
||||
col.clicked.connect(self._install_app)
|
||||
else:
|
||||
col = None
|
||||
|
||||
col_installed.setPixmap((QPixmap(resource.get_path('img/{}.svg'.format(img_name)))))
|
||||
col_installed.setAlignment(Qt.AlignCenter)
|
||||
col_installed.setToolTip(tooltip)
|
||||
|
||||
self.setCellWidget(idx, 4, col_installed)
|
||||
self.setCellWidget(idx, 4, col)
|
||||
|
||||
def _set_col_type(self, idx: int, app_v: ApplicationView):
|
||||
col_type = QLabel()
|
||||
|
||||
@@ -17,3 +17,6 @@ class ApplicationView:
|
||||
self.update_checked = model.update
|
||||
self.visible = visible
|
||||
self.status = ApplicationViewStatus.LOADING
|
||||
|
||||
def __repr__(self):
|
||||
return '{} ( {} )'.format(self.model.base_data.name, self.model.get_type())
|
||||
|
||||
Reference in New Issue
Block a user