diff options
author | Matt Wilson <msw@redhat.com> | 2002-07-26 16:07:41 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2002-07-26 16:07:41 +0000 |
commit | fe63ceb8aae9c68a379d5783bfb2b20eb87d08cb (patch) | |
tree | cbaae15c568665d7c4ed6c455124a730ba588060 /gui.py | |
parent | 115107abb1e48950db95f3b0f26784a4c56352e2 (diff) | |
download | anaconda-fe63ceb8aae9c68a379d5783bfb2b20eb87d08cb.tar.gz anaconda-fe63ceb8aae9c68a379d5783bfb2b20eb87d08cb.tar.xz anaconda-fe63ceb8aae9c68a379d5783bfb2b20eb87d08cb.zip |
make it a cursor, not an icon. automatically switch to wait cursor on wait windows and progress windows
Diffstat (limited to 'gui.py')
-rwxr-xr-x | gui.py | 48 |
1 files changed, 29 insertions, 19 deletions
@@ -166,6 +166,26 @@ def growToParent(widget, rect, growTo=None): else: widget.ignoreEvents = 0 +_busyCursor = 0 + +def rootPushBusyCursor(process=1): + global _busyCursor + _busyCursor += 1 + if _busyCursor > 0: + root = gtk.gdk.get_default_root_window() + cursor = gtk.gdk.Cursor(gtk.gdk.WATCH) + root.set_cursor(cursor) + if process: + processEvents() + +def rootPopBusyCursor(): + global _busyCursor + _busyCursor -= 1 + if _busyCursor <= 0: + root = gtk.gdk.get_default_root_window() + cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR) + root.set_cursor(cursor) + class MnemonicLabel(gtk.Label): def __init__(self, text=""): gtk.Label.__init__(self, "") @@ -268,10 +288,11 @@ class WaitWindow: frame.add (box) self.window.add(frame) self.window.show_all() - processEvents() + rootPushBusyCursor() def pop(self): self.window.destroy() + rootPopBusyCursor() class ProgressWindow: def __init__(self, title, text, total): @@ -295,7 +316,7 @@ class ProgressWindow: frame.add (box) self.window.add (frame) self.window.show_all () - processEvents () + rootPushBusyCursor() def set (self, amount): self.progress.set_fraction (float (amount) / self.total) @@ -303,6 +324,7 @@ class ProgressWindow: def pop(self): self.window.destroy () + rootPopBusyCursor() class ExceptionWindow: def __init__ (self, text): @@ -857,8 +879,6 @@ class InstallControlWindow: nextButton.grab_focus () def __init__ (self, ii, dispatch, locale): - self.busyIcon = 0 - self.prevButtonStock = None self.nextButtonStock = None self.releaseButton = None @@ -1071,22 +1091,12 @@ class InstallControlWindow: splashScreenPop() - def busyIconPush(self): - self.busyIcon += 1 - if self.busyIcon > 0: - root = gtk.gdk.get_default_root_window() - cursor = gtk.gdk.Cursor(gtk.gdk.WATCH) - root.set_cursor(cursor) - processEvents() + def busyCursorPush(self): + rootPushBusyCursor() + + def busyCursorPop(self): + rootPopBusyCursor() - def busyIconPop(self): - self.busyIcon -= 1 - if self.busyIcon <= 0: - root = gtk.gdk.get_default_root_window() - cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR) - root.set_cursor(cursor) - processEvents() - def run (self, runres, configFileData): self.configFileData = configFileData self.setup_window(runres) |