MCPcopy Create free account
hub / github.com/MCSLTeam/MCSL2 / onPauseBtnClicked

Method onPauseBtnClicked

MCSL2Lib/Widgets/DownloadProgressWidget.py:468–484  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

466 )
467
468 def onPauseBtnClicked(self):
469 try:
470 self.pauseSwitch = not self.pauseSwitch
471 if self.pauseSwitch:
472 if hasattr(self, "pauseBtn") and self.pauseBtn:
473 self.pauseBtn.setText(self.tr("继续"))
474 if hasattr(self, "ProgressBar") and self.ProgressBar:
475 self.ProgressBar.pause()
476 else:
477 if hasattr(self, "pauseBtn") and self.pauseBtn:
478 self.pauseBtn.setText(self.tr("暂停"))
479 if hasattr(self, "ProgressBar") and self.ProgressBar:
480 self.ProgressBar.resume()
481 self.paused.emit(self.pauseSwitch)
482 except RuntimeError:
483 # 对象已被删除,静默忽略
484 pass
485
486 @pyqtSlot(dict)
487 def onInfoGet(self, info):

Callers

nothing calls this directly

Calls 2

pauseMethod · 0.80
resumeMethod · 0.80

Tested by

no test coverage detected