Recent

Author Topic: JCF Format Settings - easier getting access to the settings file  (Read 7689 times)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
hi All,
i have found that it would help if the path of the JCF file shown in IDE Options would be actually presented in the memo component.
this would allow copy and paste in explorer so i can easily find the file.
even better would be an open explorer option for the folder where this file is.
what do you guys think?

thank you
Lazarus 2.0.2 64b on Debian LXDE 10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: JCF Format Settings - easier getting access to the settings file
« Reply #1 on: July 11, 2017, 10:10:29 am »
i have found that it would help if the path of the JCF file shown in IDE Options would be actually presented in the memo component.
Your mean the contents of the XML config file? Or just its name? The name does not need a Memo.

Quote
this would allow copy and paste in explorer so i can easily find the file.
In Windows file explorer? Ok, you need the file name. Now the file name is shown in a Label. It should be a StaticText ot a read-only Edit to allow Copy/Paste.

Quote
even better would be an open explorer option for the folder where this file is.
Ok, just remember that Lazarus is cross-platform.

Patches are welcome.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: JCF Format Settings - easier getting access to the settings file
« Reply #2 on: July 11, 2017, 10:50:07 am »
the full name needs to be presented in a control that allows copy because right now the user cannot copy the full name with the mouse.

i am just a beginner, just learning, the IDE patching is too complicated for me for now...
Lazarus 2.0.2 64b on Debian LXDE 10

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: JCF Format Settings - easier getting access to the settings file
« Reply #3 on: July 11, 2017, 11:24:34 am »
Actually, you have a point. I deleted a previous answer because there was a really stupid question to answer elsewhere (i do that myself too...asking stupid questions, yours is not one of them...) but... Yes... that's a good suggestion and maintainers can easily solve that for us (read-only edit, focus, hide cursor, borderless, copy and past will work, maybe even easier. On Windows it is, but this is also cross platform).
« Last Edit: July 11, 2017, 11:59:28 am by Thaddy »
Specialize a type, not a var.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: JCF Format Settings - easier getting access to the settings file
« Reply #4 on: July 12, 2017, 01:03:10 pm »
... maintainers can easily solve that for us ...
Which maintainers? Thaddy, you could also provide such patches. What do you think?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: JCF Format Settings - easier getting access to the settings file
« Reply #5 on: July 12, 2017, 01:28:30 pm »
... maintainers can easily solve that for us ...
Which maintainers? Thaddy, you could also provide such patches. What do you think?
Well, as you know, I am a bit proficient in Pascal. I am a Newbie in using Lazarus ;) on a permanent basis.. :P But... Yes. Given time. (my health does not always condone such efforts, alas, but my brain works, sort of)
Specialize a type, not a var.

balazsszekely

  • Guest
Re: JCF Format Settings - easier getting access to the settings file
« Reply #6 on: July 14, 2017, 07:35:56 pm »
@Juha
I added a read-only editbox + a button to open containing folder.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: JCF Format Settings - easier getting access to the settings file
« Reply #7 on: July 15, 2017, 11:02:32 am »
I added a read-only editbox + a button to open containing folder.
Sorry, I almost missed this one.
I applied it in r55504 with small modifications. I changed text "Format File" to "Settings File" and tweaked the offsets in layout.
The layout is adjusted in code instead of using anchors. It is an old-fashioned way but works.

Code: Pascal  [Select][+][-]
  1. OpenDocument(ExtractFilePath(edFormatFile.Text));
Nice! I did not realize it works with paths like that.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: JCF Format Settings - easier getting access to the settings file
« Reply #8 on: July 15, 2017, 03:10:36 pm »
This inspired me for a source editor Statusbar related r55505. Please take a look!
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

balazsszekely

  • Guest
Re: JCF Format Settings - easier getting access to the settings file
« Reply #9 on: July 15, 2017, 09:45:36 pm »
Quote
The layout is adjusted in code instead of using anchors. It is an old-fashioned way but works.
Every other component on that frame is adjusted by code, I did not want to change that. I know using anchors is a better way.

Quote
This inspired me for a source editor Statusbar related r55505. Please take a look!
Good idea. I like it.  :)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: JCF Format Settings - easier getting access to the settings file
« Reply #10 on: July 17, 2017, 01:21:30 pm »
hi,
in other IDE (LiteIDE) i have seen the formatting is done automatically before compilation. mainly in Golang i saw it (gofmt). in Golang it is not flexibile - i am not aware of a file with settings but gofmt can be called before compilation.

i was wondering what you guys feel about an option to format all the units in project inspector before compilation.

thank you
Lazarus 2.0.2 64b on Debian LXDE 10

balazsszekely

  • Guest
Re: JCF Format Settings - easier getting access to the settings file
« Reply #11 on: July 17, 2017, 02:59:53 pm »
The attached patch will register an IDE command for formatting the whole project. The shortcut key is: [Shift] + [Ctr] + [Alt] + P, you can call it manually before every compile(please note the key sequence can be changed in Tools-->Options), or automatically,  with an extra checkbox in project option, like this:
Code: Pascal  [Select][+][-]
  1. var
  2.   IDECommand: TIDECommand;
  3. begin
  4.   IDECommand := IDECommandList.FindCommandByName('jcfAllFilesinProject');
  5.   IDECommand.Execute(nil);
  6. end;

PS: Basically all you have to do is add a checkbox in project option and call the above code before compile. It shouldn't be to difficult to implement.

 

TinyPortal © 2005-2018