allow group selection from graphs window

This commit is contained in:
Damien Elmes 2011-03-30 21:33:27 +09:00
parent 78808b4541
commit 3155384a9a
3 changed files with 7 additions and 4 deletions

View file

@ -16,8 +16,8 @@ COLNEW = 5
GREY = "#777"
class GroupManager(QDialog):
def __init__(self, mw):
QDialog.__init__(self, mw)
def __init__(self, mw, parent=None):
QDialog.__init__(self, parent or mw)
self.mw = mw
self.form = aqt.forms.groupman.Ui_Dialog()
self.form.setupUi(self)

View file

@ -644,9 +644,9 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors")
def onOverview(self):
self.moveToState("overview")
def onGroups(self):
def onGroups(self, parent=None):
from aqt.groupman import GroupManager
g = GroupManager(self)
g = GroupManager(self, parent)
def onCardStats(self):
self.cardStats.show()

View file

@ -82,6 +82,7 @@ class DeckStats(QDialog):
c = self.connect
s = SIGNAL("clicked()")
c(f.groups, s, lambda: self.changeSel(True))
f.groups.setShortcut("g")
c(f.all, s, lambda: self.changeSel(False))
c(f.month, s, lambda: self.changePeriod(0))
c(f.year, s, lambda: self.changePeriod(1))
@ -115,6 +116,8 @@ class DeckStats(QDialog):
def changeSel(self, sel):
self.sel = sel
if sel:
self.mw.onGroups(self)
self.refresh()
def loadFin(self, b):