[PATCH] Set the busy spinning cursor while the UI is loading.
Chris Lumens
clumens at redhat.com
Mon Sep 10 14:21:27 UTC 2012
---
pyanaconda/ui/gui/__init__.py | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 787f40c..9e73413 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -21,6 +21,8 @@
import importlib, inspect, os, sys, time
import meh.ui.gui
+from gi.repository import Gdk
+
from pyanaconda.ui import UserInterface, common
from pyanaconda.ui.gui.utils import enlightbox
@@ -30,7 +32,7 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
import logging
log = logging.getLogger("anaconda")
-__all__ = ["GraphicalUserInterface", "UIObject"]
+__all__ = ["GraphicalUserInterface", "UIObject", "busyCursor", "unbusyCursor"]
_screenshotIndex = 0
@@ -55,6 +57,8 @@ class GraphicalUserInterface(UserInterface):
from hubs.progress import ProgressHub
from spokes import StandaloneSpoke
+ busyCursor()
+
self._hubs.extend([SummaryHub, ProgressHub])
# First, grab a list of all the standalone spokes.
@@ -82,6 +86,8 @@ class GraphicalUserInterface(UserInterface):
def run(self):
from gi.repository import Gtk
+ unbusyCursor()
+
if Gtk.main_level() > 0:
# Gtk main loop running. That means python-meh caught exception
# and runs its main loop. Do not crash Gtk by running another one
@@ -387,3 +393,11 @@ class QuitDialog(GUIObject):
def run(self):
rc = self.window.run()
return rc
+
+def busyCursor():
+ window = Gdk.get_default_root_window()
+ window.set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
+
+def unbusyCursor():
+ window = Gdk.get_default_root_window()
+ window.set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW))
--
1.7.11.2
More information about the anaconda-patches
mailing list