Skip to content

Commit

Permalink
Set selected instance to None when switching frames or videos
Browse files Browse the repository at this point in the history
  • Loading branch information
Jvshen committed Oct 9, 2024
1 parent b55d4ef commit 5b1440a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sleap/gui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,12 @@ def exportFullPackage(self):
def previousLabeledFrame(self):
"""Goes to labeled frame prior to current frame."""
self.execute(GoPreviousLabeledFrame)
self.state["instance"] = None

def nextLabeledFrame(self):
"""Goes to labeled frame after current frame."""
self.execute(GoNextLabeledFrame)
self.state["instance"] = None

def nextUserLabeledFrame(self):
"""Goes to next labeled frame with user instances."""
Expand Down Expand Up @@ -403,6 +405,7 @@ def nextTrackFrame(self):
def gotoFrame(self):
"""Shows gui to go to frame by number."""
self.execute(GoFrameGui)
self.state["instance"] = None

def selectToFrame(self):
"""Shows gui to go to frame by number."""
Expand All @@ -411,14 +414,17 @@ def selectToFrame(self):
def gotoVideoAndFrame(self, video: Video, frame_idx: int):
"""Activates video and goes to frame."""
NavCommand.go_to(self, frame_idx, video)
self.state["instance"] = None

def nextView(self):
"""Goes to next view."""
self.execute(GoAdjacentView, prev_or_next="next")
self.state["instance"] = None

def prevView(self):
"""Goes to previous view."""
self.execute(GoAdjacentView, prev_or_next="prev")
self.state["instance"] = None

# Editing Commands

Expand Down

0 comments on commit 5b1440a

Please sign in to comment.