diff --git a/meldapp.py b/meldapp.py
index 158d22f..f0d2a95 100644
--- a/meldapp.py
+++ b/meldapp.py
@@ -446,9 +446,13 @@ class MeldPreferences(prefs.Preferences):
         if self.use_custom_font:
             return self.custom_font
         else:
+            if not self._gconf:
+                return "Monospace 10"
             return self._gconf.get_string('/desktop/gnome/interface/monospace_font_name') or "Monospace 10"
 
     def get_toolbar_style(self):
+        if not self._gconf:
+            return gtk.TOOLBAR_BOTH
         style = self._gconf.get_string('/desktop/gnome/interface/toolbar_style') or "both"
         style = {"both":gtk.TOOLBAR_BOTH, "text":gtk.TOOLBAR_TEXT,
                  "icon":gtk.TOOLBAR_ICONS, "icons":gtk.TOOLBAR_ICONS,
@@ -458,6 +462,8 @@ class MeldPreferences(prefs.Preferences):
         return style
 
     def get_gnome_editor_command(self, files):
+        if not self._gconf:
+            return []
         argv = []
         editor = self._gconf.get_string('/desktop/gnome/applications/editor/exec') or "gedit"
         if self._gconf.get_bool("/desktop/gnome/applications/editor/needs_term"):
diff --git a/prefs.py b/prefs.py
index 0593fa2..d05cd1a 100644
--- a/prefs.py
+++ b/prefs.py
@@ -48,9 +48,6 @@ class Value(object):
         self.default = d
         self.current = d
 
-# maybe fall back to ConfigParser if gconf is unavailable.
-import gconf
-
 # types of values allowed
 BOOL = "bool"
 INT = "int"
@@ -61,8 +58,8 @@ FLOAT = "float"
 
 ##
 
-class Preferences(object):
-    """Persistent preferences object.
+class GConfPreferences(object):
+    """Persistent preferences object that handles preferences via gconf.
 
     Example:
     import prefs
@@ -140,3 +137,122 @@ class Preferences(object):
         for k,v in self._prefs.items():
             print k, v.type, v.current
 
+
+class ConfigParserPreferences(object):
+    """Persistent preferences object that handles preferences via ConfigParser.
+
+    This preferences implementation is a fallback for people who dislike gconf
+    or do not have gnome readily available (i.e., other platforms). As the
+    ConfigParser library is included in Python, it should be available
+    everywhere.
+
+    The biggest drawback to this preferences object is the lack of
+    change notification, which means that in order for any preference changes
+    to take effect, Meld must be restarted.
+    """
+
+    def __init__(self, rootkey, initial):
+        """Create a preferences object.
+
+        Settings are initialised with 'initial' and then overriden
+        from values in the ConfigParser database if available.
+
+        rootkey : the root gconf key where the values will be stored
+        initial : a dictionary of string to Value objects.
+        """
+
+        self.__dict__['_parser'] = ConfigParser.SafeConfigParser()
+        dirty = False
+
+        try:
+            config_file = open(self.__getrcfile__(), 'r')
+            self._parser.readfp(config_file)
+        finally:
+            config_file.close()
+
+        self.__dict__['_listeners'] = []
+        self.__dict__['_root'] = []
+        self.__dict__['_initial'] = []
+        self.__dict__["_prefs"] = initial
+
+        self.__dict__['_type_mappings'] = {
+            BOOL : self._parser.getboolean,
+            INT : self._parser.getint,
+            STRING : self._parser.get,
+            FLOAT : self._parser.getfloat
+        }
+
+        #self._gconf.add_dir(rootkey, gconf.CLIENT_PRELOAD_NONE)
+        # TODO: The only way to get this to work would be to do something like
+        # inotify on the file
+        #self._gconf.notify_add(rootkey, self._on_preference_changed)
+
+        for key, value in self._prefs.items():
+            if self._parser.has_option('DEFAULT', key):
+                value.current = self._type_mappings[value.type]('DEFAULT', key)
+
+    def __getrcfile__(self):
+
+        user_home = os.path.expanduser("~")
+        file_path = None;
+        if sys.platform == 'win32':
+            file_path = os.path.join(user_home, '_meld')
+        else:
+            file_path = os.path.join(user_home, '.meld')
+
+        # Touch the config file if it does not exist
+        if not os.path.isfile(file_path):
+            open(file_path, 'a').close()
+
+        assert file_path, "Should have a config file"
+        return file_path
+
+    def __getattr__(self, attr):
+        return self._prefs[attr].current
+
+    def get_default(self, attr):
+        return self._prefs[attr].default
+
+    def __setattr__(self, attr, val):
+        value = self._prefs[attr]
+        if value.current != val:
+            value.current = val
+            self._parser.set(None, attr, str(val))
+
+            try:
+                fp = open(self.__getrcfile__(), 'w')
+                self._parser.write(fp)
+            finally:
+                fp.close()
+
+            try:
+                for l in self._listeners:
+                    l(attr,val)
+            except StopIteration:
+                pass
+
+    def notify_add(self, callback):
+        """Register a callback to be called when a preference changes.
+
+        callback : a callable object which take two parameters, 'attr' the
+                   name of the attribute changed and 'val' the new value.
+        """
+        self._listeners.append(callback)
+
+    def dump(self):
+        """Print all preferences.
+        """
+        for k,v in self._prefs.items():
+            print k, v.type, v.current
+
+# Try to use gconf, and fall back to ConfigParser
+Preferences = None
+try:
+    import gconf
+    Preferences = GConfPreferences
+except ImportError:
+    import ConfigParser
+    import os, sys
+    Preferences = ConfigParserPreferences
+
+assert Preferences is not None, "Could not load a preference parser"
diff --git a/vc/_vc.py b/vc/_vc.py
index b3ba033..d82e32d 100644
--- a/vc/_vc.py
+++ b/vc/_vc.py
@@ -142,3 +142,13 @@ class Vc(object):
 
     def _get_dirsandfiles(self, directory, dirs, files):
         raise NotImplementedError()
+
+    def find_vcs_root(self, location, tofind):
+        while True:
+            if os.path.isdir(os.path.join(location, tofind)):
+                return location
+            tmp = os.path.dirname(location)
+            if location == tmp:
+                raise ValueError()
+            location = tmp
+
diff --git a/vc/bzr.py b/vc/bzr.py
index 3274572..683899f 100644
--- a/vc/bzr.py
+++ b/vc/bzr.py
@@ -29,18 +29,14 @@ import _vc
 class Vc(_vc.Vc):
 
     CMD = "bzr"
+    BZR_DIR = ".bzr"
     NAME = "Bazaar-NG"
     PATCH_STRIP_NUM = 0
     PATCH_INDEX_RE = "^=== modified file '(.*)'$"
 
     def __init__(self, location):
         self._tree_cache = None
-        while location != "/":
-            if os.path.isdir( "%s/.bzr" % location):
-                self.root = location
-                return
-            location = os.path.dirname(location)
-        raise ValueError()
+        self.root = self.find_vcs_root(location, self.BZR_DIR)
 
     def commit_command(self, message):
         return [self.CMD,"commit","-m",message]
diff --git a/vc/cvs.py b/vc/cvs.py
index da55c09..d4526a1 100644
--- a/vc/cvs.py
+++ b/vc/cvs.py
@@ -32,10 +32,11 @@ import _vc
 class Vc(_vc.Vc):
     CMD = "cvs"
     NAME = "CVS"
+    CVS_DIR = "CVS"
     PATCH_INDEX_RE = "^Index:(.*)$"
 
     def __init__(self, location):
-        if not os.path.exists("%s/CVS"% location):
+        if not os.path.exists(os.path.join(location, self.CVS_DIR)):
             raise ValueError
         self.root = location
 
diff --git a/vc/darcs.py b/vc/darcs.py
index ff8748b..4639e93 100644
--- a/vc/darcs.py
+++ b/vc/darcs.py
@@ -36,18 +36,14 @@ STATES = {
 class Vc(_vc.Vc):
 
     CMD = "darcs"
+    DARCS_DIR = "_darcs"
     NAME = "Darcs"
     PATCH_STRIP_NUM = 1
     PATCH_INDEX_RE = "--- old.+?/(.+?)\\t+.*[0-9]{4}$"
 
     def __init__(self, location):
         self._cachetime = None
-        while location != "/":
-            if os.path.isdir( "%s/_darcs" % location):
-                self.root = location
-                return
-            location = os.path.dirname(location)
-        raise ValueError()
+        self.root = self.find_vcs_root(location, self.DARCS_DIR)
 
     def commit_command(self, message):
         return [self.CMD, "record",
diff --git a/vc/git.py b/vc/git.py
index 47d0161..5238f58 100644
--- a/vc/git.py
+++ b/vc/git.py
@@ -34,22 +34,21 @@ import _vc
 class Vc(_vc.Vc):
 
     CMD = "git"
+    GIT_DIR = ".git"
     NAME = "Git"
     PATCH_STRIP_NUM = 1
     PATCH_INDEX_RE = "^diff --git a/(.*) b/.*$"
 
     def __init__(self, location):
         self._tree_cache = None
-        while location != "/":
-            if os.path.isdir( "%s/.git" % location):
-                self.root = location
-                return
-            location = os.path.dirname(location)
+
+        # Invoke the special case first, it saves a file walk
         gitdir = os.environ.get("GIT_DIR")
         if gitdir and os.path.isdir(gitdir):
             self.root = gitdir
             return
-        raise ValueError()
+        else:
+            self.root = self.find_vcs_root(location, self.GIT_DIR)
 
     def commit_command(self, message):
         return [self.CMD,"commit","-m",message]
diff --git a/vc/mercurial.py b/vc/mercurial.py
index de0224b..60ff277 100644
--- a/vc/mercurial.py
+++ b/vc/mercurial.py
@@ -28,17 +28,13 @@ import _vc
 class Vc(_vc.Vc):
 
     CMD = "hg"
+    HG_DIR = ".hg"
     NAME = "Mercurial"
     PATCH_STRIP_NUM = 1
     PATCH_INDEX_RE = "^diff -r \w+ (.*)$"
 
     def __init__(self, location):
-        while location != "/":
-            if os.path.isdir( "%s/.hg" % location):
-                self.root = location
-                return
-            location = os.path.dirname(location)
-        raise ValueError()
+        self.root = self.find_vcs_root(location, self.HG_DIR)
 
     def commit_command(self, message):
         return [self.CMD,"commit","-m",message]
diff --git a/vc/monotone.py b/vc/monotone.py
index d10503a..5649cc0 100644
--- a/vc/monotone.py
+++ b/vc/monotone.py
@@ -36,35 +36,21 @@ class Vc(_vc.Vc):
 
     def __init__(self, location):
         self._tree_cache = None
-        location = os.path.normpath(location)
-
-        def find_folder(where, tofind):
-            while where != "/":
-                cur = os.path.join(where,tofind)
-                if os.path.isdir(cur):
-                    return where
-                where = os.path.dirname(where)
 
         # for monotone >= 0.26
-        mtn = find_folder(location,"_MTN")
-        if mtn:
-            self.root = mtn
-
-	    self.interface_version = float(os.popen("mtn" + " automate interface_version").read())
-	    if self.interface_version > 6.0:
-		print "WARNING: Unsupported interface version (please report any problems to the meld mailing list)"
+        try :
+            self.root = self.find_vcs_root(location,"_MTN")
+            self.interface_version = float(os.popen("mtn" + " automate interface_version").read())
+            if self.interface_version > 6.0:
+                print "WARNING: Unsupported interface version (please report any problems to the meld mailing list)"
 
             return
-
-        # for monotone <= 0.25 (different metadata directory, different executable)
-        mt = find_folder(location,"MT")
-        if mt:
-            self.root = mt
+        except ValueError:
+            # for monotone <= 0.25 (different metadata directory, different executable)
+            self.root = self.find_vcs_root(location,"MT")
             self.CMD = "monotone"
             return
 
-        raise ValueError
-
     def commit_command(self, message):
         return [self.CMD,"commit","-m",message]
     def diff_command(self):
diff --git a/vc/svn.py b/vc/svn.py
index 5dce5f7..388c38d 100644
--- a/vc/svn.py
+++ b/vc/svn.py
@@ -32,9 +32,10 @@ class Vc(_vc.Vc):
     CMD = "svn"
     NAME = "Subversion"
     PATCH_INDEX_RE = "^Index:(.*)$"
+    SVN_DIR = ".svn"
 
     def __init__(self, location):
-        if not os.path.exists("%s/.svn"%location):
+        if not os.path.exists(os.path.join(location, self.SVN_DIR)):
             raise ValueError()
         self.root = location
 
diff --git a/vc/tla.py b/vc/tla.py
index 083da9c..ffd485c 100644
--- a/vc/tla.py
+++ b/vc/tla.py
@@ -63,16 +63,12 @@ class Vc(_vc.Vc):
     NAME = "Arch"
     PATCH_STRIP_NUM = 1
     PATCH_INDEX_RE = "--- orig/(.*)"
+    TLA_DIR = "{arch}"
 
     def __init__(self, location):
         self._cachetime = None
         self._cached_statuses = None
-        while location != "/":
-            if os.path.isdir( "%s/{arch}" % location):
-                self.root = location
-                return
-            location = os.path.dirname(location)
-        raise ValueError()
+        self.root = self.find_vcs_root(location, self.TLA_DIR)
 
     def commit_command(self, message):
         return [self.CMD, "commit",
