From 7a81015c7a6408fedfb2cbfb62f2c04c472e626c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 7 Sep 2011 03:13:15 +0900 Subject: [PATCH] hack groups back into working state, pending port to sidebar --- aqt/browser.py | 2 +- aqt/groups.py | 21 +++++++++++---------- aqt/overview.py | 9 ++------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/aqt/browser.py b/aqt/browser.py index 0e3e5065c..75a570157 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -670,7 +670,7 @@ class Browser(QMainWindow): "group", head+g[0])) item.setIcon(0, QIcon(":/icons/stock_group.png")) root.addChild(item) - fillGroups(item, g[5], g[0]+"::") + fillGroups(item, g[4], g[0]+"::") fillGroups(root, grps) def _systemTagTree(self, root): diff --git a/aqt/groups.py b/aqt/groups.py index 97c373bf6..b3e4bc6b0 100644 --- a/aqt/groups.py +++ b/aqt/groups.py @@ -167,18 +167,19 @@ class Groups(QDialog): if len(gids) == self.gidCount: # all enabled is same as empty gids = [] - if gids != self.mw.deck.conf['groups']: - self.mw.deck.conf['groups'] = gids - self.mw.reset() + # if gids != self.mw.deck.conf['groups']: + # self.mw.deck.conf['groups'] = gids + # self.mw.reset() QDialog.accept(self) def _makeItems(self, grps): self.gidCount = 0 on = {} - if not self.mw.deck.conf['groups']: + a = self.mw.deck.groups.active() + if not a: on = None else: - for gid in self.mw.deck.conf['groups']: + for gid in a: on[gid] = True grey = QBrush(QColor(GREY)) def makeItems(grp, head=""): @@ -196,17 +197,17 @@ class Groups(QDialog): branch.setText(COLNAME, grp[0]) if gid: branch.setText(COLOPTS, self.mw.deck.groups.name(gid)) - branch.setText(COLCOUNT, str(grp[2])) - branch.setText(COLDUE, str(grp[3])) - branch.setText(COLNEW, str(grp[4])) + branch.setText(COLCOUNT, "") + branch.setText(COLDUE, str(grp[2])) + branch.setText(COLNEW, str(grp[3])) for i in (COLCOUNT, COLDUE, COLNEW): branch.setTextAlignment(i, Qt.AlignRight) self.groupMap[grp[0]] = grp[1] self.fullNames[grp[0]] = head+grp[0] if grp[1]: self.gidCount += 1 - if grp[5]: - for c in grp[5]: + if grp[4]: + for c in grp[4]: branch.addChild(makeItems(c, head+grp[0]+"::")) return branch top = [makeItems(g) for g in grps] diff --git a/aqt/overview.py b/aqt/overview.py index 3c1f2aa59..02b5f34f8 100644 --- a/aqt/overview.py +++ b/aqt/overview.py @@ -60,14 +60,10 @@ class Overview(object): fc = self._ovForecast() tbl = self._overviewTable() but = self.mw.button - eta = self.mw.deck.sched.etaStr() - if eta: - eta = _("Estimated study time: %s") % eta self.web.stdHtml(self._overviewBody % dict( title=_("Overview"), table=tbl, fcsub=_("Reviews over next two weeks"), - eta=eta, fcdata=fc, ), css) @@ -77,7 +73,6 @@ class Overview(object):

%(table)s

-%(eta)s

%(fcsub)s

@@ -136,8 +131,8 @@ $(function () { def _ovCounts(self): # we have the limited count already - selcnt = self.mw.deck.sched.selCounts() - allcnt = self.mw.deck.sched.allCounts() + selcnt = [0,0,0] #self.mw.deck.sched.selCounts() + allcnt = [0,0,0] #self.mw.deck.sched.allCounts() return [ limitedCount(selcnt[1] + selcnt[2]), selcnt[0],