From c5906fa0b9eab4d4519d80660ed5794266eb7340 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 29 Apr 2015 07:03:56 +0530 Subject: [PATCH] Do not allow user to hide all columns in book list via the context menu --- src/calibre/gui2/library/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index f415db0834..f88dfc5346 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -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)