Created
April 10, 2017 20:33
-
-
Save anaselli/7a84baa6b7d53d733edcfee525feb904 to your computer and use it in GitHub Desktop.
Possible workaround to max recursion in progress bar set value and libyui gtk bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dnfdragora/progress_ui.py b/dnfdragora/progress_ui.py | |
index 3096142..9840862 100644 | |
--- a/dnfdragora/progress_ui.py | |
+++ b/dnfdragora/progress_ui.py | |
@@ -74,7 +74,10 @@ class ProgressBar: | |
def set_progress(self, frac, label=None) : | |
if label is not None: | |
self.progressbar.setLabel(label) | |
- self.progressbar.setValue(int(100*frac)) | |
+ val = self.progressbar.value() | |
+ newval = int(100*frac) | |
+ if (val != newval) : | |
+ self.progressbar.setValue(newval) | |
#self.__flush() | |
def reset_all(self) : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment