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 
 b...@freudenbergs.de 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

 ?xml version=1.0 encoding=UTF-8?
 mime-info xmlns=http://www.freedesktop.org/standards/shared-mime-info;
   mime-type type=application/x-scratch-project
 commentScratch Project/comment
 glob pattern=*.sb/
   /mime-type
 /mime-info
 #!/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 

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 b...@freudenbergs.de 
  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

 ?xml version=1.0 encoding=UTF-8?
 mime-info xmlns=http://www.freedesktop.org/standards/shared-mime-info 
 
  mime-type type=application/x-scratch-project
commentScratch Project/comment
glob pattern=*.sb/
  /mime-type
 /mime-info
 #!/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)   

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
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-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 b...@freudenbergs.de 
  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

 ?xml version=1.0 encoding=UTF-8?
 mime-info xmlns=http://www.freedesktop.org/standards/shared-mime-info 
 
   mime-type type=application/x-scratch-project
 commentScratch Project/comment
 glob pattern=*.sb/
   /mime-type
 /mime-info
 #!/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
   

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-13 Thread Tomeu Vizoso
On Tue, Jan 13, 2009 at 06:55, Philipp Kocher philipp.koc...@gmx.net wrote:


 Tomeu Vizoso wrote:

 On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg b...@freudenbergs.de
 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 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  
 b...@freudenbergs.de 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 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 b...@freudenbergs.de 
  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 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 
b...@freudenbergs.de 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



?xml version=1.0 encoding=UTF-8?
mime-info xmlns=http://www.freedesktop.org/standards/shared-mime-info;
   mime-type type=application/x-scratch-project
 commentScratch Project/comment
 glob pattern=*.sb/
   /mime-type
/mime-info
#!/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 

Re: Journal integration for Scratch

2009-01-12 Thread Philipp Kocher


Tomeu Vizoso wrote:
 On Thu, Jan 8, 2009 at 04:50, Philipp Kocher philipp.koc...@gmx.net 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-12 Thread Tomeu Vizoso
[adding sugar-devel to the cc list]

On Mon, Jan 12, 2009 at 09:42, Philipp Kocher philipp.koc...@gmx.net wrote:


 Tomeu Vizoso wrote:

 On Thu, Jan 8, 2009 at 04:50, Philipp Kocher philipp.koc...@gmx.net
 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 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
On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg b...@freudenbergs.de 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 17:03, Tomeu Vizoso wrote:

 On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg  
 b...@freudenbergs.de 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: Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg b...@freudenbergs.de wrote:

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

 On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg b...@freudenbergs.de
 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)
gio.ThemedIcon at 0xb7de8c84: image-png, gnome-mime-image-png, image-x-generic

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  
 b...@freudenbergs.de wrote:

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

 On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg b...@freudenbergs.de 
 
 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 18:07, Bert Freudenberg b...@freudenbergs.de wrote:

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

 On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg b...@freudenbergs.de
 wrote:

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

 On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg b...@freudenbergs.de
 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 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: Journal integration for Scratch

2009-01-12 Thread Tomeu Vizoso
On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg b...@freudenbergs.de 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 Philipp Kocher


Tomeu Vizoso wrote:
 On Mon, Jan 12, 2009 at 18:50, Bert Freudenberg b...@freudenbergs.de 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-08 Thread Tomeu Vizoso
On Thu, Jan 8, 2009 at 04:50, Philipp Kocher philipp.koc...@gmx.net 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 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


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 Eben Eliason
On Thu, Dec 18, 2008 at 9:57 AM, John Maloney jmalo...@media.mit.edu 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 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 12:05 PM, Bert Freudenberg b...@freudenbergs.de 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 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 jmalo...@media.mit.edu 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.

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  
 jmalo...@media.mit.edu 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