auto open sln if checked
This commit is contained in:
@@ -27,6 +27,14 @@ public partial class SlnPicker : Control
|
|||||||
var windowParent = GetParentOrNull<Window>();
|
var windowParent = GetParentOrNull<Window>();
|
||||||
_fileDialog.FileSelected += path => _tcs.SetResult(path);
|
_fileDialog.FileSelected += path => _tcs.SetResult(path);
|
||||||
windowParent?.CloseRequested += () => _tcs.SetResult(null);
|
windowParent?.CloseRequested += () => _tcs.SetResult(null);
|
||||||
|
if (Singletons.AppState.IdeSettings.AutoOpenLastSolution && GetParent() is not Window)
|
||||||
|
{
|
||||||
|
var lastSln = Singletons.AppState.RecentSlns.LastOrDefault();
|
||||||
|
if (lastSln is not null && File.Exists(lastSln.FilePath))
|
||||||
|
{
|
||||||
|
_tcs.TrySetResult(lastSln.FilePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
PopulatePreviousSolutions();
|
PopulatePreviousSolutions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +45,7 @@ public partial class SlnPicker : Control
|
|||||||
{
|
{
|
||||||
var node = _previousSlnEntryScene.Instantiate<PreviousSlnEntry>();
|
var node = _previousSlnEntryScene.Instantiate<PreviousSlnEntry>();
|
||||||
node.RecentSln = previousSln;
|
node.RecentSln = previousSln;
|
||||||
node.Clicked = path => _tcs.SetResult(path);
|
node.Clicked = path => _tcs.TrySetResult(path);
|
||||||
_previousSlnsVBoxContainer.AddChild(node);
|
_previousSlnsVBoxContainer.AddChild(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user