ensure only one copy of stats shown, and close with collection
This commit is contained in:
parent
34dcf64d76
commit
aeaf9df32f
@ -44,11 +44,12 @@ from anki.utils import checksum
|
||||
class DialogManager:
|
||||
|
||||
def __init__(self):
|
||||
from aqt import addcards, browser, editcurrent
|
||||
from aqt import addcards, browser, editcurrent, stats
|
||||
self._dialogs = {
|
||||
"AddCards": [addcards.AddCards, None],
|
||||
"Browser": [browser.Browser, None],
|
||||
"EditCurrent": [editcurrent.EditCurrent, None],
|
||||
"DeckStats": [stats.DeckStats, None]
|
||||
}
|
||||
|
||||
def open(self, name, *args):
|
||||
|
@ -734,7 +734,7 @@ title="%s" %s>%s</button>''' % (
|
||||
deck = self._selectedDeck()
|
||||
if not deck:
|
||||
return
|
||||
aqt.stats.DeckStats(self)
|
||||
aqt.dialogs.open("DeckStats", self)
|
||||
|
||||
def onPrefs(self):
|
||||
import aqt.preferences
|
||||
|
@ -42,8 +42,12 @@ class DeckStats(QDialog):
|
||||
self.show()
|
||||
self.activateWindow()
|
||||
|
||||
def canClose(self):
|
||||
return True
|
||||
|
||||
def reject(self):
|
||||
saveGeom(self, self.name)
|
||||
aqt.dialogs.close("DeckStats")
|
||||
QDialog.reject(self)
|
||||
|
||||
def _imagePath(self):
|
||||
|
Loading…
Reference in New Issue
Block a user