mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Comments editor: Make the clear text action undoable
This commit is contained in:
parent
54832c893e
commit
f0f490971e
@ -161,8 +161,12 @@ class EditorWidget(QWebView): # {{{
|
||||
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…
x
Reference in New Issue
Block a user