From 5119ee9a933261cf9387d98c52e4f2246446add0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 2 Dec 2016 11:13:21 +0100 Subject: [PATCH] Use correct descriptor for project open CURA-1263 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 21 +++---- plugins/3MFReader/WorkspaceDialog.qml | 69 +++++++++++++++++++-- resources/qml/Actions.qml | 2 +- 3 files changed, 74 insertions(+), 18 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index f5d7466ad4..8e3f8e64aa 100644 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -110,20 +110,19 @@ class ThreeMFWorkspaceReader(WorkspaceReader): Logger.log("w", "File %s is not a valid workspace.", file_name) return WorkspaceReader.PreReadResult.failed - if machine_conflict or quality_changes_conflict or material_conflict: - # There is a conflict; User should choose to either update the existing data, add everything as new data or abort - self._dialog.setMachineConflict(machine_conflict) - self._dialog.setQualityChangesConflict(quality_changes_conflict) - self._dialog.setMaterialConflict(material_conflict) - self._dialog.show() + # Show the dialog, informing the user what is about to happen. + self._dialog.setMachineConflict(machine_conflict) + self._dialog.setQualityChangesConflict(quality_changes_conflict) + self._dialog.setMaterialConflict(material_conflict) + self._dialog.show() - # Block until the dialog is closed. - self._dialog.waitForClose() + # Block until the dialog is closed. + self._dialog.waitForClose() - if self._dialog.getResult() == {}: - return WorkspaceReader.PreReadResult.cancelled + if self._dialog.getResult() == {}: + return WorkspaceReader.PreReadResult.cancelled - self._resolve_strategies = self._dialog.getResult() + self._resolve_strategies = self._dialog.getResult() return WorkspaceReader.PreReadResult.accepted diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index cdefd9a4b0..3896e94869 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -48,7 +48,7 @@ UM.Dialog // See http://stackoverflow.com/questions/7659442/listelement-fields-as-properties Component.onCompleted: { - append({"key": "override", "label": catalog.i18nc("@action:ComboBox option", "Override existing")}); + append({"key": "override", "label": catalog.i18nc("@action:ComboBox option", "Update existing")}); append({"key": "new", "label": catalog.i18nc("@action:ComboBox option", "Create new")}); } } @@ -56,14 +56,70 @@ UM.Dialog Column { anchors.fill: parent + spacing: 2 Label { - id: infoLabel - width: parent.width - text: catalog.i18nc("@action:label", "Cura detected a number of conflicts while importing the workspace. How would you like to resolve these?") - wrapMode: Text.Wrap - height: 50 + id: titleLabel + text: catalog.i18nc("@action:title", "Summary - Cura Project") + font.pixelSize: 22 } + Rectangle + { + id: separator + color: "black" + width: parent.width + height: 1 + } + Item // Spacer + { + height: 5 + width: height + } + + Label + { + text: catalog.i18nc("@action:label", "Printer settings") + font.bold: true + } + + Row + { + width: parent.width + height: childrenRect.height + Label + { + text: catalog.i18nc("@action:label", "Type") + width: parent.width / 3 + } + Label + { + text: catalog.i18nc("@action:label", "TOCHANGE") + width: parent.width / 3 + } + } + + Label + { + text: catalog.i18nc("@action:label", "Profile settings") + font.bold: true + } + + Row + { + width: parent.width + height: childrenRect.height + Label + { + text: catalog.i18nc("@action:label", "Type") + width: parent.width / 3 + } + Label + { + text: catalog.i18nc("@action:label", "TOCHANGE") + width: parent.width / 3 + } + } + UM.TooltipArea { id: machineResolveTooltip @@ -86,6 +142,7 @@ UM.Dialog model: resolveStrategiesModel textRole: "label" id: machineResolveComboBox + width: 150 onActivated: { manager.setResolveStrategy("machine", resolveStrategiesModel.get(index).key) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 1f18dfd47e..d15404fbf6 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -290,7 +290,7 @@ Item Action { id: loadWorkspaceAction - text: catalog.i18nc("@action:inmenu menubar:file","&Save project..."); + text: catalog.i18nc("@action:inmenu menubar:file","&Open project..."); } Action