IDE: add example projects to recent menu only once

git-svn-id: trunk@41319 -
This commit is contained in:
mattias 2013-05-20 11:40:49 +00:00
parent d181c76fe3
commit 4a609e7a5a

View File

@ -335,6 +335,9 @@ type
FNewUnitTemplate: string;
FFileDialogFilter: string;
// Prevent repopulating Recent project files menu with example projects if it was already cleared up.
FAlreadyPopulatedRecentFiles : Boolean;
function GetCompilerFilename: string;
function GetCompilerMessagesFilename: string;
function GetDebuggerEventLogColors(AIndex: TDBGEventType): TDebuggerEventLogColor;
@ -1268,13 +1271,16 @@ begin
LoadRecentList(XMLConfig,FRecentPackageFiles,
Path+'Recent/PackageFiles/',rltFile);
FAlreadyPopulatedRecentFiles := XMLConfig.GetValue(Path+'Recent/AlreadyPopulated', false);
// Add example projects to an empty project list if examples have write access
if FRecentProjectFiles.count=0 then begin
if (FRecentProjectFiles.count=0) and (not FAlreadyPopulatedRecentFiles) then begin
AddRecentProjectInitial('examples/jpeg/', 'jpegexample.lpi');
AddRecentProjectInitial('examples/sprites/', 'spriteexample.lpi');
AddRecentProjectInitial('examples/openglcontrol/', 'openglcontrol_demo.lpi');
AddRecentProjectInitial('examples/barchart/', 'chartdemo.lpi');
AddRecentProjectInitial('examples/', 'hello.lpi');
FAlreadyPopulatedRecentFiles := True;
end;
// external tools
@ -1609,6 +1615,8 @@ begin
SaveRecentList(XMLConfig,FRecentPackageFiles,
Path+'Recent/PackageFiles/');
XMLConfig.SetValue(Path+'Recent/AlreadyPopulated', FAlreadyPopulatedRecentFiles);
// external tools
fExternalTools.Save(FConfigStore,Path+'ExternalTools/');