Present replay 3D with the cursor and open Analyze on a remembered video
Replay left the 3D pane on the rest mesh or a sparse overlay, and Analyze skipped the setup dialog unless the file was re-picked. Live Run no longer starts a chain on a video path. Verified with Studio tests for flush, overlay mask, Analyze open, live-video refusal, and locales.
This commit is contained in:
@@ -184,6 +184,8 @@ class _Host:
|
||||
#: has no dialog, so the answer is the field a test sets.
|
||||
self.workspace = None
|
||||
self.workspace_requests: list = []
|
||||
self.workspace_kwargs: dict = {}
|
||||
self.override_requests: list = []
|
||||
|
||||
# AcquireGate reads (legacy private names kept as writeable fields for tests)
|
||||
@property
|
||||
@@ -238,10 +240,15 @@ class _Host:
|
||||
def current_source_kind(self) -> str:
|
||||
return "recompute"
|
||||
|
||||
def bare_video_workspace(self, video):
|
||||
def bare_video_workspace(self, video, **kwargs):
|
||||
self.workspace_requests.append(video)
|
||||
self.workspace_kwargs = dict(kwargs)
|
||||
return self.workspace
|
||||
|
||||
def recording_analysis_overrides(self, recording):
|
||||
self.override_requests.append(recording)
|
||||
return False
|
||||
|
||||
def analysis_service(self, recording, cancelled=None, *, on_progress=None):
|
||||
raise AssertionError("the test did not provide an analysis service")
|
||||
|
||||
@@ -577,3 +584,22 @@ def test_the_replay_entries_exist_only_in_the_replay_view(qt_app):
|
||||
assert actions["open_video"].enabled is True
|
||||
assert actions["open_video"].tooltips[-1] == ""
|
||||
assert parts[0].recompute_enabled[-1] is True
|
||||
|
||||
|
||||
def test_analyze_opens_a_remembered_video_that_is_not_loaded_yet(qt_app, tmp_path):
|
||||
"""A toolbar path alone used to notify ``playback.no_video`` and skip the dialog.
|
||||
|
||||
The rail can show a file name from a previous session while the engine has not opened
|
||||
anything. 「分析视频」 must call ``load_video`` so the setup prompt appears — the same
|
||||
path as picking the file again in the explorer.
|
||||
"""
|
||||
bare = tmp_path / "1.mp4"
|
||||
bare.write_bytes(b"not really a video")
|
||||
engine = _Engine(has_video=False, video_only=False)
|
||||
toolbar = _Toolbar(video_path=str(bare))
|
||||
controller, host, engine, parts = _controller(engine=engine, toolbar=toolbar)
|
||||
|
||||
controller.on_recompute_toggled(True)
|
||||
assert engine.opened == [("video", bare)], "the remembered file was not opened"
|
||||
assert host.workspace_requests == [bare], "the setup dialog was not shown"
|
||||
assert t("playback.no_video") not in host.notes
|
||||
|
||||
Reference in New Issue
Block a user