当前位置: 首页>>代码示例>>Python>>正文


Python tag_editor.TagEditor类代码示例

本文整理汇总了Python中calibre.gui2.dialogs.tag_editor.TagEditor的典型用法代码示例。如果您正苦于以下问题:Python TagEditor类的具体用法?Python TagEditor怎么用?Python TagEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TagEditor类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createEditor

 def createEditor(self, parent, option, index):
     if self.db and hasattr(self.db, self.items_func_name):
         m = index.model()
         col = m.column_map[index.column()]
         # If shifted, bring up the tag editor instead of the line editor.
         if check_key_modifier(Qt.ShiftModifier) and col != 'authors':
             key = col if m.is_custom_column(col) else None
             d = TagEditor(parent, self.db, m.id(index.row()), key=key)
             if d.exec_() == TagEditor.Accepted:
                 m.setData(index, self.sep.join(d.tags), Qt.EditRole)
             return None
         editor = EditWithComplete(parent)
         editor.set_separator(self.sep)
         editor.set_space_before_sep(self.space_before_sep)
         if self.sep == '&':
             editor.set_add_separator(tweaks['authors_completer_append_separator'])
         if not m.is_custom_column(col):
             all_items = getattr(self.db, self.items_func_name)()
         else:
             all_items = list(self.db.all_custom(
                 label=self.db.field_metadata.key_to_label(col)))
         editor.update_items_cache(all_items)
     else:
         editor = EnLineEdit(parent)
     return editor
开发者ID:AEliu,项目名称:calibre,代码行数:25,代码来源:delegates.py

示例2: tag_editor

 def tag_editor(self, *args):
     d = TagEditor(self, self.db, None)
     d.exec_()
     if d.result() == QDialog.Accepted:
         tag_string = ', '.join(d.tags)
         self.tags.setText(tag_string)
         self.tags.update_items_cache(self.db.all_tags())
         self.remove_tags.update_items_cache(self.db.all_tags())
开发者ID:Hainish,项目名称:calibre,代码行数:8,代码来源:metadata_bulk.py

示例3: edit

 def edit(self, widget):
     if widget.text():
         d = _save_dialog(self.parent, _('Values changed'),
                 _('You have entered values. In order to use this '
                    'editor you must first discard them. '
                    'Discard the values?'))
         if d == QMessageBox.Cancel or d == QMessageBox.No:
             return
         widget.setText('')
     d = TagEditor(self.parent, self.db, key=('#'+self.col_metadata['label']))
     if d.exec_() == TagEditor.Accepted:
         val = d.tags
         if not val:
             val = []
         widget.setText(self.col_metadata['multiple_seps']['list_to_ui'].join(val))
开发者ID:auspex,项目名称:calibre,代码行数:15,代码来源:custom_column_widgets.py

示例4: edit

 def edit(self):
     if (self.getter() != self.initial_val and (self.getter() or self.initial_val)):
         d = self._save_dialog(self.parent, _('Values changed'),
                 _('You have changed the values. In order to use this '
                    'editor, you must either discard or apply these '
                    'changes. Apply changes?'))
         if d == QMessageBox.Cancel:
             return
         if d == QMessageBox.Yes:
             self.commit(self.book_id)
             self.db.commit()
             self.initial_val = self.current_val
         else:
             self.setter(self.initial_val)
     d = TagEditor(self.parent, self.db, self.book_id, self.key)
     if d.exec_() == TagEditor.Accepted:
         self.setter(d.tags)
开发者ID:aimylios,项目名称:calibre,代码行数:17,代码来源:custom_column_widgets.py

示例5: edit_tags

 def edit_tags(self):
     from calibre.gui2.dialogs.tag_editor import TagEditor
     d = TagEditor(self, get_gui().current_db, current_tags=filter(None, [x.strip() for x in self.query.text().split(',')]))
     if d.exec_() == d.Accepted:
         self.query.setText(', '.join(d.tags))
开发者ID:Mymei2,项目名称:calibre,代码行数:5,代码来源:tag_mapper.py


注:本文中的calibre.gui2.dialogs.tag_editor.TagEditor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。