Merge pull request #10030 from Ultimaker/CURA-8055_export_all_materials_usb_redone

Export all materials to archive
This commit is contained in:
Remco Burema 2021-07-23 17:59:38 +02:00 committed by GitHub
commit af02b44024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 81 additions and 9 deletions

View file

@ -22,7 +22,8 @@
"0": "ultimaker2_plus_connect_extruder_0"
},
"supports_usb_connection": false,
"supports_network_connection": true
"supports_network_connection": true,
"supports_material_export": true
},
"overrides": {

View file

@ -27,6 +27,7 @@
"first_start_actions": [ "DiscoverUM3Action" ],
"supported_actions": [ "DiscoverUM3Action" ],
"supports_usb_connection": false,
"supports_material_export": true,
"weight": -1,
"firmware_update_info": {
"id": 213482,

View file

@ -28,6 +28,7 @@
"supported_actions": [ "DiscoverUM3Action" ],
"supports_usb_connection": false,
"supports_network_connection": true,
"supports_material_export": true,
"weight": -2,
"firmware_update_info": {
"id": 9051,

View file

@ -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,21 @@ 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.folder = base.materialManagementModel.getPreferredExportAllPath();
exportAllMaterialsDialog.open();
}
visible: Cura.MachineManager.activeMachine.supportsMaterialExport
}
}
Item {
@ -368,6 +383,19 @@ Item
}
}
FileDialog
{
id: exportAllMaterialsDialog
title: catalog.i18nc("@title:window", "Export All Materials")
selectExisting: false
nameFilters: ["Material archives (*.umm)", "All files (*)"]
onAccepted:
{
base.materialManagementModel.exportAll(fileUrl);
CuraApplication.setDefaultPath("dialog_material_path", folder);
}
}
MessageDialog
{
id: messageDialog