Reply
Thread Tools
Posts: 111 | Thanked: 31 times | Joined on Nov 2007
#1
For my forthcoming archive extraction gui, I've added some mimetypes for all of the different archive formats that the program supports. The good news is they work and when I double click files that match the mimetypes in the file manager, the gui launches, you are prompted for an extraction path, the files are extracted and angels sing. Well not quite...

Problem is I want to associate an icon with each mime type so that the user can easily recognize the compatible archives in the file manager. I recall doing something similar many moons ago in a regular linux gui app and it was as simple as suitably naming the icon after the mimetype and placing it in "/usr/share/icons/hicolor/XXX/mimetypes". e.g. for mimetype "application/x-compressed-tar" (i.e. tar.gz files) I created an icon with the following path: "/usr/share/icons/hicolor/scalable/mimetypes/gnome-icon-application-x-compressed-tar.png". This doesn't appear to work

Does anyone know what I'm doing wrong or how to do this correctly?
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#2
Does this help?

The part Further reading points to freedesktop standard.
 
Posts: 111 | Thanked: 31 times | Joined on Nov 2007
#3
unfortunately, the desktop standards weren't much help as there is no definitive standard for naming the icons. it turns out i was doing it right, though. for some reason resetting the tablet wasn't enough and i had to run (as root)

gtk-update-icon-cache /usr/share/icons/hicolor

now it is working. pity about my art skills...
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#4
Sounds great... im looking forward to this gui archive program. Does your gui interface with libosso in order to receive the filename they clicked on or are you able to get that from a commandline somehow?

I would like to do something similar with torrent files, but havent figured out libosso yet.
 
Posts: 111 | Thanked: 31 times | Joined on Nov 2007
#5
Originally Posted by pipeline View Post
Sounds great... im looking forward to this gui archive program. Does your gui interface with libosso in order to receive the filename they clicked on or are you able to get that from a commandline somehow?
I use libosso to do it. As far as I can tell this is the only way to interact with the file manager.

I would like to do something similar with torrent files, but havent figured out libosso yet.
In python this is very easy to do and even in C it isn't too bad. libosso takes care of a lot of the ugliness of dbus. The key to getting it working is setting up the .desktop, .service, icon and mime type files correctly. When I'm done in the next day or two, you can browse my source tree.

Another alternative to writing a million little wrapper scripts for every conceivable command would be to write a mimetype manager that:
1. lets users create new and edit existing mimetypes and add associated icons
2. associates a command line tool with each mimetype
3. receives mime_open messages and spawns the associated command line tool with appropriate options/flags/switches

I've seen talk of tools that do 2 and 3 in the maemo dev list, but have yet to see any code (not that I have searched thoroughly), although in python 2 and 3 are trivial.

The bigger problem with such a tool is that it goes against the intent of libosso, which is to ensure only one running instance of programs on a device with limited capabilties. You could imagine a newbie user spawning off multiple hung processes via the tool and grinding their tablet to a halt. Good process management in the tool could probably get around that but it's just duplicating the work of libosso...
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#6
Originally Posted by cripes View Post
The key to getting it working is setting up the .desktop, .service, icon and mime type files correctly. When I'm done in the next day or two, you can browse my source tree.
Yes, I'd like that... thanks

Originally Posted by cripes View Post
Another alternative to writing a million little wrapper scripts for every conceivable command would be to write a mimetype manager that:
1. lets users create new and edit existing mimetypes and add associated icons
2. associates a command line tool with each mimetype
3. receives mime_open messages and spawns the associated command line tool with appropriate options/flags/switches
I'm secretly hoping you will evolve your program to do just that I'd rather have a 'shim' type wrapper app as you described... that would instantly open up so many possibilities, especially with multiple target possibilities (open in mplayer, kagu, etc) Would be great if there was such an app with a choice of launch method (launch via command line, launch via libosso).

Ah well not to distract you from your current goal... just a subliminal feature request for next version
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 20:36.