[view] improvement: displaying a tooltip with the missing dependencies for a supported packaging technology

This commit is contained in:
Vinicius Moreira
2021-11-22 15:48:48 -03:00
parent 5121bb40ef
commit c80845cde4
47 changed files with 525 additions and 47 deletions

View File

@@ -253,8 +253,8 @@ class SnapManager(SoftwareManager):
def set_enabled(self, enabled: bool):
self.enabled = enabled
def can_work(self) -> bool:
return snap.is_installed()
def can_work(self) -> Tuple[bool, Optional[str]]:
return (True, None) if snap.is_installed() else (False, self.i18n['missing_dep'].format(dep=bold('snap')))
def requires_root(self, action: SoftwareAction, pkg: SnapApplication) -> bool:
return action not in (SoftwareAction.PREPARE, SoftwareAction.SEARCH)