Improvement: index frames by name and not position.

This commit is contained in:
Filippo Scognamiglio
2014-12-26 00:00:35 +01:00
parent 04a6365349
commit f03fa29836
2 changed files with 64 additions and 22 deletions

View File

@@ -101,7 +101,20 @@ Tab{
Layout.fillWidth: true
model: appSettings.framesList
currentIndex: appSettings.framesIndex
onCurrentIndexChanged: appSettings.framesIndex = currentIndex
onActivated: {
appSettings.frameName = appSettings.framesList.get(index).name;
}
function updateIndex(){
var name = appSettings.frameName;
var index = appSettings.getFrameIndexByName(name);
if (index !== undefined)
currentIndex = index;
}
Component.onCompleted: updateIndex();
Connections {
target: appSettings
onFrameNameChanged: framescombobox.updateIndex();
}
}
}
}