Skip to content

Commit 424de68

Browse files
committed
Bug fix for https://bugs.launchpad.net/or/+bug/1997482. Explore in Activity Mode, is not restored.
1 parent 71c1114 commit 424de68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Source/Menu/MainForm.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ void SaveOptions()
682682
SelectedRoute != null ? SelectedRoute.Path : "",
683683
// Activity mode items / Explore mode items
684684
radioButtonModeActivity.Checked ?
685-
SelectedActivity != null && SelectedActivity.FilePath != null ? SelectedActivity.FilePath : "" :
685+
SelectedActivity != null && SelectedActivity.FilePath != null ? SelectedActivity.FilePath : SelectedActivity != null? SelectedActivity.Name : "" :
686686
SelectedTimetableSet != null ? SelectedTimetableSet.fileName : "",
687687
radioButtonModeActivity.Checked ?
688688
SelectedActivity is ExploreActivity && comboBoxLocomotive.SelectedItem != null && (comboBoxLocomotive.SelectedItem as Locomotive).FilePath != null ? (comboBoxLocomotive.SelectedItem as Locomotive).FilePath : "" :
@@ -1349,9 +1349,10 @@ void SelectComboBoxItem<T>(ComboBox comboBox, Func<T, bool> predicate)
13491349
if (comboBox.Items.Count == 0)
13501350
return;
13511351

1352+
var index = (int)UserSettings.Menu_SelectionIndex.Activity;
13521353
for (var i = 0; i < comboBox.Items.Count; i++)
13531354
{
1354-
if (comboBox.Items[i] is T && predicate((T)comboBox.Items[i]))
1355+
if (comboBox.Items[i] is T && predicate((T)comboBox.Items[i]) || (Settings.Menu_Selection.Length > i && comboBox.Items[i].ToString() == Settings.Menu_Selection[index] ))
13551356
{
13561357
comboBox.SelectedIndex = i;
13571358
return;

0 commit comments

Comments
 (0)