I'm not sure of the right place for this, so feel free to redirect me to another place
I'm trying to make my first patch for Lazarus. I downloaded SVN and build a new Lazarus with my patch.
The question is,
is it acceptable and usable for commiting? Just take a look - need feedback.
The aim of the patch was to give an opportunity to import multiply paths to Libraries (-Fu) and Includes (-Fi) from the text-file.
Just click "Import Paths" and select in TOpendDialog a File. (see Attachement)
patheditordlg.lfm object ImportPathsButton: TBitBtn
AnchorSideLeft.Control = DeleteInvalidPathsButton
AnchorSideLeft.Side = asrBottom
AnchorSideBottom.Control = PathGroupBox
AnchorSideBottom.Side = asrBottom
Left = 471
Height = 25
Top = 172
Width = 127
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'ImportPathsButton'
Enabled = False
OnClick = ImportPathsButtonClick
ParentShowHint = False
ShowHint = True
TabOrder = 8
end
object OpenDialogPathsImport: TOpenDialog
left = 504
top = 80
end
patheditordlg.pas procedure TPathEditorDialog.ImportPathsButtonClick(Sender: TObject);
var paths:TStringList;
y:integer;
c:integer;
RelPath:string;
begin
if not OpenDialogPathsImport.Execute then exit;
paths:=TStringList.Create();
try
paths.LoadFromFile(OpenDialogPathsImport.FileName);
with PathListBox do
begin
y:=ItemIndex+1;
if y=0 then
begin
y:=Count;
end;
for c:=0 to paths.Count-1 do
begin
if path[c]<>'' then
begin
RelPath:=BaseRelative(paths[c]);
Items.InsertObject(y, RelPath, PathMayExist(paths[c]));
ItemIndex:=y;
end;
end;
UpdateButtons;
end;
finally
FreeAndNil(paths);
end;
end;
procedure TPathEditorDialog.FormCreate(Sender: TObject);
...
ImportPathsButton.Caption:=lisPathEditImportPaths;
...
end;
procedure TPathEditorDialog.UpdateButtons;
...
ImportPathsButton.Enabled:=true;
...
end;
LazarusIDEStrConsts.pas lisPathEditImportPaths = 'Import Paths';