FreeCAD document icon

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: FreeCAD document icon

Post by yorik »

On linux it works more or less the same way, a little program (that Werner also programmed ;) ) called freecad-thumbnailer extracts the .png thumbnail stored in the .fcstd file. That thumbnailer is registered somewhere so the file managers know when to use it.

Indeed there are a lot of distros, desktops and file managers around, but there is also a *kind of* standard called freedesktop.org, which at least all the major desktop systems such as gnome, kde and lxde follow (more or less). For example, it defines the arguments that the thumbnailer program must take. As far as I saw, Werner's thumbnailer follows all the freedesktop standards.

The problem most probably lies in the way that thumbnailer is registered... For gnome/nautilus, it's an entry in gconf (the gnome's "registry" (never understood how/why a linux desktop must have a registry, but...)), for thunar it's a .desktop file in /usr/share/thumbnailers, and for kde I don't know.

That "registration" simply specifies a thumbnailer program to be called on certain MIME types. So for nautilus, the best way to check is to open gconf-editor and navigate to Desktop>Gnome>Thumbnailers and see if the freecad one is there. AFAIK freecad correctly registers its thumbnailer there on installation (but I don't use gnome so I cannot check here)

For Thunar, it seems something changed recently and several of my thumbnailers don't work anymore, so probably nothing to do with freecad itself...
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: FreeCAD document icon

Post by NormandC »

yorikvanhavre wrote:That "registration" simply specifies a thumbnailer program to be called on certain MIME types. So for nautilus, the best way to check is to open gconf-editor and navigate to Desktop>Gnome>Thumbnailers and see if the freecad one is there. AFAIK freecad correctly registers its thumbnailer there on installation (but I don't use gnome so I cannot check here)
Thanks for the info,

I just checked in gconf-editor, there is no entry for freecad. From what I understand the entry should be named application@x-enxtension-fcstd. Out of curiosity I'd like to create one, but what would be the required command? For a few entries, like pdf, the command is "evince-thumbnailer -s %s %u %o".

Image
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: FreeCAD document icon

Post by yorik »

check that you have freecad-thumbnailer in /usr/bin (if needed put it there, it's a simple python script that lies somewhere in the freecad source tree)
then the command would be freecad-thumbnailer %u %o %s (not sure about the order...)
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD document icon

Post by wmayer »

I'll fix this issue shortly. AFAIR there must be some special files in the debian folder and the rules file must contain some instructions to add these files to the .deb package. In the past this worked pretty well but was broken when I did a merge with the official Debian packaging files.
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD document icon

Post by wmayer »

So, I have just fixed the thumbnailer. On Lucid it works for me pretty well again. As a next step I'll show the icon Normand provided as fallback if inside a FreeCAD project no thumbnail was stored.

Can anybody test it on Natty and maybe on other desktops than GNOME?
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: FreeCAD document icon

Post by NormandC »

Cool! :)

I made a .svg as well, here it is. (remove .zip extension)
Attachments
application-x-extension-fcstd.svg.zip
Remove .zip extension
(12.54 KiB) Downloaded 86 times
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD document icon

Post by wmayer »

The PNG is OK because in the specs (I can't remember where exactly) it is required to offer png files as thumbnails.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: FreeCAD document icon

Post by NormandC »

Sweet! I requested a build of the latest revision from the Daily Builds PPA, then installed it. Not only do my FreeCAD files have thumbnails now, but my SpaceNavigator is working too! :D

Thanks Werner! :)

There was no changes after install, but a system restart did the trick.
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD document icon

Post by wmayer »

There was no changes after install, but a system restart did the trick.
Ah good to know! When I tried it mid of last week it didn't work for me either. When checking it again on Saturday it suddenly worked.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: FreeCAD document icon

Post by yorik »

Hm i still can't make it work but definitely there is something broken with my thunar file manager here, many other thumbnailers stopped working. I'll keep investigating...
Post Reply