[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allow missing components (or detect them in project)


On Sun, 11 Jan 2026 at 23:49, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 09/01/2026 à 18:25, Bruce Steers a écrit :
> > I want a way to be able to exclude a component that another component
> > depends on.
> >
> > I have a work-around but I think this is a valid issue.
> >
> > In my program I have imported gb.settings and deselected it from the
> > loaded components. (i needed to force lower case default settings file
> name)
> >
> > This causes a problem with gb.form.mdi as it demands i have gb.settings
> > also loaded.
> >
> > My workaround is to manually edit the .project file and remove the
> line...
> > Component=gb.settings
> >
> > But if i load the project properties page it sneakily puts it back in.
> > Then my program gets conflicts with 2 gb.settings versions.
> >
> > I have gb.settings imported in many of my projects,
> >
> > Possible Solutions...
> > 1. Have another checkbox on components page selections to "ignore
> > dependencies"  so i can load gb.form.mdi and stop it requiring and auto-
> > adding gb.settings
> >
> > 2. Have another checkbox on components page selections to "Never load"
> > so i can add gb.settings to satisfy gb.form.mdi and it is completely
> > ignored and not loaded.
> >
> > 3. A generic "Ignore dependencies" option on components page to ignore
> > all dependencies and not auto-add anything.
> >
> > 4.  er, most other ideas i'm having are turning out to be bad ones :(
> >
> > Ps. Using the Manual loading methods to workaround the issue did not
> > work, i still had conflicts.
> >
> > Respects
> > BruceS
> >
>
> Sorry but I think it's nonsense. If a component requires another
> component to work, then it requires it.
>
> The problem is actually just that 'gb.form.mdi' requires 'gb.settings'
> for managing the Toolbar class. If I find a way to have a working
> Toolbar without having to rely on it, I will be able to make that
> component optional.
>
> Regards,
>
> --
> Benoît Minisini.


Sorry I might not have been clear.

The thing is I DO have gb.settings in the program, but a modified version
included in the source code.
I copied the gb.settings/.src folder contents
(Settings.class/_Settings_Keys.class) into my project so i could make some
changes
So although the gb.settings "component" is not added in the components page
my program does actually have the gb.settings "components" and gb.form.mdi
works okay.
The only issue is when th IDE thinks gb.settings must be added to
the.project file components list and thus breaks things. (every time i open
the project properties page)

My initial issue was with Settings.class more than gb.form.mdi requiring it
because there was no way to initialize the default settings file with a set
name.
The problem was the application file is called UseEdit.gambas but i have a
symlink to it called useedit.  running the symlink changed case of the
settings file too as the program gets a different Application.Name running
via symlink.

A Static Property like Settings.DefaultName in Settings.class would be
useful that if set before any Settings[] call forces your choice of name
(in my case LCase useedit)

I added 2 useful Static properties to the Settings.class file..

'' Force the default settings file name (Provide just the name, default
path will be used and extension .conf)
Static Property ForceName As String Use $sForceName

'' Force settings file to be new on load and deleted on exit (for testing)
Static Property TestNew As Boolean Use $bTestNew

So in my program before any Settings[] calls i use the following...
Settings.ForceName = "useedit"
Then my setting file is always Settings.DefaultDir &/ "useedit.conf"
regardless of Application.Name

And for development purposes the Settings.TestNew option changes the
filename used to useedit-tmp.conf and ensures no old one is loaded and any
new one is deleted.
Then I can simply quickly test my program still loads in a "new install"
scenario having no settings without messing about in the ~/.config/gambas/
folder.

But back on point, I have many programs that have gambas components added
to their .src folder and de-selected from the project config.
So it would be useful to have a way to let the IDE know that a component IS
still included just not the usual way and would fix the issue for other
similar scenarios.

Respects
BruceS

Follow-Ups:
Re: Allow missing components (or detect them in project)Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
Allow missing components (or detect them in project)Bruce Steers <bsteers4@xxxxxxxxx>
Re: Allow missing components (or detect them in project)Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>