File FlightGear-0.9.11-browser.patch of Package FlightGear

--- src/GUI/gui_funcs.cxx
+++ src/GUI/gui_funcs.cxx
@@ -211,6 +211,8 @@
 void helpCb (puObject *)
 {
     string command;
+    char help_app_str[30];
+    char dialog_str[120];
 	
 #if defined(FX) && !defined(WIN32)
 #  if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
@@ -228,11 +230,18 @@
 
     string help_app = fgGetString("/sim/startup/browser-app");
 
-    if ( system("xwininfo -name Netscape > /dev/null 2>&1") == 0 ) {
-        command = help_app + " -remote \"openURL(" + path.str() + ")\"";
+    if (!strcmp(help_app.c_str(), "firefox") ) {
+	command = help_app + " " + path.str();
+    } else if (!strcmp(help_app.c_str(), "mozilla") ) {
+	if ( system("xwininfo -name Mozilla > /dev/null 2>&1") == 0 ) {
+	    command = help_app + " -remote \"openURL(" + path.str() + ")\"";
+	} else {
+	    command = help_app + " " + path.str();
+	}
     } else {
         command = help_app + " " + path.str();
     }
+
     command += " &";
     system( command.c_str() );
 
@@ -253,8 +262,13 @@
                    SW_SHOWNORMAL ) ;
 
 #endif
-	
-    mkDialog ("Help started in your web browser window.");
+
+    strncpy (help_app_str, help_app.c_str(), 30);
+    sprintf (dialog_str, "Help started in %s window.\nTry --browser-app option to specify\nbrowser.", help_app_str);
+    cout << "Running " << command.c_str() << endl;
+    cout << "Note:  words \"firefox\" and \"mozilla\" are recognized in --browser-app option, in order to supply URL in correct syntax\n";
+    system( command.c_str() );
+    mkDialog (dialog_str);
 }
 
 #if defined( TR_HIRES_SNAP)
openSUSE Build Service is sponsored by