drop the deck count warning

This commit is contained in:
Damien Elmes 2020-03-14 19:41:15 +10:00
parent 2ed7e3d1cd
commit 522ee8fca7

View File

@ -20,7 +20,6 @@ from aqt.toolbar import BottomBar
from aqt.utils import ( from aqt.utils import (
askUser, askUser,
getOnlyText, getOnlyText,
openHelp,
openLink, openLink,
shortcut, shortcut,
showWarning, showWarning,
@ -41,12 +40,10 @@ class DeckBrowserContent:
Attributes: Attributes:
tree {str} -- HTML of the deck tree section tree {str} -- HTML of the deck tree section
stats {str} -- HTML of the stats section stats {str} -- HTML of the stats section
countwarn {str} -- HTML of the deck count warning section
""" """
tree: str tree: str
stats: str stats: str
countwarn: str
class DeckBrowser: class DeckBrowser:
@ -84,11 +81,6 @@ class DeckBrowser:
self._onShared() self._onShared()
elif cmd == "import": elif cmd == "import":
self.mw.onImport() self.mw.onImport()
elif cmd == "lots":
openHelp("using-decks-appropriately")
elif cmd == "hidelots":
self.mw.pm.profile["hideDeckLotsMsg"] = True
self.refresh()
elif cmd == "create": elif cmd == "create":
deck = getOnlyText(_("Name for deck:")) deck = getOnlyText(_("Name for deck:"))
if deck: if deck:
@ -116,7 +108,6 @@ class DeckBrowser:
<br> <br>
%(stats)s %(stats)s
%(countwarn)s
</center> </center>
""" """
@ -130,9 +121,7 @@ class DeckBrowser:
def __renderPage(self, offset): def __renderPage(self, offset):
content = DeckBrowserContent( content = DeckBrowserContent(
tree=self._renderDeckTree(self._dueTree), tree=self._renderDeckTree(self._dueTree), stats=self._renderStats(),
stats=self._renderStats(),
countwarn=self._countWarn(),
) )
gui_hooks.deck_browser_will_render_content(self, content) gui_hooks.deck_browser_will_render_content(self, content)
self.web.stdHtml( self.web.stdHtml(
@ -161,22 +150,6 @@ where id > ?""",
buf = self.mw.col.backend.studied_today(cards, float(thetime)) buf = self.mw.col.backend.studied_today(cards, float(thetime))
return buf return buf
def _countWarn(self):
if self.mw.col.decks.count() < 25 or self.mw.pm.profile.get("hideDeckLotsMsg"):
return ""
return "<br><div style='width:50%;border: 1px solid #000;padding:5px;'>" + (
_("You have a lot of decks. Please see %(a)s. %(b)s")
% dict(
a=(
"<a href=# onclick=\"return pycmd('lots')\">%s</a>" % _("this page")
),
b=(
"<br><small><a href=# onclick='return pycmd(\"hidelots\")'>("
"%s)</a></small>" % (_("hide")) + "</div>"
),
)
)
def _renderDeckTree(self, nodes, depth=0): def _renderDeckTree(self, nodes, depth=0):
if not nodes: if not nodes:
return "" return ""