Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit a8cafde

Browse files
committed
fixed recent files list filling up
Previously, the Recent Files menu item was getting filled up with all of the files that were previously opened in the editor. Now it adds them to the list only if the editor is fully initialized, which means it will not add new files if they're being loaded on startup.
1 parent 1007f3f commit a8cafde

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

UI/MainWindow/MainWindow.xaml.cs

+10-3
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ public MainWindow(SplashScreen sc)
173173

174174
// Close SplashScreen
175175
sc.Close(TimeSpan.FromMilliseconds(500.0));
176-
FullyInitialized = true;
177176

178177
// Enclose menuitems in an accesible list to set their InputGestureTexts easier
179178
MenuItems = new()
@@ -214,6 +213,8 @@ public MainWindow(SplashScreen sc)
214213

215214
// Evaluate RTL
216215
EvaluateRTL();
216+
217+
FullyInitialized = true;
217218
}
218219
#endregion
219220

@@ -456,7 +457,10 @@ private void AddEditorElement(FileInfo fInfo, string editorTitle, bool SelectMe,
456457
layoutDocument.Content = editor;
457458
EditorReferences.Add(editor);
458459
DockingPane.Children.Add(layoutDocument);
459-
AddNewRecentFile(fInfo);
460+
if (FullyInitialized)
461+
{
462+
AddNewRecentFile(fInfo);
463+
}
460464
if (SelectMe)
461465
{
462466
layoutDocument.IsSelected = true;
@@ -478,7 +482,10 @@ private void AddDASMElement(FileInfo fileInfo)
478482
layoutDocument.Content = dasmElement;
479483
DockingPane.Children.Add(layoutDocument);
480484
DockingPane.SelectedContentIndex = DockingPane.ChildrenCount - 1;
481-
AddNewRecentFile(fileInfo);
485+
if (FullyInitialized)
486+
{
487+
AddNewRecentFile(fileInfo);
488+
}
482489
}
483490

484491
/// <summary>

0 commit comments

Comments
 (0)