/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to ui.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2008-05-23 13:14:58 UTC
  • mfrom: (487.3.1 bug.228709)
  • Revision ID: szilveszter.farkas@gmail.com-20080523131458-l53e1pcace4hnbtw
Merged fix for #228709 by Javier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        super(GtkProgressBar, self).__init__()
46
46
        self.set_fraction(0.0)
47
47
        self._stack = stack
48
 
        self.current = None
49
 
        self.total = None
50
48
 
51
49
    def finished(self):
52
50
        self._stack.remove(self)
58
56
        self.pulse()
59
57
 
60
58
    def update(self, msg=None, current=None, total=None):
61
 
        if current:
62
 
            self.current = current
63
 
        if total:
64
 
            self.total = total
65
59
        if msg is not None:
66
60
            self.set_text(msg)
67
 
        if None not in (self.current, self.total):
68
 
            self.set_fraction(1.0 * self.current / self.total)
 
61
        if None not in (current, total):
 
62
            self.set_fraction(1.0 * current / total)
69
63
        while gtk.events_pending():
70
64
            gtk.main_iteration()
71
65