diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llappviewermacosx.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llappviewermacosx.cpp')
-rw-r--r-- | linden/indra/newview/llappviewermacosx.cpp | 128 |
1 files changed, 9 insertions, 119 deletions
diff --git a/linden/indra/newview/llappviewermacosx.cpp b/linden/indra/newview/llappviewermacosx.cpp index 96b6b24..68c3a16 100644 --- a/linden/indra/newview/llappviewermacosx.cpp +++ b/linden/indra/newview/llappviewermacosx.cpp | |||
@@ -65,7 +65,12 @@ int main( int argc, char **argv ) | |||
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | // Set the working dir to <bundle>/Contents/Resources | 67 | // Set the working dir to <bundle>/Contents/Resources |
68 | (void) chdir(gDirUtilp->getAppRODataDir().c_str()); | 68 | if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1) |
69 | { | ||
70 | llwarns << "Could not change directory to " | ||
71 | << gDirUtilp->getAppRODataDir() << ": " << strerror(errno) | ||
72 | << llendl; | ||
73 | } | ||
69 | 74 | ||
70 | LLAppViewerMacOSX* viewer_app_ptr = new LLAppViewerMacOSX(); | 75 | LLAppViewerMacOSX* viewer_app_ptr = new LLAppViewerMacOSX(); |
71 | 76 | ||
@@ -173,7 +178,7 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) | |||
173 | char path[MAX_PATH]; | 178 | char path[MAX_PATH]; |
174 | if(CFURLGetFileSystemRepresentation(url, false, (UInt8 *)path, sizeof(path))) | 179 | if(CFURLGetFileSystemRepresentation(url, false, (UInt8 *)path, sizeof(path))) |
175 | { | 180 | { |
176 | LLString lang; | 181 | std::string lang; |
177 | if(_read_file_into_string(lang, path)) /* Flawfinder: ignore*/ | 182 | if(_read_file_into_string(lang, path)) /* Flawfinder: ignore*/ |
178 | { | 183 | { |
179 | LLControlVariable* c = gSavedSettings.getControl("SystemLanguage"); | 184 | LLControlVariable* c = gSavedSettings.getControl("SystemLanguage"); |
@@ -196,8 +201,8 @@ void LLAppViewerMacOSX::handleSyncCrashTrace() | |||
196 | void LLAppViewerMacOSX::handleCrashReporting() | 201 | void LLAppViewerMacOSX::handleCrashReporting() |
197 | { | 202 | { |
198 | // Macintosh | 203 | // Macintosh |
199 | LLString command_str; | 204 | std::string command_str; |
200 | command_str += "open crashreporter.app"; | 205 | command_str += "open mac-crash-logger.app"; |
201 | 206 | ||
202 | clear_signals(); | 207 | clear_signals(); |
203 | llinfos << "Launching crash reporter using: '" << command_str << "'" << llendl; | 208 | llinfos << "Launching crash reporter using: '" << command_str << "'" << llendl; |
@@ -304,121 +309,6 @@ OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void * | |||
304 | return(result); | 309 | return(result); |
305 | } | 310 | } |
306 | 311 | ||
307 | OSStatus DisplayReleaseNotes(void) | ||
308 | { | ||
309 | OSStatus err; | ||
310 | IBNibRef nib = NULL; | ||
311 | WindowRef window = NULL; | ||
312 | |||
313 | err = CreateNibReference(CFSTR("SecondLife"), &nib); | ||
314 | |||
315 | if(err == noErr) | ||
316 | { | ||
317 | CreateWindowFromNib(nib, CFSTR("Release Notes"), &window); | ||
318 | } | ||
319 | |||
320 | if(err == noErr) | ||
321 | { | ||
322 | // Get the text view control | ||
323 | HIViewRef textView; | ||
324 | ControlID id; | ||
325 | |||
326 | id.signature = 'text'; | ||
327 | id.id = 0; | ||
328 | |||
329 | LLString releaseNotesText; | ||
330 | |||
331 | _read_file_into_string(releaseNotesText, "releasenotes.txt"); // Flawfinder: ignore | ||
332 | |||
333 | err = HIViewFindByID(HIViewGetRoot(window), id, &textView); | ||
334 | |||
335 | if(err == noErr) | ||
336 | { | ||
337 | // Convert from the encoding used in the release notes. | ||
338 | CFStringRef str = CFStringCreateWithBytes( | ||
339 | NULL, | ||
340 | (const UInt8*)releaseNotesText.c_str(), | ||
341 | releaseNotesText.size(), | ||
342 | kCFStringEncodingWindowsLatin1, // This matches the way the Windows version displays the release notes. | ||
343 | FALSE); | ||
344 | |||
345 | if(str != NULL) | ||
346 | { | ||
347 | int size = CFStringGetLength(str); | ||
348 | |||
349 | if(size > 0) | ||
350 | { | ||
351 | UniChar *chars = new UniChar[size + 1]; | ||
352 | CFStringGetCharacters(str, CFRangeMake(0, size), chars); | ||
353 | |||
354 | err = TXNSetData(HITextViewGetTXNObject(textView), kTXNUnicodeTextData, chars, size * sizeof(UniChar), kTXNStartOffset, kTXNStartOffset); | ||
355 | |||
356 | delete[] chars; | ||
357 | } | ||
358 | |||
359 | CFRelease(str); | ||
360 | } | ||
361 | else | ||
362 | { | ||
363 | // Creating the string failed. Probably an encoding problem. Display SOMETHING... | ||
364 | err = TXNSetData(HITextViewGetTXNObject(textView), kTXNTextData, releaseNotesText.c_str(), releaseNotesText.size(), kTXNStartOffset, kTXNStartOffset); | ||
365 | } | ||
366 | } | ||
367 | |||
368 | // Set the selection to the beginning of the text and scroll it into view. | ||
369 | if(err == noErr) | ||
370 | { | ||
371 | err = TXNSetSelection(HITextViewGetTXNObject(textView), kTXNStartOffset, kTXNStartOffset); | ||
372 | } | ||
373 | |||
374 | if(err == noErr) | ||
375 | { | ||
376 | // This function returns void. | ||
377 | TXNShowSelection(HITextViewGetTXNObject(textView), false); | ||
378 | } | ||
379 | } | ||
380 | |||
381 | if(err == noErr) | ||
382 | { | ||
383 | ShowWindow(window); | ||
384 | } | ||
385 | |||
386 | if(err == noErr) | ||
387 | { | ||
388 | // Set up an event handler for the window. | ||
389 | EventHandlerRef handler = NULL; | ||
390 | EventTypeSpec handlerEvents[] = | ||
391 | { | ||
392 | { kEventClassCommand, kEventCommandProcess } | ||
393 | }; | ||
394 | |||
395 | InstallWindowEventHandler( | ||
396 | window, | ||
397 | NewEventHandlerUPP(simpleDialogHandler), | ||
398 | GetEventTypeCount (handlerEvents), | ||
399 | handlerEvents, | ||
400 | (void*)window, | ||
401 | &handler); | ||
402 | } | ||
403 | |||
404 | if(err == noErr) | ||
405 | { | ||
406 | RunAppModalLoopForWindow(window); | ||
407 | } | ||
408 | |||
409 | if(window != NULL) | ||
410 | { | ||
411 | DisposeWindow(window); | ||
412 | } | ||
413 | |||
414 | if(nib != NULL) | ||
415 | { | ||
416 | DisposeNibReference(nib); | ||
417 | } | ||
418 | |||
419 | return(err); | ||
420 | } | ||
421 | |||
422 | void init_apple_menu(const char* product) | 312 | void init_apple_menu(const char* product) |
423 | { | 313 | { |
424 | // Load up a proper menu bar. | 314 | // Load up a proper menu bar. |