mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
1. Update WindowList registry when filename changes so that
Window menu updates. 2. Display Python Shell window in Window menu 3. Remove some dead code in FileList.py M EditorWindow.py M FileList.py M WindowList.py
This commit is contained in:
parent
b268f03459
commit
260cb9034c
3 changed files with 4 additions and 7 deletions
|
@ -486,6 +486,7 @@ class EditorWindow:
|
||||||
if self.flist:
|
if self.flist:
|
||||||
self.flist.filename_changed_edit(self)
|
self.flist.filename_changed_edit(self)
|
||||||
self.saved_change_hook()
|
self.saved_change_hook()
|
||||||
|
self.top.update_windowlist_registry(self)
|
||||||
if self.ispythonsource(self.io.filename):
|
if self.ispythonsource(self.io.filename):
|
||||||
self.addcolorizer()
|
self.addcolorizer()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -61,10 +61,6 @@ class FileList:
|
||||||
def new(self, filename=None):
|
def new(self, filename=None):
|
||||||
return self.EditorWindow(self, filename)
|
return self.EditorWindow(self, filename)
|
||||||
|
|
||||||
def new_callback(self, event):
|
|
||||||
self.new()
|
|
||||||
return "break"
|
|
||||||
|
|
||||||
def close_all_callback(self, event):
|
def close_all_callback(self, event):
|
||||||
for edit in self.inversedict.keys():
|
for edit in self.inversedict.keys():
|
||||||
reply = edit.close()
|
reply = edit.close()
|
||||||
|
|
|
@ -29,9 +29,6 @@ class WindowList:
|
||||||
list.append((title, window))
|
list.append((title, window))
|
||||||
list.sort()
|
list.sort()
|
||||||
for title, window in list:
|
for title, window in list:
|
||||||
if title == "Python Shell":
|
|
||||||
# Hack -- until we have a better way to this
|
|
||||||
continue
|
|
||||||
menu.add_command(label=title, command=window.wakeup)
|
menu.add_command(label=title, command=window.wakeup)
|
||||||
|
|
||||||
def register_callback(self, callback):
|
def register_callback(self, callback):
|
||||||
|
@ -72,6 +69,9 @@ class ListedToplevel(Toplevel):
|
||||||
if not registry.dict:
|
if not registry.dict:
|
||||||
self.quit()
|
self.quit()
|
||||||
|
|
||||||
|
def update_windowlist_registry(self, window):
|
||||||
|
registry.call_callbacks()
|
||||||
|
|
||||||
def get_title(self):
|
def get_title(self):
|
||||||
# Subclass can override
|
# Subclass can override
|
||||||
return self.wm_title()
|
return self.wm_title()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue