Kaydet (Commit) 9cf00dd5 authored tarafından Jack Jansen's avatar Jack Jansen

Updated to optionally use Carbon Scrap manager.

üst ad8381a8
...@@ -141,7 +141,10 @@ class TEWindow(ScrolledWindow): ...@@ -141,7 +141,10 @@ class TEWindow(ScrolledWindow):
def menu_cut(self): def menu_cut(self):
self.ted.TESelView() self.ted.TESelView()
self.ted.TECut() self.ted.TECut()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
TE.TEToScrap() TE.TEToScrap()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
...@@ -149,7 +152,10 @@ class TEWindow(ScrolledWindow): ...@@ -149,7 +152,10 @@ class TEWindow(ScrolledWindow):
def menu_copy(self): def menu_copy(self):
self.ted.TECopy() self.ted.TECopy()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
TE.TEToScrap() TE.TEToScrap()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
...@@ -226,8 +232,13 @@ class Ped(Application): ...@@ -226,8 +232,13 @@ class Ped(Application):
if hasattr(Scrap, 'InfoScrap'): if hasattr(Scrap, 'InfoScrap'):
on = (Scrap.InfoScrap()[0] <> 0) on = (Scrap.InfoScrap()[0] <> 0)
else: else:
# Not there yet on Carbon, simply always enable flavors = Scrap.GetCurrentScrap().GetScrapFlavorInfoList()
for tp, info in flavors:
if tp == 'TEXT':
on = 1 on = 1
break
else:
on = 0
if on <> self.pastegroup_on: if on <> self.pastegroup_on:
self.pasteitem.enable(on) self.pasteitem.enable(on)
self.pastegroup_on = on self.pastegroup_on = on
......
...@@ -297,14 +297,19 @@ class WasteWindow(ScrolledWindow): ...@@ -297,14 +297,19 @@ class WasteWindow(ScrolledWindow):
def menu_cut(self): def menu_cut(self):
self.ted.WESelView() self.ted.WESelView()
self.ted.WECut() if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECut() self.ted.WECut()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
def menu_copy(self): def menu_copy(self):
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECopy() self.ted.WECopy()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
......
...@@ -235,14 +235,19 @@ class WasteWindow(ScrolledWindow): ...@@ -235,14 +235,19 @@ class WasteWindow(ScrolledWindow):
def menu_cut(self): def menu_cut(self):
self.ted.WESelView() self.ted.WESelView()
self.ted.WECut() if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECut() self.ted.WECut()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
def menu_copy(self): def menu_copy(self):
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECopy() self.ted.WECopy()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
......
...@@ -190,15 +190,20 @@ class WasteWindow(ScrolledWindow): ...@@ -190,15 +190,20 @@ class WasteWindow(ScrolledWindow):
def menu_cut(self): def menu_cut(self):
self.ted.WESelView() self.ted.WESelView()
self.ted.WECut() if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECut() self.ted.WECut()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
self.changed = 1 self.changed = 1
def menu_copy(self): def menu_copy(self):
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap() Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECopy() self.ted.WECopy()
self.updatescrollbars() self.updatescrollbars()
self.parent.updatemenubar() self.parent.updatemenubar()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment