Gimp addon manager
------------------

This is an improved version of the Sean Bogie/MareroQ manager.

The enhancements:
- one single Python file to handle all managers
- no need to edit the Python file, all user changes are handled with a configuration file
- the standard defaults are usable as is, you may not even need a configuration file
- on platforms that support it, the activation is performed with symlinks instead of file copies, which is much faster.
- add-ons can be kept in their own subfolders, allowing filtering on the collection name in thre Gimp lists

Installation:

- copy addonCollectionManager.py in the plug-ins folder in your profile or in the Gimp installation tree 
  (/usr/lib/gimp/2.0/plug-ins/ for linux users)
- on Linux and OSX, make sure it is executable (chmod +x addonCollectionManager.py)

Usage:

This plugin lets you quickly activate or deactivate collections of add-ons. This reduces clutter in the add-ons lists and
improves Gimp performance by reducing the number of add-ons it needs to cache. To do so:

- for each add-on type, there is a "storage" folder (ie, one for brushes, one for palettes...)
- this storage folder will in turn contain:
  - child directories with one or more add-ons (each such folder is an individually selectable set)
  - ZIP files with one or more addons (each such ZIP is an individually selectable set)

To activate a collection, the manager makes the add-ons appear in one of the folders Gimp uses for active add-ons (see Edit/Preferences->Folders) 
   - on Linux and OSX systems, and with collection in directories, the collection folder is merely linked in the active add-ons folder.
   - with ZIP files or on Windows system, the add-ons from the collection are copied to a subfolder of the active add-ons folder.

By default, the folders Gimp uses for add-ons are in the user's Gimp profile (SEE NOTE), for instance, for brushes:
   - on Linux; /home/{user's_id}/.gimp-2.8/brushes
   - on Windows XP: c:\Documents and Settings\{user's_id}\.gimp-2.8\brushes
   - on Vista/Seven: c:\Users\{user's_id}\.gimp-2.8\brushes

Also by default, the manager uses folders that are siblings of the default active add-on folders, named by suffixing "_storage";
   - on Linux; /home/{user's_id}/.gimp-2.8/brushes_storage
   - on Windows XP: c:\Documents and Settings\{user's_id}\.gimp-2.8\brushes_storage
   - on Vista/Seven: c:\Users\{user's_id}\.gimp-2.8\brushes_storage
   
Configuration file:

If used, the configuration file should be named addonCollectionManager.ini and should be in the standard user's plugin folder, 
which is the "plugin-ins" child folder of the Gimp user profile (SEE NOTE). 

There is a section for each of the managed add-on types (brushes, patterns...). A section starts with its name between brackets: [section]

There is also an [all] section for general settings and for settings that have a common value across several sections (unless overriden by
a specific setting in other sections).

The configurable items so far are:

In [all]:

enable: the list of enabled addon managers (SEE NOTE)

In add-on types sections (or [all]):

addons_active: the folder for active add-ons (where Gimp looks for them, typically in your Gimp profile)
addons_stored: the folder for managed add-ons (where the manager looks for them)
use_subdirectory: [yes|no]: copy/link the addons in a subdirectory of the active addon directory (this allows filtering in the list)
use_link: [yes|no]:  use symbolic links instead of copy when the operating system allows it.
menu_location; the location in the Gimp menus for the menu entry to start the  add-on manager (SEE NOTE)
menu_entry: the label on the menu entry for the add-on manager (SEE NOTE)
menu_description: the description that pops up when you hower the mouse above the menu entry (SEE NOTE)
dialog_title: the title of the add-on manager dialog
extensions: the extensions considered for the add-ons (files with other extensions are ignored). Extensions are case-sensitive.

For all these items, some speficic names enclosed in braces are dynamically replaced when reading the configuration:

{UserHome}: the user's home folder (the parent of the Gimp profile)
{GimpUser}: the user's Gimp profile folder
{GimpData}: the global Gimp data folder (in the Gimp installation tree, in Linux: /usr/share/gimp/2.0/)
{GimpPlugin}: the plugins folder in the Gimp profile
{type}: the lower case name of the add-on types: "brushes"
{Type}: the capitalized name of the add-on types: "Brushes"

These last two items can be used for menu locations and directories.

The default settings correspond to the following configuration:

#-------------------------------------------------------------------------
[all]
enable:brushes dynamics fonts gradients palettes patterns scripts
addons_active:{GimpUser}/{type}
addons_stored:{GimpUser}/{type}_storage
menu_location:{<Type>}
menu_entry:{Type} sets...
menu_description:Manage {type} sets...
dialog_title:{Type} sets manager
use_subdirectory:yes
use_link: {depends on OS capablities: yes for Unixish ones, no for Windows}

[brushes]
extensions:.gbr .vbr .gih .abr .GBR .VBR .GIH
[dynamics]
extensions:.gdyn .GDYN
[fonts]
extensions:.ttf .otf .TTF .OTF
[gradients]
extensions:.ggr .GGR
[palettes]
extensions:.pal .PAL
[patterns]
extensions:.png .pat .PNG .PAT
[scripts]
menu_location:<Image>/Help
extensions:.scm .SCM
use_subdirectory:no
#-------------------------------------------------------------------------

In the end, the directory structure should look like this:

c:\users\your_id\.gimp-2.8
  |
  +--plugins
  |     |
  |     +--addonCollectionManager.py
  |     +--addonCollectionManager.ini (optional)
  |
  +--brushes (existing)
  |     |
  |     +--permanent-brush1.gbr
  |     +--permanent-brush2.gbr
  |
  +--brushes_storage (to be created)
  |     |
  |     +--brush_collection1 (to be created, with a more descriptive name)
  |     |     |
  |     |     +-- collection1-brush1.gbr
  |     |     +-- collection1-brush2.gbr
  |     |
  |     +--brush_collection2 (to be created, with a more descriptive name)
  |           |
  |           +-- collection2-brush1.gbr
  |           +-- collection2-brush2.gbr
  |
  +--fonts
  |
  +--fonts_storage (etc...)


NOTES: 

Registration
------------

Gimp updates the registration data for the plugins only when it notices a new plugin executable,
or when an already registered executable changes (according to the file change date). Changing the menu-related 
configuration items above requires Gimp to update its registration data, but since the plugin file hasn't changed 
it won't notice it. 

You can force Gimp to re-acquire the registration data using one the three methods below:

- Editing the 'pluginrc' file in the Gimp profile, locating the line starting with '(plug-in-def' that bears the plugin file name, 
  and delete the file contents from that line up to and not including the next '(plug-in-def'. 
- Deleting the pluginrc file, but this makes Gimp re-run all the plugins for registration the next time it starts.
- Renaming the plugin file. Gimp will delete the registration data obtained under its previous name, and make that new plugin
  register itself.

The user's profile in Gimp
--------------------------

To locate the Gimp user's profile:
- Follow menus: Filters -> Python-fu -> Console
- Next to the ">>>" enter: "print gimp.directory" (without the double quotes)
- This is you Gimp user's profile.

