Wish Add optional prefix and suffix to window title using b4xV5.ini

Sandman

Expert
Licensed User
Longtime User
This wish is available in two flavours. The first one is the standard one, below is an advanced version.

At some point in the near future we will get support for per-instance settings for our B4X IDE's:

I came up with a way to better signal to the developer that a custom .ini was specified. (Let's be real, we will all remember it ten minutes after we launched the IDE. But when we have 8 IDE's open, it will start to get confusing.)

One way to solve this would be to add two new entries to the b4xV5.ini file:
INI:
IDEWindowTitlePrefix="Customer X: "
IDEWindowTitleSuffix=" - Deadline 2025-06-01"

Meaning that the window title would go from this:

MyFineGame2000

To this:

Customer X: MyFineGame2000 - Deadline 2025-06-01

(Please note that my example prefix and suffix is just that - an example. I thought it would be good to provide the ability for both a prefix and suffix so all developers can construct whatever makes sense to them.)

This ends this standard version of the Wish.



Advanced version of this Wish

The ability to specify the prefix and/or suffix based on first line of script output.

(For those with background from Linux, this would be equivalent to the standard $(myscript.sh) feature.)

Let's say we have this in the .ini. Please note the change for the suffix:
INI:
IDEWindowTitlePrefix="Customer X: "
IDEWindowTitleSuffix="script:my-suffix-script.bat"
IDEWindowTitleRefresh=500

The value for IDEWindowTitleSuffix now is script:my-suffix-script.bat. The thought is that if the value starts with script: , the IDE will expect a script with that name to be placed in the same dir as the currently used .ini. This would mean that we could easily create code in a separate .bat that return a value with more valuable data.

Meaning that the window title would go from this, using the first wish above:

Customer X: MyFineGame2000 - Deadline 2025-06-01

To this:

Customer X: MyFineGame2000 - 27 days to deadline [git branch 'refactoring-animation-balloons']


I think it would make sense to automatically update the title on every open and save.

But also allow it to be refreshed automatically based on IDEWindowTitleRefresh. 500 would mean 500 milliseconds. And 0 would mean that it shouldn't be updated automatically. (I imagine this wouldn't be noticable by the IDE, I suppose it would be updated by a different thread? In any case, I have no problem with the IDE deciding to not rerun the script if it's just too slow and degrade the IDE experience. Just output "script too slow" as the value and a longer explanation in the log window, so the developer knows what's happening.) And in case somebody wonders why it would be interesting to have this refreshed periodically, automatically: Things can happen outside the IDE too. One very typical example would be that the developer switch to a different git branch, so it would make sense to reflect that in the window title.

This ends this advanced version of the Wish.


A final note: As it is now, the suffix for B4A is hardcoded to be " - B4A". My best suggestion is to either remove it if the .ini specifies a IDEWindowTitleSuffix or hardcode it to show after IDEWindowTitleSuffix.
 
Top