fix: resolve AttributeError by calling call_from_thread on self.app
This commit is contained in:
parent
599fa858f6
commit
78bac31c5f
1 changed files with 4 additions and 4 deletions
|
|
@ -197,7 +197,7 @@ class ProcessingScreen(Screen):
|
|||
|
||||
def _update_ui(self, phase: str, status: str, progress: float) -> None:
|
||||
"""Thread-safe UI update."""
|
||||
self.call_from_thread(self._do_update_ui, phase, status, progress)
|
||||
self.app.call_from_thread(self._do_update_ui, phase, status, progress)
|
||||
|
||||
def _do_update_ui(self, phase: str, status: str, progress: float) -> None:
|
||||
self.query_one("#phase-label", Label).update(phase)
|
||||
|
|
@ -268,7 +268,7 @@ class ProcessingScreen(Screen):
|
|||
|
||||
# Write face samples and transition to selection screen
|
||||
face_samples = self._write_face_samples()
|
||||
self.call_from_thread(
|
||||
self.app.call_from_thread(
|
||||
self.app.push_screen,
|
||||
FaceSelectionScreen(
|
||||
video_path=self.video_path,
|
||||
|
|
@ -571,7 +571,7 @@ class EncodingScreen(Screen):
|
|||
self.run_worker(self._encode(), thread=True)
|
||||
|
||||
def _update_ui(self, status: str, progress: float) -> None:
|
||||
self.call_from_thread(self._do_update_ui, status, progress)
|
||||
self.app.call_from_thread(self._do_update_ui, status, progress)
|
||||
|
||||
def _do_update_ui(self, status: str, progress: float) -> None:
|
||||
self.query_one("#encoding-status", Label).update(status)
|
||||
|
|
@ -597,7 +597,7 @@ class EncodingScreen(Screen):
|
|||
progress_callback=on_progress,
|
||||
)
|
||||
self._update_ui("Encoding complete!", 100)
|
||||
self.call_from_thread(self._show_done)
|
||||
self.app.call_from_thread(self._show_done)
|
||||
except Exception as e:
|
||||
self._update_ui(f"Error: {e}", 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue