mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:25:51 +08:00
Implement functionality of export to USB button
It now creates a similar dialogue of what the old button did. The dialogue is no longer necessary in the materials page, so I've moved it to here specifically. Contributes to issue CURA-8609.
This commit is contained in:
parent
e5dc90a519
commit
038db1fc4f
@ -332,6 +332,7 @@ class MaterialManagementModel(QObject):
|
||||
self._sync_all_dialog = cura.CuraApplication.CuraApplication.getInstance().createQmlComponent(qml_path, {})
|
||||
if self._sync_all_dialog is None: # Failed to load QML file.
|
||||
return
|
||||
self._sync_all_dialog.setProperty("materialManagementModel", self)
|
||||
self._sync_all_dialog.setProperty("pageIndex", 0)
|
||||
self._sync_all_dialog.show()
|
||||
|
||||
|
@ -382,19 +382,6 @@ 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
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.1
|
||||
import Cura 1.1 as Cura
|
||||
@ -20,6 +21,7 @@ Window
|
||||
height: minimumHeight
|
||||
modality: Qt.ApplicationModal
|
||||
|
||||
property variant materialManagementModel
|
||||
property alias pageIndex: swipeView.currentIndex
|
||||
|
||||
SwipeView
|
||||
@ -430,9 +432,27 @@ Window
|
||||
{
|
||||
anchors.right: parent.right
|
||||
text: catalog.i18nc("@button", "Export material archive")
|
||||
onClicked:
|
||||
{
|
||||
exportUsbDialog.folder = materialManagementModel.getPreferredExportAllPath();
|
||||
exportUsbDialog.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
id: exportUsbDialog
|
||||
title: catalog.i18nc("@title:window", "Export All Materials")
|
||||
selectExisting: false
|
||||
nameFilters: ["Material archives (*.umm)", "All files (*)"]
|
||||
onAccepted:
|
||||
{
|
||||
materialManagementModel.exportAll(fileUrl);
|
||||
CuraApplication.setDefaultPath("dialog_material_path", folder);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user