fix: reset visible run logs for new runs
This commit is contained in:
+14
-2
@@ -146,7 +146,7 @@ class ApplyTab(QWidget):
|
||||
self.write_back_button.clicked.connect(self.write_back_results)
|
||||
|
||||
self.refresh_tasks()
|
||||
self._load_latest_run_log()
|
||||
self._show_current_run_log_empty()
|
||||
|
||||
def _set_status(self, message):
|
||||
if self.status_callback is not None:
|
||||
@@ -279,7 +279,7 @@ class ApplyTab(QWidget):
|
||||
self.apply_worker = worker
|
||||
self.apply_thread = thread
|
||||
self._set_apply_running(True)
|
||||
self.run_log_view.clear()
|
||||
self._reset_run_log(tasks, dry_run=dry_run, batch_size=batch_size)
|
||||
if dry_run:
|
||||
self._set_status(f"开始检查本轮更新:{len(tasks)} 条")
|
||||
else:
|
||||
@@ -626,6 +626,18 @@ class ApplyTab(QWidget):
|
||||
|
||||
def _append_run_log(self, message):
|
||||
self.run_log_view.appendPlainText(str(message))
|
||||
scroll_bar = self.run_log_view.verticalScrollBar()
|
||||
scroll_bar.setValue(scroll_bar.maximum())
|
||||
|
||||
def _show_current_run_log_empty(self):
|
||||
self.run_log_view.setPlainText("本轮日志会在开始运行后显示")
|
||||
|
||||
def _reset_run_log(self, tasks, dry_run=False, batch_size=1):
|
||||
self.run_log_view.clear()
|
||||
action = "检查" if dry_run else "更新"
|
||||
self._append_run_log(
|
||||
f"本轮{action}开始:任务 {len(tasks)} 条,每批 {batch_size} 条"
|
||||
)
|
||||
|
||||
def _load_latest_run_log(self):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user