no permanent widgets, fix timer being shown at wrong time

This commit is contained in:
Damien Elmes 2009-02-15 21:07:50 +09:00
parent 43f60b92c8
commit 67fc768196

View file

@ -47,7 +47,6 @@ class StatusView(object):
self.state = state
if self.state == "initial":
self.showDeckStatus()
self.updateProgressGoal()
elif self.state == "noDeck":
self.hideDeckStatus()
elif self.state in ("showQuestion",
@ -71,7 +70,7 @@ class StatusView(object):
progressBarSize = (50, 8)
# small spacer
self.initialSpace = QWidget()
self.addWidget(self.initialSpace, 0)
self.addWidget(self.initialSpace, 1)
# remaining & eta
self.remText = QLabel()
self.addWidget(self.remText, 0)
@ -105,20 +104,14 @@ class StatusView(object):
self.addWidget(self.vertSep(), 0)
self.timer = QClickableLabel()
self.timer.setText("00:00")
# if sys.platform.startswith("darwin"):
# self.timer.setFixedWidth(40)
# else:
# self.timer.setFixedWidth(33)
self.addWidget(self.timer)
self.plastiqueStyle = QStyleFactory.create("plastique")
self.progressBar.setStyle(self.plastiqueStyle)
self.retentionBar.setStyle(self.plastiqueStyle)
self.redraw()
self.timer.setShown(self.main.config['showTimer'])
def addWidget(self, w, stretch=0, perm=True):
if perm:
self.statusbar.addPermanentWidget(w, stretch)
else:
def addWidget(self, w, stretch=0):
self.statusbar.addWidget(w, stretch)
self.shown.append(w)
@ -132,11 +125,6 @@ class StatusView(object):
"Remove the ugly borders QT places on status bar widgets."
self.statusbar.setStyleSheet("::item { border: 0; }")
def updateProgressGoal(self):
return
stats = self.main.deck.sched.getStats()
self.totalPending = stats['pending']
# Updating
##########################################################################
@ -214,7 +202,6 @@ Total correct: %(gYesTotal%)0.1f%%
(%(gYesTotal)d of %(gTotal)d)""") % stats
self.combinedBar.setToolTip(tip)
if self.main.config['showTimer']:
self.timer.setVisible(True)
self.drawTimer()
self.timer.setToolTip(_("""
<h1>Time</h1>
@ -223,8 +210,6 @@ This time is used to calculate the ETA, but not used<br>
for scheduling.<br><br>
You should aim to answer each question within<br>
10 seconds. Click the timer to learn more."""))
else:
self.timer.setVisible(False)
def setProgressColour(self, palette, perc):
if perc == 0: