IDE: Save changes in Object Inspector before compiling the project. Issues #22601 and #17795

git-svn-id: trunk@39082 -
This commit is contained in:
juha 2012-10-14 15:34:49 +00:00
parent 642f340a49
commit 3b90468c10

View File

@ -3067,16 +3067,19 @@ begin
ShowContextHelpEditor(Sender);
ecSave:
if (Sender is TDesigner) then begin
GetDesignerUnit(TDesigner(Sender),ASrcEdit,AnUnitInfo);
if (AnUnitInfo<>nil) and (AnUnitInfo.OpenEditorInfoCount > 0) then
DoSaveEditorFile(ASrcEdit, [sfCheckAmbiguousFiles]);
end else if (Sender is TObjectInspectorDlg) then begin
GetObjectInspectorUnit(ASrcEdit,AnUnitInfo);
if (AnUnitInfo<>nil) and (AnUnitInfo.OpenEditorInfoCount > 0) then
DoSaveEditorFile(ASrcEdit, [sfCheckAmbiguousFiles]);
end else if Sender is TSourceNotebook then
mnuSaveClicked(Self);
begin
ObjectInspector1.GetActivePropertyGrid.SaveChanges;
if (Sender is TDesigner) or (Sender is TObjectInspectorDlg) then begin
if (Sender is TDesigner) then
GetDesignerUnit(TDesigner(Sender),ASrcEdit,AnUnitInfo)
else
GetObjectInspectorUnit(ASrcEdit,AnUnitInfo);
if (AnUnitInfo<>nil) and (AnUnitInfo.OpenEditorInfoCount > 0) then
DoSaveEditorFile(ASrcEdit, [sfCheckAmbiguousFiles]);
end
else if Sender is TSourceNotebook then
mnuSaveClicked(Self);
end;
ecOpen:
mnuOpenClicked(Self);
@ -8180,15 +8183,17 @@ function TMainIDE.PrepareForCompile: TModalResult;
begin
Result:=mrOk;
if ToolStatus=itDebugger then begin
Result:=IDEQuestionDialog(lisStopDebugging2,
lisStopCurrentDebuggingAndRebuildProject,
mtConfirmation,[mrYes, mrCancel, lisNo],'');
Result:=IDEQuestionDialog(lisStopDebugging2, lisStopCurrentDebuggingAndRebuildProject,
mtConfirmation,[mrYes, mrCancel, lisNo],'');
if Result<>mrYes then exit;
Result:=DebugBoss.DoStopProject;
if Result<>mrOk then exit;
end;
// Save the property editor value in Object Inspector
ObjectInspector1.GetActivePropertyGrid.SaveChanges;
if MainBuildBoss.CompilerOnDiskChanged then
MainBuildBoss.RescanCompilerDefines(false,false,false,false);
end;