Re: Journal integration for Scratch

2009-01-15 Thread John Maloney
Ahh, that would explain it!

Maybe we need a couple of lines of shell script to check for the link  
and create it if it isn't there.

-- John

On Jan 15, 2009, at 7:56 AM, Bert Freudenberg wrote:
> On 15.01.2009, at 13:55, John Maloney wrote:
>
>> Hi, Phillip.
>>
>> Re:
>>> There is a bug in Scratch version 12. The symbolic link of the  
>>> Project
>>> directory doesn't get created (Open Projects shows Scratch.activity
>>> folder instead). I checked the scripts (scratch-activity and
>>> scratch-wrapper) but couldn't find where the link should get  
>>> created.
>>
>> In Scratch 11, a symbolic link was included in the .xo and  
>> unzipping re-created that link. Someone else helped me create that  
>> mechanism (sorry I can't quite remember who). But you are right, it  
>> no longer works in v12, either because I changed something about my  
>> process for creating the .xo file or perhaps because of a change in  
>> the XO software (less likely).
>>
>> I will look into this.
>
>
> Unless someone fixed this in the mean time, symbolic links in  
> bundles are not preserved:
>
> http://dev.laptop.org/ticket/4584
>
> - Bert -
>
>

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-15 Thread Bert Freudenberg

On 15.01.2009, at 13:55, John Maloney wrote:

> Hi, Phillip.
>
> Re:
>> There is a bug in Scratch version 12. The symbolic link of the  
>> Project
>> directory doesn't get created (Open Projects shows Scratch.activity
>> folder instead). I checked the scripts (scratch-activity and
>> scratch-wrapper) but couldn't find where the link should get created.
>
> In Scratch 11, a symbolic link was included in the .xo and unzipping  
> re-created that link. Someone else helped me create that mechanism  
> (sorry I can't quite remember who). But you are right, it no longer  
> works in v12, either because I changed something about my process  
> for creating the .xo file or perhaps because of a change in the XO  
> software (less likely).
>
> I will look into this.


Unless someone fixed this in the mean time, symbolic links in bundles  
are not preserved:

http://dev.laptop.org/ticket/4584

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-15 Thread John Maloney
Hi, Phillip.

Re:
> There is a bug in Scratch version 12. The symbolic link of the Project
> directory doesn't get created (Open Projects shows Scratch.activity
> folder instead). I checked the scripts (scratch-activity and
> scratch-wrapper) but couldn't find where the link should get created.

In Scratch 11, a symbolic link was included in the .xo and unzipping  
re-created that link. Someone else helped me create that mechanism  
(sorry I can't quite remember who). But you are right, it no longer  
works in v12, either because I changed something about my process for  
creating the .xo file or perhaps because of a change in the XO  
software (less likely).

I will look into this.

-- John


>
>
> Regards,
> Philipp
>
> Bert Freudenberg wrote:
>> The script looks good, except for the name mangling magic (which is  
>> a bit hard to understand because of mis-indentations). This  
>> wouldn't even work with your XO's language set to non-English  
>> (which the majority of XOs use).
>> I would simply name the file "$object_id.sb".
>> - Bert -
>> On 14.01.2009, at 07:04, Philipp Kocher wrote:
>>> Hi John
>>>
>>> Yes, we need the mimetypes.xml file as well (thanks Tomeu I forgot  
>>> the USB flash drive use case). I have tested the attached  
>>> mimetypes.xml. It is working fine. Put it in the activity directory.
>>>
>>> Furthermore we have to change the scratch-activity script, so the  
>>> parameter with the scratch project object-id gets converted (copy- 
>>> from-journal) in a file and passed on to scratch. See the attached  
>>> scratch-activity script. I am not an expert with bash scripts, so  
>>> please give feedback.
>>>
>>> I would like to extend the script so project files in the journal  
>>> directory are copied back to the journal after exiting scratch,  
>>> but for opening project it should work fine.
>>>
>>> Best regards,
>>> Philipp
>>>
>>> John Maloney wrote:
 Hi, Phillip.
 Thanks for all your hard work in tracking this down. I had looked  
 at several other packages, including EToys, and couldn't figure  
 out from them how to do this.
 I will make these changes to the next XO Scratch bundle.
 Is that all I need to do? What about the mime types XML file  
 similar to the one added by Etoys? Does that turn out to be  
 unnecessary?
   -- John
 On Jan 13, 2009, at 12:55 AM, Philipp Kocher wrote:
> Tomeu Vizoso wrote:
>> On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg > > wrote:
>>> On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
> So what would the Scratch activity have to do so files put  
> into the
> Journal
> (maybe by downloading) are displayed using a Scratch icon  
> rather than the
> generic document icon?
 Shipping a mimetypes.xml file inside the bundle as explained  
 here:

 http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure

 Sugar will call update-mime-database and will merge that file  
 into the
 xdg mime database.

 I think that John is already trying this.
>>>
>>> Guess I'm confused then - I thought that's exactly what  
>>> Philipp had done.
>> I think he just changed the mime_types field in the .info file.
>>> And I just checked and it does work with Etoys projects. When  
>>> downloading
>>> one it indeed gets an etoys icon (although at a smaller size -  
>>> why is that?)
>> No idea, though I think that the mime database is updated in  
>> the etoys
>> rpm and not in the bundle, am I right?
>> Regards,
>> Tomeu
>
> Thanks Tomeu to lead me to the /home/olpc/.local directory.  
> However, the
> mimetypes.xml is not necessary to get the icon in the journal. I  
> just
> had to copy the scratch icon file in the activity directory to
> "application-x-scratch-project.svg" (also in the scratch activity
> dirctory). The Memorize Activity is a good example for using  
> that feature.
> Sugar has to be restarted after installing Scratch to show the  
> icon.
>
> John, could you please make the following changes in the next  
> Scratch
> version:
> - add the line "mime_types = application/x-scratch-project" to the
> activity.info file
> - copy the scratch icon to "application-x-scratch-project.svg"  
> in the
> activity directory
>
> Etoys gets configured by different packages. e.g. the rpm
> etoys-3.0.2153-1.noarch is adding the file
> /usr/share/mime/packges/etoys.xml and the rpm sugar- 
> artwork-0.82.3-1.olpc3 is
> adding the file
> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake- 
> project.svg.
>
> Regards,
> Philipp
>
>>> 
>>> http://www.freedesktop.org/standards/shared-mime-info 
>>> ">
>>>  
>>>Scratch Project
>>>
>>>  
>>> 
>>> #!/bin/sh
>>> # Author: Bert Freudenberg
>>> # Mo

Re: Journal integration for Scratch

2009-01-15 Thread Philipp Kocher
You are right. It doesn't work like that, but the filename is quite
important to me. It is shown in the Scratch GUI and it is an important
marker to find the project, when save and not save as is used.
I wouldn't just take the object_id. What do you think John?

There is a bug in Scratch version 12. The symbolic link of the Project
directory doesn't get created (Open Projects shows Scratch.activity
folder instead). I checked the scripts (scratch-activity and
scratch-wrapper) but couldn't find where the link should get created.

Regards,
Philipp

Bert Freudenberg wrote:
> The script looks good, except for the name mangling magic (which is a 
> bit hard to understand because of mis-indentations). This wouldn't even 
> work with your XO's language set to non-English (which the majority of 
> XOs use).
> 
> I would simply name the file "$object_id.sb".
> 
> - Bert -
> 
> On 14.01.2009, at 07:04, Philipp Kocher wrote:
> 
>> Hi John
>>
>> Yes, we need the mimetypes.xml file as well (thanks Tomeu I forgot the 
>> USB flash drive use case). I have tested the attached mimetypes.xml. 
>> It is working fine. Put it in the activity directory.
>>
>> Furthermore we have to change the scratch-activity script, so the 
>> parameter with the scratch project object-id gets converted 
>> (copy-from-journal) in a file and passed on to scratch. See the 
>> attached scratch-activity script. I am not an expert with bash 
>> scripts, so please give feedback.
>>
>> I would like to extend the script so project files in the journal 
>> directory are copied back to the journal after exiting scratch, but 
>> for opening project it should work fine.
>>
>> Best regards,
>> Philipp
>>
>> John Maloney wrote:
>>> Hi, Phillip.
>>> Thanks for all your hard work in tracking this down. I had looked at 
>>> several other packages, including EToys, and couldn't figure out from 
>>> them how to do this.
>>> I will make these changes to the next XO Scratch bundle.
>>> Is that all I need to do? What about the mime types XML file similar 
>>> to the one added by Etoys? Does that turn out to be unnecessary?
>>>-- John
>>> On Jan 13, 2009, at 12:55 AM, Philipp Kocher wrote:
 Tomeu Vizoso wrote:
> On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg 
>  wrote:
>> On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
 So what would the Scratch activity have to do so files put into the
 Journal
 (maybe by downloading) are displayed using a Scratch icon rather 
 than the
 generic document icon?
>>> Shipping a mimetypes.xml file inside the bundle as explained here:
>>>
>>> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>>>
>>> Sugar will call update-mime-database and will merge that file 
>>> into the
>>> xdg mime database.
>>>
>>> I think that John is already trying this.
>>
>> Guess I'm confused then - I thought that's exactly what Philipp 
>> had done.
> I think he just changed the mime_types field in the .info file.
>> And I just checked and it does work with Etoys projects. When 
>> downloading
>> one it indeed gets an etoys icon (although at a smaller size - why 
>> is that?)
> No idea, though I think that the mime database is updated in the etoys
> rpm and not in the bundle, am I right?
> Regards,
> Tomeu

 Thanks Tomeu to lead me to the /home/olpc/.local directory. However, 
 the
 mimetypes.xml is not necessary to get the icon in the journal. I just
 had to copy the scratch icon file in the activity directory to
 "application-x-scratch-project.svg" (also in the scratch activity
 dirctory). The Memorize Activity is a good example for using that 
 feature.
 Sugar has to be restarted after installing Scratch to show the icon.

 John, could you please make the following changes in the next Scratch
 version:
 - add the line "mime_types = application/x-scratch-project" to the
 activity.info file
 - copy the scratch icon to "application-x-scratch-project.svg" in the
 activity directory

 Etoys gets configured by different packages. e.g. the rpm
 etoys-3.0.2153-1.noarch is adding the file
 /usr/share/mime/packges/etoys.xml and the rpm 
 sugar-artwork-0.82.3-1.olpc3 is
 adding the file
 /usr/share/icons/sugar/scalable/mimetypes/application-x-squake-project.svg.
  


 Regards,
 Philipp

>> 
>> http://www.freedesktop.org/standards/shared-mime-info";>
>>   
>> Scratch Project
>> 
>>   
>> 
>> #!/bin/sh
>> # Author: Bert Freudenberg
>> # Modified by: John Maloney
>> # Purpose: Run Scratch using the Squeak virtual machine
>>
>> echo "scratch-activity"
>> echo "$@"
>>
>> echo "$0" "$@"
>> echo
>>
>> # arguments are unordered, have to loop
>> args=""
>> while [ -n "$2" ] ; do
>>case "$1" in
>>  -b | --bundle-id)   bundle_id="$2"   ; args="$args BUNDLE_ID 
>> $2" ;;
>>  -a | --activit

Re: Journal integration for Scratch

2009-01-14 Thread Bert Freudenberg
The script looks good, except for the name mangling magic (which is a  
bit hard to understand because of mis-indentations). This wouldn't  
even work with your XO's language set to non-English (which the  
majority of XOs use).

I would simply name the file "$object_id.sb".

- Bert -

On 14.01.2009, at 07:04, Philipp Kocher wrote:

> Hi John
>
> Yes, we need the mimetypes.xml file as well (thanks Tomeu I forgot  
> the USB flash drive use case). I have tested the attached  
> mimetypes.xml. It is working fine. Put it in the activity directory.
>
> Furthermore we have to change the scratch-activity script, so the  
> parameter with the scratch project object-id gets converted (copy- 
> from-journal) in a file and passed on to scratch. See the attached  
> scratch-activity script. I am not an expert with bash scripts, so  
> please give feedback.
>
> I would like to extend the script so project files in the journal  
> directory are copied back to the journal after exiting scratch, but  
> for opening project it should work fine.
>
> Best regards,
> Philipp
>
> John Maloney wrote:
>> Hi, Phillip.
>> Thanks for all your hard work in tracking this down. I had looked  
>> at several other packages, including EToys, and couldn't figure out  
>> from them how to do this.
>> I will make these changes to the next XO Scratch bundle.
>> Is that all I need to do? What about the mime types XML file  
>> similar to the one added by Etoys? Does that turn out to be  
>> unnecessary?
>>-- John
>> On Jan 13, 2009, at 12:55 AM, Philipp Kocher wrote:
>>> Tomeu Vizoso wrote:
 On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg >>> > wrote:
> On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
>>> So what would the Scratch activity have to do so files put  
>>> into the
>>> Journal
>>> (maybe by downloading) are displayed using a Scratch icon  
>>> rather than the
>>> generic document icon?
>> Shipping a mimetypes.xml file inside the bundle as explained  
>> here:
>>
>> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>>
>> Sugar will call update-mime-database and will merge that file  
>> into the
>> xdg mime database.
>>
>> I think that John is already trying this.
>
> Guess I'm confused then - I thought that's exactly what Philipp  
> had done.
 I think he just changed the mime_types field in the .info file.
> And I just checked and it does work with Etoys projects. When  
> downloading
> one it indeed gets an etoys icon (although at a smaller size -  
> why is that?)
 No idea, though I think that the mime database is updated in the  
 etoys
 rpm and not in the bundle, am I right?
 Regards,
 Tomeu
>>>
>>> Thanks Tomeu to lead me to the /home/olpc/.local directory.  
>>> However, the
>>> mimetypes.xml is not necessary to get the icon in the journal. I  
>>> just
>>> had to copy the scratch icon file in the activity directory to
>>> "application-x-scratch-project.svg" (also in the scratch activity
>>> dirctory). The Memorize Activity is a good example for using that  
>>> feature.
>>> Sugar has to be restarted after installing Scratch to show the icon.
>>>
>>> John, could you please make the following changes in the next  
>>> Scratch
>>> version:
>>> - add the line "mime_types = application/x-scratch-project" to the
>>> activity.info file
>>> - copy the scratch icon to "application-x-scratch-project.svg" in  
>>> the
>>> activity directory
>>>
>>> Etoys gets configured by different packages. e.g. the rpm
>>> etoys-3.0.2153-1.noarch is adding the file
>>> /usr/share/mime/packges/etoys.xml and the rpm sugar- 
>>> artwork-0.82.3-1.olpc3 is
>>> adding the file
>>> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake- 
>>> project.svg.
>>>
>>> Regards,
>>> Philipp
>>>
> 
> http://www.freedesktop.org/standards/shared-mime-info 
> ">
>   
> Scratch Project
> 
>   
> 
> #!/bin/sh
> # Author: Bert Freudenberg
> # Modified by: John Maloney
> # Purpose: Run Scratch using the Squeak virtual machine
>
> echo "scratch-activity"
> echo "$@"
>
> echo "$0" "$@"
> echo
>
> # arguments are unordered, have to loop
> args=""
> while [ -n "$2" ] ; do
>case "$1" in
>   -b | --bundle-id)   bundle_id="$2"   ; args="$args BUNDLE_ID  
> $2" ;;
>   -a | --activity-id) activity_id="$2" ; args="$args ACTIVITY_ID  
> $2";;
>   -o | --object-id)   object_id="$2"   ; args="$args OBJECT_ID  
> $2";;
>   -u | --uri) uri="$2" ; args="$args URI $2";;
>   *) echo unknown argument $1 $2 ;;
>esac
>shift;shift
> done
>
> # really need bundle id and activity id
> if [ -z "$bundle_id" -o -z "$activity_id" ] ; then
>  echo ERROR: bundle-id and activity-id arguments required
>  echo Aborting
>  exit 1
> fi
>
> # some debug output
> echo launching $bundle_id instance $activity_id
> [ -n "$object_id" ] && echo with journal obj $object_id
> [ -n "$uri"   ] && echo loading uri $

Re: Journal integration for Scratch

2009-01-13 Thread Philipp Kocher

Hi John

Yes, we need the mimetypes.xml file as well (thanks Tomeu I forgot the 
USB flash drive use case). I have tested the attached mimetypes.xml. It 
is working fine. Put it in the activity directory.


Furthermore we have to change the scratch-activity script, so the 
parameter with the scratch project object-id gets converted 
(copy-from-journal) in a file and passed on to scratch. See the attached 
scratch-activity script. I am not an expert with bash scripts, so please 
give feedback.


I would like to extend the script so project files in the journal 
directory are copied back to the journal after exiting scratch, but for 
opening project it should work fine.


Best regards,
Philipp

John Maloney wrote:

Hi, Phillip.

Thanks for all your hard work in tracking this down. I had looked at 
several other packages, including EToys, and couldn't figure out from 
them how to do this.


I will make these changes to the next XO Scratch bundle.

Is that all I need to do? What about the mime types XML file similar to 
the one added by Etoys? Does that turn out to be unnecessary?


-- John


On Jan 13, 2009, at 12:55 AM, Philipp Kocher wrote:

Tomeu Vizoso wrote:
On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg 
 wrote:

On 12.01.2009, at 18:11, Tomeu Vizoso wrote:

So what would the Scratch activity have to do so files put into the
Journal
(maybe by downloading) are displayed using a Scratch icon rather 
than the

generic document icon?

Shipping a mimetypes.xml file inside the bundle as explained here:

http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure

Sugar will call update-mime-database and will merge that file into the
xdg mime database.

I think that John is already trying this.


Guess I'm confused then - I thought that's exactly what Philipp had 
done.

I think he just changed the mime_types field in the .info file.
And I just checked and it does work with Etoys projects. When 
downloading
one it indeed gets an etoys icon (although at a smaller size - why 
is that?)

No idea, though I think that the mime database is updated in the etoys
rpm and not in the bundle, am I right?
Regards,
Tomeu


Thanks Tomeu to lead me to the /home/olpc/.local directory. However, the
mimetypes.xml is not necessary to get the icon in the journal. I just
had to copy the scratch icon file in the activity directory to
"application-x-scratch-project.svg" (also in the scratch activity
dirctory). The Memorize Activity is a good example for using that 
feature.

Sugar has to be restarted after installing Scratch to show the icon.

John, could you please make the following changes in the next Scratch
version:
- add the line "mime_types = application/x-scratch-project" to the
activity.info file
- copy the scratch icon to "application-x-scratch-project.svg" in the
activity directory

Etoys gets configured by different packages. e.g. the rpm
etoys-3.0.2153-1.noarch is adding the file
/usr/share/mime/packges/etoys.xml and the rpm 
sugar-artwork-0.82.3-1.olpc3 is

adding the file
/usr/share/icons/sugar/scalable/mimetypes/application-x-squake-project.svg. 



Regards,
Philipp




http://www.freedesktop.org/standards/shared-mime-info";>
   
 Scratch Project
 
   

#!/bin/sh
# Author: Bert Freudenberg
# Modified by: John Maloney
# Purpose: Run Scratch using the Squeak virtual machine

echo "scratch-activity"
echo "$@"

echo "$0" "$@"
echo

# arguments are unordered, have to loop
args=""
while [ -n "$2" ] ; do
case "$1" in
-b | --bundle-id)   bundle_id="$2"   ; args="$args BUNDLE_ID $2" ;;
-a | --activity-id) activity_id="$2" ; args="$args ACTIVITY_ID $2";;
-o | --object-id)   object_id="$2"   ; args="$args OBJECT_ID $2";;
-u | --uri) uri="$2" ; args="$args URI $2";;
*) echo unknown argument $1 $2 ;;
esac
shift;shift
done

# really need bundle id and activity id
if [ -z "$bundle_id" -o -z "$activity_id" ] ; then
  echo ERROR: bundle-id and activity-id arguments required
  echo Aborting
  exit 1
fi

# some debug output
echo launching $bundle_id instance $activity_id
[ -n "$object_id" ] && echo with journal obj $object_id
[ -n "$uri"   ] && echo loading uri $uri
echo

# do not crash on dbus errors
export DBUS_FATAL_WARNINGS=0

if [ -n "$object_id" ] ; then
JOURNAL_DIR="$SUGAR_ACTIVITY_ROOT/data/Journal"
mkdir -p "$JOURNAL_DIR"
temp_filename="$JOURNAL_DIR/temp.sb"
title=`copy-from-journal -o "$object_id" -m "$temp_filename" | grep 
"title "`
# title is something like this for files downloaded from server:
#   title -> File do_math_3.sb from 
http://schoolserver/Scratch/do_math_3.sb.
# or like this if copied from USB flash drive:
#   title -> do_math_3
title=${title#*"title -> "} #cut off description
echo "title: $title"

# workaround for copy-from-journal bug (adds another dot before 
fileextension)
if [ -f "$JOURNAL_DIR/temp..sb" ] ; then
   

Re: [Sugar-devel] Journal integration for Scratch

2009-01-13 Thread Bert Freudenberg

On 13.01.2009, at 19:14, Eben Eliason wrote:

> On Tue, Jan 13, 2009 at 12:49 PM, Bert Freudenberg  > wrote:
>>
>> On 13.01.2009, at 17:22, Eben Eliason wrote:
>>
> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake-
> project.svg.

 Interesting ... thanks for the archaeology :)

 Eben: see, I did remember correctly there was an icon for the
 document
 independent of the activity ;)
>>>
>>> Indeed. However, that one's not mine, and I wasn't aware of it. I
>>> think it must have been copied before I or someone else (don't  
>>> recall)
>>> matched the Etoys icon to the spec.  I just checked the file you
>>> mention, and it clearly has a 75x75 pixel canvas, which is why it's
>>> being scaled down.
>>
>>
>> I see. So this is really really old, from before the icon dimensions
>> were changed. Someone who understood the system back then must have
>> taken the Etoys icon and checked it in as the mime type icon. Would
>> make sense to upgrade it to the current icon now :)
>
> Right. From my understanding of the conversation, this needs to be
> updated within the bundle, right?  This isn't something that should
> need to live in artwork.


What's the precedence of icons in the system vs the bundle?

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Journal integration for Scratch

2009-01-13 Thread Eben Eliason
On Tue, Jan 13, 2009 at 12:49 PM, Bert Freudenberg  wrote:
>
> On 13.01.2009, at 17:22, Eben Eliason wrote:
>
 /usr/share/icons/sugar/scalable/mimetypes/application-x-squake-
 project.svg.
>>>
>>> Interesting ... thanks for the archaeology :)
>>>
>>> Eben: see, I did remember correctly there was an icon for the
>>> document
>>> independent of the activity ;)
>>
>> Indeed. However, that one's not mine, and I wasn't aware of it. I
>> think it must have been copied before I or someone else (don't recall)
>> matched the Etoys icon to the spec.  I just checked the file you
>> mention, and it clearly has a 75x75 pixel canvas, which is why it's
>> being scaled down.
>
>
> I see. So this is really really old, from before the icon dimensions
> were changed. Someone who understood the system back then must have
> taken the Etoys icon and checked it in as the mime type icon. Would
> make sense to upgrade it to the current icon now :)

Right. From my understanding of the conversation, this needs to be
updated within the bundle, right?  This isn't something that should
need to live in artwork.

- Eben


> - Bert -
>
> ___
> Sugar-devel mailing list
> sugar-de...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Journal integration for Scratch

2009-01-13 Thread Bert Freudenberg

On 13.01.2009, at 17:22, Eben Eliason wrote:

>>> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake-
>>> project.svg.
>>
>> Interesting ... thanks for the archaeology :)
>>
>> Eben: see, I did remember correctly there was an icon for the  
>> document
>> independent of the activity ;)
>
> Indeed. However, that one's not mine, and I wasn't aware of it. I
> think it must have been copied before I or someone else (don't recall)
> matched the Etoys icon to the spec.  I just checked the file you
> mention, and it clearly has a 75x75 pixel canvas, which is why it's
> being scaled down.


I see. So this is really really old, from before the icon dimensions  
were changed. Someone who understood the system back then must have  
taken the Etoys icon and checked it in as the mime type icon. Would  
make sense to upgrade it to the current icon now :)

- Bert -

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Journal integration for Scratch

2009-01-13 Thread Eben Eliason
On Tue, Jan 13, 2009 at 3:54 AM, Bert Freudenberg  wrote:
> On 13.01.2009, at 06:55, Philipp Kocher wrote:
>
>> Thanks Tomeu to lead me to the /home/olpc/.local directory. However,
>> the
>> mimetypes.xml is not necessary to get the icon in the journal. I just
>> had to copy the scratch icon file in the activity directory to
>> "application-x-scratch-project.svg" (also in the scratch activity
>> dirctory). The Memorize Activity is a good example for using that
>> feature.
>> Sugar has to be restarted after installing Scratch to show the icon.
>
> Thanks! This is not documented anywhere I know of. So I put it here:
>
> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>
> Hope someone can proof-read / confirm.
>
>> Etoys gets configured by different packages. e.g. the rpm
>> etoys-3.0.2153-1.noarch is adding the file
>> /usr/share/mime/packges/etoys.xml and the rpm sugar-
>> artwork-0.82.3-1.olpc3 is
>> adding the file
>> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake-
>> project.svg.
>
>
> Interesting ... thanks for the archaeology :)
>
> Eben: see, I did remember correctly there was an icon for the document
> independent of the activity ;)

Indeed. However, that one's not mine, and I wasn't aware of it. I
think it must have been copied before I or someone else (don't recall)
matched the Etoys icon to the spec.  I just checked the file you
mention, and it clearly has a 75x75 pixel canvas, which is why it's
being scaled down.

- Eben

> That must be the smaller version.
>
> - Bert -
>
>
> ___
> Sugar-devel mailing list
> sugar-de...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-13 Thread Bert Freudenberg

On 13.01.2009, at 13:30, John Maloney wrote:

> Hi, Phillip.
>
> Thanks for all your hard work in tracking this down. I had looked at  
> several other packages, including EToys, and couldn't figure out  
> from them how to do this.
>
> I will make these changes to the next XO Scratch bundle.
>
> Is that all I need to do? What about the mime types XML file similar  
> to the one added by Etoys? Does that turn out to be unnecessary?

That file provides the mapping from file extensions to MIME types, so  
it is needed for Scratch bundles downloaded from the Web or a USB  
memory stick to be recognized as such.

- Bert -


>   -- John
>
>
> On Jan 13, 2009, at 12:55 AM, Philipp Kocher wrote:
>> Tomeu Vizoso wrote:
>>> On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg >> > wrote:
 On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
>> So what would the Scratch activity have to do so files put into  
>> the
>> Journal
>> (maybe by downloading) are displayed using a Scratch icon  
>> rather than the
>> generic document icon?
> Shipping a mimetypes.xml file inside the bundle as explained here:
>
> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>
> Sugar will call update-mime-database and will merge that file  
> into the
> xdg mime database.
>
> I think that John is already trying this.

 Guess I'm confused then - I thought that's exactly what Philipp  
 had done.
>>> I think he just changed the mime_types field in the .info file.
 And I just checked and it does work with Etoys projects. When  
 downloading
 one it indeed gets an etoys icon (although at a smaller size -  
 why is that?)
>>> No idea, though I think that the mime database is updated in the  
>>> etoys
>>> rpm and not in the bundle, am I right?
>>> Regards,
>>> Tomeu
>>
>> Thanks Tomeu to lead me to the /home/olpc/.local directory.  
>> However, the
>> mimetypes.xml is not necessary to get the icon in the journal. I just
>> had to copy the scratch icon file in the activity directory to
>> "application-x-scratch-project.svg" (also in the scratch activity
>> dirctory). The Memorize Activity is a good example for using that  
>> feature.
>> Sugar has to be restarted after installing Scratch to show the icon.
>>
>> John, could you please make the following changes in the next Scratch
>> version:
>> - add the line "mime_types = application/x-scratch-project" to the
>> activity.info file
>> - copy the scratch icon to "application-x-scratch-project.svg" in the
>> activity directory
>>
>> Etoys gets configured by different packages. e.g. the rpm
>> etoys-3.0.2153-1.noarch is adding the file
>> /usr/share/mime/packges/etoys.xml and the rpm sugar- 
>> artwork-0.82.3-1.olpc3 is
>> adding the file
>> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake- 
>> project.svg.
>>
>> Regards,
>> Philipp
>>
>



___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-13 Thread John Maloney
Hi, Phillip.

Thanks for all your hard work in tracking this down. I had looked at  
several other packages, including EToys, and couldn't figure out from  
them how to do this.

I will make these changes to the next XO Scratch bundle.

Is that all I need to do? What about the mime types XML file similar  
to the one added by Etoys? Does that turn out to be unnecessary?

-- John


On Jan 13, 2009, at 12:55 AM, Philipp Kocher wrote:
> Tomeu Vizoso wrote:
>> On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg  
>>  wrote:
>>> On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
> So what would the Scratch activity have to do so files put into  
> the
> Journal
> (maybe by downloading) are displayed using a Scratch icon rather  
> than the
> generic document icon?
 Shipping a mimetypes.xml file inside the bundle as explained here:

 http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure

 Sugar will call update-mime-database and will merge that file  
 into the
 xdg mime database.

 I think that John is already trying this.
>>>
>>> Guess I'm confused then - I thought that's exactly what Philipp  
>>> had done.
>> I think he just changed the mime_types field in the .info file.
>>> And I just checked and it does work with Etoys projects. When  
>>> downloading
>>> one it indeed gets an etoys icon (although at a smaller size - why  
>>> is that?)
>> No idea, though I think that the mime database is updated in the  
>> etoys
>> rpm and not in the bundle, am I right?
>> Regards,
>> Tomeu
>
> Thanks Tomeu to lead me to the /home/olpc/.local directory. However,  
> the
> mimetypes.xml is not necessary to get the icon in the journal. I just
> had to copy the scratch icon file in the activity directory to
> "application-x-scratch-project.svg" (also in the scratch activity
> dirctory). The Memorize Activity is a good example for using that  
> feature.
> Sugar has to be restarted after installing Scratch to show the icon.
>
> John, could you please make the following changes in the next Scratch
> version:
> - add the line "mime_types = application/x-scratch-project" to the
> activity.info file
> - copy the scratch icon to "application-x-scratch-project.svg" in the
> activity directory
>
> Etoys gets configured by different packages. e.g. the rpm
> etoys-3.0.2153-1.noarch is adding the file
> /usr/share/mime/packges/etoys.xml and the rpm sugar- 
> artwork-0.82.3-1.olpc3 is
> adding the file
> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake- 
> project.svg.
>
> Regards,
> Philipp
>

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-13 Thread Tomeu Vizoso
On Tue, Jan 13, 2009 at 06:55, Philipp Kocher  wrote:
>
>
> Tomeu Vizoso wrote:
>>
>> On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg 
>> wrote:
>>>
>>> On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
>
> So what would the Scratch activity have to do so files put into the
> Journal
> (maybe by downloading) are displayed using a Scratch icon rather than
> the
> generic document icon?

 Shipping a mimetypes.xml file inside the bundle as explained here:

 http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure

 Sugar will call update-mime-database and will merge that file into the
 xdg mime database.

 I think that John is already trying this.
>>>
>>> Guess I'm confused then - I thought that's exactly what Philipp had done.
>>
>> I think he just changed the mime_types field in the .info file.
>>
>>> And I just checked and it does work with Etoys projects. When downloading
>>> one it indeed gets an etoys icon (although at a smaller size - why is
>>> that?)
>>
>> No idea, though I think that the mime database is updated in the etoys
>> rpm and not in the bundle, am I right?
>>
>> Regards,
>>
>> Tomeu
>>
>
> Thanks Tomeu to lead me to the /home/olpc/.local directory. However, the
> mimetypes.xml is not necessary to get the icon in the journal. I just
> had to copy the scratch icon file in the activity directory to
> "application-x-scratch-project.svg" (also in the scratch activity
> dirctory). The Memorize Activity is a good example for using that feature.
> Sugar has to be restarted after installing Scratch to show the icon.

Yes, you are right in that you don't need to mess with mimetypes.xml
if you only want to set the icon for a mime type.

mimetype.xml also serves to associate a file extension with a mime
type, and Scratch might also want this so that scratch projects copied
from a removable files are correctly identified as such.

Thanks,

Tomeu

> John, could you please make the following changes in the next Scratch
> version:
> - add the line "mime_types = application/x-scratch-project" to the
> activity.info file
> - copy the scratch icon to "application-x-scratch-project.svg" in the
> activity directory
>
> Etoys gets configured by different packages. e.g. the rpm
> etoys-3.0.2153-1.noarch is adding the file
> /usr/share/mime/packges/etoys.xml and the rpm sugar-artwork-0.82.3-1.olpc3
> is
> adding the file
> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake-project.svg.
>
> Regards,
> Philipp
>
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-13 Thread Bert Freudenberg
On 13.01.2009, at 06:55, Philipp Kocher wrote:

> Thanks Tomeu to lead me to the /home/olpc/.local directory. However,  
> the
> mimetypes.xml is not necessary to get the icon in the journal. I just
> had to copy the scratch icon file in the activity directory to
> "application-x-scratch-project.svg" (also in the scratch activity
> dirctory). The Memorize Activity is a good example for using that  
> feature.
> Sugar has to be restarted after installing Scratch to show the icon.

Thanks! This is not documented anywhere I know of. So I put it here:

http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure

Hope someone can proof-read / confirm.

> Etoys gets configured by different packages. e.g. the rpm
> etoys-3.0.2153-1.noarch is adding the file
> /usr/share/mime/packges/etoys.xml and the rpm sugar- 
> artwork-0.82.3-1.olpc3 is
> adding the file
> /usr/share/icons/sugar/scalable/mimetypes/application-x-squake- 
> project.svg.


Interesting ... thanks for the archaeology :)

Eben: see, I did remember correctly there was an icon for the document  
independent of the activity ;)

That must be the smaller version.

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Philipp Kocher


Tomeu Vizoso wrote:
> On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg  wrote:
>> On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
 So what would the Scratch activity have to do so files put into the
 Journal
 (maybe by downloading) are displayed using a Scratch icon rather than the
 generic document icon?
>>> Shipping a mimetypes.xml file inside the bundle as explained here:
>>>
>>> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>>>
>>> Sugar will call update-mime-database and will merge that file into the
>>> xdg mime database.
>>>
>>> I think that John is already trying this.
>>
>> Guess I'm confused then - I thought that's exactly what Philipp had done.
> 
> I think he just changed the mime_types field in the .info file.
> 
>> And I just checked and it does work with Etoys projects. When downloading
>> one it indeed gets an etoys icon (although at a smaller size - why is that?)
> 
> No idea, though I think that the mime database is updated in the etoys
> rpm and not in the bundle, am I right?
> 
> Regards,
> 
> Tomeu
> 

Thanks Tomeu to lead me to the /home/olpc/.local directory. However, the
mimetypes.xml is not necessary to get the icon in the journal. I just
had to copy the scratch icon file in the activity directory to
"application-x-scratch-project.svg" (also in the scratch activity
dirctory). The Memorize Activity is a good example for using that feature.
Sugar has to be restarted after installing Scratch to show the icon.

John, could you please make the following changes in the next Scratch
version:
- add the line "mime_types = application/x-scratch-project" to the
activity.info file
- copy the scratch icon to "application-x-scratch-project.svg" in the
activity directory

Etoys gets configured by different packages. e.g. the rpm
etoys-3.0.2153-1.noarch is adding the file
/usr/share/mime/packges/etoys.xml and the rpm 
sugar-artwork-0.82.3-1.olpc3 is
adding the file
/usr/share/icons/sugar/scalable/mimetypes/application-x-squake-project.svg.

Regards,
Philipp

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Journal integration for Scratch

2009-01-12 Thread Eben Eliason
On Mon, Jan 12, 2009 at 2:23 PM, Bert Freudenberg  wrote:
> On 12.01.2009, at 19:30, Tomeu Vizoso wrote:
>>
>>> And I just checked and it does work with Etoys projects. When downloading
>>> one it indeed gets an etoys icon (although at a smaller size - why is
>>> that?)
>>
>> No idea, though I think that the mime database is updated in the etoys
>> rpm and not in the bundle, am I right?
>
>
> Yes. Though I can't imagine how that would affect the icon size:
>
>
>
>
> Or is it intentional?

Definitely not intentional.

- Eben


>
> - Bert -
>
> ___
> Sugar-devel mailing list
> sugar-de...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Bert Freudenberg

On 12.01.2009, at 19:30, Tomeu Vizoso wrote:


And I just checked and it does work with Etoys projects. When  
downloading
one it indeed gets an etoys icon (although at a smaller size - why  
is that?)


No idea, though I think that the mime database is updated in the etoys
rpm and not in the bundle, am I right?



Yes. Though I can't imagine how that would affect the icon size:

<>


Or is it intentional?


- Bert -
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg  wrote:
> On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
>>>
>>> So what would the Scratch activity have to do so files put into the
>>> Journal
>>> (maybe by downloading) are displayed using a Scratch icon rather than the
>>> generic document icon?
>>
>> Shipping a mimetypes.xml file inside the bundle as explained here:
>>
>> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>>
>> Sugar will call update-mime-database and will merge that file into the
>> xdg mime database.
>>
>> I think that John is already trying this.
>
>
> Guess I'm confused then - I thought that's exactly what Philipp had done.

I think he just changed the mime_types field in the .info file.

> And I just checked and it does work with Etoys projects. When downloading
> one it indeed gets an etoys icon (although at a smaller size - why is that?)

No idea, though I think that the mime database is updated in the etoys
rpm and not in the bundle, am I right?

Regards,

Tomeu
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Bert Freudenberg
On 12.01.2009, at 18:11, Tomeu Vizoso wrote:
>>
>> So what would the Scratch activity have to do so files put into the  
>> Journal
>> (maybe by downloading) are displayed using a Scratch icon rather  
>> than the
>> generic document icon?
>
> Shipping a mimetypes.xml file inside the bundle as explained here:
>
> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>
> Sugar will call update-mime-database and will merge that file into the
> xdg mime database.
>
> I think that John is already trying this.


Guess I'm confused then - I thought that's exactly what Philipp had  
done.

And I just checked and it does work with Etoys projects. When  
downloading one it indeed gets an etoys icon (although at a smaller  
size - why is that?)

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
On Mon, Jan 12, 2009 at 18:16, Eben Eliason  wrote:
> On Mon, Jan 12, 2009 at 12:11 PM, Tomeu Vizoso  wrote:
>> On Mon, Jan 12, 2009 at 18:07, Bert Freudenberg  wrote:
>>>
>>> On 12.01.2009, at 17:55, Tomeu Vizoso wrote:
>>>
 On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg 
 wrote:
>
> On 12.01.2009, at 17:03, Tomeu Vizoso wrote:
>
>> On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg 
>> wrote:
>>>
>>> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>>>
 Ok, what you just did will tell Sugar that Scratch is able to open
 files with the mime type 'application/x-scratch-project'. But this
 will not affect the icon of those files.
>>>
>>> Is there a way to assign icons for files other than by saving it in an
>>> activity?
>>
>> Currently, only by changing the mime-type.
>
>
> Maybe I misunderstood then. How is the icon for a mime type such as
> application/x-scratch-project found then?

 We are using the xdg mime database, the mimetypes.xml file contained
 in activities is added to that database. So that's the mechanism
 through which activities can associate icons to mime types.
>>>
>>>
>>> So what would the Scratch activity have to do so files put into the Journal
>>> (maybe by downloading) are displayed using a Scratch icon rather than the
>>> generic document icon?
>>
>> Shipping a mimetypes.xml file inside the bundle as explained here:
>>
>> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>>
>> Sugar will call update-mime-database and will merge that file into the
>> xdg mime database.
>
> What does this merge do with conflicts?  It seems we might need a way
> for the most recent activity which has used a given object to apply
> its own icon for it, which isn't covered by this case.  Would the most
> recently installed activity trump the rest?

Not sure about what we can do regarding this while not having to cook
our own mime info stuff. This is the spec implemented by the tools we
are using:

http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec

Regards,

Tomeu

> - Eben
>
>
>> I think that John is already trying this.
>>
>> Regards,
>>
>> Tomeu
>> ___
>> Sugar-devel mailing list
>> sugar-de...@lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Journal integration for Scratch

2009-01-12 Thread Eben Eliason
On Mon, Jan 12, 2009 at 12:11 PM, Tomeu Vizoso  wrote:
> On Mon, Jan 12, 2009 at 18:07, Bert Freudenberg  wrote:
>>
>> On 12.01.2009, at 17:55, Tomeu Vizoso wrote:
>>
>>> On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg 
>>> wrote:

 On 12.01.2009, at 17:03, Tomeu Vizoso wrote:

> On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg 
> wrote:
>>
>> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>>
>>> Ok, what you just did will tell Sugar that Scratch is able to open
>>> files with the mime type 'application/x-scratch-project'. But this
>>> will not affect the icon of those files.
>>
>> Is there a way to assign icons for files other than by saving it in an
>> activity?
>
> Currently, only by changing the mime-type.


 Maybe I misunderstood then. How is the icon for a mime type such as
 application/x-scratch-project found then?
>>>
>>> We are using the xdg mime database, the mimetypes.xml file contained
>>> in activities is added to that database. So that's the mechanism
>>> through which activities can associate icons to mime types.
>>
>>
>> So what would the Scratch activity have to do so files put into the Journal
>> (maybe by downloading) are displayed using a Scratch icon rather than the
>> generic document icon?
>
> Shipping a mimetypes.xml file inside the bundle as explained here:
>
> http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure
>
> Sugar will call update-mime-database and will merge that file into the
> xdg mime database.

What does this merge do with conflicts?  It seems we might need a way
for the most recent activity which has used a given object to apply
its own icon for it, which isn't covered by this case.  Would the most
recently installed activity trump the rest?

- Eben


> I think that John is already trying this.
>
> Regards,
>
> Tomeu
> ___
> Sugar-devel mailing list
> sugar-de...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
On Mon, Jan 12, 2009 at 18:07, Bert Freudenberg  wrote:
>
> On 12.01.2009, at 17:55, Tomeu Vizoso wrote:
>
>> On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg 
>> wrote:
>>>
>>> On 12.01.2009, at 17:03, Tomeu Vizoso wrote:
>>>
 On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg 
 wrote:
>
> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>
>> Ok, what you just did will tell Sugar that Scratch is able to open
>> files with the mime type 'application/x-scratch-project'. But this
>> will not affect the icon of those files.
>
> Is there a way to assign icons for files other than by saving it in an
> activity?

 Currently, only by changing the mime-type.
>>>
>>>
>>> Maybe I misunderstood then. How is the icon for a mime type such as
>>> application/x-scratch-project found then?
>>
>> We are using the xdg mime database, the mimetypes.xml file contained
>> in activities is added to that database. So that's the mechanism
>> through which activities can associate icons to mime types.
>
>
> So what would the Scratch activity have to do so files put into the Journal
> (maybe by downloading) are displayed using a Scratch icon rather than the
> generic document icon?

Shipping a mimetypes.xml file inside the bundle as explained here:

http://wiki.laptop.org/go/Activity_bundles#Bundle_Structure

Sugar will call update-mime-database and will merge that file into the
xdg mime database.

I think that John is already trying this.

Regards,

Tomeu
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Bert Freudenberg

On 12.01.2009, at 17:55, Tomeu Vizoso wrote:

> On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg  
>  wrote:
>>
>> On 12.01.2009, at 17:03, Tomeu Vizoso wrote:
>>
>>> On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg >> >
>>> wrote:

 On 12.01.2009, at 10:16, Tomeu Vizoso wrote:

> Ok, what you just did will tell Sugar that Scratch is able to open
> files with the mime type 'application/x-scratch-project'. But this
> will not affect the icon of those files.

 Is there a way to assign icons for files other than by saving it  
 in an
 activity?
>>>
>>> Currently, only by changing the mime-type.
>>
>>
>> Maybe I misunderstood then. How is the icon for a mime type such as
>> application/x-scratch-project found then?
>
> We are using the xdg mime database, the mimetypes.xml file contained
> in activities is added to that database. So that's the mechanism
> through which activities can associate icons to mime types.


So what would the Scratch activity have to do so files put into the  
Journal (maybe by downloading) are displayed using a Scratch icon  
rather than the generic document icon?

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg  wrote:
>
> On 12.01.2009, at 17:03, Tomeu Vizoso wrote:
>
>> On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg 
>> wrote:
>>>
>>> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>>>
 Ok, what you just did will tell Sugar that Scratch is able to open
 files with the mime type 'application/x-scratch-project'. But this
 will not affect the icon of those files.
>>>
>>> Is there a way to assign icons for files other than by saving it in an
>>> activity?
>>
>> Currently, only by changing the mime-type.
>
>
> Maybe I misunderstood then. How is the icon for a mime type such as
> application/x-scratch-project found then?

We are using the xdg mime database, the mimetypes.xml file contained
in activities is added to that database. So that's the mechanism
through which activities can associate icons to mime types.

In a python shell inside strace -e open:

>>> gio.content_type_get_icon('image/png')
open("/home/tomeu/.local/share//mime/mime.cache", O_RDONLY|O_LARGEFILE) = 3
open("/home/tomeu/sugar-jhbuild/install/share/mime/mime.cache",
O_RDONLY|O_LARGEFILE) = 3
open("/usr/share/mime/mime.cache", O_RDONLY|O_LARGEFILE) = 3
open("/usr/local/share//mime/aliases", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/local/share//mime/subclasses", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/local/share//mime/icons", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
open("/usr/local/share//mime/generic-icons", O_RDONLY|O_LARGEFILE) =
-1 ENOENT (No such file or directory)
open("/usr/share//mime/mime.cache", O_RDONLY|O_LARGEFILE) = 3
open("/usr/share/gdm//mime/aliases", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
open("/usr/share/gdm//mime/subclasses", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/share/gdm//mime/icons", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
open("/usr/share/gdm//mime/generic-icons", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)


Regards,

Tomeu
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Bert Freudenberg

On 12.01.2009, at 17:03, Tomeu Vizoso wrote:

> On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg  
>  wrote:
>> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>>
>>> Ok, what you just did will tell Sugar that Scratch is able to open
>>> files with the mime type 'application/x-scratch-project'. But this
>>> will not affect the icon of those files.
>>
>> Is there a way to assign icons for files other than by saving it in  
>> an
>> activity?
>
> Currently, only by changing the mime-type.


Maybe I misunderstood then. How is the icon for a mime type such as  
application/x-scratch-project found then?

- Bert -

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Journal integration for Scratch

2009-01-12 Thread Eben Eliason
This is something I've briefly discussed with Marco in the past.  It
seems a natural extension of the idea of "objects" as first class
citizens of Sugar to allow those objects to have custom icons and
identities.  Right now, we have no such support.

The most natural way (at least for me, as a Mac user) to visualize
this idea is in the form of type/creator associations, by which an
object would be assigned the icon for type t as defined by its creator
c. This scheme is nice because it makes the effort on the part of
activities rather simple (most importantly, static): define your set
of icons and the mime-types the represent within your activity bundle,
and the system will always apply the correct icons.

However, it seems this can't work for Sugar.  I suppose we could
simply allow an activity to assign an icon to a given object at will,
as you mention.  It might be the best way to achieve a similar effect,
albeit with more effort on the part of activities.

- Eben


On Mon, Jan 12, 2009 at 10:52 AM, Bert Freudenberg  wrote:
> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>
>> Ok, what you just did will tell Sugar that Scratch is able to open
>> files with the mime type 'application/x-scratch-project'. But this
>> will not affect the icon of those files.
>
> Is there a way to assign icons for files other than by saving it in an
> activity?
>
> - Bert -
>
>
> ___
> Sugar-devel mailing list
> sugar-de...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg  wrote:
> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>
>> Ok, what you just did will tell Sugar that Scratch is able to open
>> files with the mime type 'application/x-scratch-project'. But this
>> will not affect the icon of those files.
>
> Is there a way to assign icons for files other than by saving it in an
> activity?

Currently, only by changing the mime-type.

Regards,

Tomeu
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Bert Freudenberg
On 12.01.2009, at 10:16, Tomeu Vizoso wrote:

> Ok, what you just did will tell Sugar that Scratch is able to open
> files with the mime type 'application/x-scratch-project'. But this
> will not affect the icon of those files.

Is there a way to assign icons for files other than by saving it in an  
activity?

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
[adding sugar-devel to the cc list]

On Mon, Jan 12, 2009 at 09:42, Philipp Kocher  wrote:
>
>
> Tomeu Vizoso wrote:
>>
>> On Thu, Jan 8, 2009 at 04:50, Philipp Kocher 
>> wrote:
>>>
>>> Bert Freudenberg wrote:

 On 18.12.2008, at 08:08, Philipp Kocher wrote:
>
> One more thing, the scratch icon is not shown in the journal for files
> with the scratch mimetype. I think the file
> /usr/share/sugar/data/mime.defaults has to be adapted to include the
> scratch-mimetype.

 It just has to be listed in the activity bundle's info file:

 http://wiki.laptop.org/go/Activity_bundles#.info_File_Format

 - Bert -


>>> I added the mime_types attribute to the activities.info file and the
>>> icon attribute is set as well. But still the Scratch icon is not shown
>>> in the Journal (the default octet-stream icon is shown) even so the
>>> Scratch mime-type is set in the metadata file in the datastore.
>>>
>>> I think the problem is connected to the gtk theme (gtk-update-icon-cache
>>> and update-mime-database). e.g. etoys has file etoys.xml in
>>> /usr/share/mime/packages and probably the icon in the icon cache.
>>>
>>> How can I put the icon in the icon-cache?
>>
>> Hi, Sugar will put it there for you when the .xo bundle is installed.
>> That means that if the activity bundle gets installed from outside
>> Sugar, the mime db won't be updated.
>>
>> So, I would recommend you to uninstall Scratch from Sugar, then
>> installing the .xo bundle by downloading it with Browse or by copying
>> it into the journal from an usb stick.
>>
>> HTH,
>>
>> Tomeu
>>
>
> Thanks for the input, but I wasn't successful.
>
> I tried the following:
> 1. Extracted the files of "Scratch-12.xo"
> 2. Added the line "mime_types = application/x-scratch-project" to the
> activity.info file
> 2. Created a new archive file "Scratch-12_mime.xo" with the change
> 3. Erased activity Scratch on the XO
> 4. Copied the file "Scratch-12_mime.xo" to the Journal
> 5. Started/Installed "Scratch-12_mime.xo"
> 6. Copied Scratch project to the Journal with "copy-to-journal test.sb -m
> 'application/x-scratch-project' -t test.sb"

Ok, what you just did will tell Sugar that Scratch is able to open
files with the mime type 'application/x-scratch-project'. But this
will not affect the icon of those files.

> test.sb still has the standard icon and not the Scratch cat icon in the
> Journal.
>
> Which activity is using the mime db update feature?

Don't know myself :/

> I would expect a new
> timestamp for the file /usr/share/mime/mime.cache after installing the
> activity.

Well, activities are installed by a normal user so that file won't be
modified. Instead, the cache will live in ~/.local/share/mime

> Can I execute the mime db update on the command line?

Yes: update-mime-database ~/.local/share/mime

If you want to get the details and fully understand how this is done,
you can check this code:

http://git.sugarlabs.org/projects/sugar-toolkit/repos/mainline/blobs/master/src/sugar/bundle/activitybundle.py#line318

That gets executed when a bundle is unpacked and registered in the
shell. As you can see, if a file activity/mimetypes.xml is found in
the exploded dir, a symlink will be made to this file form the mime
dir and the updater script will be run.

HTH,

Tomeu
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-12 Thread Philipp Kocher


Tomeu Vizoso wrote:
> On Thu, Jan 8, 2009 at 04:50, Philipp Kocher  wrote:
>> Bert Freudenberg wrote:
>>> On 18.12.2008, at 08:08, Philipp Kocher wrote:
 One more thing, the scratch icon is not shown in the journal for files
 with the scratch mimetype. I think the file
 /usr/share/sugar/data/mime.defaults has to be adapted to include the
 scratch-mimetype.
>>>
>>> It just has to be listed in the activity bundle's info file:
>>>
>>> http://wiki.laptop.org/go/Activity_bundles#.info_File_Format
>>>
>>> - Bert -
>>>
>>>
>> I added the mime_types attribute to the activities.info file and the
>> icon attribute is set as well. But still the Scratch icon is not shown
>> in the Journal (the default octet-stream icon is shown) even so the
>> Scratch mime-type is set in the metadata file in the datastore.
>>
>> I think the problem is connected to the gtk theme (gtk-update-icon-cache
>> and update-mime-database). e.g. etoys has file etoys.xml in
>> /usr/share/mime/packages and probably the icon in the icon cache.
>>
>> How can I put the icon in the icon-cache?
> 
> Hi, Sugar will put it there for you when the .xo bundle is installed.
> That means that if the activity bundle gets installed from outside
> Sugar, the mime db won't be updated.
> 
> So, I would recommend you to uninstall Scratch from Sugar, then
> installing the .xo bundle by downloading it with Browse or by copying
> it into the journal from an usb stick.
> 
> HTH,
> 
> Tomeu
> 

Thanks for the input, but I wasn't successful.

I tried the following:
1. Extracted the files of "Scratch-12.xo"
2. Added the line "mime_types = application/x-scratch-project" to the 
activity.info file
2. Created a new archive file "Scratch-12_mime.xo" with the change
3. Erased activity Scratch on the XO
4. Copied the file "Scratch-12_mime.xo" to the Journal
5. Started/Installed "Scratch-12_mime.xo"
6. Copied Scratch project to the Journal with "copy-to-journal test.sb 
-m 'application/x-scratch-project' -t test.sb"

test.sb still has the standard icon and not the Scratch cat icon in the 
Journal.

Which activity is using the mime db update feature? I would expect a new 
timestamp for the file /usr/share/mime/mime.cache after installing the 
activity.
Can I execute the mime db update on the command line?

Regards,
Philipp
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-08 Thread Tomeu Vizoso
On Thu, Jan 8, 2009 at 04:50, Philipp Kocher  wrote:
> Bert Freudenberg wrote:
>> On 18.12.2008, at 08:08, Philipp Kocher wrote:
>>>
>>> One more thing, the scratch icon is not shown in the journal for files
>>> with the scratch mimetype. I think the file
>>> /usr/share/sugar/data/mime.defaults has to be adapted to include the
>>> scratch-mimetype.
>>
>>
>> It just has to be listed in the activity bundle's info file:
>>
>> http://wiki.laptop.org/go/Activity_bundles#.info_File_Format
>>
>> - Bert -
>>
>>
> I added the mime_types attribute to the activities.info file and the
> icon attribute is set as well. But still the Scratch icon is not shown
> in the Journal (the default octet-stream icon is shown) even so the
> Scratch mime-type is set in the metadata file in the datastore.
>
> I think the problem is connected to the gtk theme (gtk-update-icon-cache
> and update-mime-database). e.g. etoys has file etoys.xml in
> /usr/share/mime/packages and probably the icon in the icon cache.
>
> How can I put the icon in the icon-cache?

Hi, Sugar will put it there for you when the .xo bundle is installed.
That means that if the activity bundle gets installed from outside
Sugar, the mime db won't be updated.

So, I would recommend you to uninstall Scratch from Sugar, then
installing the .xo bundle by downloading it with Browse or by copying
it into the journal from an usb stick.

HTH,

Tomeu
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2009-01-07 Thread Philipp Kocher
Bert Freudenberg wrote:
> On 18.12.2008, at 08:08, Philipp Kocher wrote:
>>
>> One more thing, the scratch icon is not shown in the journal for files
>> with the scratch mimetype. I think the file
>> /usr/share/sugar/data/mime.defaults has to be adapted to include the
>> scratch-mimetype.
> 
> 
> It just has to be listed in the activity bundle's info file:
> 
> http://wiki.laptop.org/go/Activity_bundles#.info_File_Format
> 
> - Bert -
> 
> 
I added the mime_types attribute to the activities.info file and the 
icon attribute is set as well. But still the Scratch icon is not shown 
in the Journal (the default octet-stream icon is shown) even so the 
Scratch mime-type is set in the metadata file in the datastore.

I think the problem is connected to the gtk theme (gtk-update-icon-cache 
and update-mime-database). e.g. etoys has file etoys.xml in 
/usr/share/mime/packages and probably the icon in the icon cache.

How can I put the icon in the icon-cache?

Regards,
Philipp
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-25 Thread Philipp Kocher
Hi John

Sorry for the late response.

I think to increase the font size in the file dialog is a good idea. As
for the thumbnails and project notes, for us an easy way to open and
save the projects is more important than to see a thumbnail and project
notes (the filename and the date when the project was saved is enough
information for us).

If the examples and the own projects would be separated (e.g. a button
examples) would help as well. It is quite confusing for the students
that they can not save their projects in some folders (folder symbols of
own folders and example folders look the same, but no write permission
for the example folders). TurtleArt has such a solution.

Scratch is the favourite Activity at our school, even so it is quite
hard for the students to drag and drop the small command icons on the XO
with the jumping mouse cursor problem.

I am aware that these are all just XO problems and you have to maintain
other platforms as well. Thanks for your great support for Scratch on
the XO.

Thanks,
Philipp
Pepyride School
Cambodia

John Maloney wrote:
> Hi, Phillip.
> 
> Re: Do you plan a journal integration for scratch?
> 
> Probably not in the near future. There has been talk about making an API 
> for the Journal that looks more like a file system to application 
> programs. That might be the easiest way to integrate the Journal into 
> Scratch in the long run.
> 
> Sugar continues to evolve. Earlier versions still allowed access to the 
> file system in a way that made it fairly easy to port applications like 
> Scratch. More recently, with the Rainbow security system, it became much 
> more difficult to use the file system directly.
> 
> I support Scratch on many different platforms. The XO is an important 
> one due to the educational mission of OLPC. Still, my time is limited 
> and I can only spend so much of it on the XO version of Scratch. Thus, I 
> try to steer a middle path -- create a Scratch port for the XO without 
> changing too much of the Scratch source code. I am hoping that 
> eventually Sugar will make life easier for those porting applications 
> from file-based platforms by providing some sort of virtual file system 
> API. The Journal and the virtual file system could just be two views on 
> the same set of files.
> 
> Re:
>> At the moment it is not possible to delete scratch projects easily 
>> (just in terminal) and our students have difficulty to understand the 
>> file and folder structure in the dialog with the very small font.
> 
> Yes, I see the problem. Your solution sounds like it would work, but the 
> downside is that browsing for existing Scratch projects would be done 
> using the Journal, rather than Scratch's "open" dialog. That means the 
> user would not see the project thumbnail and project notes.
> 
> If project deletion is the only issue, my preference would be to add a 
> way to delete projects to the Scratch open and save dialogs. (Although 
> I'm not promising to do that immediately, since we're currently working 
> on the release of Scratch 1.4.)
> 
> Another solution (which could be more near-term) would be to increase 
> the font size in the file dialog. Do you think that would help?
> 
> -- John
> 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread John Maloney
Hi, Eben.

Not to worry -- I did not see your email as an attack at all. You were  
just pointing out the fact that the Journal does support thumbnails  
and text info. That's a good point.

Something as innovative as Sugar simply takes time to mature, and you  
can't get everything 100% right the first time. You need to have real  
applications and real users and you need to iterate many, many times.  
Sugar is still in the "rapid-evolution" phase of its development.  
(Even more so for the Journal.) I've been working with the XO for  
about 18 months now, and over that time the software has made enormous  
progress. And rapid progress is still being made. I'm sure that things  
will continue to get easier over the next 18 months -- both for XO  
users and for those of us porting applications.

Keep up the good work!

-- John


On Dec 18, 2008, at 1:25 PM, Eben Eliason wrote:
> Thanks John!
>
> My previous comments weren't meant as an attack against you or
> Scratch, of course.  We know as well as anyone about resource
> constraints!   I just want to keep everyone honest, and make sure that
> the broader goals for Sugar and the Journal don't get lost while we
> struggle to figure out how to reach them.
>
> I wish I could say "the Journal does all of these things
> wonderfully!", but alas, I can only muster "the Journal, as
> (re)designed, would do all of these things wonderfully!"  Hopefully
> we'll get there.
>
> - Eben
>
> On Thu, Dec 18, 2008 at 12:57 PM, John Maloney  
>  wrote:
>> Hi, Eben.
>>
>> Yes, using the Journal would be optimal for XO users, and perhaps  
>> we will
>> make Scratch do that in the long run.
>>
>>   -- John
>>
>>
 Re:
>
> At the moment it is not possible to delete scratch projects easily
> (just in terminal) and our students have difficulty to understand
> the file and folder structure in the dialog with the very small  
> font.

 Yes, I see the problem. Your solution sounds like it would work,  
 but
 the downside is that browsing for existing Scratch projects would  
 be
 done using the Journal, rather than Scratch's "open" dialog. That
 means the user would not see the project thumbnail and project  
 notes.
>>>
>>> I'm not sure this is the downside.  That's one of the benefits.  In
>>> fact, the Journal itself supports thumbnails and a description  
>>> field,
>>> so a similar experience could be offered there, in a place that's
>>> familiar to those using Sugar.
>>>
>>> - Eben
>>
>>

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread Eben Eliason
Thanks John!

My previous comments weren't meant as an attack against you or
Scratch, of course.  We know as well as anyone about resource
constraints!   I just want to keep everyone honest, and make sure that
the broader goals for Sugar and the Journal don't get lost while we
struggle to figure out how to reach them.

I wish I could say "the Journal does all of these things
wonderfully!", but alas, I can only muster "the Journal, as
(re)designed, would do all of these things wonderfully!"  Hopefully
we'll get there.

- Eben


On Thu, Dec 18, 2008 at 12:57 PM, John Maloney  wrote:
> Hi, Eben.
>
> Yes, using the Journal would be optimal for XO users, and perhaps we will
> make Scratch do that in the long run.
>
>-- John
>
>
>>> Re:

 At the moment it is not possible to delete scratch projects easily
 (just in terminal) and our students have difficulty to understand
 the file and folder structure in the dialog with the very small font.
>>>
>>> Yes, I see the problem. Your solution sounds like it would work, but
>>> the downside is that browsing for existing Scratch projects would be
>>> done using the Journal, rather than Scratch's "open" dialog. That
>>> means the user would not see the project thumbnail and project notes.
>>
>> I'm not sure this is the downside.  That's one of the benefits.  In
>> fact, the Journal itself supports thumbnails and a description field,
>> so a similar experience could be offered there, in a place that's
>> familiar to those using Sugar.
>>
>> - Eben
>
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread John Maloney
Hi, Eben.

Yes, using the Journal would be optimal for XO users, and perhaps we  
will make Scratch do that in the long run.

-- John


>> Re:
>>> At the moment it is not possible to delete scratch projects easily
>>> (just in terminal) and our students have difficulty to understand
>>> the file and folder structure in the dialog with the very small  
>>> font.
>>
>> Yes, I see the problem. Your solution sounds like it would work, but
>> the downside is that browsing for existing Scratch projects would be
>> done using the Journal, rather than Scratch's "open" dialog. That
>> means the user would not see the project thumbnail and project notes.
>
> I'm not sure this is the downside.  That's one of the benefits.  In
> fact, the Journal itself supports thumbnails and a description field,
> so a similar experience could be offered there, in a place that's
> familiar to those using Sugar.
>
> - Eben

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread Eben Eliason
On Thu, Dec 18, 2008 at 12:05 PM, Bert Freudenberg  wrote:
> On 18.12.2008, at 17:11, Eben Eliason wrote:
>
>> In
>> fact, the Journal itself supports thumbnails and a description field,
>> so a similar experience could be offered there, in a place that's
>> familiar to those using Sugar.
>
>
> In theory, yes. In practice, you do not get a preview for downloaded
> files, not even for images. This has been known for ages:
>
> http://dev.laptop.org/ticket/2460

Hmm, that's too bad.  Maybe we can get that fixed.

> Besides, even if all entries had a preview, it is still cumbersome to
> find anything by preview, because the preview is hidden in the "detail
> view", and there is not even a way to move directly between detail
> views (next/previous buttons as well as page up/down keys have been

That's true.  As soon as we have some manpower to put the new Journal
design in place, we'll all be far better off here.  In addition to
improvements to the detail view itself, it will expose thumbnails in
browsable views as well.

> discussed but not implemented). Nor is there a way to navigate by
> keyboard at all in the Journal.

True, and extremely unfortunate.  I think we need to keep some
accessibility concerns on the short term agenda.

> Unfortunately "usability" is not one of the goals in the Sugar roadmap.

Your pain is my pain.  However, I still feel it necessary to keep
everyone's eye on a larger prize.  Rather than having every activity
solve these problems in a different way, I'd like to convince one or
two of the activity devs to help address the core issue so we have a
net win for everyone.  If the system is broken (and we know it is!)
then we should fix it, rather than building numerous
workarounds/substitutions.

- Eben


> - Bert -
>
>
> ___
> Devel mailing list
> Devel@lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread Bert Freudenberg
On 18.12.2008, at 17:11, Eben Eliason wrote:

> In
> fact, the Journal itself supports thumbnails and a description field,
> so a similar experience could be offered there, in a place that's
> familiar to those using Sugar.


In theory, yes. In practice, you do not get a preview for downloaded  
files, not even for images. This has been known for ages:

http://dev.laptop.org/ticket/2460

Besides, even if all entries had a preview, it is still cumbersome to  
find anything by preview, because the preview is hidden in the "detail  
view", and there is not even a way to move directly between detail  
views (next/previous buttons as well as page up/down keys have been  
discussed but not implemented). Nor is there a way to navigate by  
keyboard at all in the Journal.

Unfortunately "usability" is not one of the goals in the Sugar roadmap.

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread Eben Eliason
On Thu, Dec 18, 2008 at 9:57 AM, John Maloney  wrote:
> Hi, Phillip.
>
> Re: Do you plan a journal integration for scratch?
>
> Probably not in the near future. There has been talk about making an
> API for the Journal that looks more like a file system to application
> programs. That might be the easiest way to integrate the Journal into
> Scratch in the long run.
>
> Sugar continues to evolve. Earlier versions still allowed access to
> the file system in a way that made it fairly easy to port applications
> like Scratch. More recently, with the Rainbow security system, it
> became much more difficult to use the file system directly.
>
> I support Scratch on many different platforms. The XO is an important
> one due to the educational mission of OLPC. Still, my time is limited
> and I can only spend so much of it on the XO version of Scratch. Thus,
> I try to steer a middle path -- create a Scratch port for the XO
> without changing too much of the Scratch source code. I am hoping that
> eventually Sugar will make life easier for those porting applications
> from file-based platforms by providing some sort of virtual file
> system API. The Journal and the virtual file system could just be two
> views on the same set of files.
>
> Re:
>> At the moment it is not possible to delete scratch projects easily
>> (just in terminal) and our students have difficulty to understand
>> the file and folder structure in the dialog with the very small font.
>
> Yes, I see the problem. Your solution sounds like it would work, but
> the downside is that browsing for existing Scratch projects would be
> done using the Journal, rather than Scratch's "open" dialog. That
> means the user would not see the project thumbnail and project notes.

I'm not sure this is the downside.  That's one of the benefits.  In
fact, the Journal itself supports thumbnails and a description field,
so a similar experience could be offered there, in a place that's
familiar to those using Sugar.

- Eben


> If project deletion is the only issue, my preference would be to add a
> way to delete projects to the Scratch open and save dialogs. (Although
> I'm not promising to do that immediately, since we're currently
> working on the release of Scratch 1.4.)
>
> Another solution (which could be more near-term) would be to increase
> the font size in the file dialog. Do you think that would help?
>
>-- John
>
> ___
> Devel mailing list
> Devel@lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread John Maloney
Hi, Phillip.

Re: Do you plan a journal integration for scratch?

Probably not in the near future. There has been talk about making an  
API for the Journal that looks more like a file system to application  
programs. That might be the easiest way to integrate the Journal into  
Scratch in the long run.

Sugar continues to evolve. Earlier versions still allowed access to  
the file system in a way that made it fairly easy to port applications  
like Scratch. More recently, with the Rainbow security system, it  
became much more difficult to use the file system directly.

I support Scratch on many different platforms. The XO is an important  
one due to the educational mission of OLPC. Still, my time is limited  
and I can only spend so much of it on the XO version of Scratch. Thus,  
I try to steer a middle path -- create a Scratch port for the XO  
without changing too much of the Scratch source code. I am hoping that  
eventually Sugar will make life easier for those porting applications  
from file-based platforms by providing some sort of virtual file  
system API. The Journal and the virtual file system could just be two  
views on the same set of files.

Re:
> At the moment it is not possible to delete scratch projects easily  
> (just in terminal) and our students have difficulty to understand  
> the file and folder structure in the dialog with the very small font.

Yes, I see the problem. Your solution sounds like it would work, but  
the downside is that browsing for existing Scratch projects would be  
done using the Journal, rather than Scratch's "open" dialog. That  
means the user would not see the project thumbnail and project notes.

If project deletion is the only issue, my preference would be to add a  
way to delete projects to the Scratch open and save dialogs. (Although  
I'm not promising to do that immediately, since we're currently  
working on the release of Scratch 1.4.)

Another solution (which could be more near-term) would be to increase  
the font size in the file dialog. Do you think that would help?

-- John

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Journal integration for Scratch

2008-12-18 Thread Bert Freudenberg
On 18.12.2008, at 08:08, Philipp Kocher wrote:
>
> One more thing, the scratch icon is not shown in the journal for files
> with the scratch mimetype. I think the file
> /usr/share/sugar/data/mime.defaults has to be adapted to include the
> scratch-mimetype.


It just has to be listed in the activity bundle's info file:

http://wiki.laptop.org/go/Activity_bundles#.info_File_Format

- Bert -


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Journal integration for Scratch

2008-12-17 Thread Philipp Kocher
Hi John

Do you plan a journal integration for scratch?

At the moment it is not possible to delete scratch projects easily (just 
in terminal) and our students have difficulty to understand the file and 
folder structure in the dialog with the very small font.

If you don't want to change the core application, there might be a 
workaround.

1. create a directory projects/journal
2. if scratch gets opened without a datastore reference, a default 
project (e.g. scratch_project) gets copied to projects/journal and opened.
3. if scratch gets opened with a datastore reference, the files gets 
copied (copy-from-journal) to the projects/journal directory and opened.
4. the name of the default project still has to be changed with save as
5. after quit the files in the directory projects/journal get copied to 
the journal (copy-to-journal) and deleted in projects/journal

The scratch projects could be erased in the journal.
What do you think?

One more thing, the scratch icon is not shown in the journal for files 
with the scratch mimetype. I think the file 
/usr/share/sugar/data/mime.defaults has to be adapted to include the 
scratch-mimetype.

Best regards,
Philipp
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel