diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-25 15:08:02 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-25 15:08:02 (GMT) |
commit | c00b6d7a0a72a481de3064e0bd11e7b30f5b2610 (patch) | |
tree | ccd778cd1144df1cc98831bf7783e521e0f56e4d /Mac/Tools/IDE/PyEdit.py | |
parent | f4a9ac25e9cf27914ad4235d0745980d56212c1d (diff) | |
download | cpython-c00b6d7a0a72a481de3064e0bd11e7b30f5b2610.zip cpython-c00b6d7a0a72a481de3064e0bd11e7b30f5b2610.tar.gz cpython-c00b6d7a0a72a481de3064e0bd11e7b30f5b2610.tar.bz2 |
Added an "Open Recent" command. Fixes 607810.
Diffstat (limited to 'Mac/Tools/IDE/PyEdit.py')
-rw-r--r-- | Mac/Tools/IDE/PyEdit.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index ef31486..6cac553 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -63,6 +63,7 @@ class Editor(W.Window): text = f.read() f.close() self._creator, filetype = MacOS.GetCreatorAndType(path) + self.addrecentfile(path) else: raise IOError, "file '%s' does not exist" % path self.path = path @@ -399,6 +400,7 @@ class Editor(W.Window): del linecache.cache[self.path] import macostools macostools.touched(self.path) + self.addrecentfile(self.path) def can_save(self, menuitem): return self.editgroup.editor.changed or self.editgroup.editor.selchanged @@ -780,6 +782,10 @@ class Editor(W.Window): def selectline(self, lineno, charoffset = 0): self.editgroup.editor.selectline(lineno - 1, charoffset) + + def addrecentfile(self, filename): + app = W.getapplication() + app.addrecentfile(filename) class _saveoptions: |