From 518f72be2c3f19afd983b2be61eaf510b95166d1 Mon Sep 17 00:00:00 2001 From: Jvshen Date: Fri, 24 May 2024 11:40:04 -0700 Subject: [PATCH 1/4] Add TODO comment --- sleap/gui/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sleap/gui/app.py b/sleap/gui/app.py index 25a07385d..98041756b 100644 --- a/sleap/gui/app.py +++ b/sleap/gui/app.py @@ -1391,6 +1391,8 @@ def updateStatusMessage(self, message: Optional[str] = None): else: self.statusBar().setStyleSheet("color: black") + # TODO(JS): Add Camera indicator test here + self.statusBar().showMessage(message) def resetPrefs(self): From 084fb0a56ce9795678a33aeec0bc79c740164124 Mon Sep 17 00:00:00 2001 From: Jvshen Date: Tue, 28 May 2024 19:38:27 -0700 Subject: [PATCH 2/4] Add visual indicator for current camera --- sleap/gui/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sleap/gui/app.py b/sleap/gui/app.py index 98041756b..27823f28c 100644 --- a/sleap/gui/app.py +++ b/sleap/gui/app.py @@ -1392,7 +1392,9 @@ def updateStatusMessage(self, message: Optional[str] = None): self.statusBar().setStyleSheet("color: black") # TODO(JS): Add Camera indicator test here - + if self.state["session"] is not None and current_video is not None: + message += f'{spacer}Camera: {self.state["session"].get_camera(video=self.state["video"])}' + self.statusBar().showMessage(message) def resetPrefs(self): From 86b5c3466ad97a624b724bacb8313cba096b69ec Mon Sep 17 00:00:00 2001 From: Jvshen Date: Wed, 29 May 2024 17:14:13 -0700 Subject: [PATCH 3/4] Add change to print Camcorder.name --- sleap/gui/app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sleap/gui/app.py b/sleap/gui/app.py index 27823f28c..2044b17f5 100644 --- a/sleap/gui/app.py +++ b/sleap/gui/app.py @@ -1393,8 +1393,10 @@ def updateStatusMessage(self, message: Optional[str] = None): # TODO(JS): Add Camera indicator test here if self.state["session"] is not None and current_video is not None: - message += f'{spacer}Camera: {self.state["session"].get_camera(video=self.state["video"])}' - + camera = self.state["session"].get_camera(video=self.state["video"]) + if camera is not None: + message += f"{spacer}Camera: {camera.name}" + self.statusBar().showMessage(message) def resetPrefs(self): From 9d55a0e8c28b97b2ff59b8c8d99bcb06b6ad7952 Mon Sep 17 00:00:00 2001 From: roomrys <38435167+roomrys@users.noreply.github.com> Date: Thu, 30 May 2024 14:20:12 -0700 Subject: [PATCH 4/4] Ensure session state is updated as first callback of video state --- sleap/gui/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sleap/gui/app.py b/sleap/gui/app.py index b2aa0d93c..15592a401 100644 --- a/sleap/gui/app.py +++ b/sleap/gui/app.py @@ -357,10 +357,10 @@ def update_session(video): self.state.connect( "video", callbacks=[ + update_session, # Important to update session before other callbacks switch_frame, lambda x: self._update_seekbar_marks(), update_frame_chunk_suggestions, - update_session, ], ) @@ -1417,7 +1417,6 @@ def updateStatusMessage(self, message: Optional[str] = None): else: self.statusBar().setStyleSheet("color: black") - # TODO(JS): Add Camera indicator test here if self.state["session"] is not None and current_video is not None: camera = self.state["session"].get_camera(video=self.state["video"]) if camera is not None: