mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:15:51 +08:00
Replace MessageDialogs with new custom version
Changing a few fields. Contributes to issue CURA-8687.
This commit is contained in:
parent
7f8591718d
commit
a03988d146
@ -310,17 +310,15 @@ Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dialogs
|
// Dialogs
|
||||||
MessageDialog
|
UM.MessageDialog
|
||||||
{
|
{
|
||||||
id: confirmRemoveMaterialDialog
|
id: confirmRemoveMaterialDialog
|
||||||
icon: StandardIcon.Question;
|
|
||||||
title: catalog.i18nc("@title:window", "Confirm Remove")
|
title: catalog.i18nc("@title:window", "Confirm Remove")
|
||||||
property string materialName: base.currentItem !== null ? base.currentItem.name : ""
|
property string materialName: base.currentItem !== null ? base.currentItem.name : ""
|
||||||
|
|
||||||
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(materialName)
|
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(materialName)
|
||||||
standardButtons: StandardButton.Yes | StandardButton.No
|
standardButtons: Dialog.Yes | Dialog.No
|
||||||
modality: Qt.ApplicationModal
|
onAccepted:
|
||||||
onYes:
|
|
||||||
{
|
{
|
||||||
// Set the active material as the fallback. It will be selected when the current material is deleted
|
// Set the active material as the fallback. It will be selected when the current material is deleted
|
||||||
base.newRootMaterialIdToSwitchTo = base.active_root_material_id
|
base.newRootMaterialIdToSwitchTo = base.active_root_material_id
|
||||||
@ -340,19 +338,13 @@ Item
|
|||||||
var result = Cura.ContainerManager.importMaterialContainer(fileUrl);
|
var result = Cura.ContainerManager.importMaterialContainer(fileUrl);
|
||||||
|
|
||||||
messageDialog.title = catalog.i18nc("@title:window", "Import Material");
|
messageDialog.title = catalog.i18nc("@title:window", "Import Material");
|
||||||
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);
|
if(result.status == "success")
|
||||||
if (result.status == "success")
|
|
||||||
{
|
{
|
||||||
messageDialog.icon = StandardIcon.Information;
|
|
||||||
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(fileUrl);
|
||||||
}
|
}
|
||||||
else if (result.status == "duplicate")
|
|
||||||
{
|
|
||||||
messageDialog.icon = StandardIcon.Warning;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
messageDialog.icon = StandardIcon.Critical;
|
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.open();
|
messageDialog.open();
|
||||||
CuraApplication.setDefaultPath("dialog_material_path", folder);
|
CuraApplication.setDefaultPath("dialog_material_path", folder);
|
||||||
@ -371,15 +363,13 @@ Item
|
|||||||
var result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl);
|
var result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl);
|
||||||
|
|
||||||
messageDialog.title = catalog.i18nc("@title:window", "Export Material");
|
messageDialog.title = catalog.i18nc("@title:window", "Export Material");
|
||||||
if (result.status == "error")
|
if(result.status == "error")
|
||||||
{
|
{
|
||||||
messageDialog.icon = StandardIcon.Critical;
|
|
||||||
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(fileUrl).arg(result.message);
|
||||||
messageDialog.open();
|
messageDialog.open();
|
||||||
}
|
}
|
||||||
else if (result.status == "success")
|
else if(result.status == "success")
|
||||||
{
|
{
|
||||||
messageDialog.icon = StandardIcon.Information;
|
|
||||||
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully exported material to <filename>%1</filename>").arg(result.path);
|
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully exported material to <filename>%1</filename>").arg(result.path);
|
||||||
messageDialog.open();
|
messageDialog.open();
|
||||||
}
|
}
|
||||||
@ -387,7 +377,7 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageDialog
|
UM.MessageDialog
|
||||||
{
|
{
|
||||||
id: messageDialog
|
id: messageDialog
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user