mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 13:39:24 +02:00
IDE: Use InputQuery instead of AddProfileDialog in BuildProfileManager. Issue #28088, patch from Alexey Torgashin.
git-svn-id: trunk@49044 -
This commit is contained in:
parent
5973d8ebed
commit
692ca6bd8b
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -5539,8 +5539,6 @@ ide/aboutfrm.lfm svneol=native#text/plain
|
|||||||
ide/aboutfrm.pas svneol=native#text/pascal
|
ide/aboutfrm.pas svneol=native#text/pascal
|
||||||
ide/abstractsmethodsdlg.lfm svneol=native#text/plain
|
ide/abstractsmethodsdlg.lfm svneol=native#text/plain
|
||||||
ide/abstractsmethodsdlg.pas svneol=native#text/plain
|
ide/abstractsmethodsdlg.pas svneol=native#text/plain
|
||||||
ide/addprofiledialog.lfm svneol=native#text/plain
|
|
||||||
ide/addprofiledialog.pas svneol=native#text/plain
|
|
||||||
ide/addtoprojectdlg.lfm svneol=native#text/plain
|
ide/addtoprojectdlg.lfm svneol=native#text/plain
|
||||||
ide/addtoprojectdlg.pas svneol=native#text/pascal
|
ide/addtoprojectdlg.pas svneol=native#text/pascal
|
||||||
ide/advhistorylist.pas svneol=native#text/pascal
|
ide/advhistorylist.pas svneol=native#text/pascal
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
object AddProfileForm: TAddProfileForm
|
|
||||||
Left = 279
|
|
||||||
Height = 110
|
|
||||||
Top = 246
|
|
||||||
Width = 443
|
|
||||||
AutoSize = True
|
|
||||||
Caption = 'Add New Profile'
|
|
||||||
ClientHeight = 110
|
|
||||||
ClientWidth = 443
|
|
||||||
Constraints.MinWidth = 400
|
|
||||||
OnCreate = FormCreate
|
|
||||||
LCLVersion = '0.9.29'
|
|
||||||
object NameEdit: TEdit
|
|
||||||
AnchorSideLeft.Control = Owner
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = Owner
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = ButtonPanel
|
|
||||||
Left = 12
|
|
||||||
Height = 21
|
|
||||||
Top = 51
|
|
||||||
Width = 419
|
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
|
||||||
BorderSpacing.Left = 12
|
|
||||||
BorderSpacing.Right = 12
|
|
||||||
BorderSpacing.Bottom = 6
|
|
||||||
TabOrder = 0
|
|
||||||
end
|
|
||||||
object ProfileHeaderLabel: TLabel
|
|
||||||
AnchorSideLeft.Control = NameEdit
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = NameEdit
|
|
||||||
Left = 12
|
|
||||||
Height = 14
|
|
||||||
Top = 31
|
|
||||||
Width = 64
|
|
||||||
Anchors = [akLeft, akBottom]
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
BorderSpacing.Right = 12
|
|
||||||
BorderSpacing.Bottom = 6
|
|
||||||
Caption = 'Profile name:'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object ButtonPanel: TButtonPanel
|
|
||||||
Left = 6
|
|
||||||
Height = 26
|
|
||||||
Top = 78
|
|
||||||
Width = 431
|
|
||||||
OKButton.Name = 'OKButton'
|
|
||||||
HelpButton.Name = 'HelpButton'
|
|
||||||
HelpButton.Enabled = False
|
|
||||||
CloseButton.Name = 'CloseButton'
|
|
||||||
CloseButton.Enabled = False
|
|
||||||
CancelButton.Name = 'CancelButton'
|
|
||||||
TabOrder = 1
|
|
||||||
ShowButtons = [pbOK, pbCancel]
|
|
||||||
ShowBevel = False
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,43 +0,0 @@
|
|||||||
unit AddProfileDialog;
|
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
|
||||||
|
|
||||||
interface
|
|
||||||
|
|
||||||
uses
|
|
||||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
|
||||||
StdCtrls, ButtonPanel, LazarusIDEStrConsts;
|
|
||||||
|
|
||||||
type
|
|
||||||
|
|
||||||
{ TAddProfileForm }
|
|
||||||
|
|
||||||
TAddProfileForm = class(TForm)
|
|
||||||
ButtonPanel: TButtonPanel;
|
|
||||||
NameEdit: TEdit;
|
|
||||||
ProfileHeaderLabel: TLabel;
|
|
||||||
procedure FormCreate(Sender:TObject);
|
|
||||||
private
|
|
||||||
|
|
||||||
public
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
|
||||||
AddProfileForm: TAddProfileForm;
|
|
||||||
|
|
||||||
implementation
|
|
||||||
|
|
||||||
{$R *.lfm}
|
|
||||||
|
|
||||||
|
|
||||||
{ TAddProfileForm }
|
|
||||||
|
|
||||||
procedure TAddProfileForm.FormCreate(Sender:TObject);
|
|
||||||
begin
|
|
||||||
ButtonPanel.OKButton.Caption:=lisMenuOk;
|
|
||||||
ButtonPanel.CancelButton.Caption:=lisCancel;
|
|
||||||
end;
|
|
||||||
|
|
||||||
end.
|
|
||||||
|
|
@ -9,7 +9,7 @@ object BuildProfileManagerForm: TBuildProfileManagerForm
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '1.5'
|
||||||
object ProfilesPanel: TPanel
|
object ProfilesPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 459
|
Height = 459
|
||||||
@ -41,21 +41,21 @@ object BuildProfileManagerForm: TBuildProfileManagerForm
|
|||||||
OnClick = MoveDownButtonClick
|
OnClick = MoveDownButtonClick
|
||||||
end
|
end
|
||||||
object MoveUpButton: TToolButton
|
object MoveUpButton: TToolButton
|
||||||
Left = 252
|
Left = 223
|
||||||
Top = 0
|
Top = 0
|
||||||
Caption = 'MoveUpButton'
|
Caption = 'MoveUpButton'
|
||||||
ImageIndex = 3
|
ImageIndex = 3
|
||||||
OnClick = MoveUpButtonClick
|
OnClick = MoveUpButtonClick
|
||||||
end
|
end
|
||||||
object EditButton: TToolButton
|
object EditButton: TToolButton
|
||||||
Left = 173
|
Left = 154
|
||||||
Top = 0
|
Top = 0
|
||||||
Caption = 'EditButton'
|
Caption = 'EditButton'
|
||||||
ImageIndex = 2
|
ImageIndex = 2
|
||||||
OnClick = EditButtonClick
|
OnClick = EditButtonClick
|
||||||
end
|
end
|
||||||
object RemoveButton: TToolButton
|
object RemoveButton: TToolButton
|
||||||
Left = 75
|
Left = 67
|
||||||
Top = 0
|
Top = 0
|
||||||
Caption = 'RemoveButton'
|
Caption = 'RemoveButton'
|
||||||
ImageIndex = 1
|
ImageIndex = 1
|
||||||
@ -69,7 +69,8 @@ object BuildProfileManagerForm: TBuildProfileManagerForm
|
|||||||
OnClick = AddButtonClick
|
OnClick = AddButtonClick
|
||||||
end
|
end
|
||||||
object tbSeparator: TToolButton
|
object tbSeparator: TToolButton
|
||||||
Left = 247
|
Left = 218
|
||||||
|
Height = 46
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 5
|
Width = 5
|
||||||
Caption = 'tbSeparator'
|
Caption = 'tbSeparator'
|
||||||
@ -86,7 +87,6 @@ object BuildProfileManagerForm: TBuildProfileManagerForm
|
|||||||
OnClick = ProfilesListboxClick
|
OnClick = ProfilesListboxClick
|
||||||
ScrollWidth = 354
|
ScrollWidth = 354
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
|
||||||
end
|
end
|
||||||
object ButtonPanel: TButtonPanel
|
object ButtonPanel: TButtonPanel
|
||||||
Left = 7
|
Left = 7
|
||||||
|
@ -161,9 +161,6 @@ implementation
|
|||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
uses
|
|
||||||
AddProfileDialog;
|
|
||||||
|
|
||||||
const
|
const
|
||||||
DefaultTargetDirectory = ''; // empty will be replaced by '$(ConfDir)/bin';
|
DefaultTargetDirectory = ''; // empty will be replaced by '$(ConfDir)/bin';
|
||||||
|
|
||||||
@ -560,26 +557,22 @@ end;
|
|||||||
procedure TBuildProfileManagerForm.AddButtonClick(Sender: TObject);
|
procedure TBuildProfileManagerForm.AddButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
NewProfile: TBuildLazarusProfile;
|
NewProfile: TBuildLazarusProfile;
|
||||||
|
Str: string;
|
||||||
begin
|
begin
|
||||||
with TAddProfileForm.Create(nil) do
|
Str:= '';
|
||||||
try
|
if not InputQuery(lisLazBuildNewProf, lisLazBuildNewProfInfo, Str) then Exit;
|
||||||
Caption:=lisLazBuildNewProf;
|
if Str='' then Exit;
|
||||||
ProfileHeaderLabel.Caption:=lisLazBuildNewProfInfo;
|
|
||||||
if (ShowModal=mrOk) and (NameEdit.Text<>'') then begin
|
|
||||||
// Update ProfsToManage collection.
|
// Update ProfsToManage collection.
|
||||||
NewProfile:=TBuildLazarusProfile.Create(fProfsToManage,NameEdit.Text);
|
NewProfile:=TBuildLazarusProfile.Create(fProfsToManage,Str);
|
||||||
NewProfile.Assign(fProfsToManage.Current, False);
|
NewProfile.Assign(fProfsToManage.Current, False);
|
||||||
fProfsToManage.Add(NewProfile);
|
fProfsToManage.Add(NewProfile);
|
||||||
fProfsToManage.fCurrentIndex:=fProfsToManage.Count-1; // Select the new profile.
|
fProfsToManage.fCurrentIndex:=fProfsToManage.Count-1; // Select the new profile.
|
||||||
// Update ListBox
|
// Update ListBox
|
||||||
ProfilesListbox.Items.Add(NameEdit.Text);
|
ProfilesListbox.Items.Add(Str);
|
||||||
ProfilesListbox.ItemIndex:=ProfilesListbox.Count-1;
|
ProfilesListbox.ItemIndex:=ProfilesListbox.Count-1;
|
||||||
EnableButtons;
|
EnableButtons;
|
||||||
end;
|
end;
|
||||||
finally
|
|
||||||
Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TBuildProfileManagerForm.RemoveButtonClick(Sender: TObject);
|
procedure TBuildProfileManagerForm.RemoveButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
@ -612,29 +605,25 @@ end;
|
|||||||
procedure TBuildProfileManagerForm.EditButtonClick(Sender: TObject);
|
procedure TBuildProfileManagerForm.EditButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i, SelI: integer;
|
i, SelI: integer;
|
||||||
|
Str: string;
|
||||||
begin
|
begin
|
||||||
i:=ProfilesListbox.ItemIndex;
|
i:=ProfilesListbox.ItemIndex;
|
||||||
if i<0 then exit;
|
if i<0 then exit;
|
||||||
with TAddProfileForm.Create(nil) do
|
|
||||||
try
|
Str:= ProfilesListbox.Items[i];
|
||||||
Caption:=lisLazBuildRenameProf;
|
if not InputQuery(lisLazBuildRenameProf, lisLazBuildRenameProfInfo, Str) then Exit;
|
||||||
ProfileHeaderLabel.Caption:=lisLazBuildRenameProfInfo;
|
if Str='' then Exit;
|
||||||
NameEdit.Text:=ProfilesListbox.Items[i];
|
|
||||||
if (ShowModal=mrOk) and (NameEdit.Text<>'') then begin
|
|
||||||
// Update ProfsToManage collection.
|
// Update ProfsToManage collection.
|
||||||
fProfsToManage[i].fName:=NameEdit.Text;
|
fProfsToManage[i].fName:=Str;
|
||||||
// Update selected list.
|
// Update selected list.
|
||||||
SelI:=fProfsToManage.Selected.IndexOf(ProfilesListbox.Items[i]);
|
SelI:=fProfsToManage.Selected.IndexOf(ProfilesListbox.Items[i]);
|
||||||
if SelI>-1 then
|
if SelI>-1 then
|
||||||
fProfsToManage.Selected[SelI]:=NameEdit.Text;
|
fProfsToManage.Selected[SelI]:=Str;
|
||||||
// Update ListBox
|
// Update ListBox
|
||||||
ProfilesListbox.Items[i]:=NameEdit.Text;
|
ProfilesListbox.Items[i]:=Str;
|
||||||
EnableButtons;
|
EnableButtons;
|
||||||
end;
|
end;
|
||||||
finally
|
|
||||||
Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TBuildProfileManagerForm.MoveUpButtonClick(Sender: TObject);
|
procedure TBuildProfileManagerForm.MoveUpButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user