/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: Jelmer Vernooij
  • Date: 2008-07-17 11:51:03 UTC
  • Revision ID: jelmer@samba.org-20080717115103-djh5sb0pvpse2zkb
Add note about glade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        pass
59
59
 
60
60
    def update(self, msg=None, current_cnt=None, total_cnt=None):
61
 
        if current_cnt is not None:
 
61
        if current_cnt:
62
62
            self.current = current_cnt
63
 
        if total_cnt is not None:
 
63
        if total_cnt:
64
64
            self.total = total_cnt
65
65
        if msg is not None:
66
66
            self.set_text(msg)
67
67
        if None not in (self.current, self.total):
68
68
            self.fraction = float(self.current) / self.total
69
 
            if self.fraction < 0.0 or self.fraction > 1.0:
70
 
                raise AssertionError
71
69
            self.set_fraction(self.fraction)
72
70
        while gtk.events_pending():
73
71
            gtk.main_iteration()
93
91
    def update(self, *args, **kwargs):
94
92
        self.pb.update(*args, **kwargs)
95
93
 
96
 
    def tick(self, *args, **kwargs):
97
 
        self.pb.tick(*args, **kwargs)
98
 
 
99
94
    def finished(self):
100
95
        self.pb.finished()
101
96
        self.hide_all()
137
132
        self._stack = _stack
138
133
        self.show_all()
139
134
        return self
140
 
 
141
 
    def tick(self, *args, **kwargs):
142
 
        self.pb.tick(*args, **kwargs)
143
135
    
144
136
    def update(self, *args, **kwargs):
145
137
        self.pb.update(*args, **kwargs)