summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2002-07-26 16:07:41 +0000
committerMatt Wilson <msw@redhat.com>2002-07-26 16:07:41 +0000
commitfe63ceb8aae9c68a379d5783bfb2b20eb87d08cb (patch)
treecbaae15c568665d7c4ed6c455124a730ba588060 /gui.py
parent115107abb1e48950db95f3b0f26784a4c56352e2 (diff)
downloadanaconda-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-xgui.py48
1 files changed, 29 insertions, 19 deletions
diff --git a/gui.py b/gui.py
index ce753b191..6224db300 100755
--- a/gui.py
+++ b/gui.py
@@ -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)