Merge pull request #1605 from 1hitsong/moveSelectedSubtileToTop
Move selected subtitle to top of selection menu
This commit is contained in:
commit
97a2fee81c
|
@ -65,16 +65,8 @@ end sub
|
|||
|
||||
' User requested subtitle selection popup
|
||||
sub onSelectSubtitlePressed()
|
||||
' None is always first in the subtitle list
|
||||
subtitleData = {
|
||||
data: [{
|
||||
"Index": -1,
|
||||
"IsExternal": false,
|
||||
"Track": {
|
||||
"description": "None"
|
||||
},
|
||||
"Type": "subtitleselection"
|
||||
}]
|
||||
data: []
|
||||
}
|
||||
|
||||
for each item in m.view.fullSubtitleData
|
||||
|
@ -100,9 +92,24 @@ sub onSelectSubtitlePressed()
|
|||
end if
|
||||
end if
|
||||
|
||||
subtitleData.data.push(item)
|
||||
' Put the selected item at the top of the option list
|
||||
if isValid(item.selected) and item.selected
|
||||
subtitleData.data.Unshift(item)
|
||||
else
|
||||
subtitleData.data.push(item)
|
||||
end if
|
||||
end for
|
||||
|
||||
' Manually create the None option and place at top
|
||||
subtitleData.data.Unshift({
|
||||
"Index": -1,
|
||||
"IsExternal": false,
|
||||
"Track": {
|
||||
"description": "None"
|
||||
},
|
||||
"Type": "subtitleselection"
|
||||
})
|
||||
|
||||
m.global.sceneManager.callFunc("radioDialog", tr("Select Subtitles"), subtitleData)
|
||||
m.global.sceneManager.observeField("returnData", "onSelectionMade")
|
||||
end sub
|
||||
|
|
Loading…
Reference in New Issue
Block a user