Do not allow user to hide all columns in book list via the context menu

This commit is contained in:
Kovid Goyal 2015-04-29 07:03:56 +05:30
parent fd9ff327c7
commit c5906fa0b9

View File

@ -260,6 +260,9 @@ class BooksView(QTableView): # {{{
h = self.column_header
if action == 'hide':
if h.hiddenSectionCount() >= h.count():
return error_dialog(self, _('Cannot hide all columns'), _(
'You must not hide all columns'), show=True)
h.setSectionHidden(idx, True)
elif action == 'show':
h.setSectionHidden(idx, False)