Merge branch '5.0' into CURA-9146_account_sync

This commit is contained in:
Ghostkeeper 2022-04-21 13:18:49 +02:00
commit 1e7cf21f46
No known key found for this signature in database
GPG key ID: 68F39EA88EEED5FF
76 changed files with 205 additions and 200 deletions

View file

@ -571,7 +571,7 @@ UM.MainWindow
id: contextMenu
}
onPreClosing:
onPreClosing: (close) =>
{
close.accepted = CuraApplication.getIsAllChecksPassed();
if (!close.accepted)

View file

@ -40,7 +40,7 @@ UM.Dialog
}
}
onAccepted: loadModelFiles(base.fileUrls)
onAccepted: loadModelFiles(base.selectedFiles)
UM.Label
{

View file

@ -266,10 +266,8 @@ Item
}
}
}
onReleased:
{
dragging = false
}
onReleased: dragging = false
onDoubleClicked:
{

View file

@ -231,7 +231,7 @@ UM.ManagementPage
currentFolder: CuraApplication.getDefaultPath("dialog_material_path")
onAccepted:
{
const result = Cura.ContainerManager.importMaterialContainer(fileUrl);
const result = Cura.ContainerManager.importMaterialContainer(selectedFile);
const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
messageDialog.standardButtons = Dialog.Ok;
@ -239,10 +239,10 @@ UM.ManagementPage
switch (result.status)
{
case "success":
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(fileUrl);
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(selectedFile);
break;
default:
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Could not import material <filename>%1</filename>: <message>%2</message>").arg(fileUrl).arg(result.message);
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Could not import material <filename>%1</filename>: <message>%2</message>").arg(selectedFile).arg(result.message);
break;
}
messageDialog.open();
@ -259,7 +259,7 @@ UM.ManagementPage
currentFolder: CuraApplication.getDefaultPath("dialog_material_path")
onAccepted:
{
const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl);
const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, selectedFile);
const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
messageDialog.title = catalog.i18nc("@title:window", "Export Material");
@ -267,7 +267,7 @@ UM.ManagementPage
switch (result.status)
{
case "error":
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> and <message>!", "Failed to export material to <filename>%1</filename>: <message>%2</message>").arg(fileUrl).arg(result.message);
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> and <message>!", "Failed to export material to <filename>%1</filename>: <message>%2</message>").arg(selectedFile).arg(result.message);
break;
case "success":
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully exported material to <filename>%1</filename>").arg(result.path);

View file

@ -701,7 +701,7 @@ Window
{
if(!materialsSyncDialog.hasExportedUsb)
{
exportUsbDialog.folder = syncModel.getPreferredExportAllPath();
exportUsbDialog.currentFolder = syncModel.getPreferredExportAllPath();
exportUsbDialog.open();
}
else
@ -733,9 +733,10 @@ Window
{
title: catalog.i18nc("@title:window", "Export All Materials")
nameFilters: ["Material archives (*.umm)", "All files (*)"]
fileMode: FileDialog.SaveFile
onAccepted:
{
syncModel.exportAll(fileUrl);
syncModel.exportAll(selectedFile);
CuraApplication.setDefaultPath("dialog_material_path", folder);
materialsSyncDialog.hasExportedUsb = true;
}

View file

@ -355,7 +355,7 @@ UM.ManagementPage
onAccepted:
{
var result = Cura.ContainerManager.exportQualityChangesGroup(base.currentItem.quality_changes_group,
fileUrl, selectedNameFilter);
selectedFile, selectedNameFilter);
if (result && result.status == "error")
{
@ -385,7 +385,7 @@ UM.ManagementPage
title: catalog.i18nc("@title:window", "Confirm Remove")
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItemName)
standardButtons: StandardButton.Yes | StandardButton.No
standardButtons: Dialog.Yes | Dialog.No
modal: true
onAccepted:
@ -419,7 +419,7 @@ UM.ManagementPage
currentFolder: CuraApplication.getDefaultPath("dialog_profile_path")
onAccepted:
{
var result = Cura.ContainerManager.importProfile(fileUrl);
var result = Cura.ContainerManager.importProfile(selectedFile);
messageDialog.title = catalog.i18nc("@title:window", "Import Profile")
messageDialog.text = result.message;
messageDialog.open();

View file

@ -12,7 +12,6 @@ Cura.ExpandableComponent
id: printSetupSelector
dragPreferencesNamePrefix: "view/settings"
property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced
contentPadding: UM.Theme.getSize("default_lining").width

View file

@ -15,9 +15,8 @@ Item
id: content
property int absoluteMinimumHeight: 200 * screenScaleFactor
implicitWidth: UM.Theme.getSize("print_setup_widget").width - 2 * UM.Theme.getSize("default_margin").width
implicitWidth: UM.Theme.getSize("print_setup_widget").width
implicitHeight: contents.height + buttonRow.height
enum Mode
{
Recommended = 0,