diff options
-rw-r--r-- | cmdline.py | 9 | ||||
-rwxr-xr-x | gui.py | 14 | ||||
-rw-r--r-- | text.py | 12 |
3 files changed, 24 insertions, 11 deletions
diff --git a/cmdline.py b/cmdline.py index c343eb91b..972ce9cf4 100644 --- a/cmdline.py +++ b/cmdline.py @@ -38,6 +38,9 @@ class ProgressWindow: def pop(self): print "" + def pulse(self): + pass + def set(self, amount): if amount == self.total: print _("Completed"), @@ -45,7 +48,7 @@ class ProgressWindow: def refresh(self): pass - def __init__(self, title, text, total, updpct = 0.05): + def __init__(self, title, text, total, updpct = 0.05, pulse = False): self.total = total print text print _("In progress... "), @@ -61,8 +64,8 @@ class InstallInterface: def shutdown(self): pass - def progressWindow(self, title, text, total, updpct = 0.05): - return ProgressWindow(title, text, total, updpct) + def progressWindow(self, title, text, total, updpct = 0.05, pulse = False): + return ProgressWindow(title, text, total, updpct, pulse) def kickstartErrorWindow(self, text): s = _("The following error was found while parsing your " @@ -511,7 +511,7 @@ class WaitWindow: class ProgressWindow: def __init__(self, title, text, total, updpct = 0.05, updsecs=10, - parent = None): + parent = None, pulse = False): if flags.rootpath or not runningMiniWm(): self.window = gtk.Window() if parent: @@ -543,6 +543,11 @@ class ProgressWindow: def refresh(self): processEvents() + def pulse(self): + self.progress.set_pulse_step(self.updpct) + self.progress.pulse() + processEvents() + def set (self, amount): # only update widget if we've changed by 5% or our timeout has # expired @@ -1037,11 +1042,12 @@ class InstallInterface: else: return WaitWindow (title, text) - def progressWindow (self, title, text, total, updpct = 0.05): + def progressWindow (self, title, text, total, updpct = 0.05, pulse = False): if self.icw: - return ProgressWindow (title, text, total, updpct, self.icw.window) + return ProgressWindow (title, text, total, updpct, + parent = self.icw.window, pulse = pulse) else: - return ProgressWindow (title, text, total, updpct) + return ProgressWindow (title, text, total, updpct, pulse = pulse) def packageProgressWindow (self, total, totalSize): self.ppw.setSizes (total, totalSize) @@ -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=[]): |