File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,15 +141,21 @@ def menu_save_as(self):
141141 def menu_cut (self ):
142142 self .ted .TESelView ()
143143 self .ted .TECut ()
144- Scrap .ZeroScrap ()
144+ if hasattr (Scrap , 'ZeroScrap' ):
145+ Scrap .ZeroScrap ()
146+ else :
147+ Scrap .ClearCurrentScrap ()
145148 TE .TEToScrap ()
146149 self .updatescrollbars ()
147150 self .parent .updatemenubar ()
148151 self .changed = 1
149152
150153 def menu_copy (self ):
151154 self .ted .TECopy ()
152- Scrap .ZeroScrap ()
155+ if hasattr (Scrap , 'ZeroScrap' ):
156+ Scrap .ZeroScrap ()
157+ else :
158+ Scrap .ClearCurrentScrap ()
153159 TE .TEToScrap ()
154160 self .updatescrollbars ()
155161 self .parent .updatemenubar ()
@@ -226,8 +232,13 @@ def updatemenubar(self):
226232 if hasattr (Scrap , 'InfoScrap' ):
227233 on = (Scrap .InfoScrap ()[0 ] <> 0 )
228234 else :
229- # Not there yet on Carbon, simply always enable
230- on = 1
235+ flavors = Scrap .GetCurrentScrap ().GetScrapFlavorInfoList ()
236+ for tp , info in flavors :
237+ if tp == 'TEXT' :
238+ on = 1
239+ break
240+ else :
241+ on = 0
231242 if on <> self .pastegroup_on :
232243 self .pasteitem .enable (on )
233244 self .pastegroup_on = on
Original file line number Diff line number Diff line change @@ -297,14 +297,19 @@ def menu_insert_html(self, fp):
297297
298298 def menu_cut (self ):
299299 self .ted .WESelView ()
300- self .ted .WECut ()
301- Scrap .ZeroScrap ()
300+ if hasattr (Scrap , 'ZeroScrap' ):
301+ Scrap .ZeroScrap ()
302+ else :
303+ Scrap .ClearCurrentScrap ()
302304 self .ted .WECut ()
303305 self .updatescrollbars ()
304306 self .parent .updatemenubar ()
305307
306308 def menu_copy (self ):
307- Scrap .ZeroScrap ()
309+ if hasattr (Scrap , 'ZeroScrap' ):
310+ Scrap .ZeroScrap ()
311+ else :
312+ Scrap .ClearCurrentScrap ()
308313 self .ted .WECopy ()
309314 self .updatescrollbars ()
310315 self .parent .updatemenubar ()
Original file line number Diff line number Diff line change @@ -235,14 +235,19 @@ def menu_save_as(self):
235235
236236 def menu_cut (self ):
237237 self .ted .WESelView ()
238- self .ted .WECut ()
239- Scrap .ZeroScrap ()
238+ if hasattr (Scrap , 'ZeroScrap' ):
239+ Scrap .ZeroScrap ()
240+ else :
241+ Scrap .ClearCurrentScrap ()
240242 self .ted .WECut ()
241243 self .updatescrollbars ()
242244 self .parent .updatemenubar ()
243245
244246 def menu_copy (self ):
245- Scrap .ZeroScrap ()
247+ if hasattr (Scrap , 'ZeroScrap' ):
248+ Scrap .ZeroScrap ()
249+ else :
250+ Scrap .ClearCurrentScrap ()
246251 self .ted .WECopy ()
247252 self .updatescrollbars ()
248253 self .parent .updatemenubar ()
Original file line number Diff line number Diff line change @@ -190,15 +190,20 @@ def menu_save_as(self):
190190
191191 def menu_cut (self ):
192192 self .ted .WESelView ()
193- self .ted .WECut ()
194- Scrap .ZeroScrap ()
193+ if hasattr (Scrap , 'ZeroScrap' ):
194+ Scrap .ZeroScrap ()
195+ else :
196+ Scrap .ClearCurrentScrap ()
195197 self .ted .WECut ()
196198 self .updatescrollbars ()
197199 self .parent .updatemenubar ()
198200 self .changed = 1
199201
200202 def menu_copy (self ):
201- Scrap .ZeroScrap ()
203+ if hasattr (Scrap , 'ZeroScrap' ):
204+ Scrap .ZeroScrap ()
205+ else :
206+ Scrap .ClearCurrentScrap ()
202207 self .ted .WECopy ()
203208 self .updatescrollbars ()
204209 self .parent .updatemenubar ()
You can’t perform that action at this time.
0 commit comments