Recent

Author Topic: Patch for Lazarus - need Feedback!  (Read 4678 times)

DimProfi

  • Full Member
  • ***
  • Posts: 126
    • http://www.dimprofi.de
Patch for Lazarus - need Feedback!
« 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';
« Last Edit: March 22, 2014, 04:20:19 pm by DimProfi »
Lazarus 1.2/FPC 2.6.4 (x86/x86_64/win32/win64/Linux) :: Be smart - use predictable {$INTERFACES CORBA}! :)

Bart

  • Hero Member
  • *****
  • Posts: 3538
    • Bart en Mariska's Webstek
Re: Patch for Lazarus - need Feedback!
« Reply #1 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

DimProfi

  • Full Member
  • ***
  • Posts: 126
    • http://www.dimprofi.de
Re: Patch for Lazarus - need Feedback!
« Reply #2 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?  %)
Lazarus 1.2/FPC 2.6.4 (x86/x86_64/win32/win64/Linux) :: Be smart - use predictable {$INTERFACES CORBA}! :)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
Re: Patch for Lazarus - need Feedback!
« Reply #3 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

DimProfi

  • Full Member
  • ***
  • Posts: 126
    • http://www.dimprofi.de
Re: Patch for Lazarus - need Feedback!
« Reply #4 on: March 23, 2014, 01:11:01 am »
Lazarus 1.2/FPC 2.6.4 (x86/x86_64/win32/win64/Linux) :: Be smart - use predictable {$INTERFACES CORBA}! :)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Patch for Lazarus - need Feedback!
« Reply #5 on: March 23, 2014, 08:59:43 am »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Timewarp

  • Full Member
  • ***
  • Posts: 144
Re: Patch for Lazarus - need Feedback!
« Reply #6 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)

DimProfi

  • Full Member
  • ***
  • Posts: 126
    • http://www.dimprofi.de
Re: Patch for Lazarus - need Feedback!
« Reply #7 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  :)
Lazarus 1.2/FPC 2.6.4 (x86/x86_64/win32/win64/Linux) :: Be smart - use predictable {$INTERFACES CORBA}! :)