/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: Andrew Bennetts
  • Date: 2008-04-29 08:17:01 UTC
  • mto: This revision was merged to the branch mainline in revision 476.
  • Revision ID: andrew@puzzling.org-20080429081701-2pu9uteic8o88nre
Simple hack to fix gannotate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2006 Szilveszter Farkas <szilveszter.farkas@gmail.com>
 
2
# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org>
2
3
 
3
4
# This program is free software; you can redistribute it and/or modify
4
5
# it under the terms of the GNU General Public License as published by
35
36
        
36
37
        self.vbox.show_all()
37
38
 
38
 
        self.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_YES, gtk.STOCK_NO, gtk.RESPONSE_NO)
 
39
        self.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_YES, gtk.STOCK_NO, 
 
40
                         gtk.RESPONSE_NO)
39
41
 
40
42
 
41
43
class GtkProgressBar(gtk.ProgressBar):
56
58
    def update(self, msg=None, current=None, total=None):
57
59
        if msg is not None:
58
60
            self.set_text(msg)
59
 
        self.set_fraction(1.0 * current / total)
 
61
        if None not in (current, total):
 
62
            self.set_fraction(1.0 * current / total)
60
63
        while gtk.events_pending():
61
64
            gtk.main_iteration()
62
65
 
117
120
 
118
121
        """
119
122
        super(GtkUIFactory, self).__init__()
120
 
        if stdout is None:
121
 
            self.stdout = sys.stdout
122
 
        else:
123
 
            self.stdout = stdout
124
 
        if stderr is None:
125
 
            self.stderr = sys.stderr
126
 
        else:
127
 
            self.stderr = stderr
128
123
        self._progress_bar_stack = None
129
124
 
130
125
    def get_boolean(self, prompt):