fix: recreate batch resume action after release summary retirement
This commit is contained in:
1 parent
363a279157
commit
a7df105616
2 files changed
+8
-1
No files matched your search
@@ -465,7 +465,13 @@ class MainWindow(QWidget):
|
||||
if self._defer_mapping_finish(self._release_dialog_finished): return
|
||||
self._finished()
|
||||
pending = getattr(self, '_resume_batch', None)
|
||||
if pending and pending['released'] and getattr(self, 'summary', None) is not None:
|
||||
if pending and pending['released']:
|
||||
if getattr(self, 'summary', None) is None:
|
||||
self.summary = self._new_result_summary('_batch_summary')
|
||||
self.summary.setWindowTitle('继续未执行项')
|
||||
self._resume_batch_action = self.summary.addButton('继续未执行项', QMessageBox.ActionRole)
|
||||
self._resume_batch_action.clicked.connect(self._resume_released_batch)
|
||||
self._update()
|
||||
self.summary.setText('会话已释放,可以继续未执行项。')
|
||||
self.summary.show()
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ def test_released_batch_can_resume_only_its_unexecuted_items(qtbot, tmp_path, mo
|
||||
window.release_dialog.close()
|
||||
qtbot.waitUntil(lambda: not window.busy)
|
||||
assert window.summary.isVisible()
|
||||
action = window._resume_batch_action
|
||||
assert action.isEnabled()
|
||||
calls = []
|
||||
monkeypatch.setattr(window, '_run', lambda names, **kw: calls.append((names, kw)))
|
||||
|
||||
Reference in new issue
Block a user