aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs')
-rw-r--r--OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs120
1 files changed, 42 insertions, 78 deletions
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs
index 1cddb2b..700c004 100644
--- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs
+++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs
@@ -44,7 +44,7 @@ namespace LaunchSLClient
44 { 44 {
45 const string deepGridUrl = "http://user.deepgrid.com:8002/"; 45 const string deepGridUrl = "http://user.deepgrid.com:8002/";
46 const string osGridUrl = "http://www.osgrid.org:8002/"; 46 const string osGridUrl = "http://www.osgrid.org:8002/";
47 const string openLifeGridUrl = "http://logingrid.net:8002"; 47 const string openLifeGridUrl = "http://logingrid.net:8002/";
48 48
49 string gridUrl = ""; 49 string gridUrl = "";
50 string sandboxUrl = ""; 50 string sandboxUrl = "";
@@ -53,6 +53,47 @@ namespace LaunchSLClient
53 string exeFlags = ""; 53 string exeFlags = "";
54 string exePath = ""; 54 string exePath = "";
55 55
56 private MachineConfig m_machineConfig;
57
58 public Form1()
59 {
60 InitializeComponent();
61 ArrayList menuItems = new ArrayList();
62
63 m_machineConfig = getMachineConfig();
64 m_machineConfig.GetClient(ref exePath, ref runLine, ref exeFlags);
65
66 menuItems.Add("Please select one:");
67
68 addLocalSims(ref menuItems);
69
70 menuItems.Add("OSGrid - www.osgrid.org");
71 menuItems.Add("DeepGrid - www.deepgrid.com");
72 menuItems.Add("OpenlifeGrid - www.openlifegrid.com");
73 menuItems.Add("Linden Labs - www.secondlife.com");
74
75 comboBox1.DataSource = menuItems;
76 }
77
78 private MachineConfig getMachineConfig()
79 {
80 if (Environment.OSVersion.Platform == PlatformID.Unix)
81 {
82 if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa"))
83 {
84 return new OSXConfig();
85 }
86 else
87 {
88 return new UnixConfig();
89 }
90 }
91 else
92 {
93 return new WindowsConfig();
94 }
95 }
96
56 private void addLocalSandbox(ref ArrayList menuItems) 97 private void addLocalSandbox(ref ArrayList menuItems)
57 { 98 {
58 // build sandbox URL from Regions\default.xml 99 // build sandbox URL from Regions\default.xml
@@ -140,83 +181,6 @@ namespace LaunchSLClient
140 } 181 }
141 } 182 }
142 183
143 private void getClientWindows(ref string exePath, ref string runLine, ref string exeFlags)
144 {
145 // get executable path from registry
146 RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Linden Research, Inc.\SecondLife");
147 if (regKey == null)
148 {
149 regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Linden Research, Inc.\SecondLife");
150 if (regKey == null)
151 {
152 throw new LauncherException("Can't find Second Life. Are you sure it is installed?", "LauncherException.Form1");
153 }
154 }
155 string exe = regKey.GetValue("Exe").ToString();
156 exeFlags = regKey.GetValue("Flags").ToString();
157 exePath = regKey.GetValue("").ToString();
158 runLine = exePath + "\\" + exe;
159 Registry.LocalMachine.Flush();
160 Registry.LocalMachine.Close();
161 }
162
163 private void getClientMacOSX(ref string exePath, ref string runLine, ref string exeFlags)
164 {
165 if (Directory.Exists("/Applications/Second Life.app"))
166 {
167 exePath = "/Applications/Second Life.app/Contents/MacOS";
168 }
169
170 runLine = exePath + "/Second Life";
171 exeFlags = "";
172 }
173
174 private void getClientUnix(ref string exePath, ref string runLine, ref string exeFlags)
175 {
176 }
177
178 private void getClient(ref string exePath, ref string runLine, ref string exeFlags)
179 {
180 if (Environment.OSVersion.Platform == PlatformID.Unix)
181 {
182 if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa"))
183 {
184 getClientMacOSX(ref exePath, ref runLine, ref exeFlags);
185 }
186 else
187 {
188 getClientUnix(ref exePath, ref runLine, ref exeFlags);
189 }
190 }
191 else
192 {
193 getClientWindows(ref exePath, ref runLine, ref exeFlags);
194 }
195 }
196
197 public Form1()
198 {
199 InitializeComponent();
200 ArrayList menuItems = new ArrayList();
201
202 getClient(ref exePath, ref runLine, ref exeFlags);
203
204 menuItems.Add("Please select one:");
205
206 addLocalSims(ref menuItems);
207
208 menuItems.Add("OSGrid - www.osgrid.org");
209 menuItems.Add("DeepGrid - www.deepgrid.com");
210 menuItems.Add("OpenlifeGrid - www.openlifegrid.com");
211 menuItems.Add("Linden Labs - www.secondlife.com");
212
213 comboBox1.DataSource = menuItems;
214 }
215
216 private void radioButton1_CheckedChanged(object sender, EventArgs e)
217 {
218 }
219
220 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 184 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
221 { 185 {
222 if (comboBox1.Text == "Please select one:") { return; } 186 if (comboBox1.Text == "Please select one:") { return; }