[Sugar-devel] [PATCH sugar] Make sure the entry has the right color when copying from external device to Journal SL #2690

2011-06-03 Thread Simon Schampijer
The patch does make sure that the color of the entry has the owner's color when 
you copy
it from an external device to the Journal. It handles the case where when you 
copy a Journal
entry from another user on an external device and then into your Journal 
cleanly.
The color stays the same.
---
 src/jarabe/journal/model.py |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index fd25681..b246abb 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -30,10 +30,12 @@ from gettext import gettext as _
 import gobject
 import dbus
 import gio
+import gconf
 
 from sugar import dispatch
 from sugar import mime
 from sugar import util
+from sugar.graphics.xocolor import XoColor
 
 
 DS_DBUS_SERVICE = 'org.laptop.sugar.DataStore'
@@ -615,6 +617,9 @@ def copy(metadata, mount_point):
 """Copies an object to another mount point
 """
 metadata = get(metadata['uid'])
+if mount_point == '/' and metadata['icon-color'] == '#00,#ff':
+client = gconf.client_get_default()
+metadata['icon-color'] = client.get_string('/desktop/sugar/user/color')
 file_path = get_file(metadata['uid'])
 
 metadata['mountpoint'] = mount_point
-- 
1.7.4

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


Re: [Sugar-devel] [PATCH sugar] Make sure the entry has the right color when copying from external device to Journal SL #2690

2011-06-03 Thread Simon Schampijer

On 06/03/2011 12:38 PM, Simon Schampijer wrote:

The patch does make sure that the color of the entry has the owner's color when 
you copy
it from an external device to the Journal. It handles the case where when you 
copy a Journal
entry from another user on an external device and then into your Journal 
cleanly.
The color stays the same.
---
  src/jarabe/journal/model.py |5 +
  1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index fd25681..b246abb 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -30,10 +30,12 @@ from gettext import gettext as _
  import gobject
  import dbus
  import gio
+import gconf

  from sugar import dispatch
  from sugar import mime
  from sugar import util
+from sugar.graphics.xocolor import XoColor


Actually, this import is not needed. rest stays the same.

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


Re: [Sugar-devel] [PATCH sugar] Make sure the entry has the right color when copying from external device to Journal SL #2690

2011-06-07 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of Fri Jun 03 12:38:03 +0200 2011:

[src/jarabe/journal/model.py]
> @@ -615,6 +617,9 @@ def copy(metadata, mount_point):
>  """Copies an object to another mount point
>  """
>  metadata = get(metadata['uid'])
> +if mount_point == '/' and metadata['icon-color'] == '#00,#ff':

Where does this colour come from? If we don't know the colour, why is it
set?

Otherwise the patch looks fine.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


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


Re: [Sugar-devel] [PATCH sugar] Make sure the entry has the right color when copying from external device to Journal SL #2690

2011-06-09 Thread Simon Schampijer

On 06/07/2011 07:52 PM, Sascha Silbe wrote:

Excerpts from Simon Schampijer's message of Fri Jun 03 12:38:03 +0200 2011:

[src/jarabe/journal/model.py]

@@ -615,6 +617,9 @@ def copy(metadata, mount_point):
  """Copies an object to another mount point
  """
  metadata = get(metadata['uid'])
+if mount_point == '/' and metadata['icon-color'] == '#00,#ff':


Where does this colour come from? If we don't know the colour, why is it
set?

Otherwise the patch looks fine.

Sascha


By default the metadata for for a file on an external device has the 
black/white color [1]. When we now copy a file from an external device 
to the Journal we color the new Journal entry in our color.


If we copy a Journal entry saved on machine A to machine B using an 
external device we want to keep the color information from machine A.


Regards,
   Simon

[1] 
http://git.sugarlabs.org/sugar/mainline/blobs/master/src/jarabe/journal/model.py#line422


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


Re: [Sugar-devel] [PATCH sugar] Make sure the entry has the right color when copying from external device to Journal SL #2690

2011-06-24 Thread Simon Schampijer

On 06/09/2011 05:27 PM, Simon Schampijer wrote:

On 06/07/2011 07:52 PM, Sascha Silbe wrote:

Excerpts from Simon Schampijer's message of Fri Jun 03 12:38:03 +0200
2011:

[src/jarabe/journal/model.py]

@@ -615,6 +617,9 @@ def copy(metadata, mount_point):
"""Copies an object to another mount point
"""
metadata = get(metadata['uid'])
+ if mount_point == '/' and metadata['icon-color'] == '#00,#ff':


Where does this colour come from? If we don't know the colour, why is it
set?

Otherwise the patch looks fine.


Took that as an ack and pushed that patch now.

http://git.sugarlabs.org/sugar/mainline/commit/c628272dba4ffa14d65220463a663658462070c9

http://git.sugarlabs.org/sugar/mainline/commit/60d7e18c2f5a4c6d2522c51c3758cb13e671375c

Thanks for the review,
   Simon


Sascha


By default the metadata for for a file on an external device has the
black/white color [1]. When we now copy a file from an external device
to the Journal we color the new Journal entry in our color.

If we copy a Journal entry saved on machine A to machine B using an
external device we want to keep the color information from machine A.

Regards,
Simon

[1]
http://git.sugarlabs.org/sugar/mainline/blobs/master/src/jarabe/journal/model.py#line422


___
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