hack groups back into working state, pending port to sidebar

This commit is contained in:
Damien Elmes 2011-09-07 03:13:15 +09:00
parent 24cabc0ce7
commit 7a81015c7a
3 changed files with 14 additions and 18 deletions

View file

@ -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):

View file

@ -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]

View file

@ -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):
<p>
%(table)s
<p>
%(eta)s<br>
<div id="placeholder" style="width:350px; height:100px;"></div>
<span class=sub>%(fcsub)s</span>
<p>
@ -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],