View Issue Details

IDProjectCategoryView StatusLast Update
0018259LazarusIDEpublic2010-12-22 10:17
ReporterStephano Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version0.9.29 (SVN) 
Summary0018259: IDE Build Lazarus enhancements
DescriptionAttached patch features:
- sets ecBuildLazarus to execute mnuToolBuildLazarusClicked instead of DoBuildLazarus
- Changes buttons of the Build Advanced select profiles dialog to: Build OK Cancel

Note:
Due to bug 0017953, genericchecklist.pas had to be modfied instead of inheriting it and modifying its descendant
TagsNo tags attached.
Fixed in Revision
LazTarget0.99.0
Widgetset
Attached Files

Relationships

related to 0017953 closedMattias Gaertner Cannot override inherited method in VFI 
related to 0018260 closedPaul Ishenin Pave the way for a configurable IDE menu 

Activities

2010-12-18 18:51

 

IDEenhancements-BuildLazarus-2010-12-18.diff (4,658 bytes)   
Index: main.pp
===================================================================
--- main.pp	(revision 28761)
+++ main.pp	(working copy)
@@ -327,6 +327,7 @@
     procedure mnuToolConvertDelphiPackageClicked(Sender: TObject);
     procedure mnuToolConvertEncodingClicked(Sender: TObject);
     procedure mnuToolBuildLazarusClicked(Sender: TObject);
+    procedure mnuToolBuildAdvancedLazarusClicked(Sender: TObject);
     procedure mnuToolConfigBuildLazClicked(Sender: TObject);
     procedure mnuCustomExtToolClick(Sender: TObject);
 
@@ -3191,8 +3192,11 @@
     DoConvertDFMtoLFM;
 
   ecBuildLazarus:
-    DoBuildLazarus([]);
+    mnuToolBuildLazarusClicked(Self);
 
+  ecBuildAdvancedLazarus:
+    mnuToolBuildAdvancedLazarusClicked(Self);
+
   ecConfigBuildLazarus:
     mnuToolConfigBuildLazClicked(Self);
 
@@ -4371,6 +4375,32 @@
   DoBuildLazarus([]);
 end;
 
+procedure TMainIDE.mnuToolBuildAdvancedLazarusClicked(Sender: TObject);
+var
+  i: Integer;
+  FoundProfToBuild: Boolean;
+  s: String;
+begin
+  with MiscellaneousOptions do begin
+    FoundProfToBuild:=False;
+    s:=sLineBreak+sLineBreak;
+    for i:=0 to BuildLazProfiles.Selected.Count-1 do
+      if BuildLazProfiles.IndexByName(BuildLazProfiles.Selected[i])<>-1 then begin
+        s:=s+BuildLazProfiles.Selected[i]+sLineBreak;
+        FoundProfToBuild:=True;
+      end;
+    if not FoundProfToBuild then begin
+      ShowMessage(lisNoBuildProfilesSelected);
+      exit;
+    end;
+    if BuildLazProfiles.ConfirmBuild then
+      if MessageDlg(Format(lisConfirmBuildAllProfiles, [s+sLineBreak]),
+                    mtConfirmation, mbYesNo, 0)<>mrYes then
+        exit;
+    DoBuildAdvancedLazarus(BuildLazProfiles.Selected);
+  end;
+end;
+
 procedure TMainIDE.mnuToolConfigBuildLazClicked(Sender: TObject);
 var
   CmdLineDefines: TDefineTemplate;
Index: genericchecklist.pas
===================================================================
--- genericchecklist.pas	(revision 28761)
+++ genericchecklist.pas	(working copy)
@@ -6,7 +6,7 @@
 
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel,
-  StdCtrls, CheckLst, LazarusIDEStrConsts;
+  StdCtrls, CheckLst, LazarusIDEStrConsts, Buttons;
 
 type
 
@@ -32,9 +32,19 @@
 { TGenericCheckListForm }
 
 procedure TGenericCheckListForm.FormCreate(Sender: TObject);
+var
+  BitButtonYes: TBitBtn;
 begin
   ButtonPanel1.OKButton.Caption:=lisOk;
   ButtonPanel1.CancelButton.Caption:=dlgCancel;
+
+  // save and compile
+  BitButtonYes:=TBitBtn.Create(ButtonPanel1);
+  BitButtonYes.Kind:=bkCustom;
+  BitButtonYes.ModalResult:=mrYes;
+  BitButtonYes.Caption:=lisLazBuildBuild;
+  BitButtonYes.Align:=alRight;
+  BitButtonYes.Parent:=ButtonPanel1;
 end;
 
 end.
Index: genericchecklist.lfm
===================================================================
--- genericchecklist.lfm	(revision 28761)
+++ genericchecklist.lfm	(working copy)
@@ -3,6 +3,7 @@
   Height = 301
   Top = 526
   Width = 343
+  ActiveControl = CheckListBox1
   Caption = 'GenericCheckListForm'
   ClientHeight = 301
   ClientWidth = 343
@@ -11,8 +12,8 @@
   LCLVersion = '0.9.29'
   object ButtonPanel1: TButtonPanel
     Left = 6
-    Height = 34
-    Top = 261
+    Height = 37
+    Top = 258
     Width = 331
     OKButton.Name = 'OKButton'
     OKButton.Caption = '&OK'
@@ -30,7 +31,7 @@
   end
   object CheckListBox1: TCheckListBox
     Left = 0
-    Height = 255
+    Height = 252
     Top = 0
     Width = 343
     Align = alClient
Index: buildlazdialog.pas
===================================================================
--- buildlazdialog.pas	(revision 28761)
+++ buildlazdialog.pas	(working copy)
@@ -1133,6 +1133,10 @@
 end;
 
 procedure TConfigureBuildLazarusDlg.CompileAdvancedButtonClick(Sender: TObject);
+// mrOk=change selected profiles. Selected profiels will be saved or discarded
+// depending on the calling dialog
+// mrYes=save and compile
+// mrCancel=do nothing
 var
   EditForm: TGenericCheckListForm;
   i, ind: Integer;
@@ -1148,15 +1152,17 @@
         EditForm.CheckListBox1.Checked[ind]:=True;
     end;
     // Show the form.
-    if EditForm.ShowModal=mrOK then begin
+    EditForm.ShowModal;
+    if EditForm.ModalResult in [mrOK, mrYes] then begin
       // Copy checked profile names to Selected.
       fProfiles.Selected.Clear;
       for i:=0 to fProfiles.Count-1 do begin      // fProfiles and CheckListBox1
         if EditForm.CheckListBox1.Checked[i] then // indexes match now.
           fProfiles.Selected.Add(fProfiles[i].Name);
       end;
+    end;
+    if EditForm.ModalResult=mrYes then
       ModalResult:=mrAll;
-    end;
   finally
     EditForm.Free;
   end;

Juha Manninen

2010-12-20 12:57

developer   ~0044421

This patch contains ecBuildAdvancedLazarus constant which is not defined.
I suggest we will combine this with the configurable IDE menu issue later.

2010-12-20 19:48

 

IDEenhancements-BuildLazarus-2010-12-20.diff (4,585 bytes)   
Index: main.pp
===================================================================
--- main.pp	(revision 28761)
+++ main.pp	(working copy)
@@ -327,6 +327,7 @@
     procedure mnuToolConvertDelphiPackageClicked(Sender: TObject);
     procedure mnuToolConvertEncodingClicked(Sender: TObject);
     procedure mnuToolBuildLazarusClicked(Sender: TObject);
+    procedure mnuToolBuildAdvancedLazarusClicked(Sender: TObject);
     procedure mnuToolConfigBuildLazClicked(Sender: TObject);
     procedure mnuCustomExtToolClick(Sender: TObject);
 
@@ -3191,8 +3192,11 @@
     DoConvertDFMtoLFM;
 
   ecBuildLazarus:
-    DoBuildLazarus([]);
+    mnuToolBuildLazarusClicked(Self);
 



   ecConfigBuildLazarus:
     mnuToolConfigBuildLazClicked(Self);
 
@@ -4371,6 +4375,32 @@
   DoBuildLazarus([]);
 end;
 
+procedure TMainIDE.mnuToolBuildAdvancedLazarusClicked(Sender: TObject);
+var
+  i: Integer;
+  FoundProfToBuild: Boolean;
+  s: String;
+begin
+  with MiscellaneousOptions do begin
+    FoundProfToBuild:=False;
+    s:=sLineBreak+sLineBreak;
+    for i:=0 to BuildLazProfiles.Selected.Count-1 do
+      if BuildLazProfiles.IndexByName(BuildLazProfiles.Selected[i])<>-1 then begin
+        s:=s+BuildLazProfiles.Selected[i]+sLineBreak;
+        FoundProfToBuild:=True;
+      end;
+    if not FoundProfToBuild then begin
+      ShowMessage(lisNoBuildProfilesSelected);
+      exit;
+    end;
+    if BuildLazProfiles.ConfirmBuild then
+      if MessageDlg(Format(lisConfirmBuildAllProfiles, [s+sLineBreak]),
+                    mtConfirmation, mbYesNo, 0)<>mrYes then
+        exit;
+    DoBuildAdvancedLazarus(BuildLazProfiles.Selected);
+  end;
+end;
+
 procedure TMainIDE.mnuToolConfigBuildLazClicked(Sender: TObject);
 var
   CmdLineDefines: TDefineTemplate;
Index: genericchecklist.pas
===================================================================
--- genericchecklist.pas	(revision 28761)
+++ genericchecklist.pas	(working copy)
@@ -6,7 +6,7 @@
 
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel,
-  StdCtrls, CheckLst, LazarusIDEStrConsts;
+  StdCtrls, CheckLst, LazarusIDEStrConsts, Buttons;
 
 type
 
@@ -32,9 +32,19 @@
 { TGenericCheckListForm }
 
 procedure TGenericCheckListForm.FormCreate(Sender: TObject);
+var
+  BitButtonYes: TBitBtn;
 begin
   ButtonPanel1.OKButton.Caption:=lisOk;
   ButtonPanel1.CancelButton.Caption:=dlgCancel;
+
+  // save and compile
+  BitButtonYes:=TBitBtn.Create(ButtonPanel1);
+  BitButtonYes.Kind:=bkCustom;
+  BitButtonYes.ModalResult:=mrYes;
+  BitButtonYes.Caption:=lisLazBuildBuild;
+  BitButtonYes.Align:=alRight;
+  BitButtonYes.Parent:=ButtonPanel1;
 end;
 
 end.
Index: genericchecklist.lfm
===================================================================
--- genericchecklist.lfm	(revision 28761)
+++ genericchecklist.lfm	(working copy)
@@ -3,6 +3,7 @@
   Height = 301
   Top = 526
   Width = 343
+  ActiveControl = CheckListBox1
   Caption = 'GenericCheckListForm'
   ClientHeight = 301
   ClientWidth = 343
@@ -11,8 +12,8 @@
   LCLVersion = '0.9.29'
   object ButtonPanel1: TButtonPanel
     Left = 6
-    Height = 34
-    Top = 261
+    Height = 37
+    Top = 258
     Width = 331
     OKButton.Name = 'OKButton'
     OKButton.Caption = '&OK'
@@ -30,7 +31,7 @@
   end
   object CheckListBox1: TCheckListBox
     Left = 0
-    Height = 255
+    Height = 252
     Top = 0
     Width = 343
     Align = alClient
Index: buildlazdialog.pas
===================================================================
--- buildlazdialog.pas	(revision 28761)
+++ buildlazdialog.pas	(working copy)
@@ -1133,6 +1133,10 @@
 end;
 
 procedure TConfigureBuildLazarusDlg.CompileAdvancedButtonClick(Sender: TObject);
+// mrOk=change selected profiles. Selected profiels will be saved or discarded
+// depending on the calling dialog
+// mrYes=save and compile
+// mrCancel=do nothing
 var
   EditForm: TGenericCheckListForm;
   i, ind: Integer;
@@ -1148,15 +1152,17 @@
         EditForm.CheckListBox1.Checked[ind]:=True;
     end;
     // Show the form.
-    if EditForm.ShowModal=mrOK then begin
+    EditForm.ShowModal;
+    if EditForm.ModalResult in [mrOK, mrYes] then begin
       // Copy checked profile names to Selected.
       fProfiles.Selected.Clear;
       for i:=0 to fProfiles.Count-1 do begin      // fProfiles and CheckListBox1
         if EditForm.CheckListBox1.Checked[i] then // indexes match now.
           fProfiles.Selected.Add(fProfiles[i].Name);
       end;
+    end;
+    if EditForm.ModalResult=mrYes then
       ModalResult:=mrAll;
-    end;
   finally
     EditForm.Free;
   end;

Stephano

2010-12-20 19:51

developer   ~0044440

ooops. ecBuildAdvancedLazarus should not have been there.
New patch uploaded.

Juha Manninen

2010-12-21 22:19

developer   ~0044480

Applied.

Issue History

Date Modified Username Field Change
2010-12-18 18:51 Stephano New Issue
2010-12-18 18:51 Stephano File Added: IDEenhancements-BuildLazarus-2010-12-18.diff
2010-12-18 19:41 Vincent Snijders Relationship added related to 0017953
2010-12-18 20:40 Vincent Snijders LazTarget => 0.99.0
2010-12-18 20:40 Vincent Snijders Status new => acknowledged
2010-12-18 20:40 Vincent Snijders Target Version => 0.99.0
2010-12-20 11:55 Juha Manninen Status acknowledged => assigned
2010-12-20 11:55 Juha Manninen Assigned To => Juha Manninen
2010-12-20 12:56 Juha Manninen Relationship added related to 0018260
2010-12-20 12:57 Juha Manninen Note Added: 0044421
2010-12-20 19:48 Stephano File Added: IDEenhancements-BuildLazarus-2010-12-20.diff
2010-12-20 19:51 Stephano Note Added: 0044440
2010-12-21 22:19 Juha Manninen Status assigned => resolved
2010-12-21 22:19 Juha Manninen Resolution open => fixed
2010-12-21 22:19 Juha Manninen Note Added: 0044480
2010-12-22 10:17 Stephano Status resolved => closed