mirror of https://github.com/python/cpython
Updated to optionally use Carbon Scrap manager.
This commit is contained in:
parent
ad8381a8f0
commit
9cf00dd551
|
@ -141,7 +141,10 @@ class TEWindow(ScrolledWindow):
|
|||
def menu_cut(self):
|
||||
self.ted.TESelView()
|
||||
self.ted.TECut()
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
TE.TEToScrap()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
|
@ -149,7 +152,10 @@ class TEWindow(ScrolledWindow):
|
|||
|
||||
def menu_copy(self):
|
||||
self.ted.TECopy()
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
TE.TEToScrap()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
|
@ -226,8 +232,13 @@ class Ped(Application):
|
|||
if hasattr(Scrap, 'InfoScrap'):
|
||||
on = (Scrap.InfoScrap()[0] <> 0)
|
||||
else:
|
||||
# Not there yet on Carbon, simply always enable
|
||||
on = 1
|
||||
flavors = Scrap.GetCurrentScrap().GetScrapFlavorInfoList()
|
||||
for tp, info in flavors:
|
||||
if tp == 'TEXT':
|
||||
on = 1
|
||||
break
|
||||
else:
|
||||
on = 0
|
||||
if on <> self.pastegroup_on:
|
||||
self.pasteitem.enable(on)
|
||||
self.pastegroup_on = on
|
||||
|
|
|
@ -297,14 +297,19 @@ class WasteWindow(ScrolledWindow):
|
|||
|
||||
def menu_cut(self):
|
||||
self.ted.WESelView()
|
||||
self.ted.WECut()
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
self.ted.WECut()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
|
||||
def menu_copy(self):
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
self.ted.WECopy()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
|
|
|
@ -235,14 +235,19 @@ class WasteWindow(ScrolledWindow):
|
|||
|
||||
def menu_cut(self):
|
||||
self.ted.WESelView()
|
||||
self.ted.WECut()
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
self.ted.WECut()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
|
||||
def menu_copy(self):
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
self.ted.WECopy()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
|
|
|
@ -190,15 +190,20 @@ class WasteWindow(ScrolledWindow):
|
|||
|
||||
def menu_cut(self):
|
||||
self.ted.WESelView()
|
||||
self.ted.WECut()
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
self.ted.WECut()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
self.changed = 1
|
||||
|
||||
def menu_copy(self):
|
||||
Scrap.ZeroScrap()
|
||||
if hasattr(Scrap, 'ZeroScrap'):
|
||||
Scrap.ZeroScrap()
|
||||
else:
|
||||
Scrap.ClearCurrentScrap()
|
||||
self.ted.WECopy()
|
||||
self.updatescrollbars()
|
||||
self.parent.updatemenubar()
|
||||
|
|
Loading…
Reference in New Issue