summaryrefslogtreecommitdiffstats
path: root/text.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-11-28 12:31:53 -0500
committerJeremy Katz <katzj@redhat.com>2007-11-29 16:12:01 -0500
commit506e264879a586c2ec390ae489c900fa5b1cedba (patch)
tree31b3bea62554096d06230eb4c9a9fa9e2dd384be /text.py
parentea50419b73c5c95fd5609b2432d7fdfaace67243 (diff)
downloadanaconda-506e264879a586c2ec390ae489c900fa5b1cedba.tar.gz
anaconda-506e264879a586c2ec390ae489c900fa5b1cedba.tar.xz
anaconda-506e264879a586c2ec390ae489c900fa5b1cedba.zip
add pulsing progress bars for gui. noop (no progress bar) for text
Diffstat (limited to 'text.py')
-rw-r--r--text.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/text.py b/text.py
index dc3c01f77..b42517eef 100644
--- a/text.py
+++ b/text.py
@@ -115,6 +115,9 @@ class ProgressWindow:
del self.scale
self.scale = None
+ def pulse(self):
+ pass
+
def set(self, amount):
self.scale.set(int(float(amount) * self.multiplier))
self.screen.refresh()
@@ -122,7 +125,7 @@ class ProgressWindow:
def refresh(self):
pass
- def __init__(self, screen, title, text, total, updpct = 0.05):
+ def __init__(self, screen, title, text, total, updpct = 0.05, pulse = False):
self.multiplier = 1
if total == 1.0:
self.multiplier = 100
@@ -136,7 +139,8 @@ class ProgressWindow:
g.add(t, 0, 0, (0, 0, 0, 1), anchorLeft=1)
self.scale = Scale(int(width), int(float(total) * self.multiplier))
- g.add(self.scale, 0, 1)
+ if not pulse:
+ g.add(self.scale, 0, 1)
g.draw()
self.screen.refresh()
@@ -351,8 +355,8 @@ class InstallInterface:
pdb.post_mortem(tb)
os._exit(1)
- def progressWindow(self, title, text, total, updpct = 0.05):
- return ProgressWindow(self.screen, title, text, total, updpct)
+ def progressWindow(self, title, text, total, updpct = 0.05, pulse = False):
+ return ProgressWindow(self.screen, title, text, total, updpct, pulse)
def messageWindow(self, title, text, type="ok", default = None,
custom_icon=None, custom_buttons=[]):