Mercurial > fife-parpg
comparison clients/editor/scripts/gui/filemanager.py @ 325:54de5aebf732
* ObjectSelector will now select and scroll to selected object automatically
* ObjectSelector will now update after importing new objects
* New event signal: onObjectsImported
author | cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 21 Aug 2009 20:34:26 +0000 |
parents | 0adf9423062e |
children | 8e71629c4c43 |
comparison
equal
deleted
inserted
replaced
324:e249fa887259 | 325:54de5aebf732 |
---|---|
6 from pychan.tools import callbackWithArguments as cbwa | 6 from pychan.tools import callbackWithArguments as cbwa |
7 from scripts.gui.error import ErrorDialog | 7 from scripts.gui.error import ErrorDialog |
8 from action import Action, ActionGroup | 8 from action import Action, ActionGroup |
9 from input import InputDialog | 9 from input import InputDialog |
10 from selection import SelectionDialog, ClickSelectionDialog | 10 from selection import SelectionDialog, ClickSelectionDialog |
11 from scripts.events import events | |
11 | 12 |
12 class FileManager(object): | 13 class FileManager(object): |
13 def __init__(self): | 14 def __init__(self): |
14 self.editor = scripts.editor.getEditor() | 15 self.editor = scripts.editor.getEditor() |
15 self.engine = self.editor.getEngine() | 16 self.engine = self.editor.getEngine() |
174 errormsg = u"Importing file failed:\n" | 175 errormsg = u"Importing file failed:\n" |
175 errormsg += u"File: "+unicode(file)+u"\n" | 176 errormsg += u"File: "+unicode(file)+u"\n" |
176 errormsg += u"Error: "+unicode(sys.exc_info()[1]) | 177 errormsg += u"Error: "+unicode(sys.exc_info()[1]) |
177 ErrorDialog(errormsg) | 178 ErrorDialog(errormsg) |
178 return None | 179 return None |
180 | |
181 events.onObjectsImported.send(sender=self) | |
179 | 182 |
180 def importDir(self, path, filename=""): | 183 def importDir(self, path, filename=""): |
181 if os.path.isdir(os.path.join(path, filename)): | 184 if os.path.isdir(os.path.join(path, filename)): |
182 path = os.path.join(path, filename) | 185 path = os.path.join(path, filename) |
183 path = os.path.normpath(path) | 186 path = os.path.normpath(path) |
197 errormsg = u"Importing directory failed:\n" | 200 errormsg = u"Importing directory failed:\n" |
198 errormsg += u"File: "+unicode(file)+u"\n" | 201 errormsg += u"File: "+unicode(file)+u"\n" |
199 errormsg += u"Error: "+unicode(sys.exc_info()[1]) | 202 errormsg += u"Error: "+unicode(sys.exc_info()[1]) |
200 ErrorDialog(errormsg) | 203 ErrorDialog(errormsg) |
201 return None | 204 return None |
205 | |
206 events.onObjectsImported.send(sender=self) | |
202 | 207 |
203 class CameraEditor(object): | 208 class CameraEditor(object): |
204 """ | 209 """ |
205 CameraEditor provides a gui dialog for camera creation. The callback is called when camera creation is complete. A | 210 CameraEditor provides a gui dialog for camera creation. The callback is called when camera creation is complete. A |
206 partial specification of the camera parameters may optionally be given. | 211 partial specification of the camera parameters may optionally be given. |