Skip to content

Set selected instance to None when switching videos/frames #1988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want this logic to go inside the class that is being executed (i.e. GoPreviousLabeledFrame).

Suggested change
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
Loading