Re: PATCH: panel run dialog redux



Frank Worsley <fworsley shaw ca> writes:

> > I got the new patch almost ready ... but I want to implement the
> > auto-opening of a document or directory (if the user doesn't enter an
> > executable). No time to finish that tonight, so I will send an updated
> > patch tomorrow.
> 
> I didn't get that implemented. Now sure how to do it. If somebody else
> wants to try it ... go nuts. ;)

Something like:

{
gchar *mime_info;
GnomeVFSMimeApplication *app;
gchar *command;

mime_info = gnome_vfs_get_mime_type (file_name);
app = gnome_vfs_mime_get_default_application (file_name);
command = g_strconcat (app->command, " ", file_name);
g_spawn_command_line_async (command);
g_free (command);
gnome_vfs_mime_application_free (app);
g_free (mime_type);
...

}

should work.  You need to add error checking of course, and it would be
nice to check for URI's so that we open things like http://gnome.org/ in
the preferred browser (and man:ls in yelp, for instance).

Thanks,
-Jonathan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]