修改锁进度 以及禁用磁盘检查

This commit is contained in:
wangsong 2021-11-06 16:11:31 +08:00
parent 88f8d2aa70
commit b07dab2f2b
2 changed files with 11 additions and 12 deletions

View File

@ -81,7 +81,6 @@ class InstallBackendAptdaemon(InstallBackend):
try:
trans = yield self.client.update_cache(defer=True)
self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_UPDATE,
_("Checking for updates…"), False)
@ -104,7 +103,6 @@ class InstallBackendAptdaemon(InstallBackend):
pkgs_install, reinstall, pkgs_remove, purge = pkgs_purge, upgrade = pkgs_upgrade,
downgrade = downgrade, defer=True)
self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
yield self._show_transaction(trans, self.ACTION_INSTALL,
_("Installing updates…"), True)
@ -131,7 +129,6 @@ class InstallBackendAptdaemon(InstallBackend):
"""安装deb包 """
try:
trans = yield self.client.install_file(path = install_path,force = install_force,defer=True)
self.window_main.is_working = True
# 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_INSTALL_DEB,
_("Installing deb packages…"), False)
@ -151,7 +148,6 @@ class InstallBackendAptdaemon(InstallBackend):
try:
trans = yield self.client.fix_broken_depends(defer=True)
self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_FIX_BROKEN,
_("Installing deb packages…"), False)
@ -171,7 +167,6 @@ class InstallBackendAptdaemon(InstallBackend):
try:
trans = yield self.client.download_packages(pkg_names = pkg_lists, defer=True)
self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_DOWNLOADONLY,
_("Downloading deb packages…"), False)
@ -191,7 +186,6 @@ class InstallBackendAptdaemon(InstallBackend):
try:
trans = yield self.client.remove_packages(package_names = pkgs_purge,defer=True)
self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_REMOVE_PACKAGES,
_("Installing deb packages…"), False)

View File

@ -58,6 +58,9 @@ class InstallBackend():
def start(self,_upgrade_mode = MODE_DEFAULT_STATUS,partial_upgrade_list = []):
#对所有的操作进行枷锁 当执行完毕后返回到_action_done 进行解锁,除了计算依赖模式 不进入_action_done 单独解锁
self.window_main.is_working = True
#安装升级包 首先必须调用ACTION_CHECK_RESOLVER 计算依赖解决方便 标记cache 进行升级
if self.action == self.ACTION_INSTALL:
self.now_upgrade.upgrade_mode = _upgrade_mode
@ -78,11 +81,11 @@ class InstallBackend():
return
#检查磁盘的状态
_success,desc = check_free_space(self.cache)
if _success == False and desc != None:
header = _("Can not upgrade")
self._action_done(self.action,True,False,header,desc)
return
# _success,desc = check_free_space(self.cache)
# if _success == False and desc != None:
# header = _("Can not upgrade")
# self._action_done(self.action,True,False,header,desc)
# return
logging.info("Disk Check finished...")
try:
self.commit(pkgs_install, pkgs_upgrade, pkgs_remove)
@ -127,6 +130,8 @@ class InstallBackend():
raw_description.append(app.get_display_name())
else:
raw_description.append(getattr(pkg_obj.candidate, "summary", ''))
#解锁忙碌
self.window_main.is_working = False
if _upgrade_mode != MODE_UPGRADE_SYSTEM:
self.window_main.dbusController.UpdateDependResloveStatus(_success,is_remove_pkgs,pkgs_remove,raw_description,delete_desc,header,desc)
else: