>>>>> "Jelmer" == Jelmer Vernooij <[email protected]> writes:
Jelmer> Vincent Ladeuil wrote:
>>
Jelmer> _progress_all_finished shouldn't reset the progress
Jelmer> bar widget to None; if the window triggers more
Jelmer> progress reports, we shouldn't be displaying those in
Jelmer> a window. To reproduce, try hitting "Refresh" in the
Jelmer> viz window.
>>
>> Right, reproduced, but given that stdout mentions many other
>> problems, I think we'd better fix them in another patch :-)
>>
>> And I think the right fix here is to re-install the progress
>> widget when the refresh button is clicked.
>> There is still an inherent weakness in the current design
>> (already present in the last one, may be worse even): if you
>> create a bzr-gtk window with progress widget from a bzr-gtk
>> window with a progress widget, which one should show the
>> progress ?
Jelmer> So we would need to re-install the progress widget
Jelmer> each time we call out to bzrlib?
That's the idea yes. For bzr viz, it would mean doing it when the
command starts and when the refresh button is clicked.
In the attached patch, that meant setting the progress widget
once: in populate(), which makes sense, even if I still think the
progress widget should be part of BranchWindow instead of
TreeView.
Jelmer> Right now nothing else installs a progress indicator,
Jelmer> so this isn't really a problem (yet).
Jelmer> Other than this, this patch seems good enough to
Jelmer> land. We can always fix the minor issues later, right
Jelmer> now this not landing breaks bzr-gtk in general.
>>
>> Exactly and it seems that several users were already blocked.
>>
>> So I landed the patch as is.
Jelmer> I really think the Refresh issue should've been
Jelmer> addressed,
Addressing the refresh issue means addressing the following
warnings too:
** (bzr:2746): CRITICAL **: pygtk_generic_tree_model_get_value: assertion
`VALID_ITER(iter, tree_model)' failed
Traceback (most recent call last):
File "/home/vila/.bazaar/plugins/gtk/branchview/treeview.py", line 155, in
do_get_property
return self.model.get_value(self.iter, treemodel.REVISION)
TypeError: unknown type (null)
And I haven't the slightest idea where they are coming
from. That's what I meant by "other problems" in my previous
answer.
...
Ok, digging further, they are caused by trying to use a GtkIter
as persistent. That's not supported and can fail under various
circumstances (such a the obscure one above). The attached patch
fixes that.
It also explicitly set the progress widget before calling
operations that may need a progress bar.
Vincent
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [email protected]
# target_branch: http://bazaar.launchpad.net/%7Ebzr-gtk/bzr-gtk/trunk
# testament_sha1: 3b9158358c07d4dfbc4c601b6f7a1e244ddaa74d
# timestamp: 2009-06-15 08:54:21 +0200
# base_revision_id: [email protected]\
# bpjckekeq2ojcyvw
#
# Begin patch
=== modified file 'branchview/treeview.py'
--- branchview/treeview.py 2009-06-12 11:34:44 +0000
+++ branchview/treeview.py 2009-06-15 06:53:53 +0000
@@ -110,11 +110,8 @@
"""
gtk.VBox.__init__(self, spacing=0)
- loading_msg_widget = ProgressPanel()
- if getattr(ui.ui_factory, "set_progress_bar_widget", None) is not None:
- # We'are using our own ui, let's tell it to use our widget.
- ui.ui_factory.set_progress_bar_widget(loading_msg_widget)
- self.pack_start(loading_msg_widget, expand=False, fill=True)
+ self.progress_widget = ProgressPanel()
+ self.pack_start(self.progress_widget, expand=False, fill=True)
self.scrolled_window = gtk.ScrolledWindow()
self.scrolled_window.set_policy(gtk.POLICY_AUTOMATIC,
@@ -125,7 +122,7 @@
self.scrolled_window.add(self.construct_treeview())
- self.iter = None
+ self.path = None
self.branch = branch
self.revision = None
self.index = {}
@@ -152,13 +149,17 @@
elif property.name == 'branch':
return self.branch
elif property.name == 'revision':
- return self.model.get_value(self.iter, treemodel.REVISION)
+ return self.model.get_value(self.model.get_iter(self.path),
+ treemodel.REVISION)
elif property.name == 'revision-number':
- return self.model.get_value(self.iter, treemodel.REVNO)
+ return self.model.get_value(self.model.get_iter(self.path),
+ treemodel.REVNO)
elif property.name == 'children':
- return self.model.get_value(self.iter, treemodel.CHILDREN)
+ return self.model.get_value(self.model.get_iter(self.path),
+ treemodel.CHILDREN)
elif property.name == 'parents':
- return self.model.get_value(self.iter, treemodel.PARENTS)
+ return self.model.get_value(self.model.get_iter(self.path),
+ treemodel.PARENTS)
else:
raise AttributeError, 'unknown property %s' % property.name
@@ -283,6 +284,9 @@
should be broken.
"""
+ if getattr(ui.ui_factory, "set_progress_bar_widget", None) is not None:
+ # We'are using our own ui, let's tell it to use our widget.
+ ui.ui_factory.set_progress_bar_widget(self.progress_widget)
self.progress_bar = ui.ui_factory.nested_progress_bar()
self.progress_bar.update("Loading ancestry graph", 0, 5)
@@ -412,7 +416,7 @@
(path, focus) = treeview.get_cursor()
if (path is not None) and (path != self._prev_cursor_path):
self._prev_cursor_path = path # avoid emitting twice per click
- self.iter = self.model.get_iter(path)
+ self.path = path
self.emit('revision-selected')
def _on_revision_selected(self, widget, event):
# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWbSNtWUAAjRfgARQXf///3/n
34C////wUAVb1uuNCu6morp0FdBKJMUxTbUaGqbNIwFPUzUAxPUzQ1NND9T1TyTyglTRJ+inpoEg
aeo9Q0AAAAAAAASmiJqCnmqbKeamp6NqJ5TNQaMjIZoCAA0xxkyaMQxNMBAwJpgjBMTTTQAYQSKC
GmiZNU9NMUw0mU9E02pkyGg9E0Mg0aaQzFeItwdCB11fX+1JZpvm3kD3rAk7Vq+0xNCuXLYySXhO
PRHCh0vpnb8cNiAKJJgZsPfTce2jbQff6Bh8fiwUu1v50trHFwxPNQil9hTnIeTvmvKyyuUGuiJk
WL0bu4R6cjJWLXS+qSq27LizvlJH2YNm9FN6PvRSKsGcL1aE4TtMZZOLIvSpZr9EXo3Dq79t2Onx
priRteSMdG1waVE1MCC3Y58PQDnA8His/Hkv6d9Z34AoryNmgiGYLOitj8d+f1Hdcb5CJB3WMUCl
NRZtlwtyC9SSIAf8keJJSaYY5G89aJFZ0y4u1C7tUPOt7bEThYRLBnX5xDF2FDkGqMRdAfxN+2nr
t1IO1xHqOqTlqBrEJQB1yMbZXgmUZEprJFkRjwJ4HDmq4ZC4gYlxQ4HDI8hiitvg2IWwJBgYQLXi
YEVFjRyrlqZfILLN1u5i24TehAJCvNZbK4yDMicrWBuIGJYDC6RgXDHACBGuEMabr4C6E6iuFDfc
Qo4FpAiRdzjgHqYqkeQ1muYpYZmBsVBSBhGQpoSN8eUoRYoPfM140wCUS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https://lists.canonical.com/mailman/listinfo/bzr-gtk