protected void OnShowSortOptions() { GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) { return; } dlg.Reset(); dlg.SetHeading(Translation.Sorting); // Sort options dlg.Add(Translation.SortByName); // name dlg.Add(Translation.SortByBitrate); // bitrate dlg.Add(Translation.NoSorting); // no sorting // set the focus to currently used sort method dlg.SelectedLabel = (int)curSorting; // show dialog and wait for result dlg.DoModal(GetID); if (dlg.SelectedId == -1) { return; } if (dlg.SelectedLabelText == Translation.SortByBitrate) { curSorting = StationSort.SortMethod.bitrate; sortButton.Label = Translation.SortByBitrate; } else if (dlg.SelectedLabelText == Translation.SortByName) { curSorting = StationSort.SortMethod.name; sortButton.Label = Translation.SortByName; } else { curSorting = StationSort.SortMethod.none; sortButton.Label = Translation.NoSorting; } sortButton.IsAscending = mapSettings.SortAscending; UpdateList(); }
protected void OnShowSortOptions() { GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) return; dlg.Reset(); dlg.SetHeading(Translation.Sorting); // Sort options dlg.Add(Translation.SortByName); // name dlg.Add(Translation.SortByBitrate); // bitrate dlg.Add(Translation.NoSorting); // no sorting // set the focus to currently used sort method dlg.SelectedLabel = (int)curSorting; // show dialog and wait for result dlg.DoModal(GetID); if (dlg.SelectedId == -1) return; if(dlg.SelectedLabelText==Translation.SortByBitrate) { curSorting = StationSort.SortMethod.bitrate; sortButton.Label = Translation.SortByBitrate; } else if (dlg.SelectedLabelText == Translation.SortByName) { curSorting = StationSort.SortMethod.name; sortButton.Label = Translation.SortByName; } else { curSorting = StationSort.SortMethod.none; sortButton.Label = Translation.NoSorting; } sortButton.IsAscending = mapSettings.SortAscending; UpdateList(); }