def __init__(self, vertical, parent=None): HTMLDisplay.__init__(self, parent) self.vertical = vertical self.anchor_clicked.connect(self.link_activated) for x, icon in [ ('remove_format', 'trash.png'), ('save_format', 'save.png'), ('restore_format', 'edit-undo.png'), ('copy_link','edit-copy.png'), ('compare_format', 'diff.png'), ('set_cover_format', 'default_cover.png'), ('find_in_tag_browser', 'search.png') ]: ac = QAction(QIcon(I(icon)), '', self) ac.current_fmt = None ac.current_url = None ac.triggered.connect(getattr(self, '%s_triggerred'%x)) setattr(self, '%s_action'%x, ac) self.manage_action = QAction(self) self.manage_action.current_fmt = self.manage_action.current_url = None self.manage_action.triggered.connect(self.manage_action_triggered) self.edit_identifiers_action = QAction(QIcon(I('identifiers.png')), _('Edit identifiers for this book'), self) self.edit_identifiers_action.triggered.connect(self.edit_identifiers) self.remove_item_action = ac = QAction(QIcon(I('minus.png')), '...', self) ac.data = (None, None, None) ac.triggered.connect(self.remove_item_triggered) self.copy_identifiers_url_action = ac = QAction(QIcon(I('edit-copy.png')), _('Identifier &URL'), self) ac.triggered.connect(self.copy_id_url_triggerred) ac.current_url = ac.current_fmt = None self.setFocusPolicy(Qt.FocusPolicy.NoFocus) self.setDefaultStyleSheet(css())
def __init__(self, parent=None): HTMLDisplay.__init__(self, parent) self.setAcceptDrops(False) self.wait_timer = QTimer(self) self.wait_timer.timeout.connect(self.update_wait) self.wait_timer.setInterval(800) self.dots_count = 0 self.anchor_clicked.connect(self.link_activated)
def __init__(self, book_info, parent=None): HTMLDisplay.__init__(self, parent) self.book_info = book_info self.setDefaultStyleSheet(css())
def mouseDoubleClickEvent(self, ev): v = self.viewport() if v.rect().contains(self.mapFromGlobal(ev.globalPos())): ev.ignore() else: return HTMLDisplay.mouseDoubleClickEvent(self, ev)
def __init__(self, book_info, parent=None): HTMLDisplay.__init__(self, parent) self.book_info = book_info self.document().setDefaultStyleSheet(themed_css())
def __init__(self, book_info, parent=None): HTMLDisplay.__init__(self, parent) self.book_info = book_info self.edit_metadata = getattr(parent, 'edit_metadata', None) self.setDefaultStyleSheet(css())