From e9e97d69dc837ef9fa03d97bbb69f2fd99a43950 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 May 2008 15:50:58 +0000 Subject: Add basic OS X support to LaunchSLClient --- .../Tools/LaunchSLClient/LaunchSLClient/Form1.cs | 40 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tools') diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs index 61aefa0..1cddb2b 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs @@ -138,13 +138,9 @@ namespace LaunchSLClient addLocalSandbox(ref menuItems); addLocalGrid(ref menuItems); } - else - { - MessageBox.Show("No OpenSim installed. Showing public grids only", "No OpenSim"); - } } - private void getClient(ref string exePath, ref string runLine, ref string exeFlags) + private void getClientWindows(ref string exePath, ref string runLine, ref string exeFlags) { // get executable path from registry RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Linden Research, Inc.\SecondLife"); @@ -164,6 +160,40 @@ namespace LaunchSLClient Registry.LocalMachine.Close(); } + private void getClientMacOSX(ref string exePath, ref string runLine, ref string exeFlags) + { + if (Directory.Exists("/Applications/Second Life.app")) + { + exePath = "/Applications/Second Life.app/Contents/MacOS"; + } + + runLine = exePath + "/Second Life"; + exeFlags = ""; + } + + private void getClientUnix(ref string exePath, ref string runLine, ref string exeFlags) + { + } + + private void getClient(ref string exePath, ref string runLine, ref string exeFlags) + { + if (Environment.OSVersion.Platform == PlatformID.Unix) + { + if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa")) + { + getClientMacOSX(ref exePath, ref runLine, ref exeFlags); + } + else + { + getClientUnix(ref exePath, ref runLine, ref exeFlags); + } + } + else + { + getClientWindows(ref exePath, ref runLine, ref exeFlags); + } + } + public Form1() { InitializeComponent(); -- cgit v1.1