From 6c48698478d4a4ea877f86370482cf84c4dd3b50 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Wed, 10 Feb 2021 15:34:45 +0100 Subject: Prepare progress bar slots --- gui.py | 21 +++++++++++++++++++++ muddle.ui | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index f58bf23..c4b5961 100644 --- a/gui.py +++ b/gui.py @@ -354,6 +354,12 @@ class MuddleWindow(QMainWindow): selectPathBtn = self.findChild(QPushButton, "selectPathBtn") selectPathBtn.clicked.connect(self.onSelectPathBtnClicked) + ## progressbar + self.progressBar = self.findChild(QProgressBar, "downloadProgressBar") + + # self.moodleTreeModel.worker.loaded + # self.moodleTreeModel.worker.loadedItem.connect(lambda t, item:) + # local filesystem tab self.downloadPath = QDir.homePath() @@ -371,6 +377,21 @@ class MuddleWindow(QMainWindow): self.show() + @pyqtSlot(int) + def setProgressBarTasks(self, nrTasks): + self.progressBar.setMinimum(0) + self.progressBar.setMaximum(tasks) + self.progressBar.reset() + + @pyqtSlot() + def advanceProgressBar(self): + currentValue = self.progressBar.value() + self.progressBar.setValue(currentValue + 1); + + @pyqtSlot(int) + def setProgressBarValue(self, value): + self.progressBar.setValue(value) + @pyqtSlot() def onRequestTokenBtnClicked(self): # TODO: open login dialog diff --git a/muddle.ui b/muddle.ui index e574f46..f849116 100644 --- a/muddle.ui +++ b/muddle.ui @@ -73,10 +73,10 @@ - false + true - 24 + 0 -- cgit v1.2.1