Preselect the right entry, if stream url index is set

This commit is contained in:
0xboobface 2018-12-05 12:20:50 +01:00
parent 6db00969d7
commit 28fee0b2e6
1 changed files with 2 additions and 1 deletions

View File

@ -25,7 +25,8 @@ public class StreamSourceSelectionDialog {
List<StreamSource> sources;
try {
sources = selectStreamSource.get();
ChoiceDialog<StreamSource> choiceDialog = new ChoiceDialog<StreamSource>(sources.get(sources.size()-1), sources);
int selectedIndex = model.getStreamUrlIndex() > -1 ? Math.min(model.getStreamUrlIndex(), sources.size()-1) : sources.size()-1;
ChoiceDialog<StreamSource> choiceDialog = new ChoiceDialog<StreamSource>(sources.get(selectedIndex), sources);
choiceDialog.setTitle("Stream Quality");
choiceDialog.setHeaderText("Select your preferred stream quality");
choiceDialog.setResizable(true);