[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allow missing components (or detect them in project)
[Thread Prev] | [Thread Next]
- Subject: Re: Allow missing components (or detect them in project)
- From: Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
- Date: Mon, 12 Jan 2026 13:17:51 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Le 12/01/2026 à 12:32, Bruce Steers a écrit :
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
I can add that one (but not with that name I think).
'' Force settings file to be new on load and deleted on exit (for testing) Static Property TestNew As Boolean Use $bTestNew
But not that one. You must implement it yourself.
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.NameAnd 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.
I disagree. You must do that only by using inheritance on the already exported classes of the component. Not by copying the entire source code of the component inside your project which creates some sort of a mess.
Components are supposed to be run inside their own project because they rely on being separated by the interpreter from the project and the other components at runtime.
Or you don't use the Gambas components, and copy all source code inside your project. But you still have the problem of not having the sometimes required separation.
Note that the dependencies between components will be sooner or later managed at runtime and not at compile time (i.e. the required components of a component will be loaded at runtime, whatever is checked in the main project).
Regards, -- Benoît Minisini.
| Re: Allow missing components (or detect them in project) | Bruce Steers <bsteers4@xxxxxxxxx> |
| 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> |
| Re: Allow missing components (or detect them in project) | Bruce Steers <bsteers4@xxxxxxxxx> |