Forum > Editor

Revision number in IDE main window caption

(1/4) > >>

zoltanleo:
Hi guys.

It's possible to correct a code so that information of revision number of IDE was displayed?

ps. I'm aware that revision number is here {LazDir}\ide\revision.inc

JuhaManninen:

--- Quote from: zoltanleo on August 25, 2018, 06:03:37 pm ---It's possible to correct a code so that information of revision number of IDE was displayed?

--- End quote ---
Actually it is a good idea. The revision could be shown in parenthesis but only when it is available. The release versions would not try to show it then.
A patch would be accepted. The About dialog code can be used as an example of how to do it. I remember the actual code for getting a revision is long because it supports both SVN and Git repositories. A correct SVN revision can be found also from a Git mirror repo.

howardpc:
You can hack ..lazarus/ide/main.pp
the line that is currently

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  NewCaption := Format(lisLazarusEditorV, [GetLazarusVersionString]);can be replaced with:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---NewCaption := Format(lisLazarusEditorV+' Revision: %s', [GetLazarusVersionString, GetLazarusRevision]);It is line #8351 in my Lazarus, but might be slightly different in yours.
Rebuild the IDE, et voila.
A proper patch should be more considered, however, not a mere off the top of the head hack.

Mike.Cornflake:
You mean in your application?
You could try adding the revision.inc file to your project.   This will require you to maintain relative folder structure between your Lazarus installation and your project.   I've been unable to find any other way.

Or do you mean in the IDE itself?  Looks to me like you'd need to patch main.pp  Find "procedure TMainIDE.UpdateCaption;".  Although I haven't tested, from inside that unit you should be able to use LazarusRevisionStr direct.

zoltanleo:

--- Quote from: howardpc on August 25, 2018, 06:43:38 pm ---You can hack ..lazarus/ide/main.pp
--- End quote ---
Great gratitude for the correct council. I have a little changed a code:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---NewCaption := Format(lisLazarusEditorV + ' rev.%s | FPC v%s', [GetLazarusVersionString, GetLazarusRevision,{$I %FPCVERSION%}]);and I have received desirable result.

I would be very grateful to developers if these changes are made to the new version. ;)

Navigation

[0] Message Index

[#] Next page

Go to full version