Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cura/Machines/Models/MaterialManagementModel.py1
-rw-r--r--resources/qml/Preferences/Materials/MaterialsPage.qml13
-rw-r--r--resources/qml/Preferences/Materials/MaterialsSyncDialog.qml20
3 files changed, 21 insertions, 13 deletions
diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py
index fda687c3ef..d5191988fa 100644
--- a/cura/Machines/Models/MaterialManagementModel.py
+++ b/cura/Machines/Models/MaterialManagementModel.py
@@ -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()
diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml
index 1d3519624d..6ec23f001f 100644
--- a/resources/qml/Preferences/Materials/MaterialsPage.qml
+++ b/resources/qml/Preferences/Materials/MaterialsPage.qml
@@ -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
diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml
index 215ac646ff..2e9522e445 100644
--- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml
+++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml
@@ -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);
+ }
+ }
} \ No newline at end of file