|
@@ -460,6 +460,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
hideAll = action(
|
|
hideAll = action(
|
|
self.tr("&Hide\nPolygons"),
|
|
self.tr("&Hide\nPolygons"),
|
|
functools.partial(self.togglePolygons, False),
|
|
functools.partial(self.togglePolygons, False),
|
|
|
|
+ shortcuts["hide_all_polygons"],
|
|
icon="eye",
|
|
icon="eye",
|
|
tip=self.tr("Hide all polygons"),
|
|
tip=self.tr("Hide all polygons"),
|
|
enabled=False,
|
|
enabled=False,
|
|
@@ -467,10 +468,19 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
showAll = action(
|
|
showAll = action(
|
|
self.tr("&Show\nPolygons"),
|
|
self.tr("&Show\nPolygons"),
|
|
functools.partial(self.togglePolygons, True),
|
|
functools.partial(self.togglePolygons, True),
|
|
|
|
+ shortcuts["show_all_polygons"],
|
|
icon="eye",
|
|
icon="eye",
|
|
tip=self.tr("Show all polygons"),
|
|
tip=self.tr("Show all polygons"),
|
|
enabled=False,
|
|
enabled=False,
|
|
)
|
|
)
|
|
|
|
+ toggleAll = action(
|
|
|
|
+ self.tr("&Toggle\nPolygons"),
|
|
|
|
+ functools.partial(self.togglePolygons, None),
|
|
|
|
+ shortcuts["toggle_all_polygons"],
|
|
|
|
+ icon="eye",
|
|
|
|
+ tip=self.tr("Toggle all polygons"),
|
|
|
|
+ enabled=False,
|
|
|
|
+ )
|
|
|
|
|
|
help = action(
|
|
help = action(
|
|
self.tr("&Tutorial"),
|
|
self.tr("&Tutorial"),
|
|
@@ -692,7 +702,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
editMode,
|
|
editMode,
|
|
brightnessContrast,
|
|
brightnessContrast,
|
|
),
|
|
),
|
|
- onShapesPresent=(saveAs, hideAll, showAll),
|
|
|
|
|
|
+ onShapesPresent=(saveAs, hideAll, showAll, toggleAll),
|
|
)
|
|
)
|
|
|
|
|
|
self.canvas.vertexSelected.connect(self.actions.removePoint.setEnabled)
|
|
self.canvas.vertexSelected.connect(self.actions.removePoint.setEnabled)
|
|
@@ -738,6 +748,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
None,
|
|
None,
|
|
hideAll,
|
|
hideAll,
|
|
showAll,
|
|
showAll,
|
|
|
|
+ toggleAll,
|
|
None,
|
|
None,
|
|
zoomIn,
|
|
zoomIn,
|
|
zoomOut,
|
|
zoomOut,
|
|
@@ -1496,8 +1507,11 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
self.brightnessContrast_values[self.filename] = (brightness, contrast)
|
|
self.brightnessContrast_values[self.filename] = (brightness, contrast)
|
|
|
|
|
|
def togglePolygons(self, value):
|
|
def togglePolygons(self, value):
|
|
|
|
+ flag = value
|
|
for item in self.labelList:
|
|
for item in self.labelList:
|
|
- item.setCheckState(Qt.Checked if value else Qt.Unchecked)
|
|
|
|
|
|
+ if value is None:
|
|
|
|
+ flag = (item.checkState() == Qt.Unchecked)
|
|
|
|
+ item.setCheckState(Qt.Checked if flag else Qt.Unchecked)
|
|
|
|
|
|
def loadFile(self, filename=None):
|
|
def loadFile(self, filename=None):
|
|
"""Load the specified file, or the last opened file if None."""
|
|
"""Load the specified file, or the last opened file if None."""
|