Added materialspage Display Name field and made it work. CURA-1969

This commit is contained in:
Jack Ha 2016-08-25 09:54:22 +02:00
parent 8df5bba6e9
commit 2ae998737f
4 changed files with 60 additions and 2 deletions

View file

@ -44,6 +44,16 @@ TabView
property real rowHeight: textField.height;
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") }
ReadOnlyTextField
{
id: displayNameTextField;
width: base.secondColumnWidth;
text: properties.name;
readOnly: !base.editingEnabled;
onEditingFinished: base.setName(properties.name, text)
}
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
ReadOnlyTextField
{
@ -254,7 +264,15 @@ TabView
{
if(old_value != new_value)
{
Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, entry_name, new_value)
Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, entry_name, new_value);
}
}
function setName(old_value, new_value)
{
if(old_value != new_value)
{
Cura.ContainerManager.setContainerName(base.containerId, new_value);
}
}
}

View file

@ -1,5 +1,6 @@
// Copyright (c) 2016 Ultimaker B.V.
// Uranium is released under the terms of the AGPLv3 or higher.
// Different than the name suggests, it is not always read-only.
import QtQuick 2.1
import QtQuick.Controls 1.1