From 66ffe017a4d6c72eaf79e4970c2d8f60e278c564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 11 Oct 2023 18:07:18 +0200 Subject: [PATCH] [ui] Rename "Clear Images" actions into "Remove All Images" Update the names of the commands that remove images in the "File" menu to match with those in the Image Gallery menu. "Clear Images" becomes "Remove All Images" and "Clear All Images" becomes "Remove Images From All CameraInit Nodes". --- meshroom/ui/commands.py | 6 ++--- meshroom/ui/graph.py | 12 ++++----- meshroom/ui/qml/ImageGallery/ImageGallery.qml | 2 +- meshroom/ui/qml/WorkspaceView.qml | 2 +- meshroom/ui/qml/main.qml | 25 ++++++++++--------- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/meshroom/ui/commands.py b/meshroom/ui/commands.py index f996538e51..24f48fc41d 100755 --- a/meshroom/ui/commands.py +++ b/meshroom/ui/commands.py @@ -356,13 +356,13 @@ def undoImpl(self): listAttribute.insert(self.index, self.value) -class ClearImagesCommand(GraphCommand): +class RemoveImagesCommand(GraphCommand): def __init__(self, graph, cameraInitNodes, parent=None): - super(ClearImagesCommand, self).__init__(graph, parent) + super(RemoveImagesCommand, self).__init__(graph, parent) self.cameraInits = cameraInitNodes self.viewpoints = { cameraInit.name: cameraInit.attribute("viewpoints").getExportValue() for cameraInit in self.cameraInits } self.intrinsics = { cameraInit.name: cameraInit.attribute("intrinsics").getExportValue() for cameraInit in self.cameraInits } - self.title = "Clear{}Images".format(" " if len(self.cameraInits) == 1 else " All ") + self.title = "Remove{}Images".format(" " if len(self.cameraInits) == 1 else " All ") self.setText(self.title) def redoImpl(self): diff --git a/meshroom/ui/graph.py b/meshroom/ui/graph.py index 8e79b48ef6..6b86dc3543 100644 --- a/meshroom/ui/graph.py +++ b/meshroom/ui/graph.py @@ -813,14 +813,14 @@ def removeAttribute(self, attribute): self.push(commands.ListAttributeRemoveCommand(self._graph, attribute)) @Slot() - def clearImages(self): - with self.groupedGraphModification("Clear Images"): - self.push(commands.ClearImagesCommand(self._graph, [self.cameraInit])) + def removeAllImages(self): + with self.groupedGraphModification("Remove All Images"): + self.push(commands.RemoveImagesCommand(self._graph, [self.cameraInit])) @Slot() - def clearAllImages(self): - with self.groupedGraphModification("Clear All Images"): - self.push(commands.ClearImagesCommand(self._graph, list(self.cameraInits))) + def removeImagesFromAllGroups(self): + with self.groupedGraphModification("Remove Images From All CameraInit Nodes"): + self.push(commands.RemoveImagesCommand(self._graph, list(self.cameraInits))) @Slot(Node) def appendSelection(self, node): diff --git a/meshroom/ui/qml/ImageGallery/ImageGallery.qml b/meshroom/ui/qml/ImageGallery/ImageGallery.qml index 854223d91b..fb68d82e98 100644 --- a/meshroom/ui/qml/ImageGallery/ImageGallery.qml +++ b/meshroom/ui/qml/ImageGallery/ImageGallery.qml @@ -290,7 +290,7 @@ Panel { } function removeAllImages() { - _reconstruction.clearImages() + _reconstruction.removeAllImages() _reconstruction.selectedViewId = "-1" } diff --git a/meshroom/ui/qml/WorkspaceView.qml b/meshroom/ui/qml/WorkspaceView.qml index 24d948313c..e0ad984b51 100644 --- a/meshroom/ui/qml/WorkspaceView.qml +++ b/meshroom/ui/qml/WorkspaceView.qml @@ -79,7 +79,7 @@ Item { tempCameraInit: reconstruction ? reconstruction.tempCameraInit : null cameraInitIndex: reconstruction ? reconstruction.cameraInitIndex : -1 onRemoveImageRequest: reconstruction.removeAttribute(attribute) - onAllViewpointsCleared: { reconstruction.clearImages(); reconstruction.selectedViewId = "-1" } + onAllViewpointsCleared: { reconstruction.removeAllImages(); reconstruction.selectedViewId = "-1" } onFilesDropped: reconstruction.handleFilesDrop(drop, augmentSfm ? null : cameraInit) } LiveSfmView { diff --git a/meshroom/ui/qml/main.qml b/meshroom/ui/qml/main.qml index 0f8c622266..e4897bc1e2 100644 --- a/meshroom/ui/qml/main.qml +++ b/meshroom/ui/qml/main.qml @@ -477,21 +477,21 @@ ApplicationWindow { } Action { - id: clearImagesAction - property string tooltip: "Clear images for the current CameraInit group" - text: "Clear Images" + id: removeAllImagesAction + property string tooltip: "Remove all the images from the current CameraInit group" + text: "Remove All Images" onTriggered: { - _reconstruction.clearImages() + _reconstruction.removeAllImages() _reconstruction.selectedViewId = "-1" } } Action { - id: clearAllImagesAction - property string tooltip: "Clear all the images for all the CameraInit groups" - text: "Clear All Images" + id: removeImagesFromAllGroupsAction + property string tooltip: "Remove all the images from all the CameraInit groups" + text: "Remove Images From All CameraInit Nodes" onTriggered: { - _reconstruction.clearAllImages() + _reconstruction.removeImagesFromAllGroups() _reconstruction.selectedViewId = "-1" } } @@ -723,15 +723,16 @@ ApplicationWindow { } MenuItem { - action: clearImagesAction + action: removeAllImagesAction ToolTip.visible: hovered - ToolTip.text: clearImagesAction.tooltip + ToolTip.text: removeAllImagesAction.tooltip } MenuSeparator { } Menu { id: advancedMenu title: "Advanced" + implicitWidth: 300 Action { id: saveAsTemplateAction @@ -768,9 +769,9 @@ ApplicationWindow { } MenuItem { - action: clearAllImagesAction + action: removeImagesFromAllGroupsAction ToolTip.visible: hovered - ToolTip.text: clearAllImagesAction.tooltip + ToolTip.text: removeImagesFromAllGroupsAction.tooltip } } MenuSeparator { }