From 89209f5f9ade1ec84a384e9accce2d1a28857d2b Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 6 Aug 2024 15:47:28 +0200 Subject: [PATCH 1/2] Makerbot file formats don't just have 1 mimetype. There are machines with other mime-types. Prepare for adding that one. last step of CURA-11957 (otherwise solved by previous efforts) --- plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml index ee827a6d68..eeb0a9c145 100644 --- a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml @@ -208,7 +208,7 @@ Item anchors.rightMargin: UM.Theme.getSize("thin_margin").height enabled: UM.Backend.state == UM.Backend.Done - currentIndex: UM.Backend.state == UM.Backend.Done ? (Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot") ? 1 : 0) : 2 + currentIndex: UM.Backend.state == UM.Backend.Done ? ((Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot") || Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot-sketch")) ? 1 : 0) : 2 textRole: "text" valueRole: "value" From 8b47ce0315d4b81922d8555ebc44efc0ab8854b8 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 6 Aug 2024 17:04:24 +0200 Subject: [PATCH 2/2] Autoselect file-format: Split up long line and better documentation. done as part of CURA-11957 --- .../resources/qml/SaveProjectFilesPage.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml index eeb0a9c145..99ba51a512 100644 --- a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml @@ -208,7 +208,14 @@ Item anchors.rightMargin: UM.Theme.getSize("thin_margin").height enabled: UM.Backend.state == UM.Backend.Done - currentIndex: UM.Backend.state == UM.Backend.Done ? ((Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot") || Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot-sketch")) ? 1 : 0) : 2 + + // Pre-select the correct index, depending on the situation (see the model-property below): + // - Don't select any post-slice-file-format when the engine isn't done. + // - Choose either the S-series or the Makerbot-series of printers' format otherwise, depending on the active printer. + // This way, the user can just click 'save' without having to worry about wether or not the format is right. + property int isMakerbotFormat: Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot") || Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot-sketch") + property int isBackendDone: UM.Backend.state == UM.Backend.Done + currentIndex: isBackendDone ? (isMakerbotFormat ? 1 : 0) : 2 textRole: "text" valueRole: "value"