mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 03:37:54 +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/abstractsmethodsdlg.lfm 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.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
|
||||
OnDestroy = FormDestroy
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.31'
|
||||
LCLVersion = '1.5'
|
||||
object ProfilesPanel: TPanel
|
||||
Left = 0
|
||||
Height = 459
|
||||
@ -41,21 +41,21 @@ object BuildProfileManagerForm: TBuildProfileManagerForm
|
||||
OnClick = MoveDownButtonClick
|
||||
end
|
||||
object MoveUpButton: TToolButton
|
||||
Left = 252
|
||||
Left = 223
|
||||
Top = 0
|
||||
Caption = 'MoveUpButton'
|
||||
ImageIndex = 3
|
||||
OnClick = MoveUpButtonClick
|
||||
end
|
||||
object EditButton: TToolButton
|
||||
Left = 173
|
||||
Left = 154
|
||||
Top = 0
|
||||
Caption = 'EditButton'
|
||||
ImageIndex = 2
|
||||
OnClick = EditButtonClick
|
||||
end
|
||||
object RemoveButton: TToolButton
|
||||
Left = 75
|
||||
Left = 67
|
||||
Top = 0
|
||||
Caption = 'RemoveButton'
|
||||
ImageIndex = 1
|
||||
@ -69,7 +69,8 @@ object BuildProfileManagerForm: TBuildProfileManagerForm
|
||||
OnClick = AddButtonClick
|
||||
end
|
||||
object tbSeparator: TToolButton
|
||||
Left = 247
|
||||
Left = 218
|
||||
Height = 46
|
||||
Top = 0
|
||||
Width = 5
|
||||
Caption = 'tbSeparator'
|
||||
@ -86,7 +87,6 @@ object BuildProfileManagerForm: TBuildProfileManagerForm
|
||||
OnClick = ProfilesListboxClick
|
||||
ScrollWidth = 354
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
end
|
||||
object ButtonPanel: TButtonPanel
|
||||
Left = 7
|
||||
|
@ -161,9 +161,6 @@ implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
AddProfileDialog;
|
||||
|
||||
const
|
||||
DefaultTargetDirectory = ''; // empty will be replaced by '$(ConfDir)/bin';
|
||||
|
||||
@ -560,25 +557,21 @@ end;
|
||||
procedure TBuildProfileManagerForm.AddButtonClick(Sender: TObject);
|
||||
var
|
||||
NewProfile: TBuildLazarusProfile;
|
||||
Str: string;
|
||||
begin
|
||||
with TAddProfileForm.Create(nil) do
|
||||
try
|
||||
Caption:=lisLazBuildNewProf;
|
||||
ProfileHeaderLabel.Caption:=lisLazBuildNewProfInfo;
|
||||
if (ShowModal=mrOk) and (NameEdit.Text<>'') then begin
|
||||
// Update ProfsToManage collection.
|
||||
NewProfile:=TBuildLazarusProfile.Create(fProfsToManage,NameEdit.Text);
|
||||
NewProfile.Assign(fProfsToManage.Current, False);
|
||||
fProfsToManage.Add(NewProfile);
|
||||
fProfsToManage.fCurrentIndex:=fProfsToManage.Count-1; // Select the new profile.
|
||||
// Update ListBox
|
||||
ProfilesListbox.Items.Add(NameEdit.Text);
|
||||
ProfilesListbox.ItemIndex:=ProfilesListbox.Count-1;
|
||||
EnableButtons;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
Str:= '';
|
||||
if not InputQuery(lisLazBuildNewProf, lisLazBuildNewProfInfo, Str) then Exit;
|
||||
if Str='' then Exit;
|
||||
|
||||
// Update ProfsToManage collection.
|
||||
NewProfile:=TBuildLazarusProfile.Create(fProfsToManage,Str);
|
||||
NewProfile.Assign(fProfsToManage.Current, False);
|
||||
fProfsToManage.Add(NewProfile);
|
||||
fProfsToManage.fCurrentIndex:=fProfsToManage.Count-1; // Select the new profile.
|
||||
// Update ListBox
|
||||
ProfilesListbox.Items.Add(Str);
|
||||
ProfilesListbox.ItemIndex:=ProfilesListbox.Count-1;
|
||||
EnableButtons;
|
||||
end;
|
||||
|
||||
procedure TBuildProfileManagerForm.RemoveButtonClick(Sender: TObject);
|
||||
@ -612,28 +605,24 @@ end;
|
||||
procedure TBuildProfileManagerForm.EditButtonClick(Sender: TObject);
|
||||
var
|
||||
i, SelI: integer;
|
||||
Str: string;
|
||||
begin
|
||||
i:=ProfilesListbox.ItemIndex;
|
||||
if i<0 then exit;
|
||||
with TAddProfileForm.Create(nil) do
|
||||
try
|
||||
Caption:=lisLazBuildRenameProf;
|
||||
ProfileHeaderLabel.Caption:=lisLazBuildRenameProfInfo;
|
||||
NameEdit.Text:=ProfilesListbox.Items[i];
|
||||
if (ShowModal=mrOk) and (NameEdit.Text<>'') then begin
|
||||
// Update ProfsToManage collection.
|
||||
fProfsToManage[i].fName:=NameEdit.Text;
|
||||
// Update selected list.
|
||||
SelI:=fProfsToManage.Selected.IndexOf(ProfilesListbox.Items[i]);
|
||||
if SelI>-1 then
|
||||
fProfsToManage.Selected[SelI]:=NameEdit.Text;
|
||||
// Update ListBox
|
||||
ProfilesListbox.Items[i]:=NameEdit.Text;
|
||||
EnableButtons;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
|
||||
Str:= ProfilesListbox.Items[i];
|
||||
if not InputQuery(lisLazBuildRenameProf, lisLazBuildRenameProfInfo, Str) then Exit;
|
||||
if Str='' then Exit;
|
||||
|
||||
// Update ProfsToManage collection.
|
||||
fProfsToManage[i].fName:=Str;
|
||||
// Update selected list.
|
||||
SelI:=fProfsToManage.Selected.IndexOf(ProfilesListbox.Items[i]);
|
||||
if SelI>-1 then
|
||||
fProfsToManage.Selected[SelI]:=Str;
|
||||
// Update ListBox
|
||||
ProfilesListbox.Items[i]:=Str;
|
||||
EnableButtons;
|
||||
end;
|
||||
|
||||
procedure TBuildProfileManagerForm.MoveUpButtonClick(Sender: TObject);
|
||||
|
Loading…
Reference in New Issue
Block a user