优化更新的进度
This commit is contained in:
parent
0fc2b1550f
commit
0d85dc2f28
|
@ -252,12 +252,10 @@ class InstallBackendAptdaemon(InstallBackend):
|
||||||
|
|
||||||
#进度回调
|
#进度回调
|
||||||
def _on_progress_changed(self, trans,progress,action):
|
def _on_progress_changed(self, trans,progress,action):
|
||||||
|
#不要101这种未知状态
|
||||||
if progress == 101:
|
if progress == 101:
|
||||||
return
|
return
|
||||||
|
|
||||||
if progress == 11:
|
|
||||||
progress = 10
|
|
||||||
|
|
||||||
self.trans_progress = progress
|
self.trans_progress = progress
|
||||||
self._dist_status_changed(action,self.now_upgrade.upgrade_groups+self.now_upgrade.single_pkgs,\
|
self._dist_status_changed(action,self.now_upgrade.upgrade_groups+self.now_upgrade.single_pkgs,\
|
||||||
self.trans_progress,self.trans_status,self.details)
|
self.trans_progress,self.trans_status,self.details)
|
||||||
|
@ -273,7 +271,10 @@ class InstallBackendAptdaemon(InstallBackend):
|
||||||
#分发进度状态和细节信息
|
#分发进度状态和细节信息
|
||||||
def _dist_status_changed(self,action,upgrade_content = [],progress = 0,status = '',details = ''):
|
def _dist_status_changed(self,action,upgrade_content = [],progress = 0,status = '',details = ''):
|
||||||
if action == self.ACTION_UPDATE: # 更新进度100后推迟发出100%的信号 -- 等待源过滤完成
|
if action == self.ACTION_UPDATE: # 更新进度100后推迟发出100%的信号 -- 等待源过滤完成
|
||||||
if self.trans_progress != 100:
|
if progress == 11:
|
||||||
|
progress = 15
|
||||||
|
|
||||||
|
if progress != 100:
|
||||||
self.window_main.dbusController.UpdateDetectStatusChanged(progress,status)
|
self.window_main.dbusController.UpdateDetectStatusChanged(progress,status)
|
||||||
elif action == self.ACTION_INSTALL:
|
elif action == self.ACTION_INSTALL:
|
||||||
#50%时候 属于下载状态切换到安装状态的过程
|
#50%时候 属于下载状态切换到安装状态的过程
|
||||||
|
|
Loading…
Reference in New Issue