Blur setting text fields when clicking buttons

Otherwise the setting is not applied yet by the time you duplicate or export a profile.

Contributes to issue CURA-4011.
This commit is contained in:
Ghostkeeper 2017-07-05 16:03:57 +02:00
parent 0ad7096782
commit 9dd3527504
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -1,5 +1,5 @@
// Copyright (c) 2016 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.
//Copyright (c) 2017 Ultimaker B.V.
//Cura is released under the terms of the AGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 1.1
@ -139,6 +139,7 @@ UM.ManagementPage
enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMaterialId && Cura.MachineManager.hasMaterials
onClicked:
{
forceActiveFocus();
Cura.MachineManager.setActiveMaterial(base.currentItem.id)
currentItem = base.model.getItem(base.objectList.currentIndex) // Refresh the current item.
}
@ -149,6 +150,7 @@ UM.ManagementPage
iconName: "list-add"
onClicked:
{
forceActiveFocus();
var material_id = Cura.ContainerManager.createMaterial()
if(material_id == "")
{
@ -168,6 +170,7 @@ UM.ManagementPage
enabled: base.currentItem != null
onClicked:
{
forceActiveFocus();
var base_file = Cura.ContainerManager.getContainerMetaDataEntry(base.currentItem.id, "base_file")
// We need to copy the base container instead of the specific variant.
var material_id = base_file == "" ? Cura.ContainerManager.duplicateMaterial(base.currentItem.id): Cura.ContainerManager.duplicateMaterial(base_file)
@ -187,20 +190,32 @@ UM.ManagementPage
text: catalog.i18nc("@action:button", "Remove");
iconName: "list-remove";
enabled: base.currentItem != null && !base.currentItem.readOnly && !Cura.ContainerManager.isContainerUsed(base.currentItem.id)
onClicked: confirmDialog.open()
onClicked:
{
forceActiveFocus();
confirmDialog.open();
}
},
Button
{
text: catalog.i18nc("@action:button", "Import");
iconName: "document-import";
onClicked: importDialog.open();
onClicked:
{
forceActiveFocus();
importDialog.open();
}
visible: true;
},
Button
{
text: catalog.i18nc("@action:button", "Export")
iconName: "document-export"
onClicked: exportDialog.open()
onClicked:
{
forceActiveFocus();
exportDialog.open();
}
enabled: currentItem != null
}
]