Re: Filetype registration on OS X

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Filetype registration on OS X
Date: 2007-05-10 19:53:46
Message-ID: 4643784A.7070805@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Dave Page wrote:
> Hi Florian,
>
> I've been trying to figure out how to register pgAdmin as a handler for
> .sql files with Launch Services, however all the documentation I seem to
> be finding is about using Launch Services to launch a file (as Finder
> would), rather than registering as we need to.
>
> Any ideas, or helpful URLs I've missed? I'm trying to basically do:
The necessary changes to the Info.plist files are already in the SVN ;-)

http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/trunk/pgadmin3/pkg/mac/Info.plist?rev=4615&view=markup

I planned to support opening .sql files once, and added the necessary
declarations to the Info.plist file, back when I added icon declaration
from .sql files. Since this was shorty before release, we agreed that
it was a bad time for adding code to actually open the file (the
declaration just lets pgAdmin3 start when the file is doubleclicked),
and so I changed the plist file not to launch pgAdmin3 when a sql-file
is clicked.

Well, and then I had other things to do, and quite forgot about
my plan...

According to
http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/trunk/pgadmin3/pkg/mac/Info.plist?rev=4620&r1=4615&r2=4620
you just need to change CFBundleTypeRole back from Node
to Editor ;-)

> pgAdmin3.app/Contents/MacOS/pgAdmin3 -q -f $FILE.sql
On OSX, these things are handleded via apple events -
Launch Services start the app, and then send some "file open"
event. It seems as if wx already supports receiving this event:
http://www.wxwidgets.org/wiki/index.php/WxMac_Issues

If this page is right, it's as easy as overriding
virtual void wxApp::MacOpenFile(const wxString &fileName)

Hope this helps,
greetings, Florian Pflug

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message svn 2007-05-10 20:04:46 SVN Commit by dpage: r6295 - trunk/pgadmin3/docs/en_US
Previous Message Dave Page 2007-05-10 16:04:44 Filetype registration on OS X