mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
add load_ts_page() & avoid duplicate call
This commit is contained in:
parent
dcb6bf2cd4
commit
fd854630ff
3 changed files with 16 additions and 20 deletions
|
@ -127,10 +127,8 @@ class Overview:
|
|||
self.mw.reset()
|
||||
return
|
||||
|
||||
sibs = self.mw.col.sched.haveBuriedSiblings()
|
||||
man = self.mw.col.sched.haveManuallyBuried()
|
||||
|
||||
if sibs and man:
|
||||
info = self.mw.col.sched.congratulations_info()
|
||||
if info.have_sched_buried and info.have_user_buried:
|
||||
opts = [
|
||||
_("Manually Buried Cards"),
|
||||
_("Buried Siblings"),
|
||||
|
@ -184,14 +182,7 @@ class Overview:
|
|||
)
|
||||
|
||||
def _show_finished_screen(self):
|
||||
self.web.set_open_links_externally(False)
|
||||
if theme_manager.night_mode:
|
||||
extra = "#night"
|
||||
else:
|
||||
extra = ""
|
||||
self.web.hide_while_preserving_layout()
|
||||
self.web.load(QUrl(f"{self.mw.serverURL()}_anki/congrats.html" + extra))
|
||||
self.web.inject_dynamic_style_and_show()
|
||||
self.web.load_ts_page("congrats")
|
||||
|
||||
def _desc(self, deck):
|
||||
if deck["dyn"]:
|
||||
|
|
|
@ -86,14 +86,7 @@ class NewDeckStats(QDialog):
|
|||
pass
|
||||
|
||||
def refresh(self):
|
||||
self.form.web.set_open_links_externally(False)
|
||||
if theme_manager.night_mode:
|
||||
extra = "#night"
|
||||
else:
|
||||
extra = ""
|
||||
self.form.web.hide_while_preserving_layout()
|
||||
self.form.web.load(QUrl(f"{self.mw.serverURL()}_anki/graphs.html" + extra))
|
||||
self.form.web.inject_dynamic_style_and_show()
|
||||
self.form.web.load_ts_page("graphs")
|
||||
|
||||
|
||||
class DeckStats(QDialog):
|
||||
|
|
|
@ -606,3 +606,15 @@ document.head.appendChild(style);
|
|||
""",
|
||||
lambda arg: self.show(),
|
||||
)
|
||||
|
||||
def load_ts_page(self, name: str) -> None:
|
||||
from aqt import mw
|
||||
|
||||
self.set_open_links_externally(False)
|
||||
if theme_manager.night_mode:
|
||||
extra = "#night"
|
||||
else:
|
||||
extra = ""
|
||||
self.hide_while_preserving_layout()
|
||||
self.load(QUrl(f"{mw.serverURL()}_anki/{name}.html" + extra))
|
||||
self.inject_dynamic_style_and_show()
|
||||
|
|
Loading…
Reference in a new issue