mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:03:26 +02:00
Comments editor: Make the clear text action undoable
This commit is contained in:
parent
54832c893e
commit
f0f490971e
1 changed files with 6 additions and 2 deletions
|
|
@ -161,8 +161,12 @@ def __init__(self, parent=None):
|
|||
self.page().setContentEditable(True)
|
||||
|
||||
def clear_text(self, *args):
|
||||
self.html = u''
|
||||
self.page().contentsChanged.emit()
|
||||
us = self.page().undoStack()
|
||||
us.beginMacro('clear all text')
|
||||
self.action_select_all.trigger()
|
||||
self.action_remove_format.trigger()
|
||||
self.exec_command('delete')
|
||||
us.endMacro()
|
||||
|
||||
def link_clicked(self, url):
|
||||
open_url(url)
|
||||
|
|
|
|||
Loading…
Reference in a new issue