[MERGE] Keep the currently active widget for progress when finishing a progress bar.

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Jun 15 08:06:56 BST 2009

>>>>> "Jelmer" == Jelmer Vernooij <jelmer at samba.org> writes:

    Jelmer> This changes the progress bars in bzr-gtk back to provide the old
    Jelmer> behaviour; the progress bar widget is not automatically unset after the
    Jelmer> first subsequent progress bar finishes.

    Jelmer> I don't think there is any other way of doing progress bars
    Jelmer> appropriately; a single call to bzrlib may spawn more than one progress
    Jelmer> bar, and in the current situation we would be displaying all but the
    Jelmer> first progress bar in a separate window.

No. You're mixing up the progress *tasks* with the progress
rendering UI part (which can be a terminal or in our case a
widget). This was the main point of the progress bars
refactoring: a single rendering object for any task stack.

    Jelmer> Ideal would be if each Bazaar operation could support
    Jelmer> passing in a progress bar object that it should use.

That is needed only if you invoke bzrlib in *parallel* on several
operations, I don't think there is such a case yet in bzr-gtk.

    Jelmer> Since this is unlikely to happen, we will need some
    Jelmer> global state to keep track of the proper progress bar
    Jelmer> widget to use.

The current bzr-gtk ui, *tracks* the proper progress widget right now.


    Jelmer> # Bazaar merge directive format 2 (Bazaar 0.90)
    Jelmer> # revision_id: jelmer at samba.org-20090613194202-jsg119zbqyh3gddt
    Jelmer> # target_branch: bzr+ssh://bazaar.launchpad.net/%7Ebzr-gtk/bzr-\
    Jelmer> #   gtk/trunk/
    Jelmer> # testament_sha1: 92e3289199b77fe670be0b18ad8095297a0aa1d8
    Jelmer> # timestamp: 2009-06-13 21:43:43 +0200
    Jelmer> # base_revision_id: v.ladeuil+lp at free.fr-20090612154743-\
    Jelmer> #   e85g3jqrmqcb64xx
    Jelmer> # 
    Jelmer> # Begin patch
    Jelmer> === modified file 'branchview/treeview.py'
    Jelmer> --- branchview/treeview.py	2009-06-12 11:34:44 +0000
    Jelmer> +++ branchview/treeview.py	2009-06-13 19:41:19 +0000
    Jelmer> @@ -213,7 +213,8 @@
    Jelmer>          return self.get_property('parents')
    Jelmer>      def add_tag(self, tag, revid=None):
    Jelmer> -        if revid is None: revid = self.revision.revision_id
    Jelmer> +        if revid is None:
    Jelmer> +            revid = self.revision.revision_id
    Jelmer>          try:
    Jelmer>              self.branch.unlock()

    Jelmer> === modified file 'ui.py'
    Jelmer> --- ui.py	2009-06-12 11:34:44 +0000
    Jelmer> +++ ui.py	2009-06-13 19:42:02 +0000
    Jelmer> @@ -201,7 +201,6 @@
    Jelmer>          pbw = self._progress_bar_widget
    Jelmer>          if pbw:
    Jelmer>              pbw.finished()
    Jelmer> -            self.set_progress_bar_widget(None)

Given that the current implementation will either need to set an
explicit widget or default to a ProgressBarWindow, you're not
achieving much here, except for the special case not covered by
my previous patch.

Anyway, have a look at the other patch I just submitted and see
if it address your concerns.


More information about the bzr-gtk mailing list