From a0dd6438c5f1a94eb45f8099ea2a70faec836cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alin=20Tr=C4=83istaru?= Date: Mon, 24 Apr 2017 20:18:10 +0300 Subject: [PATCH] greatly reduce CPU usage --- scripts/mbusb_gui.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/mbusb_gui.py b/scripts/mbusb_gui.py index 96c565d..6e76ffd 100644 --- a/scripts/mbusb_gui.py +++ b/scripts/mbusb_gui.py @@ -686,6 +686,7 @@ class GuiInstallProgress(QtCore.QThread): if not self.thread.isFinished() and config.percentage == 100: config.status_text = "Status: Please wait..." self.status.emit("Status: Please wait...") + time.sleep(0.1) self.update.emit(100) self.update.emit(0) @@ -718,11 +719,14 @@ class GuiUninstallProgress(QtCore.QThread): def run(self): self.thread.start() + while self.thread.isRunning(): self.update.emit(config.percentage) self.status.emit(config.status_text) if not self.thread.isFinished() and config.percentage == 100: config.status_text = "Please wait..." + time.sleep(0.1) + self.update.emit(100) self.update.emit(0) config.percentage = 0 @@ -764,6 +768,7 @@ class DD_Progress(QtCore.QThread): if not self.thread.isFinished() and config.percentage == 100: config.imager_status_text = "" self.status.emit("Please wait...") + time.sleep(0.1) self.update.emit(100) self.update.emit(0)