changeset 170:f55979111ba1

- 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
author chewie@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 21 Jan 2009 15:35:44 +0000
parents 49e0633b7dd2
children 456634bbc430
files engine/extensions/filebrowser.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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,