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:
|
class DialogManager:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
from aqt import addcards, browser, editcurrent
|
from aqt import addcards, browser, editcurrent, stats
|
||||||
self._dialogs = {
|
self._dialogs = {
|
||||||
"AddCards": [addcards.AddCards, None],
|
"AddCards": [addcards.AddCards, None],
|
||||||
"Browser": [browser.Browser, None],
|
"Browser": [browser.Browser, None],
|
||||||
"EditCurrent": [editcurrent.EditCurrent, None],
|
"EditCurrent": [editcurrent.EditCurrent, None],
|
||||||
|
"DeckStats": [stats.DeckStats, None]
|
||||||
}
|
}
|
||||||
|
|
||||||
def open(self, name, *args):
|
def open(self, name, *args):
|
||||||
|
@ -734,7 +734,7 @@ title="%s" %s>%s</button>''' % (
|
|||||||
deck = self._selectedDeck()
|
deck = self._selectedDeck()
|
||||||
if not deck:
|
if not deck:
|
||||||
return
|
return
|
||||||
aqt.stats.DeckStats(self)
|
aqt.dialogs.open("DeckStats", self)
|
||||||
|
|
||||||
def onPrefs(self):
|
def onPrefs(self):
|
||||||
import aqt.preferences
|
import aqt.preferences
|
||||||
|
@ -42,8 +42,12 @@ class DeckStats(QDialog):
|
|||||||
self.show()
|
self.show()
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
|
|
||||||
|
def canClose(self):
|
||||||
|
return True
|
||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
saveGeom(self, self.name)
|
saveGeom(self, self.name)
|
||||||
|
aqt.dialogs.close("DeckStats")
|
||||||
QDialog.reject(self)
|
QDialog.reject(self)
|
||||||
|
|
||||||
def _imagePath(self):
|
def _imagePath(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user