BUGFIX: Opening files was not always performing as expected. Fixed now.

This commit is contained in:
Cas Cremers 2012-10-02 13:42:48 +02:00
parent fc72b5f6ff
commit 10c62a6863

View File

@ -61,6 +61,8 @@ class MainWindow(wx.Frame):
MainInitOnce() MainInitOnce()
self.filename = 'noname.spdl' self.filename = 'noname.spdl'
self.filepath = ""
self.load = False self.load = False
# test # test
@ -199,8 +201,10 @@ class MainWindow(wx.Frame):
dialog = wx.FileDialog(self, **dialogOptions) dialog = wx.FileDialog(self, **dialogOptions)
if dialog.ShowModal() == wx.ID_OK: if dialog.ShowModal() == wx.ID_OK:
userProvidedFilename = True userProvidedFilename = True
self.filename = dialog.GetFilename() self.filepath = dialog.GetPath()
self.dirname = dialog.GetDirectory() (p1,p2) = os.path.split(self.filepath)
self.dirname = p1
self.filename = p2
self.SetTitle() # Update the window title with the new filename self.SetTitle() # Update the window title with the new filename
else: else:
userProvidedFilename = False userProvidedFilename = False