From 1149a6d363ca250d8ada3717e131f3bbb691412e Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 17:00:51 -0300 Subject: [PATCH] about button for manage window --- CHANGELOG.md | 2 + fpakman/resources/img/about.svg | 142 ++++++++++++++++++++++++++++++++ fpakman/resources/locale/en | 3 +- fpakman/resources/locale/es | 3 +- fpakman/resources/locale/pt | 3 +- fpakman/view/qt/window.py | 25 +++++- 6 files changed, 172 insertions(+), 6 deletions(-) create mode 100755 fpakman/resources/img/about.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d9900a2..2d2a007c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - app information is now available through an "Info" button - app extra actions are now available through a "Settings" button instead of right-click - a confirmation popup is shown when the "install" / "upgrade all" button is clicked +- "About" button added to the manage panel +- "Updates" icon left-aligned - minor GUI improvements ### Fixes: - apps table not showing empty descriptions diff --git a/fpakman/resources/img/about.svg b/fpakman/resources/img/about.svg new file mode 100755 index 00000000..9e7b371f --- /dev/null +++ b/fpakman/resources/img/about.svg @@ -0,0 +1,142 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fpakman/resources/locale/en b/fpakman/resources/locale/en index 26f8980d..325c0406 100644 --- a/fpakman/resources/locale/en +++ b/fpakman/resources/locale/en @@ -110,4 +110,5 @@ uninstall=uninstall bt.app_upgrade=Upgrade bt.app_not_upgrade=Don't upgrade manage_window.upgrade_all.popup.title=Upgrade -manage_window.upgrade_all.popup.body=Upgrade all selected applications ? \ No newline at end of file +manage_window.upgrade_all.popup.body=Upgrade all selected applications ? +manage_window.bt_about.tooltip=About \ No newline at end of file diff --git a/fpakman/resources/locale/es b/fpakman/resources/locale/es index 60948b0a..3311677f 100644 --- a/fpakman/resources/locale/es +++ b/fpakman/resources/locale/es @@ -112,4 +112,5 @@ uninstall=desinstalar bt.app_upgrade=Actualizar bt.app_not_upgrade=No actualizar manage_window.upgrade_all.popup.title=Actualizar -manage_window.upgrade_all.popup.body=¿Actualizar todos los aplicativos seleccionados? \ No newline at end of file +manage_window.upgrade_all.popup.body=¿Actualizar todos los aplicativos seleccionados? +manage_window.bt_about.tooltip=Sobre \ No newline at end of file diff --git a/fpakman/resources/locale/pt b/fpakman/resources/locale/pt index f3b4ec6a..67949d6a 100644 --- a/fpakman/resources/locale/pt +++ b/fpakman/resources/locale/pt @@ -112,4 +112,5 @@ uninstall=desinstalar bt.app_upgrade=Atualizar bt.app_not_upgrade=Não atualizar manage_window.upgrade_all.popup.title=Atualizar -manage_window.upgrade_all.popup.body=Atualizar todos os aplicativos selecionados ? \ No newline at end of file +manage_window.upgrade_all.popup.body=Atualizar todos os aplicativos selecionados ? +manage_window.bt_about.tooltip=Sobre \ No newline at end of file diff --git a/fpakman/view/qt/window.py b/fpakman/view/qt/window.py index b86798a8..8c27f499 100755 --- a/fpakman/view/qt/window.py +++ b/fpakman/view/qt/window.py @@ -2,7 +2,7 @@ import operator from functools import reduce from typing import List, Set -from PyQt5.QtCore import QEvent, Qt +from PyQt5.QtCore import QEvent, Qt, QSize from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QPixmap from PyQt5.QtWidgets import QWidget, QVBoxLayout, QApplication, QCheckBox, QHeaderView, QToolButton, QToolBar, \ QSizePolicy, QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QHBoxLayout @@ -12,6 +12,7 @@ from fpakman.core.controller import ApplicationManager from fpakman.core.model import Application from fpakman.util.cache import Cache from fpakman.view.qt import dialog +from fpakman.view.qt.about import AboutDialog from fpakman.view.qt.apps_table import AppsTable from fpakman.view.qt.history import HistoryDialog from fpakman.view.qt.info import InfoDialog @@ -177,6 +178,10 @@ class ManageWindow(QWidget): self.thread_refresh_app.signal_output.connect(self._update_action_output) self.toolbar_bottom = QToolBar() + self.toolbar_bottom.setIconSize(QSize(16, 16)) + + self.label_updates = QLabel() + self.ref_label_updates = self.toolbar_bottom.addWidget(self.label_updates) self.toolbar_bottom.addWidget(self._new_spacer()) @@ -186,8 +191,12 @@ class ManageWindow(QWidget): self.toolbar_bottom.addWidget(self._new_spacer()) - self.label_updates = QLabel() - self.ref_label_updates = self.toolbar_bottom.addWidget(self.label_updates) + bt_about = QToolButton() + bt_about.setStyleSheet('border: 0px;') + bt_about.setIcon(QIcon(resource.get_path('img/about.svg'))) + bt_about.clicked.connect(self._show_about) + bt_about.setToolTip(self.locale_keys['manage_window.bt_about.tooltip']) + self.ref_bt_about = self.toolbar_bottom.addWidget(bt_about) self.layout.addWidget(self.toolbar_bottom) @@ -198,6 +207,14 @@ class ManageWindow(QWidget): self.filter_updates = False self._maximized = False + self.dialog_about = None + + def _show_about(self): + if self.dialog_about is None: + self.dialog_about = AboutDialog(self.locale_keys) + + self.dialog_about.show() + def _handle_updates_filter(self, status: int): self.filter_updates = status == 2 self.apply_filters() @@ -521,6 +538,7 @@ class ManageWindow(QWidget): self.textarea_output.appendPlainText(output) def _begin_action(self, action_label: str, keep_search: bool = False, clear_filters: bool = False): + self.ref_bt_about.setVisible(False) self.ref_label_updates.setVisible(False) self.thread_animate_progress.stop = False self.thread_animate_progress.start() @@ -544,6 +562,7 @@ class ManageWindow(QWidget): self.extra_filters.setEnabled(False) def finish_action(self): + self.ref_bt_about.setVisible(True) self.ref_progress_bar.setVisible(False) self.ref_label_updates.setVisible(True) self.thread_animate_progress.stop = True