mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
make sure the user can't disable all columns
This commit is contained in:
parent
8e00f86234
commit
c4bef937a1
1 changed files with 2 additions and 0 deletions
|
@ -568,6 +568,8 @@ class Browser(QMainWindow):
|
||||||
def toggleField(self, type):
|
def toggleField(self, type):
|
||||||
self.model.beginReset()
|
self.model.beginReset()
|
||||||
if type in self.model.activeCols:
|
if type in self.model.activeCols:
|
||||||
|
if len(self.model.activeCols) < 2:
|
||||||
|
return showInfo(_("You must have at least one column."))
|
||||||
self.model.activeCols.remove(type)
|
self.model.activeCols.remove(type)
|
||||||
else:
|
else:
|
||||||
self.model.activeCols.append(type)
|
self.model.activeCols.append(type)
|
||||||
|
|
Loading…
Reference in a new issue