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: [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: [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: [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