Huge changes in profiles management and added support for user defined ones.

This commit is contained in:
Filippo Scognamiglio
2014-05-18 22:23:19 +02:00
parent 3440ef0e45
commit 12f09ddf52
4 changed files with 191 additions and 62 deletions
+27 -4
View File
@@ -47,11 +47,34 @@ Window {
anchors.right: parent.right
Layout.columnSpan: 2
title: qsTr("Profile")
ComboBox{
RowLayout{
anchors.fill: parent
model: shadersettings.profiles_list
onCurrentIndexChanged: shadersettings.profiles_index = currentIndex
currentIndex: shadersettings.profiles_index
ComboBox{
id: profilesbox
Layout.fillWidth: true
model: shadersettings.profiles_list
currentIndex: shadersettings.profiles_index
}
Button{
text: "Load"
onClicked: shadersettings.profiles_index = profilesbox.currentIndex
}
Button{
text: "Add"
onClicked: insertname.show()
}
Button{
text: "Remove"
enabled: !shadersettings.profiles_list.get(profilesbox.currentIndex).builtin
onClicked: {
shadersettings.profiles_list.remove(profilesbox.currentIndex)
profilesbox.currentIndex = profilesbox.currentIndex - 1
}
}
InsertNameDialog{
id: insertname
onNameSelected: shadersettings.addNewCustomProfile(name)
}
}
}