[feature] ignore updates: Arch/AUR packages

This commit is contained in:
Vinicius Moreira
2020-05-17 14:36:22 -03:00
parent 86ba1aeda7
commit a320f30911
25 changed files with 566 additions and 12 deletions

View File

@@ -121,6 +121,7 @@ class AppsTable(QTableWidget):
menu_row.setCursor(QCursor(Qt.PointingHandCursor))
if pkg.model.installed:
if pkg.model.has_history():
action_history = QAction(self.i18n["manage_window.apps_table.row.actions.history"])
action_history.setIcon(QIcon(resource.get_path('img/history.svg')))
@@ -145,6 +146,21 @@ class AppsTable(QTableWidget):
action_downgrade.setIcon(QIcon(resource.get_path('img/downgrade.svg')))
menu_row.addAction(action_downgrade)
if pkg.model.supports_ignored_updates():
if pkg.model.is_update_ignored():
action_ignore_updates = QAction(
self.i18n["manage_window.apps_table.row.actions.ignore_updates_reverse"])
action_ignore_updates.setIcon(QIcon(resource.get_path('img/revert_update_ignored.svg')))
else:
action_ignore_updates = QAction(self.i18n["manage_window.apps_table.row.actions.ignore_updates"])
action_ignore_updates.setIcon(QIcon(resource.get_path('img/ignore_update.svg')))
def ignore_updates():
self.window.ignore_updates(pkg)
action_ignore_updates.triggered.connect(ignore_updates)
menu_row.addAction(action_ignore_updates)
if bool(pkg.model.get_custom_supported_actions()):
for action in pkg.model.get_custom_supported_actions():
item = QAction(self.i18n[action.i18_label_key])
@@ -263,7 +279,7 @@ class AppsTable(QTableWidget):
if change_update_col:
col_update = None
if update_check_enabled and pkg.model.update:
if update_check_enabled and not pkg.model.is_update_ignored() and pkg.model.update:
col_update = QToolBar()
col_update.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
col_update.addWidget(UpdateToggleButton(pkg=pkg,
@@ -351,11 +367,15 @@ class AppsTable(QTableWidget):
else:
tooltip = self.i18n['version.unknown']
if pkg.model.update:
if pkg.model.update and not pkg.model.is_update_ignored():
label_version.setStyleSheet("color: {}; font-weight: bold".format(GREEN))
tooltip = self.i18n['version.installed_outdated']
if pkg.model.installed and pkg.model.update and pkg.model.version and pkg.model.latest_version and pkg.model.version != pkg.model.latest_version:
if pkg.model.is_update_ignored():
label_version.setStyleSheet("color: {}; font-weight: bold".format(BROWN))
tooltip = self.i18n['version.updates_ignored']
if pkg.model.installed and pkg.model.update and not pkg.model.is_update_ignored() and pkg.model.version and pkg.model.latest_version and pkg.model.version != pkg.model.latest_version:
tooltip = '{}. {}: {}'.format(tooltip, self.i18n['version.latest'], pkg.model.latest_version)
label_version.setText(label_version.text() + ' > {}'.format(pkg.model.latest_version))