[Sugar-devel] [PATCH] Manage the Documents folder in the VolumesToolbar

Gonzalo Odiard gonzalo at laptop.org
Mon Aug 29 11:29:35 EDT 2011


Yes, can be done in either way.
is probably a one line patch too, I think you don't need a patch, right ? ;)

Gonzalo

On Mon, Aug 29, 2011 at 11:58 AM, Simon Schampijer <simon at schampijer.de>wrote:

> On 08/26/2011 11:51 PM, godiard at sugarlabs.org wrote:
>
>> From: Gonzalo Odiard<godiard at gmail.com>
>>
>> After adding the Documents folder in the VolumesToolbar,
>> if the user unmount a device with the ObjectChooser opened,
>> the code break and the device button is not removed.
>>
>
> Thanks Gonzalo for the patch. We could as well store the mountpoint in
> DocumentsButton, the information is there. That way the
> '_get_button_for_mount' would return the correct information. What do you
> think?
>
> Regards,
>   Simon
>
>
>
>
>
>  Signed-off-by: Gonzalo Odiard<gonzalo at laptop.org>
>> ---
>>  src/jarabe/journal/**volumestoolbar.py |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/jarabe/journal/**volumestoolbar.py b/src/jarabe/journal/
>> **volumestoolbar.py
>> index 7a34e18..36f3011 100644
>> --- a/src/jarabe/journal/**volumestoolbar.py
>> +++ b/src/jarabe/journal/**volumestoolbar.py
>> @@ -280,7 +280,8 @@ class VolumesToolbar(gtk.Toolbar):
>>      def _get_button_for_mount(self, mount):
>>          mount_point = mount.get_root().get_path()
>>          for button in self.get_children():
>> -            if button.mount_point == mount_point:
>> +            if hasattr(button, 'mount_point') and \
>> +                button.mount_point == mount_point:
>>                  return button
>>          logging.error('Couldnt find button with mount_point %r',
>> mount_point)
>>          return None
>>
>
> ______________________________**_________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.**org <Sugar-devel at lists.sugarlabs.org>
> http://lists.sugarlabs.org/**listinfo/sugar-devel<http://lists.sugarlabs.org/listinfo/sugar-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110829/512180ce/attachment-0001.html>


More information about the Sugar-devel mailing list