Author Topic: Codesnippets Plugin using different configurations  (Read 5645 times)

mariocup

  • Guest
Codesnippets Plugin using different configurations
« on: June 07, 2007, 02:11:35 pm »
Hi Pecan,

I am using Codesnippets plugin for different compilers. To use codesnippets and file links I add subcategories for the different compilers e.g.

ARM
|---- snippets
TriCore
|---- snippets, file links
|----docu
---------- file link pdf files

In the settings the user can specify the snippets folder even with an environment variable or codeblocks variable.

As the codesnippets folder may vary between developing different applications: wxWidgets, Embedded or host application I think it would be cool to have different configurations for the snippets and file links.

I think it would be also useful to have different configurations, perhaps per compiler, for the help plugin. So the default help may vary depending if you are developing wxWidgets applications or others.

Another problem in my case is that the info of the configuration is stored in the default.conf. How can I preconfigure configuration of the snippet folder or help files without having a default.conf to make the configuration accessible on startup for every user or after an installation.

Perhaps an additonal tab like customer variables (not only for compiler) could be added to specify that configuration.


Bye,

Mario

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: Codesnippets Plugin using different configurations
« Reply #1 on: June 07, 2007, 05:19:55 pm »
You can load different .conf files with --personality=<somename>.

CodeSnippets does not yet understand personalities, but it could me made to do so.

Would that provide what you're asking for?

I do not maintain the Help plugin. Someone else will have to respond to that request.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Codesnippets Plugin using different configurations
« Reply #2 on: June 07, 2007, 06:06:59 pm »
How can I preconfigure configuration of the snippet folder or help files without having a default.conf to make the configuration accessible on startup for every user or after an installation.
If you really don't want a default.conf I can't help you as C::B needs to read a pre-configuration from *somehwere*. You cannot provide a million config params via command line interface. But you *can* point to a config file via command line (IIRC).

I'll give you some more hints that might be helpful:
1.) As Pecan already pointed out have a look at personalities. These are pretty much the way to configure C::B for each development environment. Then you would have shortcuts to e.g. C::B Project A, C::B Project B etc.

2.) There is cb_share_conf - a utility that allows easy sharing of the most important settings between C::B installations. Just have a look at it - it's very easy to use and (if you need to) to extend.

3.) If you build a very simple installer for C::B you can integrate a default configuration that is written to the right place after a fresh installation. There are a lot of (free) installer tools around - you could even just use the one C::B itself uses (available via SVN).

4.) If you have C::B setup on a PC and want to have each user that logs in to have the same common "startup" configuration just put it to \Documents and Settings\Default User\Application Data. That way the default.conf is copied to the right place (\Documents and Settings\[User Name]\Application Data) the first time the user logs in. This way you can pre-configure a PC for the use with C::B for multiple users. If you are on linux: similar mechanism exist.

5.) If you put a config file within the installation directory of C::B this will be the "global and only one" for C::B - just like a C::B portable. Drawback: You need write access rights to store changes and (of course) the changes apply to all users of that C::B installation.

Maybe these hints are of some help...

With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

mariocup

  • Guest
Re: Codesnippets Plugin using different configurations
« Reply #3 on: June 07, 2007, 10:50:55 pm »
Hi Pecan, Hi MortenMacFly,

thanks for the hints.

Bye,

Mario

mariocup

  • Guest
Re: Codesnippets Plugin using different configurations->same SnippetFile
« Reply #4 on: June 09, 2007, 01:21:21 am »
Hi Pecan,

thanks for the fast implementation.
I have tested the new version with different personalities. Now codesnippets generate the <personality>.codesnippets.ini file for the configuration.

But if I use different personalities the corresponding ini files contain the same entry.
SnippetFile=%APPDATA%\\codeblocks\\codesnippets.xml

Can I configure SnippetFile without editing the ini file or can you change that codesnippets plugin uses
<personality>.codesnippets.xml?

I think it would be useful if the SnippetFile is configurable with the Settings entry of codesnippets.

Thanks,

Mario

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: Codesnippets Plugin using different configurations
« Reply #5 on: June 09, 2007, 12:56:37 pm »
While codesnippets.ini and it's name are completely controlled by the plugin, the .xml name is completely controlled by the user.

I do not think it's a good idea for the plugin to be changing a user controlled filename behind the scenes.

You also do not have to edit the .ini file. You simply do a "save as" to change the .xml name, then do a load. That new name is saved in the .ini file and will be used from then on.

« Last Edit: June 09, 2007, 12:59:39 pm by Pecan »