From 9d902708d51a90910413c3a965908952336964fd Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 19 May 2010 15:49:55 +0200 Subject: [PATCH] Support to open multiple files at once. --- Projects/Simba/simbaunit.pas | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Projects/Simba/simbaunit.pas b/Projects/Simba/simbaunit.pas index e567e03..21a44d2 100644 --- a/Projects/Simba/simbaunit.pas +++ b/Projects/Simba/simbaunit.pas @@ -2866,6 +2866,7 @@ end; function TSimbaForm.OpenScript: boolean; var + i: Integer; OpenInNewTab : boolean; begin Result := False; @@ -2875,11 +2876,19 @@ begin Exit; with TOpenDialog.Create(nil) do try - Filter:= 'Simba Files|*.Simba;*.simb;*.cogat;*.mufa;*.txt;*.' +LoadSettingDef('Settings/Extensions/FileExtension','sex')+ + Options := [ofAllowMultiSelect, ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail]; + Filter:= 'Simba Files|*.simba;*.simb;*.cogat;*.mufa;*.txt;*.' +LoadSettingDef('Settings/Extensions/FileExtension','sex')+ '|Any files|*.*'; if Execute then - if FileExistsUTF8(filename) then - result := LoadScriptFile(filename); + begin + Result := True; + for i := 0 to Files.Count - 1 do + if (not FileExistsUTF8(Files[i])) or (not LoadScriptFile(Files[i])) then + begin + Result := False; + Break; + end; + end; finally Free; end;