# HG changeset patch # User chewie@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1232552144 0 # Node ID f55979111ba1cc089c272643e933e8c3df91ff5a # Parent 49e0633b7dd27ce60a9a03bf02b61273b4aac040 - minor change to filebrowser - you now can specify the directory and the filename (!) of the xml file for the filebrowser (previous one was hardcoded) FEATURES: - use guixmlpath="my_path_to/my_filebrowser.xml" as argument when creating a new filebrowser instance NOTE: - if you create your own filebrowser.xml, make sure to meet the names / widgets the browser needs to work diff -r 49e0633b7dd2 -r f55979111ba1 engine/extensions/filebrowser.py --- a/engine/extensions/filebrowser.py Wed Jan 14 16:58:51 2009 +0000 +++ b/engine/extensions/filebrowser.py Wed Jan 21 15:35:44 2009 +0000 @@ -12,13 +12,15 @@ The savefile option provides a box for supplying a new filename that doesn't exist yet. The selectdir option allows directories to be selected as well as files. """ - def __init__(self, engine, fileSelected, savefile=False, selectdir=False, extensions=('xml',)): + def __init__(self, engine, fileSelected, savefile=False, selectdir=False, extensions=('xml',), guixmlpath="content/gui/filebrowser.xml"): self.engine = engine self.fileSelected = fileSelected self._widget = None self.savefile = savefile self.selectdir = selectdir + + self.guixmlpath = guixmlpath self.extensions = extensions self.path = './..' @@ -29,7 +31,7 @@ if self._widget: self._widget.show() return - self._widget = pychan.loadXML('content/gui/filebrowser.xml') + self._widget = pychan.loadXML(self.guixmlpath) self._widget.mapEvents({ 'dirList' : self._setDirectory, 'selectButton' : self._selectFile,