Skip to content

Commit

Permalink
advanced -> tool, advancedContext -> menu
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Apr 22, 2018
1 parent 9128dd0 commit 9f47521
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
# - [high] Automatically add file suffix when saving.
# - [high] Add polygon movement with arrow keys
# - [high] Deselect shape when clicking and already selected(?)
# - [high] Sanitize shortcuts between beginner/advanced mode.
# - [medium] Zoom should keep the image centered.
# - [medium] Add undo button for vertex addition.
# - [low,maybe] Open images with drag & drop.
Expand Down Expand Up @@ -352,10 +351,10 @@ def __init__(self, filename=None, output=None, store_data=True,
fitWindow=fitWindow, fitWidth=fitWidth,
zoomActions=zoomActions,
fileMenuActions=(open_, opendir, save, saveAs, close, quit),
advanced=(),
tool=(),
editMenu=(edit, copy, delete, None, undoLastPoint,
None, color1, color2),
advancedContext=(
menu=(
createMode, editMode, edit, copy,
delete, shapeLineColor, shapeFillColor,
undoLastPoint,
Expand Down Expand Up @@ -385,13 +384,13 @@ def __init__(self, filename=None, output=None, store_data=True,
self.menus.file.aboutToShow.connect(self.updateFileMenu)

# Custom context menu for the canvas widget:
addActions(self.canvas.menus[0], self.actions.advancedContext)
addActions(self.canvas.menus[0], self.actions.menu)
addActions(self.canvas.menus[1], (
action('&Copy here', self.copyShape),
action('&Move here', self.moveShape)))

self.tools = self.toolbar('Tools')
self.actions.advanced = (
self.actions.tool = (
open_, opendir, openNextImg, openPrevImg, save,
None, createMode, copy, delete, editMode, None,
zoomIn, zoom, zoomOut, fitWindow, fitWidth)
Expand Down Expand Up @@ -491,7 +490,7 @@ def noShapes(self):
return not self.labelList.itemsToShapes

def populateModeActions(self):
tool, menu = self.actions.advanced, self.actions.advancedContext
tool, menu = self.actions.tool, self.actions.menu
self.tools.clear()
addActions(self.tools, tool)
self.canvas.menus[0].clear()
Expand All @@ -500,10 +499,6 @@ def populateModeActions(self):
actions = (self.actions.createMode, self.actions.editMode)
addActions(self.menus.edit, actions + self.actions.editMenu)

def setAdvanced(self):
self.tools.clear()
addActions(self.tools, self.actions.advanced)

def setDirty(self):
self.dirty = True
self.actions.save.setEnabled(True)
Expand Down

0 comments on commit 9f47521

Please sign in to comment.