From abba3bdd10a994a1b38bcb426a27ba379febeac7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 8 Jun 2021 16:57:24 +0200 Subject: [PATCH] Implement a sync button and file dialogue to export all materials Contributes to issue CURA-8055. --- .../Preferences/Materials/MaterialsPage.qml | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 791d6685de..61efd7f530 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -1,5 +1,5 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Uranium is released under the terms of the LGPLv3 or higher. +// Copyright (c) 2021 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 1.4 @@ -191,6 +191,20 @@ Item } enabled: base.hasCurrentItem } + + //Sync button. + Button + { + id: syncMaterialsButton + text: catalog.i18nc("@action:button Sending materials to printers", "Sync with Printers") + iconName: "sync-synchronizing" + onClicked: + { + forceActiveFocus(); + exportAllMaterialsDialog.open(); + } + enabled: Cura.MachineManager.activeMachine.supportsMaterialExport() + } } Item { @@ -368,6 +382,16 @@ Item } } + FileDialog + { + id: exportAllMaterialsDialog + title: catalog.i18nc("@title:window", "Export All Materials") + selectExisting: false + nameFilters: ["Material archives (*.zip)", "All files (*)"] + folder: CuraApplication.getDefaultPath("dialog_material_path") //TODO: Implement preference for removable drives. + //TODO: Implement onAccepted event to save the profiles. + } + MessageDialog { id: messageDialog