Lazarus

Using the Lazarus IDE => General => Topic started by: DimProfi on March 22, 2014, 04:03:45 pm

Title: Patch for Lazarus - need Feedback!
Post by: DimProfi on March 22, 2014, 04:03:45 pm
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
Code: [Select]
    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

Code: [Select]
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;


Code: [Select]
procedure TPathEditorDialog.FormCreate(Sender: TObject);
...
  ImportPathsButton.Caption:=lisPathEditImportPaths;
...
end;

Code: [Select]
procedure TPathEditorDialog.UpdateButtons;
...
  ImportPathsButton.Enabled:=true;
...
end;


LazarusIDEStrConsts.pas
Code: [Select]
  lisPathEditImportPaths = 'Import Paths';
Title: Re: Patch for Lazarus - need Feedback!
Post by: Bart on March 22, 2014, 05:54:21 pm
The best way to go forward is to open a ticket for it in the bugtracker.
Mark it as feature request.
Attach the full dif (use svn diff).

Bart
Title: Re: Patch for Lazarus - need Feedback!
Post by: DimProfi on March 23, 2014, 12:18:54 am
The best way to go forward is to open a ticket for it in the bugtracker.
Mark it as feature request.
Attach the full dif (use svn diff).

Bart


I was trying to do it here now, but cant find a checkbox "Feature Request".
Do I need another status to acccess it?  %)
Title: Re: Patch for Lazarus - need Feedback!
Post by: JuhaManninen on March 23, 2014, 12:29:53 am
I was trying to do it here now, but cant find a checkbox "Feature Request".
Do I need another status to acccess it?  %)

This is forum. Bugtracker is : http://bugs.freepascal.org
You must also create a proper patch, preferably against the latest trunk SVN :
  http://wiki.freepascal.org/Creating_A_Patch
Title: Re: Patch for Lazarus - need Feedback!
Post by: DimProfi on March 23, 2014, 01:11:01 am
This is forum. Bugtracker is : http://bugs.freepascal.org

http://bugs.freepascal.org/bug_report_page.php
- is it a right  URL to add a new feature?
Title: Re: Patch for Lazarus - need Feedback!
Post by: BigChimp on March 23, 2014, 08:59:43 am
Yes. See also
http://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report
and related pages
Title: Re: Patch for Lazarus - need Feedback!
Post by: Timewarp on March 23, 2014, 09:06:52 am
I was trying to do it here now, but cant find a checkbox "Feature Request".
Just create bug, there are no other options available (atleast for most)
Title: Re: Patch for Lazarus - need Feedback!
Post by: DimProfi on March 23, 2014, 04:00:08 pm
I made it  :)
http://bugs.freepascal.org/view.php?id=25903

Thanks you all for help!

Hope, it will be accepted  :)
TinyPortal © 2005-2018