Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ulfben on October 31, 2008, 03:07:30 pm

Title: How do I export CodeBlock themes and layout?
Post by: ulfben on October 31, 2008, 03:07:30 pm
Hi everybody! I'm a long time Visual Studio-slave, trying out some cross platform work. To make myself feel like I home, I spent some time configuring CB syntax highlights (Zenburn (http://slinky.imukuppi.org/zenburn/)), keyboard shortcuts (to mirror Visual Studio) and cleaning up the GUI-layout.

(http://picard.hgo.se/~ulbe001/ext/ulfben_CB_theme_and_layout_thumb.png) (http://picard.hgo.se/~ulbe001/ext/ulfben_CB_theme_and_layout.png)

I would like to use this exact same setup on my Linux and Mac installs, and share the config with others. But I can't find a way to export my settings.

How can I export my settings for others to use? (and what do they do to import them?)

For now: if anyone wants the zenburn theme and some VisualStudio-keybinds, my configs are available here (http://picard.hgo.se/~ulbe001/ext/ulfben_CB_zenburn.7z) (7zip (http://7-zip.org/)). I didn't replace CB-default binds, only added a few VS ones. Feel free to add / improve on it and post updates here!

I'm using Microsoft's beautiful Consolas (http://www.codinghorror.com/blog/archives/000356.html) ClearType-font. Here's a way to get Consolas free of charge (http://www.hanselman.com/blog/UsingConsolasAsTheWindowsConsoleFont.aspx).
Title: Re: How do I export CodeBlock themes and layout?
Post by: Pecan on November 01, 2008, 01:40:33 pm
Search for "portable" in this forum and on the wiki.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_make_Code::Blocks_portable.3F
FAQ - CodeBlocks

The key definitions are in cbKeybinder.ini in the same directory as the default.conf. Copy your .ini files along with the .conf

Since the key definitions are bound to the menu id's, the linux and mac id's may be different, causing temporary errors when CB is first started on those systems. KeyBinder will eventually see the errors and compensate internally during scan intervals of 15 seconds.

I finally stopped moving my conf files between system types because wxWidgets uses dynamic id assignment for keys, windows, controls, etc. This causes programatic confusion when recording those id's and moving them from one system to another.
Title: Re: How do I export CodeBlock themes and layout?
Post by: ulfben on November 01, 2008, 04:16:08 pm
I was afraid manually copying the configuration files was the only way...

What I'd like to see is a clean way to export / import settings. Exporting should produce a single file, compatible with any CodeBlocks-install.

The user should be able to select categories of settings to export/import:

What's the proper way to do feature request like these?
Title: Re: How do I export CodeBlock themes and layout?
Post by: MortenMacFly on November 01, 2008, 04:43:00 pm
What's the proper way to do feature request like these?
Did you try cb_share_config already? It's in SVN and probably in the nightlies, too (I didn't check).
BTW: Usually all plugins have their settings in the C::B config file. There are only a few which make an exception (for good reasons). But these are maybe 1-2 more files to just copy.
Title: Re: How do I export CodeBlock themes and layout?
Post by: ulfben on November 01, 2008, 05:48:35 pm
[...]I finally stopped moving my conf files between system types because wxWidgets uses dynamic id assignment for keys, windows, controls, etc. This causes programatic confusion when recording those id's and moving them from one system to another.
That's bad news! Couldn't/shouldn't we have an abstraction layer between wxWidgets' and Code::Blocks' settings?

@MortenMacFly:
No, I haven't heard of cb_share_config. Searched the forums for info on cb_share_config just now but don't get much more info than this (http://forums.codeblocks.org/index.php/topic,8787.0.html). Where can I get it and what exactly does it do? Is it available for all platforms?

I just ran with the binary download for each platform (which is what my students will do anyway) and can't find nightlies anywhere...

About plugin's settings:
I just meant that in the system I envisioned, it's important that a user can control what sub-set of settings to import and export. And that plugins should (when possible/suitable) be covered and have their own category. It doesn't make sense to send all my settings just to hook a friend up with a sweet theme. :)
Title: Re: How do I export CodeBlock themes and layout?
Post by: Jenna on November 01, 2008, 06:03:29 pm
No, I haven't heard of cb_share_config. I just ran with the binary download for each platform (which is what my students will do anyway) and can't find nightlies anywhere...

Searched the forums for info on cb_share_config just now but don't get much more info than this (http://forums.codeblocks.org/index.php/topic,8787.0.html). Where can I get it and what exactly does it do? Is it available for all platforms?

If you have installed the 8.02 binaries from download-section, you should have it, or you are able to install it.
On windows you have to chose it on the installer page, where you chose the type of installation (just check "C::B share config", it's not checked by default).
You may have to reinstall C::B to do so, but this should not change your "default.conf" (nevertheless it's always safe to backup the config of course).

The executable is in the same directory, as the codeblocks binary.

On debian it's part of the main ("codeblocks") package and will be installed to "/usr/bin".
I don't know inside which package it is on other distros (or on Mac), but it should be there.