project settings for all configurations

Discussion about CodeLite development process and patches
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: project settings for all configurations

Post by jfouche »

eranif wrote:I still supports my opinion that we should create a separate class for the global configuration - but as you mentioned, it should be deriving from ConfObject and not from SerializedObject
I'm doing this way : BuildConfigCommon. My problem actualy is that I'm not very proud of what i've done :
In BuildConfigCommon::ToXml, I create the Configuration (or global-settings) xml node, because ToXml returns one xml node.
So I must do this :

Code: Select all

wxXmlNode *BuildConfig::ToXml() const
{
	// Create the common nodes
	wxXmlNode *node = m_commonConfig.ToXml();

	node->AddProperty(wxT("Name"), m_name);
	node->AddProperty(wxT("CompilerType"), m_compilerType);
	node->AddProperty(wxT("DebuggerType"), m_debuggerType);
	node->AddProperty(wxT("Type"), m_projectType);

	wxXmlNode *compile = XmlUtils::FindFirstByTagName(node, wxT("Compiler"));
	if (compile) {
		compile->AddProperty(wxT("Required"), BoolToString(m_compilerRequired));
	}
ie : modify an already created node (Compiler for example).
Well, I keep it like this, I'll see later if there is a better way to implement this.
Jérémie
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: project settings for all configurations

Post by jfouche »

Just a question :
Do you think the "append, prepend, overwrite global settings with current configuration" wxChoice must be available in project settings -> general tab (ie : the choice will append for for compiler, linker and resources) or one for each : one in compiler tab, one in linker tab, and one in resources tab (ex : able to do something like append compiler settings to global settings, overwrite linker settings, and prepend resources settings).
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: project settings for all configurations

Post by eranif »

For maximum flexibility I would suggest adding it per page, so we could allow user to choose it page (linker/compiler/resource)

I think that the default should be 'Append' (it make sense in terms of search paths for include files, where the paths specified first are searched first, so project specific paths are scanned before the global path)

Eran
Make sure you have read the HOW TO POST thread
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: project settings for all configurations

Post by jfouche »

Hi Eran
eranif wrote:When the new entry is selected (i.e. "all configurations"), the project settings will display a new wxNotebook with 3 pages:
. Compiler
. Linker
. Resource
The above can be done pretty easy since the entire UI is all contained in a wxNotebook, so we can simply hide it and display the new one.
If I understand well, there are 2 notebook in the project settings : one for configuration, and the other one for global settings.
So, I'm gonna move the actual wxNotebook in a external panel in wxFormBuilder, create a new panel with the global settings notebook, and select (Show) the one needed during configuration selection. It will need to add 2 more classes for each panel, and manage them in the ProjectSettingsDlg class.
Am I right ?
Is it better than adding / removing unused pages (which is not as easy as I thought at the begining) ?
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: project settings for all configurations

Post by eranif »

jfouche wrote:Is it better than adding / removing unused pages (which is not as easy as I thought at the begining) ?
IMO yes. If you find it more easily done by removing pages - go ahead and do it like that I have no objection

Eran
Make sure you have read the HOW TO POST thread
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: project settings for all configurations

Post by jfouche »

Hi Eran

Here is a patch (it contains also a patch for a find resource bug).
I'm sorry if this patch comes from an old version of CL, but I do not have access to SVN (can't do update). Moreover, I have a small pb I'm not able to fix actualy, and I hope you can help me. The GlobalSettings panel doesn't fit the area (don't know why, but surely because of the Hide()) before resizing the project settings dialog.
Give me your feed back
You do not have the required permissions to view the files attached to this post.
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: project settings for all configurations

Post by eranif »

jfouche wrote:Here is a patch (it contains also a patch for a find resource bug).
I'm sorry if this patch comes from an old version of CL, but I do not have access to SVN (can't do update). Moreover, I have a small pb I'm not able to fix actualy, and I hope you can help me. The GlobalSettings panel doesn't fit the area (don't know why, but surely because of the Hide()) before resizing the project settings dialog.
Give me your feed back
No problem, however I will be able to download and test it only on Sunday. If all is working as expected, I will probably will commit it

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: project settings for all configurations

Post by eranif »

Hi,

I downloaded and applied your patch.

+ The patch applied with no errors
+ I managed to fix the layout (seems like layout() is not enough and it should be called for both sizers)
+ Problems I found:
* The 'Apply' button in the project settings is now completely broken
* Even though in the 'Libraries' entry from the 'Global Settings' is empty, the makefile generates line like this:

Code: Select all

-l -lMyLib
which of course fails during link - I managed to fix this, by making sure that empty entries will not be include
* I tried another scenario: setting a library name in the 'Global Settings' -> 'Linker' tab, when building in the 'Debug' configuration it worked well, that is: The linker included the library specified in the 'Global Settings', however it fails to add the library during link when trying to build the 'Release' configuration

EDIT:
Regarding the last problem: (global settings not applied for all settings) I managed to fix this, it appears as copy/paste error in the merging configurations code (project_settings.cpp: GetBuildConfiguration function) it is now working properly.

So the last issue we have here, is the 'Apply' button broken. I am going to commit this code and hopefully you will get the time to fix this.

Thanks,
Eran
Make sure you have read the HOW TO POST thread
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: project settings for all configurations

Post by jfouche »

hi Eran

Thanks for your review. I'll have a look at the apply button (Thought it was good for me, be must be wrong).
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: project settings for all configurations

Post by eranif »

Maybe I did not mention it: I committed the code into the SVN

Eran
Make sure you have read the HOW TO POST thread
Post Reply