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

RE: [XaraXtreme-dev] Executing Default Web Browser?





--On 18 May 2006 11:30 +0100 Neil Howe <NeilH@xxxxxxxx> wrote:

So unless we can assume that most users will have found out how to setup
a default HTML application, and will actually have done so, this
wxLaunchDefaultBrowser call is useless to us. Even with the patch that
was required to get it to work at all on local paths.

So any other suggestions of how we reliably show the user the HTML help
when they click a help button?

I'm back to the very crude solution of execing names we know might work
until we find one that does. "htmlview", "firefox", "mozilla",
"konqueror", etc.	

Yuck! Don't do that :-) Quite apart from the question "what name"
("mozilla", "mozilla-firefox") there is the question "where", and
"which of the ones you find".

Try the other thing I suggested, which is to use the MimeType stuff.
This is the mechanism an email client uses when clicking on an HTML
link. So, use
	wxMimeTypesManager::GetFileTypeFromMimeType
to get a wxFileType * for your HTML file, and, e.g.
	wxFileType::GetOpenCommand

Use wxExecute to run it.

But could you also report a wxWidgets bug that wxLaunchDefaultWebBrowser
is fundamentally broken on all known distributions? I take it you have
tried a sample program with 2.6.3 (stock) and 2.7 (CVS_HEAD) rather than
just our own code. This one really ought to be fixed and it may be
that getting people to fix it is in the long term a better solution
than playing around with MIME-types.

Alex