From 00e0fb6c233ca70670e40cbe81af33edf25a82ab Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 16 Jan 2009 20:40:34 +0900 Subject: [PATCH] graph progress --- ankiqt/ui/graphs.py | 8 +++++++- ankiqt/ui/utils.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/graphs.py b/ankiqt/ui/graphs.py index da78dacc9..0c1586597 100644 --- a/ankiqt/ui/graphs.py +++ b/ankiqt/ui/graphs.py @@ -210,9 +210,12 @@ def intervalGraph(parent, deck): hbox = QHBoxLayout() def showHideAll(): + deck.startProgress(_("Graphs"), 0, len(widgets)) for w in widgets: + deck.updateProgress(_("Preparing...")) w.showHide() frame.adjustSize() + deck.finishProgress() def onShowHideToggle(b, w): key = 'graphs.shown.' + w.name @@ -247,9 +250,12 @@ def intervalGraph(parent, deck): QDesktopServices.openUrl(QUrl(ankiqt.appWiki + "Graphs")) def onRefresh(): + deck.startProgress(_("Graphs"), 0, len(widgets)) dg.stats = None for w in widgets: - w.scheduleUpdate() + deck.updateProgress(_("Preparing...")) + w.updateFigure() + deck.finishProgress() showhide = QPushButton(_("Show/Hide")) hbox.addWidget(showhide) diff --git a/ankiqt/ui/utils.py b/ankiqt/ui/utils.py index bf09c56c7..2d58f1e59 100644 --- a/ankiqt/ui/utils.py +++ b/ankiqt/ui/utils.py @@ -205,7 +205,7 @@ class ProgressWin(object): def update(self, label=None, value=None): self.app.processEvents() - #print self.min, self.counter, self.max, label, time.time() - self.lastTime + print self.min, self.counter, self.max, label, time.time() - self.lastTime self.lastTime = time.time() if label: self.diag.setLabelText(label)