Personalities

From Code::Blocks
Revision as of 14:48, 12 April 2006 by Sethjackson (talk | contribs)

In Code::Blocks context, personalities are different sets of settings each tailored for a different workflow. Let me explain.

The "default" personality is, well, Code::Blocks as you know it :)

By default, all available plugins are loaded and all the manager panes are open (project manager, message manager, etc). Now, let's assume that you want a more lightweight Code::Blocks to quickly work on testing single-source files. Most plugins are not needed for this kind of job so it would be wise to remove them from the loading process. You would also like the manager panes to be hidden by default.

To accomplish the above task, a new Code::Blocks personality should be created. Here is how:

  • Find the shortcut to Code::Blocks on your desktop. If there isn't any, create one.
  • Make a copy of this shortcut and rename it to "Code::Blocks Lite" (for example). You should now have two shortcuts to Code::Blocks on your desktop.
  • Right-click on the "Code::Blocks Lite" shortcut and choose "Properties". In the "Target" box, append the following magic words:
  • --personality="Lite"
Tip: if you want to see a list of all defined personalities and select which one to use, replace the above with the following:
--personality=ask

This will cause Code::Blocks to use the "Lite" personality when it starts-up. "But we haven't defined "Lite" anywhere yet!", I hear you cry out. Fear not! Code::Blocks is smart enough to create a new personality for you, if the one you entered does not exist.

After you 've done the above changes to the "Lite" shortcut and saved it, launch Code::Blocks. Although you may see no changes, Code::Blocks will be operating under the personality "Lite". This means, effectively, that any personalities-aware configuration changes you make will be done on the "Lite" personality.

To see this in action, let's return to our example scenario and turn the "Lite" personality into really light ;)

  • Go to "Plugins->Manage plugins" and disable (uncheck) all plugins except the compiler.
  • Now hide the "Manager" (Shift-F2) and "Messages" (F2) panes (in the "View" menu).
  • Exit Code::Blocks.
  • Launch Code::Blocks again, by clicking on the "Lite" shortcut. Everything should be as configured: no manager panes showing and just one plugin loaded. Congratulations!

But an astute reader shouts: "Hey, Code::Blocks always remembered my changes and started like it was last closed. What's the difference? Are you kidding us?" Here's where the power of personalities comes in :)

  • Close Code::Blocks.
  • Now launch Code::Blocks by clicking on the standard shortcut (no "--personality" command-line option). Tadaa! Code::Blocks in its full capacity!


As an overview, to define and use a new personality you just have to launch Code::Blocks with the command-line option "--personality=<name>", where <name> is the personality's name or "ask" if you want to be asked which personality to use (of the existing ones). After that, Code::Blocks will work under the selected personality for this session.