/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: Vincent Ladeuil
  • Date: 2008-05-05 18:16:46 UTC
  • mto: (487.1.1 gtk)
  • mto: This revision was merged to the branch mainline in revision 490.
  • Revision ID: v.ladeuil+lp@free.fr-20080505181646-n95l8ltw2u6jtr26
Fix bug #187283 fix replacing _() by _i18n().

* genpot.sh 
Remove duplication. Add the ability to specify the genrated pot
file on command-line for debugging purposes.

* po/olive-gtk.pot:
Regenerated.

* __init__.py, branch.py, branchview/treeview.py, checkout.py,
commit.py, conflicts.py, diff.py, errors.py, initialize.py,
merge.py, nautilus-bzr.py, olive/__init__.py, olive/add.py,
olive/bookmark.py, olive/guifiles.py, olive/info.py,
olive/menu.py, olive/mkdir.py, olive/move.py, olive/remove.py,
olive/rename.py, push.py, revbrowser.py, status.py, tags.py:
Replace all calls to _() by calls to _i18n(), the latter being
defined in __init__.py and imported in the other modules from
there. This fix the problem encountered countless times when
running bzr selftest and getting silly error messages about
boolean not being callables.

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
 
72
66
 
73
 
class GtkWindowProgressBarStack(gtk.Window):
 
67
class GtkProgressBarStack(gtk.Window):
74
68
    def __init__(self):
75
 
        super(GtkWindowProgressBarStack, self).__init__(type=gtk.WINDOW_TOPLEVEL)
 
69
        super(GtkProgressBarStack, self).__init__(type=gtk.WINDOW_TOPLEVEL)
76
70
        self.set_border_width(0)
77
71
        self.set_title("Progress")
78
72
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
92
86
 
93
87
    def remove(self, pb):
94
88
        self.vbox.remove(pb)
95
 
        if len(self.vbox.get_children()) == 0: # If there is nothing to show, don't leave a ghost window here
96
 
             self.destroy()
97
89
 
98
90
 
99
91
class PasswordDialog(gtk.Dialog):
160
152
        """Return a nested progress bar.
161
153
        """
162
154
        if self._progress_bar_stack is None:
163
 
            self._progress_bar_stack = GtkWindowProgressBarStack()
 
155
            self._progress_bar_stack = GtkProgressBarStack()
164
156
        return self._progress_bar_stack.get_nested()
165
157
 
166
158
    def set_progress_bar_vbox(self, vbox):