mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 23:34:15 +02:00
[improvement][ui] not performing a full table refresh after installing a new package
This commit is contained in:
@@ -4,7 +4,8 @@ from datetime import datetime
|
||||
from threading import Thread
|
||||
from typing import List, Set, Type
|
||||
|
||||
from bauh.api.abstract.controller import SoftwareManager, SearchResult, ApplicationContext, UpgradeRequirements
|
||||
from bauh.api.abstract.controller import SoftwareManager, SearchResult, ApplicationContext, UpgradeRequirements, \
|
||||
TransactionResult
|
||||
from bauh.api.abstract.disk import DiskCacheLoader
|
||||
from bauh.api.abstract.handler import ProcessWatcher, TaskManager
|
||||
from bauh.api.abstract.model import SoftwarePackage, PackageHistory, PackageUpdate, PackageSuggestion, \
|
||||
@@ -174,7 +175,7 @@ class SnapManager(SoftwareManager):
|
||||
def get_history(self, pkg: SnapApplication) -> PackageHistory:
|
||||
raise Exception("'get_history' is not supported by {}".format(pkg.__class__.__name__))
|
||||
|
||||
def install(self, pkg: SnapApplication, root_password: str, watcher: ProcessWatcher) -> bool:
|
||||
def install(self, pkg: SnapApplication, root_password: str, disk_loader: DiskCacheLoader, watcher: ProcessWatcher) -> TransactionResult:
|
||||
info_path = self.get_info_path()
|
||||
|
||||
if not info_path:
|
||||
@@ -204,14 +205,16 @@ class SnapManager(SoftwareManager):
|
||||
if res and info_path:
|
||||
pkg.has_apps_field = snap.has_apps_field(pkg.name, info_path)
|
||||
|
||||
return res
|
||||
pkg.installed = res
|
||||
return TransactionResult(success=res, installed=[pkg] if res else [], removed=[])
|
||||
else:
|
||||
self.logger.error("Could not find available channels in the installation output: {}".format(output))
|
||||
else:
|
||||
if info_path:
|
||||
pkg.has_apps_field = snap.has_apps_field(pkg.name, info_path)
|
||||
|
||||
return res
|
||||
pkg.installed = res
|
||||
return TransactionResult(success=res, installed=[pkg] if res else [], removed=[])
|
||||
|
||||
def is_enabled(self) -> bool:
|
||||
return self.enabled
|
||||
|
||||
Reference in New Issue
Block a user