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 | |
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
-rwxr-xr-x | gui.py | 48 | ||||
-rw-r--r-- | iw/package_gui.py | 8 |
2 files changed, 33 insertions, 23 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) diff --git a/iw/package_gui.py b/iw/package_gui.py index 8e0b6b559..528d5830d 100644 --- a/iw/package_gui.py +++ b/iw/package_gui.py @@ -116,7 +116,7 @@ class IndividualPackageSelectionWindow (InstallWindow): SHOW_WATCH_MIN = 200 if len(packages) > SHOW_WATCH_MIN: cw = self.ics.getICW() - cw.busyIconPush() + cw.busyCursorPush() for header in packages: name = header[rpm.RPMTAG_NAME] @@ -137,7 +137,7 @@ class IndividualPackageSelectionWindow (InstallWindow): self.packageList.store.set_sort_column_id(self.sort_id, not self.sort_order) self.packageList.store.set_sort_column_id(self.sort_id, self.sort_order) if len(packages) > SHOW_WATCH_MIN: - cw.busyIconPop() + cw.busyCursorPop() def select_group(self, selection): (model, iter) = selection.get_selected() @@ -550,7 +550,7 @@ class PackageSelectionWindow (InstallWindow): if self.ignoreComponentToggleEvents: return - cw.busyIconPush() + cw.busyCursorPush() # turn on all the comps we selected if newstate: if ebutton: @@ -613,7 +613,7 @@ class PackageSelectionWindow (InstallWindow): # after all this we need to recompute total size self.setSize() - cw.busyIconPop() + cw.busyCursorPop() def pkgGroupMemberToggled(self, widget, data): (comp, sizeLabel, pkg) = data |