diff --git a/CHANGELOG.md b/CHANGELOG.md index e0dfe756..2b06b8f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Features - Allows to retrieve app information and history by right clicking it. - Allows app uninstall and downgrade by right clicking it. +- "About" window available when right-clicking the tray icon. ### Improvements - Performance and memory usage @@ -18,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Allowing to specify a custom app translation with the environment variable **FPAKMAN_LOCALE** - Adding expiration time for cached app data. Default to 1 hour. The environment variable **FPAKMAN_CACHE_EXPIRATION** can change this value. - Retrieving only the installed applications data from the origin API. +- Minor GUI improvements ## [0.2.1] - 2019-06-24 ### Features diff --git a/README.md b/README.md index 5e4efe8d..1c54fcb8 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ sudo pip3 install fpakman ``` **AUR** + As **fpakman** package. There is also a staging version (**fpakman-staging**) but is intended for testing and may not work properly. diff --git a/fpakman/resources/locale/en b/fpakman/resources/locale/en index 8ef2420d..fc2de6c2 100644 --- a/fpakman/resources/locale/en +++ b/fpakman/resources/locale/en @@ -8,6 +8,7 @@ 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.downgrade=Downgrade manage_window.apps_table.row.actions.downgrade.popup.body=Do you really want to downgrade {} ? +manage_window.apps_table.upgrade_toggle.tooltip=Click it to check or uncheck the update manage_window.checkbox.only_apps=Apps manage_window.label.updates=Updates manage_window.status.refreshing=Refreshing @@ -33,6 +34,7 @@ popup.button.no=No popup.button.cancel=Cancel tray.action.manage=Manage applications tray.action.exit=Exit +tray.action.about=About notification.new_updates=Updates found flatpak.info.arch=arch flatpak.info.branch=branch @@ -51,4 +53,8 @@ flatpak.info.runtime=runtime flatpak.info.sdk=sdk flatpak.info.subject=subject flatpak.info.type=type -flatpak.info.version=version \ No newline at end of file +flatpak.info.version=version +about.info.desc=Non-official Flatpak application management graphical interface +about.info.link=More information at +about.info.license=Free license +about.info.rate=If this tool is useful for you, give it a star on Github to keep it up \ No newline at end of file diff --git a/fpakman/resources/locale/es b/fpakman/resources/locale/es index 58e5a2cc..65a35dba 100644 --- a/fpakman/resources/locale/es +++ b/fpakman/resources/locale/es @@ -8,6 +8,7 @@ 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.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.upgrade_toggle.tooltip=Haz clic para marcar o desmarcar la actualización manage_window.checkbox.only_apps=Aplicativos manage_window.label.updates=Actualizaciones manage_window.status.refreshing=Recargando @@ -33,6 +34,7 @@ popup.button.no=No popup.button.cancel=Cancelar tray.action.manage=Administrar aplicativos tray.action.exit=Salir +tray.action.about=Sobre notification.new_updates=Actualizaciones encontradas flatpak.info.arch=arquitectura flatpak.info.branch=rama @@ -51,4 +53,8 @@ flatpak.info.runtime=runtime flatpak.info.sdk=sdk flatpak.info.subject=tema flatpak.info.type=tipo -flatpak.info.version=versión \ No newline at end of file +flatpak.info.version=versión +about.info.desc=Interfaz grafica no oficial para administración de aplicativos Flatpak +about.info.link=Mas informaciones en +about.info.license=Licencia gratuita +about.info.rate=Si esta herramienta es útil para ti, dale una estrella en Github para mantenerla \ No newline at end of file diff --git a/fpakman/resources/locale/pt b/fpakman/resources/locale/pt index a20cd821..6622e9ed 100644 --- a/fpakman/resources/locale/pt +++ b/fpakman/resources/locale/pt @@ -8,6 +8,7 @@ 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.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.upgrade_toggle.tooltip=Clique para marcar ou desmarcar a atualização manage_window.checkbox.only_apps=Aplicativos manage_window.label.updates=Atualizações manage_window.status.refreshing=Recarregando @@ -33,6 +34,7 @@ popup.button.no=Não popup.button.cancel=Cancelar tray.action.manage=Gerenciar aplicativos tray.action.exit=Sair +tray.action.about=Sobre notification.new_updates=Atualizações encontradas flatpak.info.arch=arquitetura flatpak.info.branch=ramo @@ -51,4 +53,8 @@ flatpak.info.runtime=runtime flatpak.info.sdk=sdk flatpak.info.subject=assunto flatpak.info.type=tipo -flatpak.info.version=versão \ No newline at end of file +flatpak.info.version=versão +about.info.desc=Interface gráfica não oficial para gerenciamento de aplicativos Flatpak +about.info.link=Mais informações em +about.info.license=Licença gratuita +about.info.rate=Se essa ferramenta é útil para você, dê uma estrela no Github para mantê-la de pé \ No newline at end of file diff --git a/fpakman/view/qt/about.py b/fpakman/view/qt/about.py new file mode 100644 index 00000000..a55c3e70 --- /dev/null +++ b/fpakman/view/qt/about.py @@ -0,0 +1,77 @@ +from PyQt5.QtCore import Qt +from PyQt5.QtGui import QPixmap +from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLabel + +from fpakman import __version__ +from fpakman.core import resource + +PROJECT_URL = 'https://github.com/vinifmor/fpakman' +LICENSE_URL = 'https://raw.githubusercontent.com/vinifmor/fpakman/master/LICENSE' + + +class AboutDialog(QDialog): + + def __init__(self, locale_keys: dict): + super(AboutDialog, self).__init__() + self.setWindowTitle(locale_keys['tray.action.about']) + layout = QVBoxLayout() + self.setLayout(layout) + + label_logo = QLabel(self) + label_logo.setPixmap(QPixmap(resource.get_path('img/flathub_45.svg'))) + label_logo.setAlignment(Qt.AlignCenter) + layout.addWidget(label_logo) + + label_name = QLabel('fpakman ( {} {} )'.format(locale_keys['flatpak.info.version'].lower(), __version__)) + label_name.setStyleSheet('font-weight: bold;') + label_name.setAlignment(Qt.AlignCenter) + layout.addWidget(label_name) + + label_flathub = QLabel() + label_flathub.setStyleSheet('font-size: 7px; color: red; font-weight: bold;') + label_flathub.setText('* logo by Flathub (' + " {url} )".format(url='https://flathub.org')) + label_flathub.setOpenExternalLinks(True) + label_flathub.setAlignment(Qt.AlignRight) + layout.addWidget(label_flathub) + + layout.addWidget(QLabel('')) + + line_desc = QLabel(self) + line_desc.setStyleSheet('font-size: 10px; font-weight: bold;') + line_desc.setText(locale_keys['about.info.desc']) + line_desc.setAlignment(Qt.AlignCenter) + line_desc.setMinimumWidth(400) + layout.addWidget(line_desc) + + layout.addWidget(QLabel('')) + + label_more_info = QLabel() + label_more_info.setStyleSheet('font-size: 9px;') + label_more_info.setText(locale_keys['about.info.link'] + ": {url}".format(url=PROJECT_URL)) + label_more_info.setOpenExternalLinks(True) + label_more_info.setAlignment(Qt.AlignCenter) + layout.addWidget(label_more_info) + + label_license = QLabel() + label_license.setStyleSheet('font-size: 9px;') + label_license.setText("{}".format(LICENSE_URL, locale_keys['about.info.license'])) + label_license.setOpenExternalLinks(True) + label_license.setAlignment(Qt.AlignCenter) + layout.addWidget(label_license) + + layout.addWidget(QLabel('')) + + label_rate = QLabel() + label_rate.setStyleSheet('font-size: 9px; font-weight: bold;') + label_rate.setText(locale_keys['about.info.rate'] + ' :)') + label_rate.setOpenExternalLinks(True) + label_rate.setAlignment(Qt.AlignCenter) + layout.addWidget(label_rate) + + layout.addWidget(QLabel('')) + + self.adjustSize() + + def closeEvent(self, event): + event.ignore() + self.hide() diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index c9d90978..b4df5c1e 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -12,7 +12,7 @@ from fpakman.view.qt import dialog class UpdateToggleButton(QToolButton): - def __init__(self, model: dict, root: QWidget, checked: bool = True): + def __init__(self, model: dict, root: QWidget, locale_keys: dict, checked: bool = True): super(UpdateToggleButton, self).__init__() self.model = model self.root = root @@ -22,6 +22,7 @@ class UpdateToggleButton(QToolButton): self.icon_off = QIcon(resource.get_path('img/toggle_off.svg')) self.setIcon(self.icon_on) self.setStyleSheet('border: 0px;') + self.setToolTip(locale_keys['manage_window.apps_table.upgrade_toggle.tooltip']) if not checked: self.click() @@ -183,7 +184,7 @@ class AppsTable(QTableWidget): col_origin.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) self.setItem(idx, 6, col_origin) - col_update = UpdateToggleButton(app['model'], self.parent, app['model']['update']) if app['model']['update'] else None + col_update = UpdateToggleButton(app['model'], self.parent, self.parent.locale_keys, app['model']['update']) if app['model']['update'] else None self.setCellWidget(idx, 7, col_update) def change_headers_policy(self, policy: QHeaderView = QHeaderView.ResizeToContents): diff --git a/fpakman/view/qt/systray.py b/fpakman/view/qt/systray.py index a888772d..b6e6601b 100755 --- a/fpakman/view/qt/systray.py +++ b/fpakman/view/qt/systray.py @@ -7,6 +7,7 @@ from PyQt5.QtWidgets import QSystemTrayIcon, QMenu from fpakman.core.controller import FlatpakManager from fpakman.core import resource +from fpakman.view.qt.about import AboutDialog from fpakman.view.qt.window import ManageWindow @@ -44,10 +45,16 @@ class TrayIcon(QSystemTrayIcon): self.setIcon(self.icon_default) self.menu = QMenu() + self.action_manage = self.menu.addAction(self.locale_keys['tray.action.manage']) self.action_manage.triggered.connect(self.show_manage_window) + + self.action_about = self.menu.addAction(self.locale_keys['tray.action.about']) + self.action_about.triggered.connect(self.show_about) + self.action_exit = self.menu.addAction(self.locale_keys['tray.action.exit']) self.action_exit.triggered.connect(lambda: QCoreApplication.exit()) + self.setContextMenu(self.menu) self.manage_window = ManageWindow(locale_keys=self.locale_keys, manager=self.manager, tray_icon=self) @@ -55,6 +62,8 @@ class TrayIcon(QSystemTrayIcon): self.check_thread.signal.connect(self.notify_updates) self.check_thread.start() + self.dialog_about = AboutDialog(self.locale_keys) + def notify_updates(self, updates: int): if updates > 0: if self.icon().cacheKey() != self.icon_update.cacheKey(): @@ -82,3 +91,8 @@ class TrayIcon(QSystemTrayIcon): self.manage_window.refresh() self.manage_window.show() + + def show_about(self): + + if self.dialog_about.isHidden(): + self.dialog_about.show() diff --git a/fpakman/view/qt/window.py b/fpakman/view/qt/window.py index fe7313c3..ef333601 100755 --- a/fpakman/view/qt/window.py +++ b/fpakman/view/qt/window.py @@ -8,7 +8,6 @@ from PyQt5.QtGui import QIcon, QWindowStateChangeEvent from PyQt5.QtWidgets import QWidget, QVBoxLayout, QApplication, QCheckBox, QHeaderView, QToolButton, QToolBar, \ QSizePolicy, QLabel, QPlainTextEdit -from fpakman import __version__ from fpakman.core import resource, flatpak from fpakman.core.controller import FlatpakManager from fpakman.view.qt import dialog @@ -45,7 +44,7 @@ class ManageWindow(QWidget): self.icon_flathub = QIcon(resource.get_path('img/flathub_45.svg')) self._check_flatpak_installed() self.resize(ManageWindow.__BASE_HEIGHT__, ManageWindow.__BASE_HEIGHT__) - self.setWindowTitle('{} ({})'.format(locale_keys['manage_window.title'], __version__)) + self.setWindowTitle(locale_keys['manage_window.title']) self.setWindowIcon(self.icon_flathub) self.layout = QVBoxLayout() @@ -122,6 +121,7 @@ class ManageWindow(QWidget): self.toolbar_bottom = QToolBar() self.label_updates = QLabel('') + self.label_updates.setStyleSheet("color: red; font-weight: bold") self.toolbar_bottom.addWidget(self.label_updates) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) @@ -247,7 +247,11 @@ class ManageWindow(QWidget): total_updates = app_updates + runtime_updates if total_updates > 0: - self.label_updates.setText('{}: {} ( {} apps | {} runtimes )'.format(self.locale_keys['manage_window.label.updates'], total_updates, app_updates, runtime_updates)) + self.label_updates.setText('{}: {} ( {} {} | {} runtimes )'.format(self.locale_keys['manage_window.label.updates'], + total_updates, + app_updates, + self.locale_keys['manage_window.checkbox.only_apps'].lower(), + runtime_updates)) else: self.label_updates.setText('')