[Sugar-devel] Removal of Activity Keep button
Simon Schampijer
simon at schampijer.de
Wed Aug 17 08:44:34 EDT 2011
On 08/17/2011 02:12 PM, Aleksey Lim wrote:
> On Sun, Jul 31, 2011 at 02:43:42PM +0200, Simon Schampijer wrote:
>> On 07/31/2011 05:17 AM, Gonzalo Odiard wrote:
>>> On Sat, Jul 30, 2011 at 7:30 PM, Rafael Ortiz<rafael at activitycentral.com>wrote:
>>>
>>>> On Fri, Jul 29, 2011 at 6:34 PM, Gonzalo Odiard<gonzalo at laptop.org>wrote:
>>>>
>>>>> Hi James,
>>>>> There are no problem, the KeepButton class is not removed, but is not
>>>>> added by default in the toolbar.
>>>>> The activities will work ok.
>>>>>
>>>>>
>>>> James, +1.
>>>>
>>>> You can remove the code w/o problem, if you don't remove it, the activity
>>>> won't work but only for sugar>=0.94 (as I understand it from Simon) , this
>>>> is only for activities that have the keepbutton ''hardcoded'' in the
>>>> activity toolbar code.
>>>>
>>>
>>>
>>> Rafael:
>>> This is not correct.
>>> The activity will continue working, because the class KeepButton was not
>>> removed (there are two proposed patches, look at the second)
>>> In most of the activities, the default Activity Tolbar is used, and in sugar
>>> 0.94, the KeepButton will not be displayed.
>>> In a few activities, the developer hidden the button, or used a custom
>>> toolbar, and we provided patches to resolve them.
>>> Of course, we did not checked the hundred of activities in ASLO, but only
>>> the activities included by default in OLPC image,
>>> then if another activity use the button (or the user is using a old version
>>> of the activity) the only difference will be
>>> the KeepButton will be present, but the activity will works ok.
>>>
>>> Gonzalo
>>
>> Right, so the button is only deprecated for now, and usage is
>> discouraged. It will be removed in a later version.
>
> That actually is not right, the patch that was landed to sugar-toolkit
> removes keep member from ActivityToolbarButton. Thus, activities like
> Terminal stops working.
>
> Also that commit says that keep button will be removed another cycle.
> Does it mean the next one? imho, there is no strong reason to break
> backwards compatibility and rehash all activities (not only fructose,
> ie, no way to fix all of them at once). The right way for me is
> declaring good practices on wiki and having warnings in logs.
Thanks for catching this. When writing the patch description I was not
thinking of any activity that does access the keep-button of the toolbar
directly (terminal does set the short cut for it).
I would suggest the following: I will put the button there without
inserting it in the toolbar. So if an activity accesses it like:
activity_button.page.keep.props.accelerator = '<Ctrl><Shift>S'
activity_button.page.keep.hide()
it won't fail but will not have any effect neither. The button would
then be removed completely in 0.96.
diff --git a/src/sugar/activity/widgets.py b/src/sugar/activity/widgets.py
index 0c34a1f..e5c4063 100644
--- a/src/sugar/activity/widgets.py
+++ b/src/sugar/activity/widgets.py
@@ -265,6 +265,9 @@ class ActivityToolbar(gtk.Toolbar):
self.share.show()
self.insert(self.share, -1)
+ # DEPRECATED
+ self.keep = KeepButton(activity)
+
self.stop = StopButton(activity)
self.insert(self.stop, -1)
self.stop.show()
And of course I will note this in the release notes.
Regards,
Simon
More information about the Sugar-devel
mailing list