fixed adding main file in gtk filediaog twice

git-svn-id: trunk@6548 -
This commit is contained in:
mattias 2005-01-11 19:01:51 +00:00
parent 04d3075534
commit bde1444b74
2 changed files with 19 additions and 3 deletions

View File

@ -1912,6 +1912,7 @@ begin
OpenDialog.Options:=OpenDialog.Options+[ofAllowMultiSelect]; OpenDialog.Options:=OpenDialog.Options+[ofAllowMultiSelect];
if OpenDialog.Execute and (OpenDialog.Files.Count>0) then begin if OpenDialog.Execute and (OpenDialog.Files.Count>0) then begin
OpenFlags:=[ofAddToRecent]; OpenFlags:=[ofAddToRecent];
//debugln('TMainIDE.mnuOpenClicked OpenDialog.Files.Count=',dbgs(OpenDialog.Files.Count));
if OpenDialog.Files.Count>1 then if OpenDialog.Files.Count>1 then
Include(OpenFlags,ofRegularFile); Include(OpenFlags,ofRegularFile);
For I := 0 to OpenDialog.Files.Count-1 do For I := 0 to OpenDialog.Files.Count-1 do
@ -5012,7 +5013,7 @@ begin
exit; exit;
end; end;
end; end;
// check if file is a lazarus package (.lpi) // check if file is a lazarus package (.lpk)
if (CompareFileExt(AFilename,'.lpk',false)=0) then begin if (CompareFileExt(AFilename,'.lpk',false)=0) then begin
if MessageDlg(lisOpenPackage, if MessageDlg(lisOpenPackage,
Format(lisOpenThePackageAnswerNoToLoadItAsXmlFile, [AFilename, #13]), Format(lisOpenThePackageAnswerNoToLoadItAsXmlFile, [AFilename, #13]),
@ -11375,6 +11376,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.827 2005/01/11 19:01:51 mattias
fixed adding main file in gtk filediaog twice
Revision 1.826 2005/01/09 23:28:18 mattias Revision 1.826 2005/01/09 23:28:18 mattias
fixed loading no unit at start fixed loading no unit at start

View File

@ -1504,6 +1504,15 @@ var
if not Result then exit; if not Result then exit;
end; end;
end; end;
procedure AddFile(List: TStrings; const NewFile: string);
var
i: Integer;
begin
for i:=0 to List.Count-1 do
if List[i]=NewFile then exit;
List.Add(NewFile);
end;
begin begin
Result := True; Result := True;
@ -1527,7 +1536,7 @@ begin
if (Filename<>'') then begin if (Filename<>'') then begin
Result:=CheckOpenedFilename(Filename); Result:=CheckOpenedFilename(Filename);
if not Result then exit; if not Result then exit;
Files.Add(FileName); AddFile(Files,FileName);
end; end;
{$IfDef GTK2} {$IfDef GTK2}
fileList := gtk_file_selection_get_selections(PGtkFileSelection(FPointer)); fileList := gtk_file_selection_get_selections(PGtkFileSelection(FPointer));
@ -1560,7 +1569,7 @@ begin
CurFilename:=DirName+fileInfo; CurFilename:=DirName+fileInfo;
Result:=CheckOpenedFilename(CurFilename); Result:=CheckOpenedFilename(CurFilename);
if not Result then exit; if not Result then exit;
Files.Add(DirName+fileInfo); AddFile(Files,CurFilename);
end; end;
end; end;
// get next row from list // get next row from list
@ -2960,6 +2969,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.258 2005/01/11 19:01:51 mattias
fixed adding main file in gtk filediaog twice
Revision 1.257 2005/01/07 01:31:44 mattias Revision 1.257 2005/01/07 01:31:44 mattias
implemented TCheckBox.State=cbGrayed for gtk intf without visual representation implemented TCheckBox.State=cbGrayed for gtk intf without visual representation