mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Better fix for split book list action
This commit is contained in:
parent
934cb71e16
commit
26848c0c99
@ -487,12 +487,16 @@ class BooksView(QTableView): # {{{
|
||||
name = unicode(self.model().headerData(idx, Qt.Horizontal, Qt.DisplayRole) or '')
|
||||
view.column_header_context_menu = self.create_context_menu(col, name, view)
|
||||
has_context_menu = hasattr(view, 'column_header_context_menu')
|
||||
if self.is_library_view and has_context_menu and not hasattr(view.column_header_context_menu, 'added_split_book_list_entry'):
|
||||
if self.is_library_view and has_context_menu:
|
||||
view.column_header_context_menu.addSeparator()
|
||||
view.column_header_context_menu.added_split_book_list_entry = True
|
||||
view.column_header_context_menu.addAction(
|
||||
_('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'))
|
||||
if not hasattr(view.column_header_context_menu, 'bl_split_action'):
|
||||
view.column_header_context_menu.bl_split_action = view.column_header_context_menu.addAction(
|
||||
'xxx', partial(self.column_header_context_handler, action='split', column='title'))
|
||||
ac = view.column_header_context_menu.bl_split_action
|
||||
if self.pin_view.isVisible():
|
||||
ac.setText(_('Un-split the book list'))
|
||||
else:
|
||||
ac.setText(_('Split the book list'))
|
||||
if has_context_menu:
|
||||
view.column_header_context_menu.popup(view.column_header.mapToGlobal(pos))
|
||||
# }}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user