=== gnome-reset ===

gnome-reset creates a backup of a bunch of settings and then resets
them.  A domain is a particular set of settings.  Some current
examples are nautilus and gnome-panel.

=== Add a domain ===

To add domains, add a file ending in .gnome-reset to the installed xml
directory.  (To add to the package, just add it to the xml directory
in cvs.)

.gnome-reset files are fairly simple xml files.  They consist of a
<gnome-reset-domain-list> toplevel element.  This can have any number
of <gnome-reset-domain> element children, each of which adds a domain.

<gnome-reset-domain> elements have a number of child elements, most of
which are mandatory.

The <name> element is a unique identifier for the domain.  This is used
internally as well as in the name of the backed up data.

The <description> element is the string displayed to the user in the GUI.

The <module> element is the module to use.  The gnome-reset programs
use gnome_reset_domain_<module>.py to process this domain.

The <parameters> element is a container element.  It contains children
elements that are passed as parameters to the creation function of the
given module.  For most modules the list of parameters must match exactly.

Parameters for different modules:

gconf:
	<gconf_paths> A comma separated list of gconf paths to backup
			and reset.  Each must start with a '/'.
files:
	<file_paths> A comma separated list of files and directories
		to backup and reset.  Must start with '/' or '%home%'
		which is replaced with the users home directory.
gconf_and_files:
	<gconf_paths> See above
	<file_paths> See above
panel:
	No parameters.  This module is panel specific.
test:
	<gconf_path> Path that gets printed to stdout.  I should
		delete this module.

=== Add a module ===

Requires ability to program python.

To add a module, you have to write a new
gnome_reset_domain_<module>.py file.  This file gets installed in a
python site directory.  If placed in the root directory of the cvs, it
will automagically get installed.

The file must contain at least a single class definition, PreferenceDomain.

The __init__ function of PreferenceDomain is passed a **kargs
containing the contents of the <parameters> element, so the definition
of your __init__ function defines what parameters your module accepts
from the xml.  Just have simple named args and those will be required
parameters.  Setting a default value for them will cause them to be
option parameters.  Accepting **kargs will cause it to accept
arbitrary named parameters.  *args will not get any contents.

Before any of the following methods are called, two pieces of data are
set up on the object.  self.location is the directory which the module
should back data up to.  self.name is the name given in the xml.  The
backup data must include this string.  gconf backs up to self.location
+ "/" + self.name + ".entries" and files backs up to a subdirectory of
self.location + "/" + self.name.  Do something along these lines.

The created object must have at least the following three methods:

def backup (self):
	Backup the data.  gconf module packs the non default gconf
	values to self.location + "/" + self.name + ".entries" as a
	gconf entries file that can be read by gconftool-2.  files
	copies the given file or subdirectory to an appropriate
	location inside self.location + "/" + self.name.

def reset (self):
	Reset the data to default values.  gconf module runs a
	recursive gconf entry delete.  files deletes the given
	subdirectory.

def restore (self, reset):
	Restore the data at self.location with the given self.name.
	If reset is true, clear the values before restoring (thus
	returning to the state when the backup was run.)  If reset is
	false, don't clear the values (thus moving to a merging of the
	two states if this makes any sense.  If this doesn't make
	sense, then treat this as reset = true.)
	Most modules can just call their reset if the reset parameter
	is true.
	gconf resets and then uses gconftool-2 to load.  files
	replaces the current contents with the original contents.
	Currently, reset is always true.

(Technically PreferenceDomain can be any callable that returns an
object with the specified methods.)

=== Known bugs ===

Clicking on the text of a row doesn't toggle the value.

XML output of gconf module looks ugly (This is a result of trying to
get python to do pretty print but at the same time not put white space
padding around text elements.)

Needs more domains.
