]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/gui_funcs.cxx
toggle fullscreen: also adapt GUI plane when resizing
[flightgear.git] / src / GUI / gui_funcs.cxx
index 5d797d009ade2dd0560bcf91c1efebd404f8b462..1da13da297f03124abd7ffe3210f6cf1c47ddca0 100644 (file)
@@ -165,10 +165,11 @@ void helpCb()
     openBrowser( "Docs/index.html" );
 }
 
-bool openBrowser(string address)
+bool openBrowser(const std::string& aAddress)
 {
     bool ok = true;
-
+    string address(aAddress);
+    
     // do not resolve addresses with given protocol, i.e. "http://...", "ftp://..."
     if (address.find("://")==string::npos)
     {
@@ -192,22 +193,7 @@ bool openBrowser(string address)
   }
   
   cocoaOpenUrl(address);
-  return ok;
-#endif
-  
-#ifndef _WIN32
-
-    string command = globals->get_browser();
-    string::size_type pos;
-    if ((pos = command.find("%u", 0)) != string::npos)
-        command.replace(pos, 2, address);
-    else
-        command += " " + address;
-
-    command += " &";
-    ok = (system( command.c_str() ) == 0);
-
-#else // _WIN32
+#elif defined _WIN32
 
     // Look for favorite browser
     char win32_name[1024];
@@ -218,7 +204,17 @@ bool openBrowser(string address)
 # endif
     ShellExecute ( NULL, "open", win32_name, NULL, NULL,
                    SW_SHOWNORMAL ) ;
+#else
+    // Linux, BSD, SGI etc
+    string command = globals->get_browser();
+    string::size_type pos;
+    if ((pos = command.find("%u", 0)) != string::npos)
+        command.replace(pos, 2, address);
+    else
+        command += " \"" + address +"\"";
 
+    command += " &";
+    ok = (system( command.c_str() ) == 0);
 #endif
 
     mkDialog("The file is shown in your web browser window.");
@@ -487,7 +483,7 @@ namespace
             if (_path.create_dir( 0755 )) {
                 SG_LOG(SG_GENERAL, SG_ALERT, "Cannot create screenshot directory '"
                         << dir << "'. Trying home directory.");
-                dir = fgGetString("/sim/fg-home");
+                dir = globals->get_fg_home();
             }
 
             char filename[24];
@@ -592,7 +588,7 @@ bool fgDumpSnapShot ()
     if (path.create_dir( 0755 )) {
         SG_LOG(SG_GENERAL, SG_ALERT, "Cannot create screenshot directory '"
                 << dir << "'. Trying home directory.");
-        dir = fgGetString("/sim/fg-home");
+        dir = globals->get_fg_home();
     }
 
     char filename[24];