本文整理汇总了Python中calibre.gui2.dialogs.template_dialog.TemplateDialog.setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:Python TemplateDialog.setWindowTitle方法的具体用法?Python TemplateDialog.setWindowTitle怎么用?Python TemplateDialog.setWindowTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calibre.gui2.dialogs.template_dialog.TemplateDialog
的用法示例。
在下文中一共展示了TemplateDialog.setWindowTitle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_template_editor
# 需要导入模块: from calibre.gui2.dialogs.template_dialog import TemplateDialog [as 别名]
# 或者: from calibre.gui2.dialogs.template_dialog.TemplateDialog import setWindowTitle [as 别名]
def show_template_editor(self, *args):
view = self.gui.current_view()
if view is not self.gui.library_view:
return error_dialog(self.gui, _('No template tester available'),
_('Template tester is not available for books '
'on the device.')).exec_()
rows = view.selectionModel().selectedRows()
if not rows:
return error_dialog(self.gui, _('No books selected'),
_('One book must be selected'), show=True)
if len(rows) > 1:
return error_dialog(self.gui, _('Selected multiple books'),
_('Only one book can be selected'), show=True)
index = rows[0]
if index.isValid():
db = view.model().db
t = TemplateDialog(self.gui, self.previous_text,
mi=db.get_metadata(index.row(), index_is_id=False, get_cover=False),
text_is_placeholder=self.first_time)
t.setWindowTitle(_('Template tester'))
if t.exec_() == t.Accepted:
self.previous_text = t.rule[1]
self.first_time = False
示例2: createEditor
# 需要导入模块: from calibre.gui2.dialogs.template_dialog import TemplateDialog [as 别名]
# 或者: from calibre.gui2.dialogs.template_dialog.TemplateDialog import setWindowTitle [as 别名]
def createEditor(self, parent, option, index):
m = index.model()
mi = m.db.get_metadata(index.row(), index_is_id=False)
text = m.custom_columns[m.column_map[index.column()]]['display']['composite_template']
editor = TemplateDialog(parent, text, mi)
editor.setWindowTitle(_("Edit template"))
editor.textbox.setTabChangesFocus(False)
editor.textbox.setTabStopWidth(20)
d = editor.exec_()
if d:
m.setData(index, (editor.rule[1]), Qt.EditRole)
return None
示例3: show_template_editor
# 需要导入模块: from calibre.gui2.dialogs.template_dialog import TemplateDialog [as 别名]
# 或者: from calibre.gui2.dialogs.template_dialog.TemplateDialog import setWindowTitle [as 别名]
def show_template_editor(self, *args):
view = self.gui.current_view()
if view is not self.gui.library_view:
return error_dialog(self.gui, _('No template tester available'),
_('Template tester is not available for books '
'on the device.')).exec_()
rows = view.selectionModel().selectedRows()
if not rows:
return error_dialog(self.gui, _('No books selected'),
_('One book must be selected'), show=True)
if len(rows) > 1:
return error_dialog(self.gui, _('Selected multiple books'),
_('Only one book can be selected'), show=True)
index = rows[0]
if index.isValid():
db = view.model().db
t = TemplateDialog(self.gui,
_('Enter a template to test using data from the selected book'),
mi=db.get_metadata(index.row(), index_is_id=False, get_cover=False))
t.setWindowTitle(_('Template tester'))
t.exec_()
示例4: edit_template
# 需要导入模块: from calibre.gui2.dialogs.template_dialog import TemplateDialog [as 别名]
# 或者: from calibre.gui2.dialogs.template_dialog.TemplateDialog import setWindowTitle [as 别名]
def edit_template(self):
t = TemplateDialog(self, self.template)
t.setWindowTitle(_("Edit template"))
if t.exec_():
self.t.setText(t.rule[1])
示例5: open_editor
# 需要导入模块: from calibre.gui2.dialogs.template_dialog import TemplateDialog [as 别名]
# 或者: from calibre.gui2.dialogs.template_dialog.TemplateDialog import setWindowTitle [as 别名]
def open_editor(self):
t = TemplateDialog(self, self.text(), mi=self.mi)
t.setWindowTitle(_('Edit template'))
if t.exec_():
self.setText(t.rule[1])
示例6: edit_cb_title_template
# 需要导入模块: from calibre.gui2.dialogs.template_dialog import TemplateDialog [as 别名]
# 或者: from calibre.gui2.dialogs.template_dialog.TemplateDialog import setWindowTitle [as 别名]
def edit_cb_title_template(self):
t = TemplateDialog(self, self.opt_cover_browser_title_template.text(), fm=self.gui.current_db.field_metadata)
t.setWindowTitle(_('Edit template for caption'))
if t.exec_():
self.opt_cover_browser_title_template.setText(t.rule[1])
示例7: do_open_editor
# 需要导入模块: from calibre.gui2.dialogs.template_dialog import TemplateDialog [as 别名]
# 或者: from calibre.gui2.dialogs.template_dialog.TemplateDialog import setWindowTitle [as 别名]
def do_open_editor(self):
t = TemplateDialog(self, self.opt_template.text(), fm=self.field_metadata)
t.setWindowTitle(_('Edit template'))
if t.exec_():
self.opt_template.set_value(t.rule[1])