From 6239fc9b87f5fdd9331f31582475f2e08c42f1b3 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 1 Aug 2019 21:25:46 -0300 Subject: [PATCH 01/23] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ef9a67c..75fe2a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - 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 +- a confirmation popup is shown when the "install" button is clicked - minor GUI improvements ### Fixes: - apps table not showing empty descriptions From b1b759b5790f5cb1e12bc6ef0a1c8642efc80f8a Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 2 Aug 2019 22:26:26 -0300 Subject: [PATCH 02/23] new update button --- fpakman/resources/locale/en | 4 +++- fpakman/resources/locale/es | 4 +++- fpakman/resources/locale/pt | 4 +++- fpakman/view/qt/apps_table.py | 41 +++++++++++++++++++++++++---------- 4 files changed, 38 insertions(+), 15 deletions(-) diff --git a/fpakman/resources/locale/en b/fpakman/resources/locale/en index 4ba9818b..0f652326 100644 --- a/fpakman/resources/locale/en +++ b/fpakman/resources/locale/en @@ -106,4 +106,6 @@ warning=warning snap.notification.snapd_unavailable=snapd seems not to be enabled. snap packages will not be available. flatpak.notification.no_remotes=No Flatpak remotes set. It will not be possible to search for Flatpak apps. install=install -uninstall=uninstall \ No newline at end of file +uninstall=uninstall +bt.app_upgrade=Upgrade +bt.app_not_upgrade=Don't upgrade \ No newline at end of file diff --git a/fpakman/resources/locale/es b/fpakman/resources/locale/es index 96044efd..4299eea2 100644 --- a/fpakman/resources/locale/es +++ b/fpakman/resources/locale/es @@ -108,4 +108,6 @@ warning=aviso snap.notification.snapd_unavailable=snapd no parece estar habilitado. los paquetes snap estarán indisponibles. flatpak.notification.no_remotes=No hay repositorios (remotes) Flatpak configurados. No será posible buscar aplicativos Flatpak. install=instalar -uninstall=desinstalar \ No newline at end of file +uninstall=desinstalar +bt.app_upgrade=Actualizar +bt.app_not_upgrade=No actualizar \ No newline at end of file diff --git a/fpakman/resources/locale/pt b/fpakman/resources/locale/pt index e7ea8f01..34579fd2 100644 --- a/fpakman/resources/locale/pt +++ b/fpakman/resources/locale/pt @@ -108,4 +108,6 @@ warning=aviso snap.notification.snapd_unavailable=snapd não parece estar habilitado. os pacotes snap estarão indisponíveis. flatpak.notification.no_remotes=Não há repositórios (remotes) Flatpak configurados. Não será possível buscar aplicativos Flatpak. install=instalar -uninstall=desinstalar \ No newline at end of file +uninstall=desinstalar +bt.app_upgrade=Atualizar +bt.app_not_upgrade=Não atualizar \ No newline at end of file diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index e98983b6..4719977c 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -5,7 +5,7 @@ from typing import List 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, \ +from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QWidget, \ QHeaderView, QLabel, QHBoxLayout, QPushButton from fpakman.core import resource @@ -15,29 +15,46 @@ from fpakman.util.cache import Cache from fpakman.view.qt import dialog from fpakman.view.qt.view_model import ApplicationView, ApplicationViewStatus -INSTALL_BT_STYLE = 'background: {back}; color: white; font-size: 9px; font-weight: bold' +INSTALL_BT_STYLE = 'background: {back}; color: white; font-size: 10px; font-weight: bold' -class UpdateToggleButton(QToolButton): +class UpdateToggleButton(QWidget): def __init__(self, app_view: ApplicationView, root: QWidget, locale_keys: dict, checked: bool = True): super(UpdateToggleButton, self).__init__() self.app_view = app_view self.root = root - self.setCheckable(True) - self.clicked.connect(self.change_state) - self.icon_on = QIcon(resource.get_path('img/toggle_on.svg')) - self.icon_off = QIcon(resource.get_path('img/toggle_off.svg')) - self.setIcon(self.icon_on) - self.setStyleSheet('QToolButton { border: 0px; }') - self.setToolTip(locale_keys['manage_window.apps_table.upgrade_toggle.tooltip']) + self.locale_keys = locale_keys + self.on = { + 'text': self.locale_keys['bt.app_upgrade'], + 'style': 'QPushButton { ' + INSTALL_BT_STYLE.format(back='#04B404') + ' }' + } + self.off = { + 'text': self.locale_keys['bt.app_not_upgrade'], + 'style': 'QPushButton { ' + INSTALL_BT_STYLE.format(back='gray') + ' }' + } + + layout = QHBoxLayout() + layout.setContentsMargins(3, 3, 3, 3) + layout.setAlignment(Qt.AlignCenter) + self.setLayout(layout) + + self.bt = QPushButton() + self.bt.setText(self.on['text']) + self.bt.setStyleSheet(self.on['style']) + self.bt.setCheckable(True) + self.bt.clicked.connect(self.change_state) + layout.addWidget(self.bt) if not checked: - self.click() + self.bt.click() def change_state(self, not_checked: bool): self.app_view.update_checked = not not_checked - self.setIcon(self.icon_on if not not_checked else self.icon_off) + + state = self.on if not not_checked else self.off + self.bt.setText(state['text']) + self.bt.setStyleSheet(state['style']) self.root.change_update_state(change_filters=False) From 575a73c8be2ce657e4a3160b6e3e13b94792a3a7 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 2 Aug 2019 23:03:04 -0300 Subject: [PATCH 03/23] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75fe2a02..37dcb439 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - 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 +- check update button design improvement - a confirmation popup is shown when the "install" button is clicked - minor GUI improvements ### Fixes: From 44f0a476971ce90b437db3b60f1ab532a513ae44 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 2 Aug 2019 23:07:42 -0300 Subject: [PATCH 04/23] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37dcb439..12fd4bc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ 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 -- check update button design improvement +- installed / uninstalled icons replaced by install / uninstall button for better UX +- check update button design changed for better UX - a confirmation popup is shown when the "install" button is clicked - minor GUI improvements ### Fixes: From b581e697cdb01c63f14ffeb550b5cd94da59c299 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 2 Aug 2019 23:13:55 -0300 Subject: [PATCH 05/23] AUR desktop entry file refactored --- aur/desktop_entry.py | 29 ----------------------------- aur/panel_entry.py | 17 +++++++++++++++++ aur/tray_entry.py | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 29 deletions(-) delete mode 100644 aur/desktop_entry.py create mode 100644 aur/panel_entry.py create mode 100644 aur/tray_entry.py diff --git a/aur/desktop_entry.py b/aur/desktop_entry.py deleted file mode 100644 index cf6680cb..00000000 --- a/aur/desktop_entry.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generates a .desktop file based on the current python version. Used for AUR installation -import os -import sys -from pathlib import Path - -desktop_file = """ -[Desktop Entry] -Type = Application -Name = fpakman{desc} -Categories = System; -Comment = Manage your Flatpak / Snap applications -Exec = /usr/bin/fpakman{param} -Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg -""" - -py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) - -with open('fpakman.desktop', 'w+') as f: - f.write(desktop_file.format(desc='', version=py_version, param=' --tray 0')) - -with open('fpakman_tray.desktop', 'w+') as f: - f.write(desktop_file.format(desc=' ( tray )', version=py_version, param='')) - - -# cleaning the old fpakman.desktop entry model -> the following lines will be removed for the next releases -desktop_file_path = '{}/.local/share/applications/fpakman.desktop'.format(str(Path.home())) - -if os.path.exists(desktop_file_path): - os.remove(desktop_file_path) diff --git a/aur/panel_entry.py b/aur/panel_entry.py new file mode 100644 index 00000000..a2e2887e --- /dev/null +++ b/aur/panel_entry.py @@ -0,0 +1,17 @@ +# Generates a .desktop file based on the current python version. Used for AUR installation +import sys + +desktop_file = """ +[Desktop Entry] +Type = Application +Name = fpakman +Categories = System; +Comment = Manage your Flatpak / Snap applications +Exec = /usr/bin/fpakman --tray=0 +Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg +""" + +py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) + +with open('fpakman.desktop', 'w+') as f: + f.write(desktop_file.format(version=py_version)) diff --git a/aur/tray_entry.py b/aur/tray_entry.py new file mode 100644 index 00000000..881a95e6 --- /dev/null +++ b/aur/tray_entry.py @@ -0,0 +1,17 @@ +# Generates a .desktop file based on the current python version. Used for AUR installation +import sys + +desktop_file = """ +[Desktop Entry] +Type = Application +Name = fpakman ( tray ) +Categories = System; +Comment = Manage your Flatpak / Snap applications +Exec = /usr/bin/fpakman +Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/logo.svg +""" + +py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) + +with open('fpakman_tray.desktop', 'w+') as f: + f.write(desktop_file.format(version=py_version)) From 93ba7cb8fc4a6d40d51b2588d2df468519105f9d Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 2 Aug 2019 23:21:43 -0300 Subject: [PATCH 06/23] upgrading version --- CHANGELOG.md | 2 +- fpakman/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12fd4bc2..a7dfeb30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [0.4.3] +## [0.5.0] ### Improvements - new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray) - search results sorting takes an average of 35% less time, reaching 60% in some scenarios diff --git a/fpakman/__init__.py b/fpakman/__init__.py index 3d6ddf33..37b3cd4f 100644 --- a/fpakman/__init__.py +++ b/fpakman/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.4.3' +__version__ = '0.5.0' __app_name__ = 'fpakman' import os From 538074fd6a26b3abc74d25fad953b28f206c8289 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Sun, 4 Aug 2019 16:33:36 -0300 Subject: [PATCH 07/23] fix: checked / unchecked update button style --- fpakman/view/qt/apps_table.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index 4719977c..b757f741 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -25,14 +25,8 @@ class UpdateToggleButton(QWidget): self.app_view = app_view self.root = root self.locale_keys = locale_keys - self.on = { - 'text': self.locale_keys['bt.app_upgrade'], - 'style': 'QPushButton { ' + INSTALL_BT_STYLE.format(back='#04B404') + ' }' - } - self.off = { - 'text': self.locale_keys['bt.app_not_upgrade'], - 'style': 'QPushButton { ' + INSTALL_BT_STYLE.format(back='gray') + ' }' - } + self.unchecked_text = self.locale_keys['bt.app_upgrade'] + self.checked_text = self.locale_keys['bt.app_not_upgrade'] layout = QHBoxLayout() layout.setContentsMargins(3, 3, 3, 3) @@ -40,8 +34,9 @@ class UpdateToggleButton(QWidget): self.setLayout(layout) self.bt = QPushButton() - self.bt.setText(self.on['text']) - self.bt.setStyleSheet(self.on['style']) + self.bt.setText(self.unchecked_text) + self.bt.setStyleSheet('QPushButton { ' + INSTALL_BT_STYLE.format(back='#04B404') + ' } ' + + 'QPushButton:checked {' + INSTALL_BT_STYLE.format(back='gray') + '}') self.bt.setCheckable(True) self.bt.clicked.connect(self.change_state) layout.addWidget(self.bt) @@ -50,11 +45,9 @@ class UpdateToggleButton(QWidget): self.bt.click() def change_state(self, not_checked: bool): + self.bt.clearFocus() self.app_view.update_checked = not not_checked - - state = self.on if not not_checked else self.off - self.bt.setText(state['text']) - self.bt.setStyleSheet(state['style']) + self.bt.setText(self.unchecked_text if not not_checked else self.checked_text) self.root.change_update_state(change_filters=False) From cba7b688de9d1117df56033cc86eaf61a481a4f3 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Sun, 4 Aug 2019 17:26:42 -0300 Subject: [PATCH 08/23] i18n improvement --- fpakman/resources/locale/en | 4 ++-- fpakman/resources/locale/es | 4 ++-- fpakman/resources/locale/pt | 4 ++-- fpakman/view/qt/apps_table.py | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fpakman/resources/locale/en b/fpakman/resources/locale/en index 0f652326..e1116c87 100644 --- a/fpakman/resources/locale/en +++ b/fpakman/resources/locale/en @@ -4,9 +4,9 @@ manage_window.columns.update=Upgrade ? manage_window.apps_table.row.actions.info=Information manage_window.apps_table.row.actions.history=History 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.uninstall.popup.body=Remove {} from your computer ? 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.install.popup.body=Install {} on your computer ? 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 diff --git a/fpakman/resources/locale/es b/fpakman/resources/locale/es index 4299eea2..43089e89 100644 --- a/fpakman/resources/locale/es +++ b/fpakman/resources/locale/es @@ -6,9 +6,9 @@ manage_window.apps_table.row.actions.info=Información 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.uninstall.popup.body=¿Eliminar {} de tu ordenador? 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.install.popup.body=¿Instalar {} en tu ordenador? 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 diff --git a/fpakman/resources/locale/pt b/fpakman/resources/locale/pt index 34579fd2..ceacb8cc 100644 --- a/fpakman/resources/locale/pt +++ b/fpakman/resources/locale/pt @@ -6,9 +6,9 @@ manage_window.apps_table.row.actions.info=Informação 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.uninstall.popup.body=Remover {} do seu computador ? 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.install.popup.body=Instalar {} no seu computador ? 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 diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index b757f741..261b28f6 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -35,6 +35,7 @@ class UpdateToggleButton(QWidget): self.bt = QPushButton() self.bt.setText(self.unchecked_text) + self.bt.setToolTip(self.locale_keys['manage_window.apps_table.upgrade_toggle.tooltip']) self.bt.setStyleSheet('QPushButton { ' + INSTALL_BT_STYLE.format(back='#04B404') + ' } ' + 'QPushButton:checked {' + INSTALL_BT_STYLE.format(back='gray') + '}') self.bt.setCheckable(True) From 99a7782d61086c66f1cc383dc4d96d12dafb3c83 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Sun, 4 Aug 2019 21:41:56 -0300 Subject: [PATCH 09/23] changing version color --- fpakman/view/qt/apps_table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index 261b28f6..fb2f4d19 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -285,7 +285,7 @@ class AppsTable(QTableWidget): tooltip = self.window.locale_keys['version.unknown'] if app_v.model.update: - label_version.setStyleSheet("color: #45ab27") + label_version.setStyleSheet("color: gold") tooltip = self.window.locale_keys['version.installed_outdated'] if app_v.model.base_data.version and app_v.model.base_data.latest_version and app_v.model.base_data.version < app_v.model.base_data.latest_version: From d326081eb76e90e202d356c41a879e35abd73dca Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 15:29:21 -0300 Subject: [PATCH 10/23] UI improvements --- CHANGELOG.md | 2 + fpakman/core/flatpak/model.py | 8 +- fpakman/resources/img/app_info.svg | 126 ++++++++++++++++++++ fpakman/resources/img/app_settings.svg | 63 ++++++++++ fpakman/resources/img/app_update.svg | 76 ++++++++++++ fpakman/resources/img/info.svg | 155 ------------------------- fpakman/resources/img/toggle_off.svg | 69 ----------- fpakman/resources/img/toggle_on.svg | 93 --------------- fpakman/view/qt/apps_table.py | 116 ++++++++++++------ fpakman/view/qt/history.py | 12 +- fpakman/view/qt/info.py | 16 ++- fpakman/view/qt/thread.py | 4 +- fpakman/view/qt/window.py | 6 +- 13 files changed, 378 insertions(+), 368 deletions(-) create mode 100755 fpakman/resources/img/app_info.svg create mode 100755 fpakman/resources/img/app_settings.svg create mode 100755 fpakman/resources/img/app_update.svg delete mode 100755 fpakman/resources/img/info.svg delete mode 100755 fpakman/resources/img/toggle_off.svg delete mode 100755 fpakman/resources/img/toggle_on.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index a7dfeb30..8da9f3ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - showing a warning popup after initialization when no Flatpak remotes are set - installed / uninstalled icons replaced by install / uninstall button for better UX - check update button design changed for better UX +- 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" button is clicked - minor GUI improvements ### Fixes: diff --git a/fpakman/core/flatpak/model.py b/fpakman/core/flatpak/model.py index 8562becd..19966ef7 100644 --- a/fpakman/core/flatpak/model.py +++ b/fpakman/core/flatpak/model.py @@ -18,19 +18,19 @@ class FlatpakApplication(Application): return self.base_data.description is None and self.base_data.icon_url def has_history(self): - return True + return self.installed def has_info(self): return self.installed def can_be_downgraded(self): - return True + return self.installed def can_be_uninstalled(self): - return True + return self.installed def can_be_installed(self): - return True + return not self.installed def get_type(self): return 'flatpak' diff --git a/fpakman/resources/img/app_info.svg b/fpakman/resources/img/app_info.svg new file mode 100755 index 00000000..442805df --- /dev/null +++ b/fpakman/resources/img/app_info.svg @@ -0,0 +1,126 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fpakman/resources/img/app_settings.svg b/fpakman/resources/img/app_settings.svg new file mode 100755 index 00000000..784659f8 --- /dev/null +++ b/fpakman/resources/img/app_settings.svg @@ -0,0 +1,63 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/fpakman/resources/img/app_update.svg b/fpakman/resources/img/app_update.svg new file mode 100755 index 00000000..0037b9e9 --- /dev/null +++ b/fpakman/resources/img/app_update.svg @@ -0,0 +1,76 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/fpakman/resources/img/info.svg b/fpakman/resources/img/info.svg deleted file mode 100755 index a276e4fb..00000000 --- a/fpakman/resources/img/info.svg +++ /dev/null @@ -1,155 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fpakman/resources/img/toggle_off.svg b/fpakman/resources/img/toggle_off.svg deleted file mode 100755 index 48f4b89a..00000000 --- a/fpakman/resources/img/toggle_off.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/fpakman/resources/img/toggle_on.svg b/fpakman/resources/img/toggle_on.svg deleted file mode 100755 index 4d89b0ca..00000000 --- a/fpakman/resources/img/toggle_on.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index fb2f4d19..d281922a 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -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, QWidget, \ - QHeaderView, QLabel, QHBoxLayout, QPushButton + QHeaderView, QLabel, QHBoxLayout, QPushButton, QToolButton, QToolBar from fpakman.core import resource from fpakman.core.model import ApplicationStatus @@ -18,37 +18,56 @@ from fpakman.view.qt.view_model import ApplicationView, ApplicationViewStatus INSTALL_BT_STYLE = 'background: {back}; color: white; font-size: 10px; font-weight: bold' +class IconButton(QWidget): + + def __init__(self, icon_path: str, action, background: str = None, align: int = Qt.AlignCenter, tooltip: str = None): + super(IconButton, self).__init__() + self.bt = QToolButton() + self.bt.setIcon(QIcon(icon_path)) + self.bt.clicked.connect(action) + + if background: + self.bt.setStyleSheet('QToolButton { color: white; background: ' + background + '}') + + if tooltip: + self.bt.setToolTip(tooltip) + + layout = QHBoxLayout() + layout.setContentsMargins(0, 0, 0, 0) + layout.setAlignment(align) + layout.addWidget(self.bt) + self.setLayout(layout) + + class UpdateToggleButton(QWidget): def __init__(self, app_view: ApplicationView, root: QWidget, locale_keys: dict, checked: bool = True): super(UpdateToggleButton, self).__init__() + self.app_view = app_view self.root = root - self.locale_keys = locale_keys - self.unchecked_text = self.locale_keys['bt.app_upgrade'] - self.checked_text = self.locale_keys['bt.app_not_upgrade'] layout = QHBoxLayout() - layout.setContentsMargins(3, 3, 3, 3) + layout.setContentsMargins(2, 2, 2, 0) layout.setAlignment(Qt.AlignCenter) self.setLayout(layout) - self.bt = QPushButton() - self.bt.setText(self.unchecked_text) - self.bt.setToolTip(self.locale_keys['manage_window.apps_table.upgrade_toggle.tooltip']) - self.bt.setStyleSheet('QPushButton { ' + INSTALL_BT_STYLE.format(back='#04B404') + ' } ' + - 'QPushButton:checked {' + INSTALL_BT_STYLE.format(back='gray') + '}') + self.bt = QToolButton() self.bt.setCheckable(True) self.bt.clicked.connect(self.change_state) + + self.bt.setIcon(QIcon(resource.get_path('img/app_update.svg'))) + self.bt.setStyleSheet('QToolButton { background: #4EC306 } ' + + 'QToolButton:checked { background: gray }') layout.addWidget(self.bt) + self.setToolTip(locale_keys['manage_window.apps_table.upgrade_toggle.tooltip']) + if not checked: self.bt.click() def change_state(self, not_checked: bool): - self.bt.clearFocus() self.app_view.update_checked = not not_checked - self.bt.setText(self.unchecked_text if not not_checked else self.checked_text) self.root.change_update_state(change_filters=False) @@ -60,12 +79,7 @@ class AppsTable(QTableWidget): self.window = parent self.disk_cache = disk_cache self.download_icons = download_icons - self.column_names = [parent.locale_keys[key].capitalize() for key in ['name', - 'version', - 'description', - 'type', - 'installed', - 'manage_window.columns.update']] + self.column_names = ['' for _ in range(7)] self.setColumnCount(len(self.column_names)) self.setFocusPolicy(Qt.NoFocus) self.setShowGrid(False) @@ -83,35 +97,46 @@ class AppsTable(QTableWidget): self.icon_cache = icon_cache self.lock_async_data = Lock() - def contextMenuEvent(self, QContextMenuEvent): # selected row right click event - - app = self.get_selected_app() + def has_any_settings(self, app_v: ApplicationView): + return app_v.model.can_be_refreshed() or \ + app_v.model.has_history() or \ + app_v.model.can_be_downgraded() + def show_app_settings(self, app: ApplicationView): menu_row = QMenu() - 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'))) - action_info.triggered.connect(self._get_app_info) - menu_row.addAction(action_info) - if app.model.installed: - if app.model.can_be_refreshed(): action_history = QAction(self.window.locale_keys["manage_window.apps_table.row.actions.refresh"]) action_history.setIcon(QIcon(resource.get_path('img/refresh.svg'))) - action_history.triggered.connect(self._refresh_app) + + def refresh(): + self.window.refresh(app) + + action_history.triggered.connect(refresh) menu_row.addAction(action_history) if app.model.has_history(): action_history = QAction(self.window.locale_keys["manage_window.apps_table.row.actions.history"]) action_history.setIcon(QIcon(resource.get_path('img/history.svg'))) - action_history.triggered.connect(self._get_app_history) + + def show_history(): + self.window.get_app_history(app) + + action_history.triggered.connect(show_history) menu_row.addAction(action_history) 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) + + def downgrade(): + if dialog.ask_confirmation( + title=self.window.locale_keys['manage_window.apps_table.row.actions.downgrade'], + body=self.window.locale_keys['manage_window.apps_table.row.actions.downgrade.popup.body'].format(app.model.base_data.name), + locale_keys=self.window.locale_keys): + self.window.downgrade_app(app) + + action_downgrade.triggered.connect(downgrade) action_downgrade.setIcon(QIcon(resource.get_path('img/downgrade.svg'))) menu_row.addAction(action_downgrade) @@ -219,12 +244,14 @@ class AppsTable(QTableWidget): self._set_col_type(idx, app_v) self._set_col_installed(idx, app_v) + self._set_col_settings(idx, app_v) + col_update = None if update_check_enabled and app_v.model.update: col_update = UpdateToggleButton(app_v, self.window, self.window.locale_keys, app_v.model.update) - self.setCellWidget(idx, 5, col_update) + self.setCellWidget(idx, 6, col_update) def _gen_row_button(self, text: str, style: str, callback) -> QWidget: col = QWidget() @@ -234,7 +261,7 @@ class AppsTable(QTableWidget): col_bt.clicked.connect(callback) layout = QHBoxLayout() - layout.setContentsMargins(3, 3, 3, 3) + layout.setContentsMargins(2, 2, 2, 1) layout.setAlignment(Qt.AlignCenter) layout.addWidget(col_bt) col.setLayout(layout) @@ -257,7 +284,7 @@ class AppsTable(QTableWidget): elif app_v.model.can_be_installed(): def install(): self._install_app(app_v) - col = self._gen_row_button(self.window.locale_keys['install'].capitalize(), INSTALL_BT_STYLE.format(back='green'), install) + col = self._gen_row_button(self.window.locale_keys['install'].capitalize(), INSTALL_BT_STYLE.format(back='#088A08'), install) else: col = None @@ -285,7 +312,7 @@ class AppsTable(QTableWidget): tooltip = self.window.locale_keys['version.unknown'] if app_v.model.update: - label_version.setStyleSheet("color: gold") + label_version.setStyleSheet("color: #4EC306; font-weight: bold") tooltip = self.window.locale_keys['version.installed_outdated'] if app_v.model.base_data.version and app_v.model.base_data.latest_version and app_v.model.base_data.version < app_v.model.base_data.latest_version: @@ -337,6 +364,25 @@ class AppsTable(QTableWidget): self.setItem(idx, 2, col) + def _set_col_settings(self, idx: int, app_v: ApplicationView): + tb = QToolBar() + + if app_v.model.has_info(): + + def get_info(): + self.window.get_app_info(app_v) + + tb.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#12ABAB')) + + def handle_click(): + self.show_app_settings(app_v) + + if self.has_any_settings(app_v): + bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='gray') + tb.addWidget(bt) + + self.setCellWidget(idx, 5, tb) + def change_headers_policy(self, policy: QHeaderView = QHeaderView.ResizeToContents): header_horizontal = self.horizontalHeader() for i in range(self.columnCount()): diff --git a/fpakman/view/qt/history.py b/fpakman/view/qt/history.py index 12e0e73a..80503b47 100644 --- a/fpakman/view/qt/history.py +++ b/fpakman/view/qt/history.py @@ -2,17 +2,18 @@ import operator from functools import reduce from PyQt5.QtCore import Qt -from PyQt5.QtGui import QIcon, QColor +from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QDialog, QVBoxLayout, QTableWidget, QTableWidgetItem, QHeaderView +from fpakman.util.cache import Cache + class HistoryDialog(QDialog): - def __init__(self, app: dict, app_icon: QIcon, locale_keys: dict): + def __init__(self, app: dict, icon_cache: Cache, locale_keys: dict): super(HistoryDialog, self).__init__() self.setWindowTitle('{} - {} '.format(locale_keys['popup.history.title'], app['model'].base_data.name)) - self.setWindowIcon(app_icon) layout = QVBoxLayout() self.setLayout(layout) @@ -52,3 +53,8 @@ class HistoryDialog(QDialog): new_width = reduce(operator.add, [table_history.columnWidth(i) for i in range(table_history.columnCount())]) self.resize(new_width, table_history.height()) + + icon_data = icon_cache.get(app['model'].base_data.icon_url) + + if icon_data and icon_data.get('icon'): + self.setWindowIcon(icon_data.get('icon')) diff --git a/fpakman/view/qt/info.py b/fpakman/view/qt/info.py index 9794deb8..3d0847f3 100644 --- a/fpakman/view/qt/info.py +++ b/fpakman/view/qt/info.py @@ -1,17 +1,18 @@ from PyQt5.QtCore import QSize -from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QDialog, QVBoxLayout, QFormLayout, QGroupBox, \ QLineEdit, QLabel from fpakman.util import util +from fpakman.util.cache import Cache + +IGNORED_ATTRS = {'name', '__app__'} class InfoDialog(QDialog): - def __init__(self, app: dict, app_icon: QIcon, locale_keys: dict, app_type: str, screen_size: QSize()): + def __init__(self, app: dict, icon_cache: Cache, locale_keys: dict, screen_size: QSize()): super(InfoDialog, self).__init__() self.setWindowTitle(app['name']) - self.setWindowIcon(app_icon) self.screen_size = screen_size layout = QVBoxLayout() self.setLayout(layout) @@ -23,8 +24,13 @@ class InfoDialog(QDialog): layout.addWidget(gbox_info) + icon_data = icon_cache.get(app['__app__'].model.base_data.icon_url) + + if icon_data and icon_data.get('icon'): + self.setWindowIcon(icon_data.get('icon')) + for attr in sorted(app.keys()): - if attr != 'name' and app[attr]: + if attr not in IGNORED_ATTRS and app[attr]: val = app[attr] text = QLineEdit() text.setToolTip(val) @@ -41,7 +47,7 @@ class InfoDialog(QDialog): text.setStyleSheet("width: 400px") text.setReadOnly(True) - label = QLabel("{}: ".format(locale_keys.get(app_type + '.info.' + attr, attr)).capitalize()) + label = QLabel("{}: ".format(locale_keys.get(app['__app__'].model.get_type() + '.info.' + attr, attr)).capitalize()) label.setStyleSheet("font-weight: bold") gbox_info_layout.addRow(label, text) diff --git a/fpakman/view/qt/thread.py b/fpakman/view/qt/thread.py index d98ab75e..f0506167 100644 --- a/fpakman/view/qt/thread.py +++ b/fpakman/view/qt/thread.py @@ -159,7 +159,9 @@ class GetAppInfo(QThread): def run(self): if self.app: - self.signal_finished.emit(self.manager.get_info(self.app.model)) + info = {'__app__': self.app} + info.update(self.manager.get_info(self.app.model)) + self.signal_finished.emit(info) self.app = None diff --git a/fpakman/view/qt/window.py b/fpakman/view/qt/window.py index 1605e828..dd56a0e5 100755 --- a/fpakman/view/qt/window.py +++ b/fpakman/view/qt/window.py @@ -288,7 +288,7 @@ class ManageWindow(QWidget): def refresh(self, app: ApplicationView): pwd = None - requires_root = self.manager.requires_root('refresh', self.table_apps.get_selected_app().model) + requires_root = self.manager.requires_root('refresh', app.model) if not is_root() and requires_root: pwd, ok = ask_root_password(self.locale_keys) @@ -586,7 +586,7 @@ class ManageWindow(QWidget): def _finish_get_info(self, app_info: dict): self.finish_action() - dialog_info = InfoDialog(app_info, self.table_apps.get_selected_app_icon(), self.locale_keys, self.table_apps.get_selected_app().model.get_type(), self.screen_size) + dialog_info = InfoDialog(app=app_info, icon_cache=self.icon_cache, locale_keys=self.locale_keys, screen_size=self.screen_size) dialog_info.exec_() def _finish_get_history(self, app: dict): @@ -597,7 +597,7 @@ class ManageWindow(QWidget): self.textarea_output.appendPlainText(app['error']) self.checkbox_console.setChecked(True) else: - dialog_history = HistoryDialog(app, self.table_apps.get_selected_app_icon(), self.locale_keys) + dialog_history = HistoryDialog(app, self.icon_cache, self.locale_keys) dialog_history.exec_() def search(self): From 31f981d9108cb1350ab20814223b57f48eed5ba6 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 15:35:42 -0300 Subject: [PATCH 11/23] improving settings button color --- fpakman/view/qt/apps_table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index d281922a..1fad70ac 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -378,7 +378,7 @@ class AppsTable(QTableWidget): self.show_app_settings(app_v) if self.has_any_settings(app_v): - bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='gray') + bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#2E68D3') tb.addWidget(bt) self.setCellWidget(idx, 5, tb) From ae96bfd577f139436c0694b11068c4da0b4c78b0 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 15:45:56 -0300 Subject: [PATCH 12/23] fix: button upgrade all keeps disabled after retrieving info / history --- fpakman/view/qt/window.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fpakman/view/qt/window.py b/fpakman/view/qt/window.py index dd56a0e5..6cf0d230 100755 --- a/fpakman/view/qt/window.py +++ b/fpakman/view/qt/window.py @@ -586,11 +586,13 @@ class ManageWindow(QWidget): def _finish_get_info(self, app_info: dict): self.finish_action() + self.change_update_state(change_filters=False) dialog_info = InfoDialog(app=app_info, icon_cache=self.icon_cache, locale_keys=self.locale_keys, screen_size=self.screen_size) dialog_info.exec_() def _finish_get_history(self, app: dict): self.finish_action() + self.change_update_state(change_filters=False) if app.get('error'): self._handle_console_option(True) From 45636448eab671407742addc216e511c13ae70c0 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 15:54:31 -0300 Subject: [PATCH 13/23] confirmation dialog for upgrade all button --- CHANGELOG.md | 2 +- fpakman/resources/locale/en | 4 +++- fpakman/resources/locale/es | 4 +++- fpakman/resources/locale/pt | 4 +++- fpakman/view/qt/window.py | 13 +++++++++---- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8da9f3ad..9d9900a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - check update button design changed for better UX - 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" button is clicked +- a confirmation popup is shown when the "install" / "upgrade all" button is clicked - minor GUI improvements ### Fixes: - apps table not showing empty descriptions diff --git a/fpakman/resources/locale/en b/fpakman/resources/locale/en index e1116c87..26f8980d 100644 --- a/fpakman/resources/locale/en +++ b/fpakman/resources/locale/en @@ -108,4 +108,6 @@ flatpak.notification.no_remotes=No Flatpak remotes set. It will not be possible install=install uninstall=uninstall bt.app_upgrade=Upgrade -bt.app_not_upgrade=Don't upgrade \ No newline at end of file +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 diff --git a/fpakman/resources/locale/es b/fpakman/resources/locale/es index 43089e89..60948b0a 100644 --- a/fpakman/resources/locale/es +++ b/fpakman/resources/locale/es @@ -110,4 +110,6 @@ flatpak.notification.no_remotes=No hay repositorios (remotes) Flatpak configurad install=instalar uninstall=desinstalar bt.app_upgrade=Actualizar -bt.app_not_upgrade=No actualizar \ No newline at end of file +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 diff --git a/fpakman/resources/locale/pt b/fpakman/resources/locale/pt index ceacb8cc..f3b4ec6a 100644 --- a/fpakman/resources/locale/pt +++ b/fpakman/resources/locale/pt @@ -110,4 +110,6 @@ flatpak.notification.no_remotes=Não há repositórios (remotes) Flatpak configu install=instalar uninstall=desinstalar bt.app_upgrade=Atualizar -bt.app_not_upgrade=Não atualizar \ No newline at end of file +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 diff --git a/fpakman/view/qt/window.py b/fpakman/view/qt/window.py index 6cf0d230..b86798a8 100755 --- a/fpakman/view/qt/window.py +++ b/fpakman/view/qt/window.py @@ -11,6 +11,7 @@ from fpakman.core import resource, system 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.apps_table import AppsTable from fpakman.view.qt.history import HistoryDialog from fpakman.view.qt.info import InfoDialog @@ -488,11 +489,15 @@ class ManageWindow(QWidget): to_update = [app_v for app_v in self.apps if app_v.visible and app_v.update_checked] if to_update: - self._handle_console_option(True) + if dialog.ask_confirmation( + title=self.locale_keys['manage_window.upgrade_all.popup.title'], + body=self.locale_keys['manage_window.upgrade_all.popup.body'], + locale_keys=self.locale_keys): + self._handle_console_option(True) - self._begin_action(self.locale_keys['manage_window.status.upgrading']) - self.thread_update.apps_to_update = to_update - self.thread_update.start() + self._begin_action(self.locale_keys['manage_window.status.upgrading']) + self.thread_update.apps_to_update = to_update + self.thread_update.start() def _finish_update_selected(self, success: bool, updated: int): self.finish_action() From a129c74e1064ef5842af4817f453891ec44cac30 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 15:56:04 -0300 Subject: [PATCH 14/23] switching info / settings button colors --- fpakman/view/qt/apps_table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index 1fad70ac..2fac3f3b 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -372,13 +372,13 @@ class AppsTable(QTableWidget): def get_info(): self.window.get_app_info(app_v) - tb.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#12ABAB')) + tb.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#2E68D3')) def handle_click(): self.show_app_settings(app_v) if self.has_any_settings(app_v): - bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#2E68D3') + bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#12ABAB') tb.addWidget(bt) self.setCellWidget(idx, 5, tb) From 1149a6d363ca250d8ada3717e131f3bbb691412e Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 17:00:51 -0300 Subject: [PATCH 15/23] 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 From 193c8bc2bc2d09919d53fd9d440bd325b3585832 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 17:23:53 -0300 Subject: [PATCH 16/23] fix: about button tooltip --- fpakman/view/qt/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpakman/view/qt/window.py b/fpakman/view/qt/window.py index 8c27f499..75109458 100755 --- a/fpakman/view/qt/window.py +++ b/fpakman/view/qt/window.py @@ -192,7 +192,7 @@ class ManageWindow(QWidget): self.toolbar_bottom.addWidget(self._new_spacer()) bt_about = QToolButton() - bt_about.setStyleSheet('border: 0px;') + bt_about.setStyleSheet('QToolButton { 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']) From 3f01ba8c3be35c67ca551c9d71eee0bbdc659f54 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 5 Aug 2019 22:06:37 -0300 Subject: [PATCH 17/23] app suggenstions when no app is installed --- CHANGELOG.md | 1 + README.md | 2 ++ fpakman/app.py | 7 ++++- fpakman/core/controller.py | 12 +++++++++ fpakman/core/flatpak/controller.py | 23 +++++++++++++++- fpakman/core/flatpak/flatpak.py | 42 ++++++++++++++++++++++-------- fpakman/core/snap/controller.py | 15 +++++++++++ fpakman/core/snap/snap.py | 9 ++++++- fpakman/view/qt/thread.py | 13 +++++++++ fpakman/view/qt/window.py | 32 ++++++++++++++++------- 10 files changed, 133 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d2a007c..aab61532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - a confirmation popup is shown when the "install" / "upgrade all" button is clicked - "About" button added to the manage panel - "Updates" icon left-aligned +- show application suggestions when no app is installed. Can be enabled / disabled through the environment variable / parameter FPAKMAN_SUGGESTIONS (--sugs) - minor GUI improvements ### Fixes: - apps table not showing empty descriptions diff --git a/README.md b/README.md index c8f022b3..e5edc104 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ You can change some application settings via environment variables or arguments - **FPAKMAN_SNAP**: enables / disables snap usage. Use **0** (disable) or **1** (enabled, default) - **FPAKMAN_CHECK_PACKAGING_ONCE**: If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Use **0** (disable, default) or **1** (enable). - **FPAKMAN_TRAY**: If the tray icon and update-check daemon should be created. Use **0** (disable) or **1** (enable, default). +- **FPAKMAN_SUGGESTIONS**: If application suggestions should be displayed if no app is installed (runtimes do not count as apps). Use **0** (disable) or **1** (enable, default). ### How to improve the application performance - If you don't care about a specific packaging technology and don't want **fpakman** to deal with it, just disable it via the specific argument or environment variable. For instance, if I don't care @@ -60,6 +61,7 @@ about **snaps**, I can initialize the application setting "snap=0" (**fpakman -- with the technology that I don't care every time an action is executed. - If you don't care about restarting **fpakman** every time a new supported packaging technology is installed, set "check-packaging-once=1" (**fpakman --check-packaging-once=1**). This can reduce the application response time up to 80% in some scenarios, since it won't need to recheck if the packaging type is available for every action you request. - If you don't mind to see the applications icons, you can set "download-icons=0" (**fpakman --download-icons=0**). The application may have a slight response improvement, since it will reduce the parallelism within it. +- If you don't mind app suggestions, disable it (**fpakman --sugs=0**) ### Roadmap - Support for other packaging technologies diff --git a/fpakman/app.py b/fpakman/app.py index 25a8265e..89d6e8da 100755 --- a/fpakman/app.py +++ b/fpakman/app.py @@ -47,6 +47,7 @@ parser.add_argument('--flatpak', action="store", default=os.getenv('FPAKMAN_FLAT parser.add_argument('--snap', action="store", default=os.getenv('FPAKMAN_SNAP', 1), choices=[0, 1], type=int, help='Enables / disables snap usage. Default: %(default)s') parser.add_argument('-co', '--check-packaging-once', action="store", default=os.getenv('FPAKMAN_CHECK_PACKAGING_ONCE', 0), choices=[0, 1], type=int, help='If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Default: %(default)s') parser.add_argument('--tray', action="store", default=os.getenv('FPAKMAN_TRAY', 1), choices=[0, 1], type=int, help='If the tray icon and update-check daemon should be created. Default: %(default)s') +parser.add_argument('--sugs', action="store", default=os.getenv('FPAKMAN_SUGGESTIONS', 1), choices=[0, 1], type=int, help='If app suggestions should be displayed if no app is installed (runtimes do not count as apps). Default: %(default)s') args = parser.parse_args() if args.cache_exp < 0: @@ -78,6 +79,9 @@ if args.download_icons == 0: if args.check_packaging_once == 1: log_msg("'check-packaging-once' is enabled", Fore.YELLOW) +if args.sugs == 0: + log_msg("suggestions are disabled", Fore.YELLOW) + locale_keys = util.get_locale_keys(args.locale) http_session = requests.Session() @@ -122,7 +126,8 @@ manage_window = ManageWindow(locale_keys=locale_keys, icon_cache=icon_cache, disk_cache=args.disk_cache, download_icons=bool(args.download_icons), - screen_size=screen_size) + screen_size=screen_size, + suggestions=args.sugs) if args.tray: trayIcon = TrayIcon(locale_keys=locale_keys, diff --git a/fpakman/core/controller.py b/fpakman/core/controller.py index 99161e8e..fd09417d 100755 --- a/fpakman/core/controller.py +++ b/fpakman/core/controller.py @@ -90,6 +90,10 @@ class ApplicationManager(ABC): def list_warnings(self) -> List[str]: pass + @abstractmethod + def list_suggestions(self, limit: int) -> List[Application]: + pass + class GenericApplicationManager(ApplicationManager): @@ -285,3 +289,11 @@ class GenericApplicationManager(ApplicationManager): warnings.extend(man_warnings) return warnings + + def list_suggestions(self, limit: int) -> List[Application]: + if self.managers: + suggestions = [] + for man in self.managers: + if self._is_enabled(man): + suggestions.extend(man.list_suggestions(5)) + return suggestions diff --git a/fpakman/core/flatpak/controller.py b/fpakman/core/flatpak/controller.py index 83292e4e..eec8dbf2 100644 --- a/fpakman/core/flatpak/controller.py +++ b/fpakman/core/flatpak/controller.py @@ -46,7 +46,9 @@ class FlatpakManager(ApplicationManager): if not api_data or expired_data: if not app_json['runtime']: - disk_loader.add(app) # preloading cached disk data + if disk_loader: + disk_loader.add(app) # preloading cached disk data + FlatpakAsyncDataLoader(app=app, api_cache=self.api_cache, manager=self, http_session=self.http_session).start() else: @@ -181,3 +183,22 @@ class FlatpakManager(ApplicationManager): def list_warnings(self) -> List[str]: if not flatpak.has_remotes_set(): return [self.locale_keys['flatpak.notification.no_remotes']] + + def list_suggestions(self, limit: int) -> List[FlatpakApplication]: + + res = [] + + if limit != 0: + + for app_id in ('com.spotify.Client', 'com.skype.Client', 'com.dropbox.Client', 'us.zoom.Zoom', 'com.visualstudio.code', 'org.inkscape.Inkscape', 'org.libretro.RetroArch', 'org.kde.kdenlive', 'org.videolan.VLC'): + + app_json = flatpak.search(app_id, app_id=True) + + if app_json: + res.append(self._map_to_model(app_json[0], False, None)) + + if len(res) == limit: + break + + return res + diff --git a/fpakman/core/flatpak/flatpak.py b/fpakman/core/flatpak/flatpak.py index 7b6a0646..410064d5 100755 --- a/fpakman/core/flatpak/flatpak.py +++ b/fpakman/core/flatpak/flatpak.py @@ -153,7 +153,7 @@ def get_app_commits_data(app_ref: str, origin: str) -> List[dict]: return commits -def search(word: str) -> List[dict]: +def search(word: str, app_id: bool = False) -> List[dict]: cli_version = get_version() res = system.run_cmd('{} search {}'.format(BASE_CMD, word)) @@ -166,13 +166,17 @@ def search(word: str) -> List[dict]: for info in split_res: if info: info_list = info.split('\t') - if cli_version >= '1.3.0': + id_ = info_list[2].strip() + + if app_id and id_ != word: + continue + version = info_list[3].strip() - found.append({ + app = { 'name': info_list[0].strip(), 'description': info_list[1].strip(), - 'id': info_list[2].strip(), + 'id': id_, 'version': version, 'latest_version': version, 'branch': info_list[4].strip(), @@ -180,14 +184,19 @@ def search(word: str) -> List[dict]: 'runtime': False, 'arch': None, # unknown at this moment, 'ref': None # unknown at this moment - }) + } elif cli_version >= '1.2.0': + id_ = info_list[1].strip() + + if app_id and id_ != word: + continue + desc = info_list[0].split('-') version = info_list[2].strip() - found.append({ + app = { 'name': desc[0].strip(), 'description': desc[1].strip(), - 'id': info_list[1].strip(), + 'id': id_, 'version': version, 'latest_version': version, 'branch': info_list[3].strip(), @@ -195,13 +204,18 @@ def search(word: str) -> List[dict]: 'runtime': False, 'arch': None, # unknown at this moment, 'ref': None # unknown at this moment - }) + } else: + id_ = info_list[0].strip() + + if app_id and id_ != word: + continue + version = info_list[1].strip() - found.append({ + app = { 'name': '', 'description': info_list[4].strip(), - 'id': info_list[0].strip(), + 'id': id_, 'version': version, 'latest_version': version, 'branch': info_list[2].strip(), @@ -209,7 +223,13 @@ def search(word: str) -> List[dict]: 'runtime': False, 'arch': None, # unknown at this moment, 'ref': None # unknown at this moment - }) + } + + found.append(app) + + if app_id and len(found) > 0: + break + return found diff --git a/fpakman/core/snap/controller.py b/fpakman/core/snap/controller.py index 9052ef48..593adeb1 100644 --- a/fpakman/core/snap/controller.py +++ b/fpakman/core/snap/controller.py @@ -137,3 +137,18 @@ class SnapManager(ApplicationManager): def list_warnings(self) -> List[str]: if snap.get_snapd_version() == 'unavailable': return [self.locale_keys['snap.notification.snapd_unavailable']] + + def list_suggestions(self, limit: int) -> List[SnapApplication]: + + suggestions = [] + + if limit != 0: + for name in ('whatsdesk', 'slack', 'yakyak', 'instagraph', 'eclipse', 'gimp', 'supertuxkart'): + res = snap.search(name, exact_name=True) + if res: + suggestions.append(self.map_json(res[0], installed=False, disk_loader=None)) + + if len(suggestions) == limit: + break + + return suggestions diff --git a/fpakman/core/snap/snap.py b/fpakman/core/snap/snap.py index af01c5ac..5421d9f0 100644 --- a/fpakman/core/snap/snap.py +++ b/fpakman/core/snap/snap.py @@ -86,7 +86,7 @@ def read_installed() -> List[dict]: return apps -def search(word: str) -> List[dict]: +def search(word: str, exact_name: bool = False) -> List[dict]: apps = [] res = system.run_cmd('{} find "{}"'.format(BASE_CMD, word), print_error=False) @@ -98,6 +98,10 @@ def search(word: str) -> List[dict]: for idx, app_str in enumerate(res): if idx > 0 and app_str: app_data = [word for word in app_str.split(' ') if word] + + if exact_name and app_data[0] != word: + continue + apps.append({ 'name': app_data[0], 'version': app_data[1], @@ -109,6 +113,9 @@ def search(word: str) -> List[dict]: 'type': None }) + if exact_name and len(apps) > 0: + break + return apps diff --git a/fpakman/view/qt/thread.py b/fpakman/view/qt/thread.py index f0506167..3ad1fde1 100644 --- a/fpakman/view/qt/thread.py +++ b/fpakman/view/qt/thread.py @@ -335,3 +335,16 @@ class RefreshApp(AsyncAction): finally: self.app = None self.signal_finished.emit(success) + + +class FindSuggestions(AsyncAction): + + signal_finished = pyqtSignal(list) + + def __init__(self, man: ApplicationManager): + super(FindSuggestions, self).__init__() + self.man = man + + def run(self): + self.signal_finished.emit(self.man.list_suggestions(limit=-1)) + \ No newline at end of file diff --git a/fpakman/view/qt/window.py b/fpakman/view/qt/window.py index 75109458..a3a4a89a 100755 --- a/fpakman/view/qt/window.py +++ b/fpakman/view/qt/window.py @@ -18,7 +18,7 @@ from fpakman.view.qt.history import HistoryDialog from fpakman.view.qt.info import InfoDialog from fpakman.view.qt.root import is_root, ask_root_password from fpakman.view.qt.thread import UpdateSelectedApps, RefreshApps, UninstallApp, DowngradeApp, GetAppInfo, \ - GetAppHistory, SearchApps, InstallApp, AnimateProgress, VerifyModels, RefreshApp + GetAppHistory, SearchApps, InstallApp, AnimateProgress, VerifyModels, RefreshApp, FindSuggestions from fpakman.view.qt.view_model import ApplicationView DARK_ORANGE = '#FF4500' @@ -27,7 +27,7 @@ DARK_ORANGE = '#FF4500' class ManageWindow(QWidget): __BASE_HEIGHT__ = 400 - def __init__(self, locale_keys: dict, icon_cache: Cache, manager: ApplicationManager, disk_cache: bool, download_icons: bool, screen_size, tray_icon=None): + def __init__(self, locale_keys: dict, icon_cache: Cache, manager: ApplicationManager, disk_cache: bool, download_icons: bool, screen_size, suggestions: bool, tray_icon=None): super(ManageWindow, self).__init__() self.locale_keys = locale_keys self.manager = manager @@ -177,6 +177,9 @@ class ManageWindow(QWidget): self.thread_refresh_app.signal_finished.connect(self._finish_refresh) self.thread_refresh_app.signal_output.connect(self._update_action_output) + self.thread_suggestions = FindSuggestions(man=self.manager) + self.thread_suggestions.signal_finished.connect(self._finish_search) + self.toolbar_bottom = QToolBar() self.toolbar_bottom.setIconSize(QSize(16, 16)) @@ -208,6 +211,7 @@ class ManageWindow(QWidget): self._maximized = False self.dialog_about = None + self.first_refresh = suggestions def _show_about(self): if self.dialog_about is None: @@ -286,6 +290,7 @@ class ManageWindow(QWidget): self.ref_checkbox_only_apps.setVisible(True) self.ref_bt_upgrade.setVisible(True) self.update_apps(apps) + self.first_refresh = False def uninstall_app(self, app: ApplicationView): pwd = None @@ -457,8 +462,14 @@ class ManageWindow(QWidget): self.apps.append(app_model) if napps == 0: - self.checkbox_only_apps.setChecked(False) - self.checkbox_only_apps.setCheckable(False) + + if self.first_refresh: + self._begin_search('') + self.thread_suggestions.start() + return + else: + self.checkbox_only_apps.setChecked(False) + self.checkbox_only_apps.setCheckable(False) else: self.checkbox_only_apps.setCheckable(True) self.checkbox_only_apps.setChecked(True) @@ -626,16 +637,19 @@ class ManageWindow(QWidget): dialog_history = HistoryDialog(app, self.icon_cache, self.locale_keys) dialog_history.exec_() + def _begin_search(self, word): + self._handle_console_option(False) + self.ref_checkbox_only_apps.setVisible(False) + self.ref_checkbox_updates.setVisible(False) + self.filter_updates = False + self._begin_action('{}{}'.format(self.locale_keys['manage_window.status.searching'], '"{}"'.format(word) if word else ''), clear_filters=True) + def search(self): word = self.input_search.text().strip() if word: - self._handle_console_option(False) - self.ref_checkbox_only_apps.setVisible(False) - self.ref_checkbox_updates.setVisible(False) - self.filter_updates = False - self._begin_action('{} "{}"'.format(self.locale_keys['manage_window.status.searching'], word), clear_filters=True) + self._begin_search(word) self.thread_search.word = word self.thread_search.start() From 921334431834e0948c8342ee6ad0d81e6f0f98b3 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 6 Aug 2019 00:29:02 -0300 Subject: [PATCH 18/23] improvements --- fpakman/core/controller.py | 2 +- fpakman/core/flatpak/controller.py | 2 +- fpakman/core/snap/controller.py | 2 +- fpakman/view/qt/apps_table.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fpakman/core/controller.py b/fpakman/core/controller.py index fd09417d..065dba1b 100755 --- a/fpakman/core/controller.py +++ b/fpakman/core/controller.py @@ -295,5 +295,5 @@ class GenericApplicationManager(ApplicationManager): suggestions = [] for man in self.managers: if self._is_enabled(man): - suggestions.extend(man.list_suggestions(5)) + suggestions.extend(man.list_suggestions(6)) return suggestions diff --git a/fpakman/core/flatpak/controller.py b/fpakman/core/flatpak/controller.py index eec8dbf2..710d70f8 100644 --- a/fpakman/core/flatpak/controller.py +++ b/fpakman/core/flatpak/controller.py @@ -190,7 +190,7 @@ class FlatpakManager(ApplicationManager): if limit != 0: - for app_id in ('com.spotify.Client', 'com.skype.Client', 'com.dropbox.Client', 'us.zoom.Zoom', 'com.visualstudio.code', 'org.inkscape.Inkscape', 'org.libretro.RetroArch', 'org.kde.kdenlive', 'org.videolan.VLC'): + for app_id in ('com.spotify.Client', 'com.skype.Client', 'com.dropbox.Client', 'us.zoom.Zoom', 'com.visualstudio.code', 'org.telegram.desktop', 'org.inkscape.Inkscape', 'org.libretro.RetroArch', 'org.kde.kdenlive', 'org.videolan.VLC'): app_json = flatpak.search(app_id, app_id=True) diff --git a/fpakman/core/snap/controller.py b/fpakman/core/snap/controller.py index 593adeb1..99a5eb70 100644 --- a/fpakman/core/snap/controller.py +++ b/fpakman/core/snap/controller.py @@ -143,7 +143,7 @@ class SnapManager(ApplicationManager): suggestions = [] if limit != 0: - for name in ('whatsdesk', 'slack', 'yakyak', 'instagraph', 'eclipse', 'gimp', 'supertuxkart'): + for name in ('whatsdesk', 'slack', 'yakyak', 'instagraph', 'pycharm-professional', 'eclipse', 'gimp', 'supertuxkart'): res = snap.search(name, exact_name=True) if res: suggestions.append(self.map_json(res[0], installed=False, disk_loader=None)) diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index 2fac3f3b..0d438cce 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -261,7 +261,7 @@ class AppsTable(QTableWidget): col_bt.clicked.connect(callback) layout = QHBoxLayout() - layout.setContentsMargins(2, 2, 2, 1) + layout.setContentsMargins(2, 3, 2, 0) layout.setAlignment(Qt.AlignCenter) layout.addWidget(col_bt) col.setLayout(layout) From 009e67dd2fc244727041be6e1223ddc3331d51ce Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 6 Aug 2019 11:00:17 -0300 Subject: [PATCH 19/23] action buttons layout fix --- fpakman/view/qt/apps_table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index 0d438cce..ca06ad80 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -261,7 +261,7 @@ class AppsTable(QTableWidget): col_bt.clicked.connect(callback) layout = QHBoxLayout() - layout.setContentsMargins(2, 3, 2, 0) + layout.setContentsMargins(2, 2, 2, 0) layout.setAlignment(Qt.AlignCenter) layout.addWidget(col_bt) col.setLayout(layout) From 9e1488d4894805c73a8b3317ee6fef00076509cc Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 6 Aug 2019 11:14:23 -0300 Subject: [PATCH 20/23] Update CHANGELOG.md --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aab61532..6047c153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,20 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [0.5.0] +## [0.5.0] - 2019-08-06 ### Improvements -- new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray) - 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 for better UX -- check update button design changed for better UX +- installed / uninstalled icons replaced by install / uninstall button +- check update button design changed - app information is now available through an "Info" button -- app extra actions are now available through a "Settings" button instead of right-click +- app extra actions are now available through a "Settings" button instead of a right-click - a confirmation popup is shown when the "install" / "upgrade all" button is clicked -- "About" button added to the manage panel +- "About" icon added to the manage panel - "Updates" icon left-aligned - show application suggestions when no app is installed. Can be enabled / disabled through the environment variable / parameter FPAKMAN_SUGGESTIONS (--sugs) +- showing a warning popup after initialization when no Flatpak remotes are set +- new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray) - minor GUI improvements ### Fixes: - apps table not showing empty descriptions From 05fc746922d7adb941116dbebb4c9700a64075f9 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 6 Aug 2019 14:48:12 -0300 Subject: [PATCH 21/23] Update LICENSE --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index f1bc9a28..bf9b45ea 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ - Copyright (c) 2017-2019 Philip Rebohle + Copyright (c) 2017-2019 Vinícius Moreira zlib/libpng license @@ -18,4 +18,4 @@ freely, subject to the following restrictions: – Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -– This notice may not be removed or altered from any source distribution. \ No newline at end of file +– This notice may not be removed or altered from any source distribution. From 98140a98dcdcbeafa7ece1cc4c5963a3cb758f94 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 6 Aug 2019 15:46:40 -0300 Subject: [PATCH 22/23] fix: flatpak dependency --- CHANGELOG.md | 4 ++++ fpakman/core/flatpak/controller.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6047c153..786987c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.5.1] +### Fixes: +- flatpak dependency + ## [0.5.0] - 2019-08-06 ### Improvements - search results sorting takes an average of 35% less time, reaching 60% in some scenarios diff --git a/fpakman/core/flatpak/controller.py b/fpakman/core/flatpak/controller.py index 710d70f8..f1d64b55 100644 --- a/fpakman/core/flatpak/controller.py +++ b/fpakman/core/flatpak/controller.py @@ -181,8 +181,9 @@ class FlatpakManager(ApplicationManager): return updates def list_warnings(self) -> List[str]: - if not flatpak.has_remotes_set(): - return [self.locale_keys['flatpak.notification.no_remotes']] + if flatpak.is_installed(): + if not flatpak.has_remotes_set(): + return [self.locale_keys['flatpak.notification.no_remotes']] def list_suggestions(self, limit: int) -> List[FlatpakApplication]: From 2d8c9bdf206e6d8ae912a3095b826f216beadb84 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 6 Aug 2019 15:59:37 -0300 Subject: [PATCH 23/23] changing version --- fpakman/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpakman/__init__.py b/fpakman/__init__.py index 37b3cd4f..522235a1 100644 --- a/fpakman/__init__.py +++ b/fpakman/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.5.0' +__version__ = '0.5.1' __app_name__ = 'fpakman' import os