[Sugar-devel] Proposed solution to OLPC #10930
gonzalo at laptop.org
Thu Jun 23 09:53:23 EDT 2011
I was working in the solution of OLPC #10930 "copy/paste does not work in if
one has not revealed the edit toolbar once"
The problem can be reproduced in activities with the new toolbars, like
Terminal or Browse.
For example, in Terminal, if you open the activity, select a text and press
"Shift-Ctrl-C", nothing is copied,
if you show the Edit toolbar and try pressing "Sift-Ctrl-C" again, the text
The same happen in Browse with "Ctrl-C"
I have worked in two different solutions:
The patch walk the objects in the toolbar_box when is set in the activity
and update the accelerators.
This patch resolve the problem in activities Terminal and Browse without
changing the activities.
If in one activity the programmer set the toolbar_box in the activity before
adding all the buttons,
must call the update_accelerators methods after add the controls.
Additionally, we can remove the 'hierarchy-changed' signal handlers in
This code is called many times at the start of the activity, and later every
time we show or hide a toolbar.
2) Another solution is
I don't like it, but is a fix using the same technique used in
Uses the 'hierarchy-changed' signal to pack the toolbar to the
udating the hierachy of the children and enabling them to setup the
The problem with this approach is the code is executed many times, because
change the parents every time are visible/invisible.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Sugar-devel