Fixed the first two bugs in the new file dialogs (found by Just):

- AskFileForSave didn't work for string return values
- filterProc didn't work.
This commit is contained in:
Jack Jansen 2003-01-17 23:13:03 +00:00
parent b2a57722a8
commit e58962af4d
2 changed files with 13 additions and 11 deletions

View file

@ -30,6 +30,7 @@ from Carbon.ControlAccessor import * # Also import Controls constants
import Carbon.File
import macfs
import macresource
import os
_initialized = 0
@ -660,7 +661,7 @@ def AskFileForSave(**args):
# This is gross, and probably incorrect too
vrefnum, dirid, name = rr.selection[0].as_tuple()
pardir_fss = Carbon.File.FSSpec((vrefnum, dirid, ''))
pardir_fsr = Carbon.File.FSRef(fss)
pardir_fsr = Carbon.File.FSRef(pardir_fss)
pardir_path = pardir_fsr.FSRefMakePath() # This is utf-8
name_utf8 = unicode(name, 'macroman').encode('utf8')
fullpath = os.path.join(pardir_path, name_utf8)