diff options
author | Matt Wilson <msw@redhat.com> | 2001-03-30 20:15:28 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2001-03-30 20:15:28 +0000 |
commit | b04cd17f0ed74576704f87f53ff523718f23f773 (patch) | |
tree | e6fa8f025474cee67da45e4a6da8c84767f41966 /gui.py | |
parent | 2880aa81df761485e3f5b956fdb35fc4b7a17a5a (diff) | |
download | anaconda-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-x | gui.py | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -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): |