本文整理汇总了Python中calibre.gui2.comments_editor.Editor.wyswyg_dirtied方法的典型用法代码示例。如果您正苦于以下问题:Python Editor.wyswyg_dirtied方法的具体用法?Python Editor.wyswyg_dirtied怎么用?Python Editor.wyswyg_dirtied使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calibre.gui2.comments_editor.Editor
的用法示例。
在下文中一共展示了Editor.wyswyg_dirtied方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Comments
# 需要导入模块: from calibre.gui2.comments_editor import Editor [as 别名]
# 或者: from calibre.gui2.comments_editor.Editor import wyswyg_dirtied [as 别名]
class Comments(Base):
def setup_ui(self, parent):
self._box = QGroupBox(parent)
self._box.setTitle('&'+self.col_metadata['name'])
self._layout = QVBoxLayout()
self._tb = CommentsEditor(self._box, toolbar_prefs_name=u'metadata-comments-editor-widget-hidden-toolbars')
self._tb.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
# self._tb.setTabChangesFocus(True)
self._layout.addWidget(self._tb)
self._box.setLayout(self._layout)
self.widgets = [self._box]
def setter(self, val):
if not val or not val.strip():
val = ''
else:
val = comments_to_html(val)
self._tb.html = val
self._tb.wyswyg_dirtied()
def getter(self):
val = unicode(self._tb.html).strip()
if not val:
val = None
return val
@dynamic_property
def tab(self):
def fget(self):
return self._tb.tab
def fset(self, val):
self._tb.tab = val
return property(fget=fget, fset=fset)
示例2: Comments
# 需要导入模块: from calibre.gui2.comments_editor import Editor [as 别名]
# 或者: from calibre.gui2.comments_editor.Editor import wyswyg_dirtied [as 别名]
class Comments(Base):
def setup_ui(self, parent):
self._box = QGroupBox(parent)
self._box.setTitle('&'+self.col_metadata['name'])
self._layout = QVBoxLayout()
self._tb = CommentsEditor(self._box)
self._tb.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
# self._tb.setTabChangesFocus(True)
self._layout.addWidget(self._tb)
self._box.setLayout(self._layout)
self.widgets = [self._box]
def setter(self, val):
if not val or not val.strip():
val = ''
else:
val = comments_to_html(val)
self._tb.html = val
self._tb.wyswyg_dirtied()
def getter(self):
val = unicode(self._tb.html).strip()
if not val:
val = None
return val
示例3: Comments
# 需要导入模块: from calibre.gui2.comments_editor import Editor [as 别名]
# 或者: from calibre.gui2.comments_editor.Editor import wyswyg_dirtied [as 别名]
class Comments(Base):
def setup_ui(self, parent):
self._box = QGroupBox(parent)
self._box.setTitle('&'+self.col_metadata['name'])
self._layout = QVBoxLayout()
self._tb = CommentsEditor(self._box, toolbar_prefs_name=u'metadata-comments-editor-widget-hidden-toolbars')
self._tb.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
# self._tb.setTabChangesFocus(True)
self._layout.addWidget(self._tb)
self._box.setLayout(self._layout)
self.widgets = [self._box]
def initialize(self, book_id):
path = self.db.abspath(book_id, index_is_id=True)
if path:
self._tb.set_base_url(QUrl.fromLocalFile(os.path.join(path, 'metadata.html')))
return Base.initialize(self, book_id)
def setter(self, val):
if not val or not val.strip():
val = ''
else:
val = comments_to_html(val)
self._tb.html = val
self._tb.wyswyg_dirtied()
def getter(self):
val = unicode(self._tb.html).strip()
if not val:
val = None
return val
@dynamic_property
def tab(self):
def fget(self):
return self._tb.tab
def fset(self, val):
self._tb.tab = val
return property(fget=fget, fset=fset)