Skip to content

Commit

Permalink
Switch out of create mode beginner presses escape
Browse files Browse the repository at this point in the history
  • Loading branch information
mpitid committed Oct 19, 2011
1 parent eda1c4f commit c6969c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion labelme.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def setClean(self):
self.dirty = False
self.actions.save.setEnabled(False)
self.actions.create.setEnabled(True)
# XXX

def toggleActions(self, value=True):
"""Enable/Disable widgets which depend on an opened image."""
Expand Down Expand Up @@ -415,11 +414,17 @@ def advanced(self):
def createShape(self):
assert self.beginner()
self.canvas.setEditing(False)
self.actions.create.setEnabled(False)

def toggleDrawingSensitive(self, drawing=True):
"""In the middle of drawing, toggling between modes should be disabled."""
self.actions.createMode.setEnabled(not drawing)
self.actions.editMode.setEnabled(not drawing)
if not drawing and self.beginner():
# Cancel creation.
self.canvas.setEditing(True)
self.canvas.restoreCursor()
self.actions.create.setEnabled(True)

def toggleDrawMode(self, edit=True):
self.canvas.setEditing(edit)
Expand Down

0 comments on commit c6969c5

Please sign in to comment.