View Issue Details

IDProjectCategoryView StatusLast Update
0036736LazarusIDEpublic2020-02-27 23:03
Reportererrno Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSwindows 
Product Version2.1 (SVN) 
Summary0036736: Cancel "build mode" fails
DescriptionThe project options dialog does'nt cancel correctly the build mode when the dialog is opened by clicking on the
"Change build mode" tool buton .
Steps To Reproduce-- open a project with at least two build modes .
-- click on "Change build mode" tool buton
-- change the build mode
-- click on cancel to close the window
-- verify the active build mode in project option .
Additional Informationpatch added
TagsNo tags attached.
Fixed in Revisionr62679
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

errno

2020-02-26 20:04

reporter  

compilMode.patch (2,099 bytes)   
Index: ide/main.pp
===================================================================
--- ide/main.pp	(r�vision 62674)
+++ ide/main.pp	(copie de travail)
@@ -5222,7 +5222,6 @@
   //ActiveSrcEdit:=nil;
   //BeginCodeTool(ActiveSrcEdit, ActiveUnitInfo, []);
   Project1.BackupSession;
-  Project1.BackupBuildModes;
   Project1.UpdateExecutableType;
   Project1.UseAsDefault := False;
   TProjectIDEOptions(Sender).CheckLclApp;
@@ -5236,10 +5235,7 @@
   if not (Sender is TProjectIDEOptions) then exit;
   Assert(Assigned(TProjectIDEOptions(Sender).Project), 'TMainIDE.ProjectOptionsAfterWrite: Project=Nil.');
   if Restore then
-  begin
-    Project1.RestoreBuildModes;
-    Project1.RestoreSession;
-  end
+    Project1.RestoreSession
   else begin
     if Project1.MainUnitID >= 0 then
     begin
Index: ide/project.pp
===================================================================
--- ide/project.pp	(r�vision 62674)
+++ ide/project.pp	(copie de travail)
@@ -513,6 +513,8 @@
     FProject: TProject;
     FCompileReasons: TCompileReasons;
     procedure InvalidateOptions;
+    procedure AfterWriteExec(Sender: TObject; Restore: boolean);
+    procedure BeforeReadExec(Sender: TObject);
   protected
     procedure SetTargetCPU(const AValue: string); override;
     procedure SetTargetOS(const AValue: string); override;
@@ -6301,6 +6303,18 @@
   //if (LazProject=nil) then exit;
 end;
 
+procedure TProjectCompilerOptions.AfterWriteExec(Sender:TObject;Restore:boolean);
+begin
+ if Restore and (LazProject<>nil) then
+   LazProject.RestoreBuildModes;
+end;
+
+procedure TProjectCompilerOptions.BeforeReadExec(Sender:TObject);
+begin
+ if LazProject<>nil then
+   LazProject.BackupBuildModes;
+end;
+
 procedure TProjectCompilerOptions.SetAlternativeCompile(const Command: string;
   ScanFPCMsgs: boolean);
 begin
@@ -6325,6 +6339,8 @@
   if AOwner <> nil then
     FProject := AOwner as TProject;
   ParsedOpts.OnLocalSubstitute:=@SubstituteProjectMacros;
+  OnAfterWrite:=@AfterWriteExec;
+  OnBeforeRead:=@BeforeReadExec;
 end;
 
 destructor TProjectCompilerOptions.Destroy;
compilMode.patch (2,099 bytes)   

Juha Manninen

2020-02-27 11:50

developer   ~0121239

You are right!
I applied the patch, thanks.

Issue History

Date Modified Username Field Change
2020-02-26 20:04 errno New Issue
2020-02-26 20:04 errno File Added: compilMode.patch
2020-02-27 11:04 Juha Manninen Assigned To => Juha Manninen
2020-02-27 11:04 Juha Manninen Status new => assigned
2020-02-27 11:50 Juha Manninen Status assigned => resolved
2020-02-27 11:50 Juha Manninen Resolution open => fixed
2020-02-27 11:50 Juha Manninen Fixed in Revision => r62679
2020-02-27 11:50 Juha Manninen LazTarget => -
2020-02-27 11:50 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-02-27 11:50 Juha Manninen Note Added: 0121239
2020-02-27 23:03 errno Status resolved => closed