mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1797684 [Multiple "Split the book list" entries](https://bugs.launchpad.net/calibre/+bug/1797684)
This commit is contained in:
parent
542c35a6cf
commit
934cb71e16
@ -487,8 +487,9 @@ class BooksView(QTableView): # {{{
|
|||||||
name = unicode(self.model().headerData(idx, Qt.Horizontal, Qt.DisplayRole) or '')
|
name = unicode(self.model().headerData(idx, Qt.Horizontal, Qt.DisplayRole) or '')
|
||||||
view.column_header_context_menu = self.create_context_menu(col, name, view)
|
view.column_header_context_menu = self.create_context_menu(col, name, view)
|
||||||
has_context_menu = hasattr(view, 'column_header_context_menu')
|
has_context_menu = hasattr(view, 'column_header_context_menu')
|
||||||
if self.is_library_view and has_context_menu:
|
if self.is_library_view and has_context_menu and not hasattr(view.column_header_context_menu, 'added_split_book_list_entry'):
|
||||||
view.column_header_context_menu.addSeparator()
|
view.column_header_context_menu.addSeparator()
|
||||||
|
view.column_header_context_menu.added_split_book_list_entry = True
|
||||||
view.column_header_context_menu.addAction(
|
view.column_header_context_menu.addAction(
|
||||||
_('Un-split the book list') if self.pin_view.isVisible() else _('Split the book list'),
|
_('Un-split the book list') if self.pin_view.isVisible() else _('Split the book list'),
|
||||||
partial(self.column_header_context_handler, action='split', column=col or 'title'))
|
partial(self.column_header_context_handler, action='split', column=col or 'title'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user