mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Use new file dialogs.
This commit is contained in:
parent
d9db3a6713
commit
b340acf9fd
16 changed files with 72 additions and 78 deletions
|
|
@ -131,9 +131,9 @@ class TEWindow(ScrolledWindow):
|
|||
self.changed = 0
|
||||
|
||||
def menu_save_as(self):
|
||||
fss, ok = macfs.StandardPutFile('Save as:')
|
||||
if not ok: return
|
||||
self.path = fss.as_pathname()
|
||||
path = EasyDialogs.AskFileForSave(message='Save as:')
|
||||
if not path: return
|
||||
self.path = path
|
||||
self.name = os.path.split(self.path)[-1]
|
||||
self.wid.SetWTitle(self.name)
|
||||
self.menu_save()
|
||||
|
|
@ -265,10 +265,9 @@ class Ped(Application):
|
|||
|
||||
def _open(self, askfile):
|
||||
if askfile:
|
||||
fss, ok = macfs.StandardGetFile('TEXT')
|
||||
if not ok:
|
||||
path = EasyDialogs.AskFileForOpen(typeList=('TEXT',))
|
||||
if not path:
|
||||
return
|
||||
path = fss.as_pathname()
|
||||
name = os.path.split(path)[-1]
|
||||
try:
|
||||
fp = open(path, 'rb') # NOTE binary, we need cr as end-of-line
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue