Active quality is now displayed (and changable) again

CURA-1278
This commit is contained in:
Jaime van Kessel 2016-05-17 10:50:01 +02:00
parent 59ec593db5
commit 12fd002e67

View File

@ -6,7 +6,8 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.1 as UM import UM 1.2 as UM
import Cura 1.0 as Cura
Item{ Item{
id: base; id: base;
@ -41,13 +42,13 @@ Item{
property int rightMargin: customisedSettings.visible ? customisedSettings.width + UM.Theme.getSize("default_margin").width / 2 : 0 property int rightMargin: customisedSettings.visible ? customisedSettings.width + UM.Theme.getSize("default_margin").width / 2 : 0
id: globalProfileSelection id: globalProfileSelection
text: UM.MachineManager.activeProfile text: Cura.MachineManager.activeQualityName
width: parent.width/100*55 width: parent.width/100*55
height: UM.Theme.getSize("setting_control").height height: UM.Theme.getSize("setting_control").height
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
tooltip: UM.MachineManager.activeProfile tooltip: Cura.MachineManager.activeQualityName
style: UM.Theme.styles.sidebar_header_button style: UM.Theme.styles.sidebar_header_button
menu: Menu menu: Menu
@ -56,7 +57,10 @@ Item{
Instantiator Instantiator
{ {
id: profileSelectionInstantiator id: profileSelectionInstantiator
// model: UM.ProfilesModel {} model: UM.InstanceContainersModel
{
filter: {"type": "quality"}
}
property int separatorIndex: -1 property int separatorIndex: -1
Loader { Loader {
@ -98,18 +102,18 @@ Item{
id: item id: item
text: model_data ? model_data.name : "" text: model_data ? model_data.name : ""
checkable: true; checkable: true;
checked: model_data ? model_data.active : false; checked: Cura.MachineManager.activeQualityId == model_data.id
exclusiveGroup: profileSelectionMenuGroup; exclusiveGroup: profileSelectionMenuGroup;
onTriggered: onTriggered:
{ {
UM.MachineManager.setActiveProfile(model_data.name); Cura.MachineManager.setActiveQuality(model_data.id);
if (!model_data.active) { /*if (!model_data.active) {
//Selecting a profile was canceled; undo menu selection //Selecting a profile was canceled; undo menu selection
profileSelectionInstantiator.model.setProperty(model_index, "active", false); profileSelectionInstantiator.model.setProperty(model_index, "active", false);
var activeProfileName = UM.MachineManager.activeProfile; var activeProfileName = UM.MachineManager.activeProfile;
var activeProfileIndex = profileSelectionInstantiator.model.find("name", activeProfileName); var activeProfileIndex = profileSelectionInstantiator.model.find("name", activeProfileName);
profileSelectionInstantiator.model.setProperty(activeProfileIndex, "active", true); profileSelectionInstantiator.model.setProperty(activeProfileIndex, "active", true);
} }*/
} }
} }
} }