};
+/**
+ * open a URL using the system's web-browser
+ */
+void cocoaOpenUrl(const std::string& url);
+
#endif // __MENUBAR_HXX
{
// no-op
}
+
+void cocoaOpenUrl(const std::string& url)
+{
+ CocoaAutoreleasePool pool;
+ NSURL* nsu = [NSURL URLWithString:stdStringToCocoa(url)];
+ [[NSWorkspace sharedWorkspace] openURL:nsu];
+}
# include <shellapi.h>
#endif
+#ifdef SG_MAC
+# include "FGCocoaMenuBar.hxx" // for cocoaOpenUrl
+#endif
+
#include "gui.h"
using std::string;
}
}
+#ifdef SG_MAC
+ if (address.find("://")==string::npos) {
+ address = "file://" + address;
+ }
+
+ cocoaOpenUrl(address);
+ return ok;
+#endif
+
#ifndef _WIN32
string command = globals->get_browser();