[view] improvement: not requesting confirmation for custom package actions that do not require it

This commit is contained in:
Vinicius Moreira
2021-12-17 13:34:33 -03:00
parent b57003ed4f
commit 31b72d2879

View File

@@ -169,10 +169,10 @@ class PackagesTable(QTableWidget):
else: else:
body = '{} ?'.format(self.i18n[action.i18n_label_key]) body = '{} ?'.format(self.i18n[action.i18n_label_key])
if ConfirmationDialog(icon=QIcon(pkg.model.get_type_icon_path()), if not action.requires_confirmation or ConfirmationDialog(icon=QIcon(pkg.model.get_type_icon_path()),
title=self.i18n[action.i18n_label_key], title=self.i18n[action.i18n_label_key],
body=self._parag(body), body=self._parag(body),
i18n=self.i18n).ask(): i18n=self.i18n).ask():
self.window.begin_execute_custom_action(pkg, action) self.window.begin_execute_custom_action(pkg, action)
return QCustomMenuAction(parent=parent, return QCustomMenuAction(parent=parent,