mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
...
This commit is contained in:
parent
1b36225c7c
commit
3bd7e3457a
@ -202,6 +202,9 @@ class EditorWidget(QWebView): # {{{
|
|||||||
|
|
||||||
def fget(self):
|
def fget(self):
|
||||||
ans = u''
|
ans = u''
|
||||||
|
check = unicode(self.page().mainFrame().toPlainText()).strip()
|
||||||
|
if not check:
|
||||||
|
return ans
|
||||||
try:
|
try:
|
||||||
raw = unicode(self.page().mainFrame().toHtml())
|
raw = unicode(self.page().mainFrame().toHtml())
|
||||||
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
||||||
@ -534,11 +537,11 @@ class Editor(QWidget): # {{{
|
|||||||
# self.source_dirty)
|
# self.source_dirty)
|
||||||
if index == 1: # changing to code view
|
if index == 1: # changing to code view
|
||||||
if self.wyswyg_dirty:
|
if self.wyswyg_dirty:
|
||||||
self.code_edit.setPlainText(self.html)
|
self.code_edit.setPlainText(self.editor.html)
|
||||||
self.wyswyg_dirty = False
|
self.wyswyg_dirty = False
|
||||||
elif index == 0: #changing to wyswyg
|
elif index == 0: #changing to wyswyg
|
||||||
if self.source_dirty:
|
if self.source_dirty:
|
||||||
self.html = unicode(self.code_edit.toPlainText())
|
self.editor.html = unicode(self.code_edit.toPlainText())
|
||||||
self.source_dirty = False
|
self.source_dirty = False
|
||||||
|
|
||||||
def wyswyg_dirtied(self, *args):
|
def wyswyg_dirtied(self, *args):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user