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

2011-08-30 Thread Simon Schampijer

On 08/30/2011 03:43 PM, Gonzalo Odiard wrote:

This patch works ok, and solves the two issues.

Tested-by: me

Gonzalo


Thanks, pushed as:

http://git.sugarlabs.org/sugar/mainline/commit/0501c03981b6656aafed5ab5c6218d576ef2695d

Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-08-30 Thread Gonzalo Odiard
This patch works ok, and solves the two issues.

Tested-by: me

Gonzalo


On Tue, Aug 30, 2011 at 10:18 AM, Simon Schampijer wrote:

> On 08/29/2011 08:23 PM, Gonzalo Odiard wrote:
>
>> Btw, the ObjectChooser, with the Journal button at left, the Document
>> folder,
>> and the devices icons at right and the cancel button in the middle is
>> intresting... :)
>>
>> Gonzalo
>>
>
> Ok, I found now the real issue thanks to you pointing out the positioning
> issue. When the button is positioned correctly we can as well remove it
> cleanly. The mount point was set correctly actually.
>
> Regards,
>   Simon
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-08-30 Thread Simon Schampijer

On 08/29/2011 08:23 PM, Gonzalo Odiard wrote:

Btw, the ObjectChooser, with the Journal button at left, the Document
folder,
and the devices icons at right and the cancel button in the middle is
intresting... :)

Gonzalo


Ok, I found now the real issue thanks to you pointing out the 
positioning issue. When the button is positioned correctly we can as 
well remove it cleanly. The mount point was set correctly actually.


Regards,
   Simon
>From 089017d7ac280f182c99832c8ea0b005ad9f9263 Mon Sep 17 00:00:00 2001
From: Simon Schampijer 
Date: Tue, 30 Aug 2011 15:14:06 +0200
Subject: [PATCH sugar] Position DocumentsButton correctly in the
 VolumesToolbar
Mail-Followup-To: 

Signed-off-by: Simon Schampijer 
---
 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..84d9e31 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -232,7 +232,8 @@ class VolumesToolbar(gtk.Toolbar):
 button.connect('toggled', self._button_toggled_cb)
 button.show()
 
-self.insert(button, -1)
+position = self.get_item_index(self._volume_buttons[-1]) + 1
+self.insert(button, position)
 self._volume_buttons.append(button)
 self.show()
 
-- 
1.7.4.4

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-08-29 Thread Gonzalo Odiard
Btw, the ObjectChooser, with the Journal button at left, the Document
folder,
and the devices icons at right and the cancel button in the middle is
intresting... :)

Gonzalo

On Mon, Aug 29, 2011 at 11:58 AM, Simon Schampijer wrote:

> On 08/26/2011 11:51 PM, godi...@sugarlabs.org wrote:
>
>> From: Gonzalo Odiard
>>
>> 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
>> ---
>>  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@lists.sugarlabs.**org 
> http://lists.sugarlabs.org/**listinfo/sugar-devel
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-08-29 Thread Gonzalo Odiard
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 wrote:

> On 08/26/2011 11:51 PM, godi...@sugarlabs.org wrote:
>
>> From: Gonzalo Odiard
>>
>> 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
>> ---
>>  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@lists.sugarlabs.**org 
> http://lists.sugarlabs.org/**listinfo/sugar-devel
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-08-29 Thread Simon Schampijer

On 08/26/2011 11:51 PM, godi...@sugarlabs.org wrote:

From: Gonzalo Odiard

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
---
  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@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-08-26 Thread godiard
From: Gonzalo Odiard 

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.

Signed-off-by: Gonzalo Odiard 
---
 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
-- 
1.7.4.4

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel