Re: [Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-12 Thread Vassilii Khachaturov
On things like Debian, this is also wrong because sensible-browser
should be used instead. Is there some autoconf library function to
discover the most likely browser on a system?

Also the WIN32 section in src/GUI/gui_funcs.cxx with the 1024-long
hardcoded buffers can be a crash trigger when the buffer overflows for
somebody with a long enough path...

V.


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-12 Thread Arthur Wiebe
In the macflightgear binary I've been passing --browser-app=open to fgfs. This opens the url in the default browser. For me that's Firefox.Your patch could be changed to something like this:Index: FlightGear/src/Main/options
.cxx===RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/options.cxx,vretrieving revision 1.73diff -u -r1.73 options.cxx
--- FlightGear/src/Main/options.cxx   12 Oct 2005 08:55:58-   1.73+++ FlightGear/src/Main/options.cxx   12 Nov 2005 02:41:34 -@@ -172,7 +172,11 @@   fgSetString(/sim/control-mode, joystick);
   fgSetBool(/sim/auto-coordination, false);#if !defined(WIN32)+#ifdef __APPLE__+  fgSetString(/sim/startup/browser-app, open);+#else   fgSetString(/sim/startup/browser-app, netscape);
+#endif#else   fgSetString(/sim/startup/browser-app, webrun.bat);#endifOn 11/12/05, Ima Sudonim 
[EMAIL PROTECTED] wrote:Arthur and James,Yes, I agree it's silly, but currently help was broken on my two mac
systems (giving a log message that netscape couldn't be found),followed by a dialog that my browser was started.It's reallyimportant to me to have browser-based help work on 0.9.9... I forgotthat it was broken until now. (I know I had this working at one
point, and thought I still did as I was building with a modifiedoptions.cxx. I was wrong). I promise to pay much more attention nexttime or at least be conscious when I try these thingsUnfortunately, my fix doesn't work.
I think it should have been the following diff, but as neither diffis working, don't apply them to cvs please.I can't get this options.cxx change working on Mac OS X, I have touse the option --browser-app=open /Applications/Safari.app when
starting flightgear.Any idea where else /sim/startup/browser-app is set or what (ifanything) is overwriting it?Never mind about the cvs update. It wouldn't break anything even ifapplied, because it didn't work anyway. 8-(
It looks like the mac browser exec actually belongs in gui/gui_funcs.cxx. If I modify void helpCb (puObject *) (line 238) to read: string help_app = open /Applications/Safari.app ;//fgGetString
(/sim/startup/browser-app);Safari starts up fine and opens help so this is the spot Arthur wouldneed to pop his code into, I guess.It would be nice if the returncode from the system call or ShellExecute could be checked before
mkDialog is called.It's adding insult to injury when your browserhasn't started, but the dialog says it has 8-(I'm still a little confused as to where /sim/startup/browser-app isbeing set, as it doesn't seem to be in main/options.cxx as I expected.
I will leave this to much wiser heads than my own.Sorry for thetrouble. Some days it doesn't pay to get out of bed in the morning...8-(I'll happily wait for arthur to fix it.Thanks to Arthur and James and all the rest...
ImaIndex: FlightGear/src/Main/options.cxx===RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/options.cxx,vretrieving revision 
1.73diff -u -r1.73 options.cxx--- FlightGear/src/Main/options.cxx 12 Oct 2005 08:55:58-1.73+++ FlightGear/src/Main/options.cxx 12 Nov 2005 02:41:34 -@@ -172,7 +172,11 @@fgSetString(/sim/control-mode, joystick);
fgSetBool(/sim/auto-coordination, false);#if !defined(WIN32)+#ifdef __APPLE__+fgSetString(/sim/startup/browser-app, open /Applications/Safari.app);+#else
fgSetString(/sim/startup/browser-app, netscape);+#endif#elsefgSetString(/sim/startup/browser-app, webrun.bat);#endif___
Flightgear-devel mailing listFlightgear-devel@flightgear.orghttp://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d-- Arthur/- http://sourceforge.net/users/artooro/- 
http://artooro.blogspot.com
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

[Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-12 Thread ima . sudonim

Arthur and Vassilii, 

Even though I couldn't fix it, I'm glad I got smarter minds to think about it! 8-)

OK, is there a way to get sensible-browser at compile time? Is this a link know to the OS or something? is it callable or does it need to be read on Debian somewhere?
this is also wrong because "sensible-browser" should be used instead.

Nice catch, not sure how to fix it though. Is there a standard path length limit? Is it queryable from some C call?
Also the WIN32 section in src/GUI/gui_funcs.cxx with the 1024-long hardcoded 
buffers can be a crash trigger when the buffer overflows for somebody with a long
enough path...
OK, now I understand what you meant by just using open by itself. I didn't know you could do that, thanks!

In the macflightgear binary I've been passing "--browser-app=open" to fgfs.
This opens the url in the default browser. For me that's Firefox.
Yes, even though I don't use xcode much (too complicated for my tiny brain 8-)), I'd like to have the projects for reference. I use the command line to make fg and run a graphical x window front end (DDD) to gdb. I don't do either very often or very well. 8-(

Macflightgear is hosted on sourceforge?

By the way Xcode projects you can use to build PLIB, Simgear, and FlightGear
are available now. I've polished them up so they should be ready.
If you're interested I'll commit them to the macflightgear cvs

Actually, I can't test this (my wife is using the Mac as a telephone 8-( ), but your fix would need to go in two places: src/Main/options.cxx and src/GUI/gui_funcs.cxx (in void helpCb). I think that one might be the actual OS Application Help menu Help menu item and one the flightgear gui menu Help menu Help menu item (but I can't test this right now and could be wrong).

Could you possibly do this additional patch also? I'm not sure when I'll get use of the Mac again. Then again, with arthritis I don't sleep much! 8-)

Also, is it a problem that the rc to the call to start the browser isn't checked before the mkDialog call (leading to possibly inaccurate messages that the browser has been started when in fact it failed to do so) as mentioned in my previous message?

Thanks for all your help and suggestions!

Ima

.
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Re: [Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-12 Thread Vassilii Khachaturov
 OK, is there a way to get sensible-browser at compile time? Is this a
 link know to the OS or something? is it callable or does it need to be
 read on Debian somewhere?

It's a callable standard script on debian.
It tries various intelligent decisions to guess what browser to run.
It is pretty debian-dependent though (e.g., it relies on the fact
that the browser packages register themselves via the alternatives
mechanism available on debian). On Debian, however, it is the
preferred thing to call in order to be user-friendly.

My point is that fgfs doesn't have the means to know the target
system defaults and thus the hardwired default is probably best
left as a toplevel configure option.

V.


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-11 Thread Ima Sudonim
With this change, FlightGear on Mac OS X launches the mac os x Safari  
browser instead of netscape (w/o this change, the browser won't  
launch without netscape installed, and netscape isn't one of the  
installed mac os x browsers).


thank you

Ima

Index: FlightGear/src/Main/options.cxx
===
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/options.cxx,v
retrieving revision 1.73
diff -u -r1.73 options.cxx
--- FlightGear/src/Main/options.cxx 12 Oct 2005 08:55:58  
-  1.73

+++ FlightGear/src/Main/options.cxx 9 Nov 2005 01:53:53 -
@@ -172,7 +172,11 @@
 fgSetString(/sim/control-mode, joystick);
 fgSetBool(/sim/auto-coordination, false);
#if !defined(WIN32)
+#if defined (__APPLE__)
+fgSetString(/sim/startup/browser-app, safari);
+#else
 fgSetString(/sim/startup/browser-app, netscape);
+#endif
#else
 fgSetString(/sim/startup/browser-app, webrun.bat);
#endif


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-11 Thread James Turner
On 12 Nov 2005, at 00:58, Ima Sudonim wrote:With this change, FlightGear on Mac OS X launches the mac os x Safari browser instead of netscape (w/o this change, the browser won't launch without netscape installed, and netscape isn't one of the installed mac os x browsers). This approach seems silly - I've got Core Foundation code to launch a URL string via LaunchServices - using whatever browser the user has selected in the system. Hard-coding a browser is always going to annoy people.I'll post the patch once I dig out the code.HHJames___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Re: [Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-11 Thread Arthur Wiebe
I agree with James. I've been using the --open-with option for sometime in the mac builds which is set to open. This opens the url is whatever is the default browser.On 11/12/05, 
James Turner [EMAIL PROTECTED] wrote:
On 12 Nov 2005, at 00:58, Ima Sudonim wrote:
With this change, FlightGear on Mac OS X launches the mac os x Safari browser instead of netscape (w/o this change, the browser won't launch without netscape installed, and netscape isn't one of the installed mac os x browsers).
 This approach seems silly - I've got Core Foundation code to launch a URL string via LaunchServices - using whatever browser the user has selected in the system. Hard-coding a browser is always going to annoy people.
I'll post the patch once I dig out the code.HHJames
___Flightgear-devel mailing listFlightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d-- Arthur/- http://sourceforge.net/users/artooro/- 
http://artooro.blogspot.com
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

[Flightgear-devel] diff for browser change for mac os x to use safari

2005-11-11 Thread Ima Sudonim

Arthur and James,

Yes, I agree it's silly, but currently help was broken on my two mac  
systems (giving a log message that netscape couldn't be found),  
followed by a dialog that my browser was started.  It's really  
important to me to have browser-based help work on 0.9.9... I forgot  
that it was broken until now. (I know I had this working at one  
point, and thought I still did as I was building with a modified  
options.cxx. I was wrong). I promise to pay much more attention next  
time or at least be conscious when I try these things


Unfortunately, my fix doesn't work.

I think it should have been the following diff, but as neither diff  
is working, don't apply them to cvs please.


I can't get this options.cxx change working on Mac OS X, I have to  
use the option --browser-app=open /Applications/Safari.app when  
starting flightgear.


Any idea where else /sim/startup/browser-app is set or what (if  
anything) is overwriting it?


Never mind about the cvs update. It wouldn't break anything even if  
applied, because it didn't work anyway. 8-(


It looks like the mac browser exec actually belongs in gui/ 
gui_funcs.cxx. If I modify void helpCb (puObject *) (line 238) to read:


string help_app = open /Applications/Safari.app ;//fgGetString 
(/sim/startup/browser-app);


Safari starts up fine and opens help so this is the spot Arthur would  
need to pop his code into, I guess.  It would be nice if the return  
code from the system call or ShellExecute could be checked before  
mkDialog is called.  It's adding insult to injury when your browser  
hasn't started, but the dialog says it has 8-(


I'm still a little confused as to where /sim/startup/browser-app is  
being set, as it doesn't seem to be in main/options.cxx as I expected.


I will leave this to much wiser heads than my own.  Sorry for the  
trouble. Some days it doesn't pay to get out of bed in the morning...  
8-(


I'll happily wait for arthur to fix it.

Thanks to Arthur and James and all the rest...

Ima

Index: FlightGear/src/Main/options.cxx
===
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/options.cxx,v
retrieving revision 1.73
diff -u -r1.73 options.cxx
--- FlightGear/src/Main/options.cxx 12 Oct 2005 08:55:58  
-  1.73

+++ FlightGear/src/Main/options.cxx 12 Nov 2005 02:41:34 -
@@ -172,7 +172,11 @@
 fgSetString(/sim/control-mode, joystick);
 fgSetBool(/sim/auto-coordination, false);
#if !defined(WIN32)
+#ifdef __APPLE__
+fgSetString(/sim/startup/browser-app, open /Applications/ 
Safari.app);

+#else
 fgSetString(/sim/startup/browser-app, netscape);
+#endif
#else
 fgSetString(/sim/startup/browser-app, webrun.bat);
#endif


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d