summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-03-30 20:15:28 +0000
committerMatt Wilson <msw@redhat.com>2001-03-30 20:15:28 +0000
commitb04cd17f0ed74576704f87f53ff523718f23f773 (patch)
treee6fa8f025474cee67da45e4a6da8c84767f41966 /gui.py
parent2880aa81df761485e3f5b956fdb35fc4b7a17a5a (diff)
downloadanaconda-b04cd17f0ed74576704f87f53ff523718f23f773.tar.gz
anaconda-b04cd17f0ed74576704f87f53ff523718f23f773.tar.xz
anaconda-b04cd17f0ed74576704f87f53ff523718f23f773.zip
update progress window when in a mainloop context (#33470, #33968)
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/gui.py b/gui.py
index 9aee7e408..aba5d4b41 100755
--- a/gui.py
+++ b/gui.py
@@ -87,6 +87,15 @@ import sys
import rpm
from threading import *
+def processEvents():
+ thread = currentThread ()
+ if thread.getName () == "gtk_main":
+ gdk_flush()
+ while events_pending ():
+ mainiteration (FALSE)
+ else:
+ gdk_flush()
+
class WaitWindow:
def __init__(self, title, text):
threads_enter ()
@@ -105,13 +114,7 @@ class WaitWindow:
frame.add (box)
self.window.add (frame)
self.window.show_all ()
- thread = currentThread ()
- if thread.getName () == "gtk_main":
- gdk_flush()
- while events_pending ():
- mainiteration (FALSE)
- else:
- gdk_flush()
+ processEvents ()
threads_leave ()
def pop(self):
@@ -143,11 +146,13 @@ class ProgressWindow:
frame.add (box)
self.window.add (frame)
self.window.show_all ()
+ processEvents ()
threads_leave ()
def set (self, amount):
threads_enter ()
self.progress.update (float (amount) / self.total)
+ processEvents ()
threads_leave ()
def pop(self):