IDE: fixed updating project inspector when unit is removed

git-svn-id: trunk@16022 -
This commit is contained in:
mattias 2008-08-11 10:38:22 +00:00
parent cb9189c27a
commit 50afe07cfb
3 changed files with 36 additions and 30 deletions

View File

@ -13727,37 +13727,43 @@ var
Dummy: Boolean;
begin
Result:=mrOk;
AnUnitInfo.IsPartOfProject:=false;
if (Project1.MainUnitID>=0)
and (pfMainUnitHasUsesSectionForAllUnits in Project1.Flags)
then begin
BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]);
ShortUnitName:=AnUnitInfo.UnitName;
if (ShortUnitName<>'') then begin
Dummy:=CodeToolBoss.RemoveUnitFromAllUsesSections(
Project1.MainUnitInfo.Source,ShortUnitName);
if Dummy then
Project1.MainUnitInfo.Modified:=true
else begin
ApplyCodeToolChanges;
DoJumpToCodeToolBossError;
Result:=mrCancel;
exit;
if not AnUnitInfo.IsPartOfProject then exit;
Project1.BeginUpdate(true);
try
AnUnitInfo.IsPartOfProject:=false;
if (Project1.MainUnitID>=0)
and (pfMainUnitHasUsesSectionForAllUnits in Project1.Flags)
then begin
BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]);
ShortUnitName:=AnUnitInfo.UnitName;
if (ShortUnitName<>'') then begin
Dummy:=CodeToolBoss.RemoveUnitFromAllUsesSections(
Project1.MainUnitInfo.Source,ShortUnitName);
if Dummy then
Project1.MainUnitInfo.Modified:=true
else begin
ApplyCodeToolChanges;
DoJumpToCodeToolBossError;
Result:=mrCancel;
exit;
end;
end;
end;
if (AnUnitInfo.ComponentName<>'') then begin
Dummy:=Project1.RemoveCreateFormFromProjectFile(
'T'+AnUnitInfo.ComponentName,AnUnitInfo.ComponentName);
if not Dummy then begin
ApplyCodeToolChanges;
DoJumpToCodeToolBossError;
Result:=mrCancel;
exit;
if (AnUnitInfo.ComponentName<>'') then begin
Dummy:=Project1.RemoveCreateFormFromProjectFile(
'T'+AnUnitInfo.ComponentName,AnUnitInfo.ComponentName);
if not Dummy then begin
ApplyCodeToolChanges;
DoJumpToCodeToolBossError;
Result:=mrCancel;
exit;
end;
end;
ApplyCodeToolChanges;
end;
ApplyCodeToolChanges;
Project1.Modified:=true;
finally
Project1.EndUpdate;
end;
Project1.Modified:=true;
end;
procedure TMainIDE.OnCompilerOptionsDialogTest(Sender: TObject);

View File

@ -726,8 +726,8 @@ begin
dec(FUpdateLock);
if FUpdateLock=0 then begin
if pifTitleChanged in FFlags then UpdateTitle;
if pifButtonsChanged in FFlags then UpdateButtons;
if pifItemsChanged in FFlags then UpdateItems;
if pifButtonsChanged in FFlags then UpdateButtons;
end;
end;

View File

@ -337,8 +337,8 @@ implementation
var
InterfaceInitializationHandlers,
InterfaceFinalizationHandlers: TFPList;
InterfaceInitializationHandlers: TFPList = nil;
InterfaceFinalizationHandlers: TFPList = nil;
DebugTextAllocated: boolean;
DebugText: ^Text;
LineInfoCache: TAvgLvlTree = nil;