summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-12-09 21:23:28 +0000
committerMike Fulbright <msf@redhat.com>2002-12-09 21:23:28 +0000
commit4030a7518402cf4418c892c707cbf9364207f972 (patch)
tree09a1c137c7356d5c0f6fd1fbf0b75f4c3c5ea316
parent64c512cfdd03ce233eab9a71472f54151110c492 (diff)
downloadanaconda-4030a7518402cf4418c892c707cbf9364207f972.tar.gz
anaconda-4030a7518402cf4418c892c707cbf9364207f972.tar.xz
anaconda-4030a7518402cf4418c892c707cbf9364207f972.zip
fixes problem with busy cursor sticking around when message dialog comes up for user input (think upgrade version nag screen)
-rwxr-xr-xgui.py35
1 files changed, 27 insertions, 8 deletions
diff --git a/gui.py b/gui.py
index 87d6a807f..c4d5ce93e 100755
--- a/gui.py
+++ b/gui.py
@@ -169,23 +169,34 @@ def growToParent(widget, rect, growTo=None):
_busyCursor = 0
+def setCursorToBusy(process=1):
+ root = gtk.gdk.get_default_root_window()
+ cursor = gtk.gdk.Cursor(gtk.gdk.WATCH)
+ root.set_cursor(cursor)
+ if process:
+ processEvents()
+
+def setCursorToNormal():
+ root = gtk.gdk.get_default_root_window()
+ cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)
+ root.set_cursor(cursor)
+
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()
+ setCursorToBusy(process)
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)
+ setCursorToNormal()
+
+def getBusyCursorStatus():
+ global _busyCursor
+
+ return _busyCursor
class MnemonicLabel(gtk.Label):
def __init__(self, text=""):
@@ -446,6 +457,10 @@ class MessageWindow:
dialog.set_position (gtk.WIN_POS_CENTER)
dialog.set_default_response(defaultchoice)
dialog.show_all ()
+
+ # XXX - Messy - turn off busy cursor if necessary
+ busycursor = getBusyCursorStatus()
+ setCursorToNormal()
rc = dialog.run()
if rc == gtk.RESPONSE_OK or rc == gtk.RESPONSE_YES:
@@ -458,6 +473,10 @@ class MessageWindow:
else:
self.rc = rc
dialog.destroy()
+
+ # restore busy cursor
+ if busycursor:
+ setCursorToBusy()
class InstallInterface:
def __init__ (self):