Open the project folder. lazarus / 9-Editor ---------------------------------------------------------------------- Otto · 2020-02-19 09:48 Mainly I use Lazarus on Windows, I would need to know if, from the Project Inspector, there was a way to open the project folder in a Windows File Explorer. If not, how to add a button to the Project Inspector to achieve this? Otto. ---------------------------------------------------------------------- balazsszekely · 2020-02-19 10:43 @Otto Right click the source editor's statusbar,  like in the attached picture. Then click "Open folder". ---------------------------------------------------------------------- JuhaManninen · 2020-02-19 10:49 Quote from: Otto on February 19, 2020, 10:48:48 amMainly I use Lazarus on Windows, I would need to know if, from the Project Inspector, there was a way to open the project folder in a Windows File Explorer. You can open it from source editor's status bar. Mouse right-click on the file name opens a popup menu with "Open folder ...". Just open the project main file or any file in the project directory and there you go. It works on every platform by opening the default file manager. For example on my KDE system Dolphin gets opened. QuoteIf not, how to add a button to the Project Inspector to achieve this? Currently there is no API to extend it. If you add a popup item in the Files section for this task and create a patch, it will surely be accepted. Most people don't need this feature so a button for everybody is an overkill. But yes, it should be extensible with plugins. [Edit] Oops, GetMem was faster ... ---------------------------------------------------------------------- Otto · 2020-02-19 11:07 Thank you all. Where can I find the documentation for creating new plugins? For now I found : https://wiki.freepascal.org/Extending_the_IDE Otto. ---------------------------------------------------------------------- Otto · 2020-02-19 17:10 I analyzed the Lazarus IDE code in the projectinspector.pas file and I think that I've identified the changes to be made to add a button to the Project Inspector. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // Add the following code to the file  projectinspector.pasuses    LCLIntF; OpenPrjFolderBitBtn: TToolButton;procedure OpenPrjFolderBitBtnClick(Sender: TObject);  procedure TProjectInspectorForm.OpenPrjFolderBitBtnClick(Sender: TObject);var  ADirectory:String;begin  ADirectory:=LazProject.Directory;  if ADirectory<>'' then    OpenURL(ADirectory);end;    OpenPrjFolderBitBtn := CreateToolButton('OpenPrjFolderBitBtn', 'Open Folder', 'Open Project Folder', 'Open_project_folder', @OpenPrjFolderBitBtnClick);     Unfortunately, I have no experience in compiling the Lazzarus IDE and would need help to verify that it is working properly. Otto. ---------------------------------------------------------------------- Otto · 2020-02-20 05:57 I managed to test the change in Windows 10 64bit. Everything works correctly apart from the fact that the button does not yet have the image. I attached the modified "projectinspector.pas" file in case it was useful to someone, the changes are preceded by a comment line containing the string "Modified by Otto" and terminated with an empty comment line. I used the "Tools > Build Lazarus" command to recompile the IDE. Previously I also tried to recompile the project using the project "lazarus-ide-lazarus.lpi", in an attempt to obtain an independent test IDE, but the build failed. Otto. ---------------------------------------------------------------------- JuhaManninen · 2020-02-21 01:22 Quote from: Otto on February 20, 2020, 06:57:26 amI managed to test the change in Windows 10 64bit. Everything works correctly apart from the fact that the button does not yet have the image. I attached the modified "projectinspector.pas" file in case it was useful to someone, the changes are preceded by a comment line containing the string "Modified by Otto" and terminated with an empty comment line. Good. You studied lots of code. In future you can learn to make patches, too:  https://wiki.freepascal.org/Creating_A_Patch The wiki page Extending_the_IDE was correct. As you can see extensions are limited. For example the project inspector window has no API. If you are interested you can create such an API to IDEIntf package and it can be added to Lazarus trunk. Just remember that an API should be intuitive. Once it is published it will not be changed easily. QuoteI used the "Tools > Build Lazarus" command to recompile the IDE. Previously I also tried to recompile the project using the project "lazarus-ide-lazarus.lpi", in an attempt to obtain an independent test IDE, but the build failed. Yes, that was the right way to build. Project lazarus.lpi can now be used only for debugging. ---------------------------------------------------------------------- Otto · 2020-02-21 12:31 Thank you JuhaManninen, for your precious advice. Creating a patch requires the use of the trunk/development version of Lazarus, is it correct to use fpcupdeluxe to get it? Do I have to use the FPC trunk to build? Otto. ---------------------------------------------------------------------- JuhaManninen · 2020-02-21 16:53 Quote from: Otto on February 21, 2020, 01:31:37 pmCreating a patch requires the use of the trunk/development version of Lazarus, is it correct to use fpcupdeluxe to get it? You can use fpcupdeluxe also for installing Lazarus but it is not really needed. Just install the release version of FPC and download Lazarus sources from SVN server. Then run "make". QuoteDo I have to use the FPC trunk to build? No. Lazarus trunk supports at least FPC 3.0.x and development branches 3.2 and trunk. FYI, I got excited with this open folder idea in a popup menu of both project inspector and package editor so I implemented it in r62656 (trunk). I used OpenDocument() but I guess OpenURL() works, too. Please test. BTW, there are some API menu section hooks in MenuIntf for package editor : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   // Package editor(s)  PackageEditorMenuRoot: TIDEMenuSection = nil;    PkgEditMenuSectionFiles: TIDEMenuSection; // e.g. sort files, clean up files    PkgEditMenuSectionUse: TIDEMenuSection; // e.g. install, add to project    PkgEditMenuSectionSave: TIDEMenuSection; // e.g. save as, revert, publish    PkgEditMenuSectionCompile: TIDEMenuSection; // e.g. build clean, create Makefile    PkgEditMenuSectionAddRemove: TIDEMenuSection; // e.g. add unit, add dependency    PkgEditMenuSectionMisc: TIDEMenuSection; // e.g. options  PackageEditorMenuFilesRoot: TIDEMenuSection = nil;    PkgEditMenuSectionFile: TIDEMenuSection; // e.g. open file, remove file, move file up/down    PkgEditMenuSectionDirectory: TIDEMenuSection; // e.g. change all properties of all files in a directory and ub directories moved ..    PkgEditMenuSectionDependency: TIDEMenuSection; // e.g. open package, remove dependencyIt means a user plugin can add menu items there. No access for the toolbar is provided though. ---------------------------------------------------------------------- balazsszekely · 2020-02-21 17:05 @Otto 1. Install TorotiseSVN(https://tortoisesvn.net/downloads.html), it's free 2. Create a "Lazarus" folder somewhere 3. Right click "Lazarus" folder, then "SVN Checkout...". The following dialog will apear(see screenshot1) 4. Type/paste in the URL: "https://svn.freepascal.org/svn/lazarus/trunk" , press OK 5. After the checkout is done, create a batch file(lazarus.bat for example), with the following content: Quoteset path=C:\FPC\3.0.4\bin\i386-win32\; make bigidewhere the path must point to a valid FPC installation 6. Copy lazarus.bat inside the Lazarus folder, then doubleclick the bat file. If everything works well, the trunk IDE is build. 7. To create a patch, right click Lazarus folder then click "Create patch...". See attachment2. PS: Make sure you backup your config folder, just in case. If you have a standard installation lazarus trunk may overwrite the settings. ---------------------------------------------------------------------- Otto · 2020-02-21 18:04 @JuhaManninen Very good JuhaManninen. I am glad to have contributed, albeit for such a small thing, to the development of the Lazarus IDE. Quote from: JuhaManninen on February 21, 2020, 05:53:54 pm FYI, I got excited with this open folder idea in a popup menu of both project inspector and package editor so I implemented it in r62656 (trunk). I used OpenDocument() but I guess OpenURL() works, too. Please test. I will run the tests as soon as possible. FYI, I have other ideas for extending The features of Lazarus, but I have yet to verify them. Could I use the IDE Window: External Tool to speed up the verification process? (I have not yet used the external tools, because it has only recently been suggested to me by the bonmario user.) Otto. ---------------------------------------------------------------------- Otto · 2020-02-21 18:15 @ GetMem Thank you very much GetMem. Your guide is really very exhaustive, thanks to it I will greatly reduce the time it takes to configure the environment to carry out the tests. Otto. ---------------------------------------------------------------------- JuhaManninen · 2020-02-21 19:42 Quote from: Otto on February 21, 2020, 07:04:43 pmFYI, I have other ideas for extending The features of Lazarus, but I have yet to verify them. Could I use the IDE Window: External Tool to speed up the verification process? No if you modify the code of Lazarus IDE itself. Then you must build the IDE and see how it behaves. It can be debugged with breakpoints and stepping and all by running the lazarus.lpi project after building with debug info. Mouse and keyboard events may mess up such debugging. A better way then is to add DebugLn() lines to your code and read their output. DebugLn has nice overloads with variant parameters. Search Lazarus source for examples. ---------------------------------------------------------------------- Otto · 2020-02-21 20:12 @ JuhaManninen Quote from: JuhaManninen on February 21, 2020, 08:42:10 pmA better way then is to add DebugLn() lines to your code and read their output. DebugLn has nice overloads with variant parameters. Search Lazarus source for examples. I'm going to study what you suggested. I tested the version r62656 (trunk). Everything looks good, great job. Otto. ---------------------------------------------------------------------- Otto · 2020-02-23 20:31 @ JuhaManninen Hello. To add the open folder in a popup menu of project inspector you had to edit other files besides “projectinspector.pas” ? Are the main changes as follows? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i +     LCLIntf,+     procedure mnuOpenFolderClick(Sender: TObject);+     AddPopupMenuItem(cLineCaption, Nil, False);                // Separator+     AddPopupMenuItem(lisMenuOpenFolder, @mnuOpenFolderClick); +     procedure TProjectInspectorForm.mnuOpenFolderClick(Sender: TObject);+     begin+       OpenDocument(LazProject.Directory);+     end;  I ask this because, if possible (perhaps in the near future), I would like to add an SVN control (or similar) from within the project inspector. So that project sources can be synchronized or compared to online sources directly, without using external programs. As you already know I had a little problem with svn2revisioninc , so I started studying the code. A volte non tutti i mali vengono per nuocere [Sometimes not all evils come to harm]. Greetings. Otto.