comparison src/parpg/gui/dialogs.py @ 12:d60f1dab8469

Fixed resource path dependencies issue that caused PARPG to crash on start. * PARPG should now run without issue (system installation not tested). * Utilized FIFE's VFS module to remove path dependencies from most PARPG modules. * The new parpg.vfs module is a singleton with a single global variable, VFS, which is a reference to the global VFS instance. Although a singleton is not ideal it should be replaced once PARPG's core code is refactored. * The parpg.vfs singleton is initialized in the parpg.applicaiton.PARPGApplication class with the absolute path to the data directory via the parpg.settings module and corresponding configuration file. * A new DataPath entry was added to the default system configuration file template under the [parpg] section to support the new parpg.vfs module. * Updated the parpg-assets subrepo to revision 3 to fix some dialog file format issues (for details see commit message for parpg-assets). * Fixed a few bugs in the parpg.dialogueparsers.YAMLDialogueParser class related to exception handling.
author M. George Hansen <technopolitica@gmail.com>
date Mon, 06 Jun 2011 15:56:14 -1000
parents 1fd2201f5c36
children
comparison
equal deleted inserted replaced
11:4706e0194af3 12:d60f1dab8469
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details. 11 # GNU General Public License for more details.
12 12
13 # You should have received a copy of the GNU General Public License 13 # You should have received a copy of the GNU General Public License
14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>. 14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
15 from fife.extensions import pychan
15 16
16 import os 17 from parpg import vfs
17
18 from fife.extensions import pychan
19 18
20 class RestartDialog(object): 19 class RestartDialog(object):
21 def __init__(self, settings): 20 def __init__(self, settings):
22 self.settings = settings 21 self.settings = settings
23 self.window = pychan.loadXML(os.path.join(self.settings.system_path, 22 xml_file = vfs.VFS.open('gui/restart_dialog.xml')
24 self.settings.parpg.GuiPath, 23 self.window = pychan.loadXML(xml_file)
25 'restart_dialog.xml'))
26 self.window.mapEvents({'closeButton': self.hide}) 24 self.window.mapEvents({'closeButton': self.hide})
27 25
28 def hide(self): 26 def hide(self):
29 self.window.hide() 27 self.window.hide()
30 28