mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 17:27:51 -06: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
3 changed files with 21 additions and 13 deletions
|
@ -332,6 +332,7 @@ class MaterialManagementModel(QObject):
|
||||||
self._sync_all_dialog = cura.CuraApplication.CuraApplication.getInstance().createQmlComponent(qml_path, {})
|
self._sync_all_dialog = cura.CuraApplication.CuraApplication.getInstance().createQmlComponent(qml_path, {})
|
||||||
if self._sync_all_dialog is None: # Failed to load QML file.
|
if self._sync_all_dialog is None: # Failed to load QML file.
|
||||||
return
|
return
|
||||||
|
self._sync_all_dialog.setProperty("materialManagementModel", self)
|
||||||
self._sync_all_dialog.setProperty("pageIndex", 0)
|
self._sync_all_dialog.setProperty("pageIndex", 0)
|
||||||
self._sync_all_dialog.show()
|
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
|
MessageDialog
|
||||||
{
|
{
|
||||||
id: messageDialog
|
id: messageDialog
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
|
import QtQuick.Dialogs 1.2
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import QtQuick.Window 2.1
|
import QtQuick.Window 2.1
|
||||||
import Cura 1.1 as Cura
|
import Cura 1.1 as Cura
|
||||||
|
@ -20,6 +21,7 @@ Window
|
||||||
height: minimumHeight
|
height: minimumHeight
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
|
|
||||||
|
property variant materialManagementModel
|
||||||
property alias pageIndex: swipeView.currentIndex
|
property alias pageIndex: swipeView.currentIndex
|
||||||
|
|
||||||
SwipeView
|
SwipeView
|
||||||
|
@ -430,9 +432,27 @@ Window
|
||||||
{
|
{
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
text: catalog.i18nc("@button", "Export material archive")
|
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…
Add table
Add a link
Reference in a new issue