Merge with viewer-materials tip

master
Kitty Barnett 2012-12-18 21:57:25 +01:00
commit c309a7bd94
61 changed files with 6624 additions and 1967 deletions

View File

@ -377,5 +377,12 @@ ab0aa2f6ba22b52fed30a2337197f589156edc75 DRTVWR-253
44e764a6ac9e672a4f3bce821a4b6a218590c374 DRTVWR-258
c23d734065ed593b2413385aecd8366d8e0ee96b DRTVWR-257
452ce96d4046dc05a3ecaecc203e2cc8ddd72e76 DRTVWR-259
5cba5f39d0a81d659f24ebc4b5efd025a39e3db1 3.4.3-release
9aa1aa9f1fe13c194695a0b8f0af298296241dc2 DRTVWR-260
daca610d840625b5bebb966a57cb49581852c417 DRTVWR-265
9afbdc4e24cc04feacfb2b7a10b78a64f780901a DRTVWR-266
73280db02501f5ad041fc18b1eba68e73a81996c DRTVWR-267
870e2d79e0063fda87187f17bbc2747766733194 3.4.3-beta3
0a2ca6546b499239afeb66d17b2fadbcdbe36ab1 3.4.3-release
84fbaf2d4141bd161731430e760949dc787ca206 DRTVWR-244
083d2d36b5bb1c54fc3dd7caac0e7ac381a9cef0 3.4.4-beta1
391a8c74cec7275c5d26c85ad108d4782a3e3dd9 DRTVWR-268

View File

@ -321,6 +321,7 @@ Dale Glass
VWR-1358
VWR-2041
Darien Caldwell
SH-3055
Dartagan Shepherd
Debs Regent
Decro Schmooz
@ -890,6 +891,8 @@ Nicholaz Beresford
VWR-2682
VWR-2684
Nick Rhodes
NickyD
MAINT-873
Nicky Dasmijn
VWR-29228
Nicky Perian
@ -1059,9 +1062,12 @@ Shawn Kaufmat
SNOW-240
Sheet Spotter
Shnurui Troughton
Shyotl Kuhr
MAINT-1138
Siana Gearz
STORM-960
STORM-1088
MAINT-1138
sicarius Thorne
Sicarius Toxx
SignpostMarv Martin
@ -1243,6 +1249,7 @@ Westley Streeter
Whimsy Winx
Whirly Fizzle
STORM-1895
MAINT-873
Whoops Babii
VWR-631
VWR-1640

View File

@ -29,7 +29,7 @@
const S32 LL_VERSION_MAJOR = 3;
const S32 LL_VERSION_MINOR = 4;
const S32 LL_VERSION_PATCH = 4;
const S32 LL_VERSION_PATCH = 5;
const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Second Life Developer";

View File

@ -366,7 +366,7 @@ bool LLCrashLogger::sendCrashLogs()
{
sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3, 5);
}
mSentCrashLogs = sent;
return true;

View File

@ -15,7 +15,6 @@ include_directories(
if (DARWIN)
include(CMakeFindFrameworks)
find_library(CARBON_LIBRARY Carbon)
find_library(COCOA_LIBRARY Cocoa)
endif (DARWIN)
@ -68,7 +67,7 @@ add_dependencies(SLPlugin
if (DARWIN)
# Mac version needs to link against Carbon
target_link_libraries(SLPlugin ${CARBON_LIBRARY} ${COCOA_LIBRARY})
target_link_libraries(SLPlugin ${COCOA_LIBRARY})
# Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later)
add_custom_command(
TARGET SLPlugin POST_BUILD

View File

@ -28,8 +28,26 @@
* @endcond
*/
//Protos for ObjectiveC classes (cannot import cocoa here due to BOOL conflict)
class NSWindow;
/* Defined in slplugin-objc.mm: */
void setupCocoa();
void createAutoReleasePool();
void deleteAutoReleasePool();
class LLCocoaPlugin
{
public:
LLCocoaPlugin();
void setupCocoa();
void createAutoReleasePool();
void deleteAutoReleasePool();
void setupGroup();
void updateWindows();
void processEvents();
public:
//EventTargetRef mEventTarget;
NSWindow* mFrontWindow;
NSWindow* mPluginWindow;
int mHackState;
};

View File

@ -30,11 +30,13 @@
#include <AppKit/AppKit.h>
#import <Cocoa/Cocoa.h>
#include "slplugin-objc.h"
//Note: NSApp is a global defined by cocoa which is an id to the application.
void setupCocoa()
void LLCocoaPlugin::setupCocoa()
{
static bool inited = false;
@ -56,6 +58,8 @@ void setupCocoa()
// Must first call [[[NSWindow alloc] init] release] to get the NSWindow machinery set up so that NSCursor can use a window to cache the cursor image
[[[NSWindow alloc] init] release];
mPluginWindow = [NSApp mainWindow];
deleteAutoReleasePool();
inited = true;
@ -64,7 +68,7 @@ void setupCocoa()
static NSAutoreleasePool *sPool = NULL;
void createAutoReleasePool()
void LLCocoaPlugin::createAutoReleasePool()
{
if(!sPool)
{
@ -72,7 +76,7 @@ void createAutoReleasePool()
}
}
void deleteAutoReleasePool()
void LLCocoaPlugin::deleteAutoReleasePool()
{
if(sPool)
{
@ -80,3 +84,94 @@ void deleteAutoReleasePool()
sPool = NULL;
}
}
LLCocoaPlugin::LLCocoaPlugin():mHackState(0)
{
NSArray* window_list = [NSApp orderedWindows];
mFrontWindow = [window_list objectAtIndex:0];
}
void LLCocoaPlugin::processEvents()
{
// Some plugins (webkit at least) will want an event loop. This qualifies.
NSEvent * event;
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
[NSApp sendEvent: event];
}
//Turns out the window ordering stuff never gets hit with any of the current plugins.
//Leaving the following code here 'just in case' for the time being.
void LLCocoaPlugin::setupGroup()
{
// CreateWindowGroup(kWindowGroupAttrFixedLevel, &layer_group);
// if(layer_group)
// {
// // Start out with a window layer that's way out in front (fixes the problem with the menubar not getting hidden on first switch to fullscreen youtube)
// SetWindowGroupName(layer_group, CFSTR("SLPlugin Layer"));
// SetWindowGroupLevel(layer_group, kCGOverlayWindowLevel);
// }
}
void LLCocoaPlugin::updateWindows() //SPATTERS give this a better name.
{
// NSArray* window_list = [NSApp orderedWindows];
// NSWindow* current_window = [window_list objectAtIndex:0];
// NSWindow* parent_window = [ current_window parentWindow ];
// bool this_is_front_process = false;
// bool parent_is_front_process = false;
//
//
// // Check for a change in this process's frontmost window.
// if ( current_window != mFrontWindow )
// {
// // and figure out whether this process or its parent are currently frontmost
// if ( current_window == parent_window ) parent_is_front_process = true;
// if ( current_window == mPluginWindow ) this_is_front_process = true;
//
// if (current_window != NULL && mFrontWindow == NULL)
// {
// // Opening the first window
//
// if(mHackState == 0)
// {
// // Next time through the event loop, lower the window group layer
// mHackState = 1;
// }
//
// if(parent_is_front_process)
// {
// // Bring this process's windows to the front.
// [mPluginWindow makeKeyAndOrderFront:NSApp];
// [mPluginWindow setOrderedIndex:0];
// }
//
// [NSApp activateIgnoringOtherApps:YES];
// }
//
// else if (( current_window == NULL) && (mFrontWindow != NULL))
// {
// // Closing the last window
//
// if(this_is_front_process)
// {
// // Try to bring this process's parent to the front
// [parent_window makeKeyAndOrderFront:NSApp];
// [parent_window setOrderedIndex:0];
// }
// }
// else if(mHackState == 1)
// {
//// if(layer_group)
//// {
//// // Set the window group level back to something less extreme
//// SetWindowGroupLevel(layer_group, kCGNormalWindowLevel);
//// }
// mHackState = 2;
// }
//
// mFrontWindow = [window_list objectAtIndex:0];
// }
}

View File

@ -37,8 +37,12 @@
#include "llapr.h"
#include "llstring.h"
#include <iostream>
#include <fstream>
using namespace std;
#if LL_DARWIN
#include <Carbon/Carbon.h>
#include "slplugin-objc.h"
#endif
@ -176,6 +180,7 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
int main(int argc, char **argv)
#endif
{
ll_init_apr();
// Set up llerror logging
@ -216,26 +221,25 @@ int main(int argc, char **argv)
// Catch signals that most kinds of crashes will generate, and exit cleanly so the system crash dialog isn't shown.
signal(SIGILL, &crash_handler); // illegal instruction
# if LL_DARWIN
signal(SIGEMT, &crash_handler); // emulate instruction executed
# endif // LL_DARWIN
signal(SIGFPE, &crash_handler); // floating-point exception
signal(SIGBUS, &crash_handler); // bus error
signal(SIGSEGV, &crash_handler); // segmentation violation
signal(SIGSYS, &crash_handler); // non-existent system call invoked
#endif
# if LL_DARWIN
signal(SIGEMT, &crash_handler); // emulate instruction executed
#if LL_DARWIN
setupCocoa();
createAutoReleasePool();
#endif
LLCocoaPlugin cocoa_interface;
cocoa_interface.setupCocoa();
cocoa_interface.createAutoReleasePool();
#endif //LL_DARWIN
LLPluginProcessChild *plugin = new LLPluginProcessChild();
plugin->init(port);
#if LL_DARWIN
deleteAutoReleasePool();
cocoa_interface.deleteAutoReleasePool();
#endif
LLTimer timer;
@ -246,114 +250,22 @@ int main(int argc, char **argv)
#endif
#if LL_DARWIN
// If the plugin opens a new window (such as the Flash plugin's fullscreen player), we may need to bring this plugin process to the foreground.
// Use this to track the current frontmost window and bring this process to the front if it changes.
WindowRef front_window = NULL;
WindowGroupRef layer_group = NULL;
int window_hack_state = 0;
CreateWindowGroup(kWindowGroupAttrFixedLevel, &layer_group);
if(layer_group)
{
// Start out with a window layer that's way out in front (fixes the problem with the menubar not getting hidden on first switch to fullscreen youtube)
SetWindowGroupName(layer_group, CFSTR("SLPlugin Layer"));
SetWindowGroupLevel(layer_group, kCGOverlayWindowLevel);
}
#endif
#if LL_DARWIN
EventTargetRef event_target = GetEventDispatcherTarget();
// cocoa_interface.mEventTarget = GetEventDispatcherTarget();
#endif
while(!plugin->isDone())
{
#if LL_DARWIN
createAutoReleasePool();
cocoa_interface.createAutoReleasePool();
#endif
timer.reset();
plugin->idle();
#if LL_DARWIN
{
// Some plugins (webkit at least) will want an event loop. This qualifies.
EventRef event;
if(ReceiveNextEvent(0, 0, kEventDurationNoWait, true, &event) == noErr)
{
SendEventToEventTarget (event, event_target);
ReleaseEvent(event);
}
// Check for a change in this process's frontmost window.
if(GetFrontWindowOfClass(kAllWindowClasses, true) != front_window)
{
ProcessSerialNumber self = { 0, kCurrentProcess };
ProcessSerialNumber parent = { 0, kNoProcess };
ProcessSerialNumber front = { 0, kNoProcess };
Boolean this_is_front_process = false;
Boolean parent_is_front_process = false;
{
// Get this process's parent
ProcessInfoRec info;
info.processInfoLength = sizeof(ProcessInfoRec);
info.processName = NULL;
info.processAppSpec = NULL;
if(GetProcessInformation( &self, &info ) == noErr)
{
parent = info.processLauncher;
}
// and figure out whether this process or its parent are currently frontmost
if(GetFrontProcess(&front) == noErr)
{
(void) SameProcess(&self, &front, &this_is_front_process);
(void) SameProcess(&parent, &front, &parent_is_front_process);
}
}
if((GetFrontWindowOfClass(kAllWindowClasses, true) != NULL) && (front_window == NULL))
{
// Opening the first window
if(window_hack_state == 0)
{
// Next time through the event loop, lower the window group layer
window_hack_state = 1;
}
if(layer_group)
{
SetWindowGroup(GetFrontWindowOfClass(kAllWindowClasses, true), layer_group);
}
if(parent_is_front_process)
{
// Bring this process's windows to the front.
(void) SetFrontProcess( &self );
}
ActivateWindow(GetFrontWindowOfClass(kAllWindowClasses, true), true);
}
else if((GetFrontWindowOfClass(kAllWindowClasses, true) == NULL) && (front_window != NULL))
{
// Closing the last window
if(this_is_front_process)
{
// Try to bring this process's parent to the front
(void) SetFrontProcess(&parent);
}
}
else if(window_hack_state == 1)
{
if(layer_group)
{
// Set the window group level back to something less extreme
SetWindowGroupLevel(layer_group, kCGNormalWindowLevel);
}
window_hack_state = 2;
}
front_window = GetFrontWindowOfClass(kAllWindowClasses, true);
}
}
cocoa_interface.processEvents();
}
#endif
F64 elapsed = timer.getElapsedTimeF64();
F64 remaining = plugin->getSleepTime() - elapsed;
@ -377,7 +289,8 @@ int main(int argc, char **argv)
// LL_INFOS("slplugin") << "slept for "<< timer.getElapsedTimeF64() * 1000.0f << " ms" << LL_ENDL;
}
#if LL_WINDOWS
// More agressive checking of interfering exception handlers.
// Doesn't appear to be required so far - even for plugins
@ -387,14 +300,14 @@ int main(int argc, char **argv)
#endif
#if LL_DARWIN
deleteAutoReleasePool();
cocoa_interface.deleteAutoReleasePool();
#endif
}
delete plugin;
ll_cleanup_apr();
return 0;
}

View File

@ -580,6 +580,15 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
addColumn(col_params);
}
S32 num_cols = item->getNumColumns();
S32 i = 0;
for (LLScrollListCell* cell = item->getColumn(i); i < num_cols; cell = item->getColumn(++i))
{
if (i >= (S32)mColumnsIndexed.size()) break;
cell->setWidth(mColumnsIndexed[i]->getWidth());
}
updateLineHeightInsert(item);
updateLayout();

View File

@ -36,6 +36,8 @@ set(llvfs_HEADER_FILES
if (DARWIN)
LIST(APPEND llvfs_SOURCE_FILES lldir_mac.cpp)
LIST(APPEND llvfs_HEADER_FILES lldir_mac.h)
LIST(APPEND llvfs_SOURCE_FILES llvfs_objc.mm)
LIST(APPEND llvfs_HEADER_FILES llvfs_objc.h)
endif (DARWIN)
if (LINUX)
@ -73,8 +75,8 @@ target_link_libraries(llvfs
if (DARWIN)
include(CMakeFindFrameworks)
find_library(CARBON_LIBRARY Carbon)
target_link_libraries(llvfs ${CARBON_LIBRARY})
find_library(COCOA_LIBRARY Cocoa)
target_link_libraries(llvfs ${COCOA_LIBRARY})
endif (DARWIN)

View File

@ -73,10 +73,8 @@ class LLDir
virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask);
// pure virtual functions
virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask) = 0;
virtual std::string getCurPath() = 0;
virtual BOOL fileExists(const std::string &filename) const = 0;
virtual bool fileExists(const std::string &filename) const = 0;
const std::string findFile(const std::string& filename, const std::vector<std::string> filenames) const;
const std::string findFile(const std::string& filename, const std::string& searchPath1 = "", const std::string& searchPath2 = "", const std::string& searchPath3 = "") const;

View File

@ -254,7 +254,7 @@ std::string LLDir_Linux::getCurPath()
}
BOOL LLDir_Linux::fileExists(const std::string &filename) const
bool LLDir_Linux::fileExists(const std::string &filename) const
{
struct stat stat_data;
// Check the age of the file

View File

@ -47,7 +47,7 @@ public:
virtual std::string getCurPath();
virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
/*virtual*/ BOOL fileExists(const std::string &filename) const;
/*virtual*/ bool fileExists(const std::string &filename) const;
/*virtual*/ std::string getLLPluginLauncher();
/*virtual*/ std::string getLLPluginFilename(std::string base_name);

View File

@ -35,73 +35,27 @@
#include <sys/stat.h>
#include <unistd.h>
#include <glob.h>
#include <Carbon/Carbon.h>
#include <boost/filesystem.hpp>
#include "llvfs_objc.h"
// --------------------------------------------------------------------------------
static OSStatus CFCreateDirectory(FSRef *parentRef, CFStringRef name, FSRef *newRef)
static bool CreateDirectory(const std::string &parent,
const std::string &child,
std::string *fullname)
{
OSStatus result = noErr;
HFSUniStr255 uniStr;
uniStr.length = CFStringGetLength(name);
CFStringGetCharacters(name, CFRangeMake(0, uniStr.length), uniStr.unicode);
result = FSMakeFSRefUnicode(parentRef, uniStr.length, uniStr.unicode, kTextEncodingMacRoman, newRef);
if (result != noErr)
{
result = FSCreateDirectoryUnicode(parentRef, uniStr.length, uniStr.unicode, 0, NULL, newRef, NULL, NULL);
}
return result;
}
// --------------------------------------------------------------------------------
static void CFStringRefToLLString(CFStringRef stringRef, std::string &llString, bool releaseWhenDone)
{
if (stringRef)
{
long stringSize = CFStringGetLength(stringRef) + 1;
long bufferSize = CFStringGetMaximumSizeForEncoding(stringSize,kCFStringEncodingUTF8);
char* buffer = new char[bufferSize];
memset(buffer, 0, bufferSize);
if (CFStringGetCString(stringRef, buffer, bufferSize, kCFStringEncodingUTF8))
llString = buffer;
delete[] buffer;
if (releaseWhenDone)
CFRelease(stringRef);
}
}
// --------------------------------------------------------------------------------
static void CFURLRefToLLString(CFURLRef urlRef, std::string &llString, bool releaseWhenDone)
{
if (urlRef)
{
CFURLRef absoluteURLRef = CFURLCopyAbsoluteURL(urlRef);
if (absoluteURLRef)
{
CFStringRef stringRef = CFURLCopyFileSystemPath(absoluteURLRef, kCFURLPOSIXPathStyle);
CFStringRefToLLString(stringRef, llString, true);
CFRelease(absoluteURLRef);
}
if (releaseWhenDone)
CFRelease(urlRef);
}
}
// --------------------------------------------------------------------------------
static void FSRefToLLString(FSRef *fsRef, std::string &llString)
{
OSStatus error = noErr;
char path[MAX_PATH];
error = FSRefMakePath(fsRef, (UInt8*) path, sizeof(path));
if (error == noErr)
llString = path;
boost::filesystem::path p(parent);
p /= child;
if (fullname)
*fullname = std::string(p.string());
if (! boost::filesystem::create_directory(p))
{
return (boost::filesystem::is_directory(p));
}
return true;
}
// --------------------------------------------------------------------------------
@ -109,35 +63,28 @@ static void FSRefToLLString(FSRef *fsRef, std::string &llString)
LLDir_Mac::LLDir_Mac()
{
mDirDelimiter = "/";
mCurrentDirIndex = -1;
mCurrentDirCount = -1;
CFBundleRef mainBundleRef = NULL;
CFURLRef executableURLRef = NULL;
CFStringRef stringRef = NULL;
OSStatus error = noErr;
FSRef fileRef;
CFStringRef secondLifeString = CFSTR("SecondLife");
mainBundleRef = CFBundleGetMainBundle();
executableURLRef = CFBundleCopyExecutableURL(mainBundleRef);
if (executableURLRef != NULL)
const std::string secondLifeString = "SecondLife";
std::string *executablepathstr = getSystemExecutableFolder();
//NOTE: LLINFOS/LLERRS will not output to log here. The streams are not initialized.
if (executablepathstr)
{
// mExecutablePathAndName
CFURLRefToLLString(executableURLRef, mExecutablePathAndName, false);
// mExecutableFilename
stringRef = CFURLCopyLastPathComponent(executableURLRef);
CFStringRefToLLString(stringRef, mExecutableFilename, true);
// mExecutableDir
CFURLRef executableParentURLRef = CFURLCreateCopyDeletingLastPathComponent(NULL, executableURLRef);
CFURLRefToLLString(executableParentURLRef, mExecutableDir, true);
mExecutablePathAndName = *executablepathstr;
boost::filesystem::path executablepath(*executablepathstr);
# ifndef BOOST_SYSTEM_NO_DEPRECATED
#endif
mExecutableFilename = executablepath.filename().string();
mExecutableDir = executablepath.parent_path().string();
// mAppRODataDir
std::string *resourcepath = getSystemResourceFolder();
mAppRODataDir = *resourcepath;
// *NOTE: When running in a dev tree, use the copy of
// skins in indra/newview/ rather than in the application bundle. This
@ -146,10 +93,7 @@ LLDir_Mac::LLDir_Mac()
// MBW -- This keeps the mac application from finding other things.
// If this is really for skins, it should JUST apply to skins.
CFURLRef resourcesURLRef = CFBundleCopyResourcesDirectoryURL(mainBundleRef);
CFURLRefToLLString(resourcesURLRef, mAppRODataDir, true);
U32 build_dir_pos = mExecutableDir.rfind("/build-darwin-");
if (build_dir_pos != std::string::npos)
{
@ -166,55 +110,50 @@ LLDir_Mac::LLDir_Mac()
}
// mOSUserDir
error = FSFindFolder(kUserDomain, kApplicationSupportFolderType, true, &fileRef);
if (error == noErr)
{
FSRef newFileRef;
// Create the directory
error = CFCreateDirectory(&fileRef, secondLifeString, &newFileRef);
if (error == noErr)
{
// Save the full path to the folder
FSRefToLLString(&newFileRef, mOSUserDir);
// Create our sub-dirs
(void) CFCreateDirectory(&newFileRef, CFSTR("data"), NULL);
//(void) CFCreateDirectory(&newFileRef, CFSTR("cache"), NULL);
(void) CFCreateDirectory(&newFileRef, CFSTR("logs"), NULL);
(void) CFCreateDirectory(&newFileRef, CFSTR("user_settings"), NULL);
(void) CFCreateDirectory(&newFileRef, CFSTR("browser_profile"), NULL);
}
}
std::string *appdir = getSystemApplicationSupportFolder();
std::string rootdir;
//Create root directory
if (CreateDirectory(*appdir, secondLifeString, &rootdir))
{
// Save the full path to the folder
mOSUserDir = rootdir;
// Create our sub-dirs
CreateDirectory(rootdir, std::string("data"), NULL);
CreateDirectory(rootdir, std::string("logs"), NULL);
CreateDirectory(rootdir, std::string("user_settings"), NULL);
CreateDirectory(rootdir, std::string("browser_profile"), NULL);
}
//mOSCacheDir
FSRef cacheDirRef;
error = FSFindFolder(kUserDomain, kCachedDataFolderType, true, &cacheDirRef);
if (error == noErr)
std::string *cachedir = getSystemCacheFolder();
if (cachedir)
{
FSRefToLLString(&cacheDirRef, mOSCacheDir);
(void)CFCreateDirectory(&cacheDirRef, CFSTR("SecondLife"),NULL);
mOSCacheDir = *cachedir;
//SPATTERS TODO: This changes from ~/Library/Cache/Secondlife to ~/Library/Cache/com.app.secondlife/Secondlife. Last dir level could go away.
CreateDirectory(mOSCacheDir, secondLifeString, NULL);
}
// mOSUserAppDir
mOSUserAppDir = mOSUserDir;
// mTempDir
error = FSFindFolder(kOnAppropriateDisk, kTemporaryFolderType, true, &fileRef);
if (error == noErr)
{
FSRef tempRef;
error = CFCreateDirectory(&fileRef, secondLifeString, &tempRef);
if (error == noErr)
FSRefToLLString(&tempRef, mTempDir);
}
//Aura 120920 boost::filesystem::temp_directory_path() not yet implemented on mac. :(
std::string *tmpdir = getSystemTempFolder();
if (tmpdir)
{
CreateDirectory(*tmpdir, secondLifeString, &mTempDir);
if (tmpdir) delete tmpdir;
}
mWorkingDir = getCurPath();
mLLPluginDir = mAppRODataDir + mDirDelimiter + "llplugin";
CFRelease(executableURLRef);
executableURLRef = NULL;
}
}
@ -235,52 +174,18 @@ void LLDir_Mac::initAppDirs(const std::string &app_name,
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
}
mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "CA.pem");
//dumpCurrentDirectories();
}
U32 LLDir_Mac::countFilesInDir(const std::string &dirname, const std::string &mask)
{
U32 file_count = 0;
glob_t g;
std::string tmp_str;
tmp_str = dirname;
tmp_str += mask;
if(glob(tmp_str.c_str(), GLOB_NOSORT, NULL, &g) == 0)
{
file_count = g.gl_pathc;
globfree(&g);
}
return (file_count);
}
std::string LLDir_Mac::getCurPath()
{
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
getcwd(tmp_str, LL_MAX_PATH);
return tmp_str;
return boost::filesystem::path( boost::filesystem::current_path() ).string();
}
BOOL LLDir_Mac::fileExists(const std::string &filename) const
bool LLDir_Mac::fileExists(const std::string &filename) const
{
struct stat stat_data;
// Check the age of the file
// Now, we see if the files we've gathered are recent...
int res = stat(filename.c_str(), &stat_data);
if (!res)
{
return TRUE;
}
else
{
return FALSE;
}
return boost::filesystem::exists(filename);
}

View File

@ -45,16 +45,10 @@ public:
const std::string& app_read_only_data_dir);
virtual std::string getCurPath();
virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
virtual BOOL fileExists(const std::string &filename) const;
virtual bool fileExists(const std::string &filename) const;
/*virtual*/ std::string getLLPluginLauncher();
/*virtual*/ std::string getLLPluginFilename(std::string base_name);
private:
int mCurrentDirIndex;
int mCurrentDirCount;
std::string mCurrentDir;
};
#endif // LL_LLDIR_MAC_H

View File

@ -272,7 +272,7 @@ std::string LLDir_Solaris::getCurPath()
}
BOOL LLDir_Solaris::fileExists(const std::string &filename) const
bool LLDir_Solaris::fileExists(const std::string &filename) const
{
struct stat stat_data;
// Check the age of the file

View File

@ -47,7 +47,7 @@ public:
virtual std::string getCurPath();
virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
/*virtual*/ BOOL fileExists(const std::string &filename) const;
/*virtual*/ bool fileExists(const std::string &filename) const;
private:
DIR *mDirp;

View File

@ -249,7 +249,7 @@ std::string LLDir_Win32::getCurPath()
}
BOOL LLDir_Win32::fileExists(const std::string &filename) const
bool LLDir_Win32::fileExists(const std::string &filename) const
{
llstat stat_data;
// Check the age of the file

View File

@ -44,7 +44,7 @@ public:
/*virtual*/ std::string getCurPath();
/*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask);
/*virtual*/ BOOL fileExists(const std::string &filename) const;
/*virtual*/ bool fileExists(const std::string &filename) const;
/*virtual*/ std::string getLLPluginLauncher();
/*virtual*/ std::string getLLPluginFilename(std::string base_name);

43
indra/llvfs/llvfs_objc.h Normal file
View File

@ -0,0 +1,43 @@
/**
* @file llvfs_objc.h
* @brief Definition of directory utilities class for Mac OS X
*
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if !LL_DARWIN
#error This header must not be included when compiling for any target other than Mac OS. Consider including lldir.h instead.
#endif // !LL_DARWIN
#ifndef LL_LLVFS_OBJC_H
#define LL_LLVFS_OBJC_H
#include <iostream>
std::string* getSystemTempFolder();
std::string* getSystemCacheFolder();
std::string* getSystemApplicationSupportFolder();
std::string* getSystemResourceFolder();
std::string* getSystemExecutableFolder();
#endif LL_LLVFS_OBJC_H

108
indra/llvfs/llvfs_objc.mm Normal file
View File

@ -0,0 +1,108 @@
/**
* @file llvfs_objc.cpp
* @brief Cocoa implementation of directory utilities for Mac OS X
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if LL_DARWIN
//WARNING: This file CANNOT use standard linden includes due to conflicts between definitions of BOOL
#include "llvfs_objc.h"
#import <Cocoa/Cocoa.h>
std::string* getSystemTempFolder()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString * tempDir = NSTemporaryDirectory();
if (tempDir == nil)
tempDir = @"/tmp";
std::string *result = ( new std::string([tempDir UTF8String]) );
[pool release];
return result;
}
//findSystemDirectory scoped exclusively to this file.
std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory,
NSSearchPathDomainMask domainMask)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
std::string *result;
NSString *path = nil;
// Search for the path
NSArray* paths = NSSearchPathForDirectoriesInDomains(searchPathDirectory,
domainMask,
YES);
if ([paths count])
{
path = [paths objectAtIndex:0];
//SPATTERS HACK: Always attempt to create directory, ignore errors.
NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
result = new std::string([path UTF8String]);
}
[pool release];
return result;
}
std::string* getSystemExecutableFolder()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *bundlePath = [[NSBundle mainBundle] executablePath];
std::string *result = (new std::string([bundlePath UTF8String]));
[pool release];
return result;
}
std::string* getSystemResourceFolder()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
std::string *result = (new std::string([bundlePath UTF8String]));
[pool release];
return result;
}
std::string* getSystemCacheFolder()
{
return findSystemDirectory (NSCachesDirectory,
NSUserDomainMask);
}
std::string* getSystemApplicationSupportFolder()
{
return findSystemDirectory (NSApplicationSupportDirectory,
NSUserDomainMask);
}
#endif // LL_DARWIN

View File

@ -134,7 +134,7 @@ struct LLDir_Dummy: public LLDir
return 0;
}
virtual BOOL fileExists(const std::string& pathname) const
virtual bool fileExists(const std::string& pathname) const
{
// Record fileExists() calls so we can check whether caching is
// working right. Certain LLDir calls should be able to make decisions

View File

@ -23,12 +23,14 @@ include_directories(
set(mac_crash_logger_SOURCE_FILES
mac_crash_logger.cpp
llcrashloggermac.cpp
llcrashloggermacdelegate.mm
)
set(mac_crash_logger_HEADER_FILES
CMakeLists.txt
llcrashloggermac.h
llcrashloggermacdelegate.h
)
set_source_files_properties(${mac_crash_logger_HEADER_FILES}
@ -55,9 +57,12 @@ set_target_properties(mac-crash-logger
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)
find_library(COCOA_LIBRARY Cocoa)
target_link_libraries(mac-crash-logger
${LLCRASHLOGGER_LIBRARIES}
${LLVFS_LIBRARIES}
${COCOA_LIBRARIES}
${LLXML_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLVFS_LIBRARIES}

BIN
indra/mac_crash_logger/CrashReporter.nib generated Normal file

Binary file not shown.

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>629</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../build-darwin-i386/SecondLife.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array/>
<key>IBSystem Version</key>
<string>9E17</string>
<key>targetFramework</key>
<string>IBCarbonFramework</string>
</dict>
</plist>

View File

@ -1,68 +0,0 @@
<?xml version="1.0" standalone="yes"?>
<object class="NSIBObjectData">
<object name="rootObject" class="NSCustomObject" id="1">
</object>
<array count="7" name="allObjects">
<object class="IBCarbonButton" id="182">
<ostype name="command">ok </ostype>
<string name="title">Send Report</string>
<string name="bounds">414 273 434 378 </string>
</object>
<object class="IBCarbonButton" id="183">
<ostype name="command">not!</ostype>
<int name="buttonType">2</int>
<string name="title">Don&apos;t Send</string>
<string name="bounds">414 390 434 487 </string>
</object>
<object class="IBCarbonStaticText" id="181">
<string name="title">Second Life appears to have crashed or frozen the last time it ran.&#10;&#10;This crash reporter collects information about your computer&apos;s hardware configuration, operating system, and some Second Life logs, all of which are used for debugging purposes only.&#10;&#10;In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help!&#10;&#10;This report is NOT read by Customer Support. If you have billing or other questions, please go to: http://www.secondlife.com/support/&#10;&#10;If you don&apos;t wish to send Linden Lab a crash report, press Don&apos;t Send.&#10;</string>
<string name="bounds">20 20 231 487 </string>
</object>
<object class="IBCarbonWindow" id="166">
<int name="carbonWindowClass">2</int>
<int name="themeBrush">3</int>
<int name="windowPosition">7</int>
<string name="title">Second Life Crash Logger</string>
<object name="rootControl" class="IBCarbonRootControl" id="167">
<array count="5" name="subviews">
<reference idRef="181"/>
<reference idRef="182"/>
<reference idRef="183"/>
<object class="IBCarbonEditText" id="185">
<ostype name="controlSignature">text</ostype>
<boolean name="isUnicode">TRUE</boolean>
<string name="bounds">242 23 391 484 </string>
</object>
<object class="IBCarbonCheckBox" id="193">
<ostype name="controlSignature">remb</ostype>
<string name="title">Remember This Choice</string>
<string name="bounds">415 20 433 186 </string>
</object>
</array>
<string name="bounds">0 0 454 507 </string>
</object>
<string name="windowRect">257 653 711 1160 </string>
<string name="ScreenRectAtEncodeTime">0 0 768 1024 </string>
</object>
<reference idRef="185"/>
<reference idRef="167"/>
<reference idRef="193"/>
</array>
<array count="7" name="allParents">
<reference idRef="167"/>
<reference idRef="167"/>
<reference idRef="167"/>
<reference idRef="1"/>
<reference idRef="167"/>
<reference idRef="166"/>
<reference idRef="167"/>
</array>
<dictionary count="2" name="nameTable">
<string>CrashReporter</string>
<reference idRef="166"/>
<string>File&apos;s Owner</string>
<reference idRef="1"/>
</dictionary>
<string name="targetFramework">IBCarbonFramework</string>
<unsigned_int name="nextObjectID">194</unsigned_int>
</object>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
@ -10,8 +10,6 @@
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.secondlife.indra.crashreporter</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
@ -22,5 +20,9 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>NSMainNibFile</key>
<string>CrashReporter</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -27,7 +27,6 @@
#include "llcrashloggermac.h"
#include <Carbon/Carbon.h>
#include <iostream>
#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME
@ -38,102 +37,14 @@
#include "lldir.h"
#include "llsdserialize.h"
#define MAX_LOADSTRING 100
const char* const SETTINGS_FILE_HEADER = "version";
const S32 SETTINGS_FILE_VERSION = 101;
// Windows Message Handlers
BOOL gFirstDialog = TRUE; // Are we currently handling the Send/Don't Send dialog?
BOOL gFirstDialog = TRUE;
LLFILE *gDebugFile = NULL;
WindowRef gWindow = NULL;
EventHandlerRef gEventHandler = NULL;
std::string gUserNotes = "";
bool gSendReport = false;
bool gRememberChoice = false;
IBNibRef nib = NULL;
OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata)
{
OSStatus result = eventNotHandledErr;
OSStatus err;
UInt32 evtClass = GetEventClass(event);
UInt32 evtKind = GetEventKind(event);
if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess))
{
HICommand cmd;
err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd);
if(err == noErr)
{
//Get the value of the checkbox
ControlID id;
ControlRef checkBox = NULL;
id.signature = 'remb';
id.id = 0;
err = GetControlByID(gWindow, &id, &checkBox);
if(err == noErr)
{
if(GetControl32BitValue(checkBox) == kControlCheckBoxCheckedValue)
{
gRememberChoice = true;
}
else
{
gRememberChoice = false;
}
}
switch(cmd.commandID)
{
case kHICommandOK:
{
char buffer[65535]; /* Flawfinder: ignore */
Size size = sizeof(buffer) - 1;
ControlRef textField = NULL;
id.signature = 'text';
id.id = 0;
err = GetControlByID(gWindow, &id, &textField);
if(err == noErr)
{
// Get the user response text
err = GetControlData(textField, kControlNoPart, kControlEditTextTextTag, size, (Ptr)buffer, &size);
}
if(err == noErr)
{
// Make sure the string is terminated.
buffer[size] = 0;
gUserNotes = buffer;
llinfos << buffer << llendl;
}
// Send the report.
QuitAppModalLoopForWindow(gWindow);
gSendReport = true;
result = noErr;
}
break;
case kHICommandCancel:
QuitAppModalLoopForWindow(gWindow);
result = noErr;
break;
default:
result = eventNotHandledErr;
}
}
}
return(result);
}
LLCrashLoggerMac::LLCrashLoggerMac(void)
{
@ -146,73 +57,16 @@ LLCrashLoggerMac::~LLCrashLoggerMac(void)
bool LLCrashLoggerMac::init(void)
{
bool ok = LLCrashLogger::init();
if(!ok) return false;
if(mCrashBehavior != CRASH_BEHAVIOR_ASK) return true;
// Real UI...
OSStatus err;
err = CreateNibReference(CFSTR("CrashReporter"), &nib);
if(err == noErr)
{
err = CreateWindowFromNib(nib, CFSTR("CrashReporter"), &gWindow);
}
if(err == noErr)
{
// Set focus to the edit text area
ControlRef textField = NULL;
ControlID id;
id.signature = 'text';
id.id = 0;
// Don't set err if any of this fails, since it's non-critical.
if(GetControlByID(gWindow, &id, &textField) == noErr)
{
SetKeyboardFocus(gWindow, textField, kControlFocusNextPart);
}
}
if(err == noErr)
{
ShowWindow(gWindow);
}
if(err == noErr)
{
// Set up an event handler for the window.
EventTypeSpec handlerEvents[] =
{
{ kEventClassCommand, kEventCommandProcess }
};
InstallWindowEventHandler(
gWindow,
NewEventHandlerUPP(dialogHandler),
GetEventTypeCount (handlerEvents),
handlerEvents,
0,
&gEventHandler);
}
return true;
return ok;
}
void LLCrashLoggerMac::gatherPlatformSpecificFiles()
{
updateApplication("Gathering hardware information...");
}
bool LLCrashLoggerMac::mainLoop()
{
OSStatus err = noErr;
if(err == noErr && mCrashBehavior == CRASH_BEHAVIOR_ASK)
{
RunAppModalLoopForWindow(gWindow);
}
else if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
{
gSendReport = true;
}
@ -227,26 +81,11 @@ bool LLCrashLoggerMac::mainLoop()
{
setUserText(gUserNotes);
sendCrashLogs();
}
if(gWindow != NULL)
{
DisposeWindow(gWindow);
}
if(nib != NULL)
{
DisposeNibReference(nib);
}
}
return true;
}
void LLCrashLoggerMac::updateApplication(const std::string& message)
{
LLCrashLogger::updateApplication(message);
}
bool LLCrashLoggerMac::cleanup()
{
commonCleanup();

View File

@ -38,7 +38,6 @@ public:
~LLCrashLoggerMac(void);
virtual bool init();
virtual bool mainLoop();
virtual void updateApplication(const std::string& message = LLStringUtil::null);
virtual bool cleanup();
virtual void gatherPlatformSpecificFiles();
};

View File

@ -0,0 +1,52 @@
/**
* @file llcrashloggermacdelegate.h
* @brief Mac OSX crash logger implementation
*
* $LicenseInfo:firstyear=2003&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
/*
#import <Cocoa/Cocoa.h>
@interface LLCrashLoggerMacDelegate : NSObject <NSApplicationDelegate>
{
IBOutlet NSTextField *crashText;
IBOutlet NSButton *rememberCheck;
NSWindow *_window;
bool mRemember;
}
- (void)setWindow:(NSWindow *)newWindow;
- (NSWindow *)window;
- (IBAction)remember:(id)sender;
- (IBAction)send:(id)sender;
- (IBAction)cancel:(id)sender;
@property (assign) IBOutlet NSWindow *window;
@end
*/

View File

@ -0,0 +1,75 @@
/**
* @file llcrashloggermacdelegate.mm
* @brief Mac OSX crash logger implementation
*
* $LicenseInfo:firstyear=2003&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
/*
#import "llcrashloggermacdelegate.h"
#include <iostream>
extern std::string gUserNotes;
extern bool gSendReport;
extern bool gRememberChoice;
@implementation LLCrashLoggerMacDelegate
- (void)setWindow:(NSWindow *)window
{
_window = window;
}
- (NSWindow *)window
{
return _window;
}
- (void)dealloc
{
[super dealloc];
}
std::string* NSToString( NSString *ns_str )
{
return ( new std::string([ns_str UTF8String]) );
}
- (IBAction)remember:(id)sender
{
gRememberChoice = [rememberCheck state];
}
- (IBAction)send:(id)sender
{
std::string* user_input = NSToString([crashText stringValue]);
gUserNotes = *user_input;
gSendReport = true;
}
- (IBAction)cancel:(id)sender
{
[ _window close];
}
@end
*/

View File

@ -26,11 +26,12 @@
#include "linden_common.h"
#include "llcrashloggermac.h"
#include "indra_constants.h"
#include <iostream>
int main(int argc, char **argv)
{
llinfos << "Starting crash reporter." << llendl;
LLCrashLoggerMac app;
app.parseCommandOptions(argc, argv);
@ -39,9 +40,16 @@ int main(int argc, char **argv)
llwarns << "Unable to initialize application." << llendl;
return 1;
}
if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND)
{
// return NSApplicationMain(argc, (const char **)argv);
}
app.mainLoop();
app.cleanup();
llinfos << "Crash reporter finished normally." << llendl;
return 0;
}

BIN
indra/mac_updater/AutoUpdater.nib generated Normal file

Binary file not shown.

View File

@ -1,4 +0,0 @@
{
IBClasses = ();
IBVersion = 1;
}

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>103 138 356 240 0 0 1280 1002 </string>
<key>IBFramework Version</key>
<string>362.0</string>
<key>IBSystem Version</key>
<string>7D24</string>
<key>targetFramework</key>
<string>IBCarbonFramework</string>
</dict>
</plist>

View File

@ -1,56 +0,0 @@
<?xml version="1.0" standalone="yes"?>
<object class="NSIBObjectData">
<string name="targetFramework">IBCarbonFramework</string>
<object name="rootObject" class="NSCustomObject" id="1">
<string name="customClass">NSApplication</string>
</object>
<array count="5" name="allObjects">
<object class="IBCarbonWindow" id="166">
<string name="windowRect">405 222 533 663 </string>
<string name="title">Second Life Updater</string>
<object name="rootControl" class="IBCarbonRootControl" id="167">
<string name="bounds">0 0 128 441 </string>
<array count="3" name="subviews">
<object class="IBCarbonStaticText" id="181">
<string name="bounds">20 20 44 421 </string>
<ostype name="controlSignature">what</ostype>
<string name="title">Initializing…</string>
</object>
<object class="IBCarbonButton" id="183">
<string name="bounds">88 351 108 421 </string>
<string name="title">Cancel</string>
<ostype name="command">not!</ostype>
<int name="buttonType">2</int>
</object>
<object class="IBCarbonProgressBar" id="193">
<string name="bounds">51 19 70 422 </string>
<ostype name="controlSignature">prog</ostype>
<int name="initialValue">50</int>
</object>
</array>
</object>
<boolean name="isResizable">FALSE</boolean>
<int name="carbonWindowClass">2</int>
<int name="themeBrush">3</int>
<int name="windowPosition">7</int>
</object>
<reference idRef="167"/>
<reference idRef="181"/>
<reference idRef="183"/>
<reference idRef="193"/>
</array>
<array count="5" name="allParents">
<reference idRef="1"/>
<reference idRef="166"/>
<reference idRef="167"/>
<reference idRef="167"/>
<reference idRef="167"/>
</array>
<dictionary count="2" name="nameTable">
<string>File&apos;s Owner</string>
<reference idRef="1"/>
<string>Updater</string>
<reference idRef="166"/>
</dictionary>
<unsigned_int name="nextObjectID">194</unsigned_int>
</object>

View File

@ -0,0 +1,520 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1070</int>
<string key="IBDocument.SystemVersion">11G63</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.51</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">2182</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSTextField</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
<string>NSProgressIndicator</string>
<string>NSCustomObject</string>
<string>IBNSLayoutConstraint</string>
<string>NSButtonCell</string>
<string>NSButton</string>
<string>NSUserDefaultsController</string>
<string>NSTextFieldCell</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="NSCustomObject" id="1001">
<string key="NSClassName">NSObject</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 240}, {402, 120}}</string>
<int key="NSWTFlags">544735232</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="269124353">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 83}, {79, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="730867742"/>
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="702170046">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Initalizing...</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<string key="NSCellIdentifier">_NS:1505</string>
<reference key="NSControlView" ref="269124353"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
<object class="NSProgressIndicator" id="730867742">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 55}, {366, 20}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="302149677"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSHuggingPriority">{250, 250}</string>
<int key="NSpiFlags">16399</int>
<double key="NSMaxValue">100</double>
</object>
<object class="NSButton" id="302149677">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{308, 19}, {74, 19}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="677565961">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Cancel</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">12</double>
<int key="NSfFlags">16</int>
</object>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="302149677"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">164</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
</array>
<string key="NSFrameSize">{402, 120}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="269124353"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSCustomObject" id="492080840">
<string key="NSClassName">MacUpdaterAppDelegate</string>
</object>
<object class="NSUserDefaultsController" id="21008314">
<bool key="NSSharedInstance">YES</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">title: values</string>
<reference key="source" ref="1005"/>
<reference key="destination" ref="21008314"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="1005"/>
<reference key="NSDestination" ref="21008314"/>
<string key="NSLabel">title: values</string>
<string key="NSBinding">title</string>
<string key="NSKeyPath">values</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">41</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1001"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1003"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1004"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="1005"/>
<array class="NSMutableArray" key="children">
<reference ref="1006"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="1006"/>
<array class="NSMutableArray" key="children">
<reference ref="269124353"/>
<reference ref="730867742"/>
<object class="IBNSLayoutConstraint" id="463541650">
<reference key="firstItem" ref="269124353"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="1006"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
<reference key="containingView" ref="1006"/>
</object>
<object class="IBNSLayoutConstraint" id="772497817">
<reference key="firstItem" ref="730867742"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="1006"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
<reference key="containingView" ref="1006"/>
</object>
<object class="IBNSLayoutConstraint" id="929212820">
<reference key="firstItem" ref="1006"/>
<int key="firstAttribute">6</int>
<int key="relation">0</int>
<reference key="secondItem" ref="730867742"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
<reference key="containingView" ref="1006"/>
</object>
<reference ref="302149677"/>
<object class="IBNSLayoutConstraint" id="813415053">
<reference key="firstItem" ref="1006"/>
<int key="firstAttribute">6</int>
<int key="relation">0</int>
<reference key="secondItem" ref="302149677"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
<reference key="containingView" ref="1006"/>
</object>
<object class="IBNSLayoutConstraint" id="178579609">
<reference key="firstItem" ref="269124353"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
<reference key="secondItem" ref="1006"/>
<int key="secondAttribute">3</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
<reference key="containingView" ref="1006"/>
</object>
<object class="IBNSLayoutConstraint" id="594621082">
<reference key="firstItem" ref="730867742"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
<reference key="secondItem" ref="269124353"/>
<int key="secondAttribute">4</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">8</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">6</int>
<float key="scoringTypeFloat">24</float>
<int key="contentType">3</int>
<reference key="containingView" ref="1006"/>
</object>
<object class="IBNSLayoutConstraint" id="658067790">
<reference key="firstItem" ref="1006"/>
<int key="firstAttribute">4</int>
<int key="relation">0</int>
<reference key="secondItem" ref="302149677"/>
<int key="secondAttribute">4</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
<reference key="containingView" ref="1006"/>
</object>
</array>
<reference key="parent" ref="1005"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="269124353"/>
<array class="NSMutableArray" key="children">
<reference ref="702170046"/>
</array>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="702170046"/>
<reference key="parent" ref="269124353"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="730867742"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="463541650"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="302149677"/>
<array class="NSMutableArray" key="children">
<reference ref="677565961"/>
<object class="IBNSLayoutConstraint" id="981064020">
<reference key="firstItem" ref="302149677"/>
<int key="firstAttribute">7</int>
<int key="relation">0</int>
<nil key="secondItem"/>
<int key="secondAttribute">0</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">74</double>
</object>
<float key="priority">1000</float>
<int key="scoringType">3</int>
<float key="scoringTypeFloat">9</float>
<int key="contentType">1</int>
<reference key="containingView" ref="302149677"/>
</object>
</array>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="677565961"/>
<reference key="parent" ref="302149677"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">31</int>
<reference key="object" ref="772497817"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">32</int>
<reference key="object" ref="929212820"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="813415053"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">36</int>
<reference key="object" ref="981064020"/>
<reference key="parent" ref="302149677"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">37</int>
<reference key="object" ref="178579609"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">38</int>
<reference key="object" ref="594621082"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">39</int>
<reference key="object" ref="658067790"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">40</int>
<reference key="object" ref="21008314"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">42</int>
<reference key="object" ref="492080840"/>
<reference key="parent" ref="0"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1.IBWindowTemplateEditedContentRect">{{357, 418}, {480, 270}}</string>
<integer value="1" key="1.NSWindowTemplate.visibleAtLaunch"/>
<array class="NSMutableArray" key="2.IBNSViewMetadataConstraints">
<reference ref="463541650"/>
<reference ref="772497817"/>
<reference ref="929212820"/>
<reference ref="813415053"/>
<reference ref="178579609"/>
<reference ref="594621082"/>
<reference ref="658067790"/>
</array>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array class="NSMutableArray" key="22.IBNSViewMetadataConstraints">
<reference ref="981064020"/>
</array>
<boolean value="NO" key="22.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="3.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="31.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="32.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="35.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="36.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="37.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="38.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="39.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="40.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="42.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="8.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">42</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">MacUpdaterAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">cancel:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">cancel:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">cancel:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="mProgressBar">NSProgressIndicator</string>
<string key="mProgressText">NSTextField</string>
<string key="window">NSWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="mProgressBar">
<string key="name">mProgressBar</string>
<string key="candidateClassName">NSProgressIndicator</string>
</object>
<object class="IBToOneOutletInfo" key="mProgressText">
<string key="name">mProgressText</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo" key="window">
<string key="name">window</string>
<string key="candidateClassName">NSWindow</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MacUpdaterAppDelegate.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<bool key="IBDocument.UseAutolayout">YES</bool>
</data>
</archive>

View File

@ -18,10 +18,14 @@ include_directories(
)
set(mac_updater_SOURCE_FILES
main.m
MacUpdaterAppDelegate.mm
mac_updater.cpp
)
set(mac_updater_HEADER_FILES
MacUpdaterAppDelegate.h
mac_updater.h
CMakeLists.txt
)
@ -32,7 +36,7 @@ list(APPEND mac_updater_SOURCE_FILES ${mac_updater_HEADER_FILES})
set(mac_updater_RESOURCE_FILES
AutoUpdater.nib/
AutoUpdater.nib
)
set_source_files_properties(
${mac_updater_RESOURCE_FILES}
@ -48,13 +52,19 @@ add_executable(mac-updater
set_target_properties(mac-updater
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/MacUpdater-Info.plist
)
find_library(COCOA_LIBRARY Cocoa)
find_library(IOKIT_LIBRARY IOKit)
target_link_libraries(mac-updater
${LLVFS_LIBRARIES}
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
${COCOA_LIBRARIES}
${BOOST_FILESYSTEM_LIBRARY}
${IOKIT_LIBRARY}
${CURL_LIBRARIES}
${CARES_LIBRARIES}
${LLCOMMON_LIBRARIES}
@ -62,10 +72,16 @@ target_link_libraries(mac-updater
add_custom_command(
TARGET mac-updater POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS
# -E
# copy_directory
# ${CMAKE_CURRENT_SOURCE_DIR}/AutoUpdater.nib
# ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-updater.app/Contents/Resources/AutoUpdater.nib
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_directory
copy
${CMAKE_CURRENT_SOURCE_DIR}/AutoUpdater.nib
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-updater.app/Contents/Resources/AutoUpdater.nib
)

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>mac-updater</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.secondlife.indra.autoupdater</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>NSMainNibFile</key>
<string>AutoUpdater</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -0,0 +1,60 @@
/**
* @file MacUpdaterAppDelegate.h
* @brief
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#import <Cocoa/Cocoa.h>
#include <iostream>
#include "mac_updater.h"
#ifndef LL_MAC_UPDATE_DELEGATE_H
#define LL_MAC_UPDATE_DELEGATE_H
@interface MacUpdaterAppDelegate : NSObject <NSApplicationDelegate>
{
IBOutlet NSProgressIndicator *mProgressBar;
IBOutlet NSTextField *mProgressText;
}
- (void)setWindow:(NSWindow *)newWindow;
- (NSWindow *)window;
- (IBAction)cancel:(id)sender;
- (void) setProgress:(int)cur max:(int) max;
- (void) setProgressText:(const std::string&)str;
- (int) parse_args:(NSArray *) args;
- (void)stopAlert;
- (void)stopAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
NSWindow *_window;
bool mAnimated;
double mProgressPercentage;
@property (assign) IBOutlet NSWindow *window;
LLMacUpdater mUpdater;
@end
#endif //LL_MAC_UPDATE_DELEGATE_H

View File

@ -0,0 +1,265 @@
/**
* @file MacUpdaterAppDelegate.mm
* @brief
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#import "MacUpdaterAppDelegate.h"
#include "llvfs_objc.h"
#include <string.h>
#include <boost/filesystem.hpp>
@implementation MacUpdaterAppDelegate
MacUpdaterAppDelegate *gWindow;
bool gCancelled = false;
bool gFailure =false;
//@synthesize window = _window;
- (void)setWindow:(NSWindow *)window
{
_window = window;
}
- (NSWindow *)window
{
return _window;
}
- (id)init
{
self = [super init];
if (self) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
mAnimated = false;
mProgressPercentage = 0.0;
NSArray *arguments = [[NSProcessInfo processInfo] arguments];
[self parse_args:arguments];
gWindow = self;
mUpdater.doUpdate();
[pool drain];
[pool release];
}
return self;
}
- (void)dealloc
{
[super dealloc];
}
std::string* NSToString( NSString *ns_str )
{
return ( new std::string([ns_str UTF8String]) );
}
- (void) setProgress:(int)cur max:(int) max
{
bool indeterminate = false;
if (max==0)
{
indeterminate = true;
}
else
{
double percentage = ((double)cur / (double)max) * 100.0;
[mProgressBar setDoubleValue:percentage];
}
[mProgressBar setIndeterminate:indeterminate];
}
- (void) setProgressText:(const std::string& )str
{
[mProgressText setStringValue:[NSString stringWithUTF8String:str.c_str()]];
}
void sendDone()
{
[ [ (id) gWindow window ] close];
}
void sendStopAlert()
{
[ gWindow stopAlert ];
}
void setProgress(int cur, int max)
{
[ (id) gWindow setProgress:cur max:max];
}
void setProgressText(const std::string& str)
{
[ (id) gWindow setProgressText:str];
}
void sendProgress(int cur, int max, const std::string str)
{
setProgress(cur,max);
setProgressText(str);
}
bool copyDir(const std::string& src_dir, const std::string& dest_dir)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString* file = [NSString stringWithCString:src_dir.c_str()
encoding:[NSString defaultCStringEncoding]];
NSString* toParent = [NSString stringWithCString:dest_dir.c_str()
encoding:[NSString defaultCStringEncoding]];
NSError* error = nil;
bool result = [[NSFileManager defaultManager] copyItemAtPath: file toPath: toParent error:&error];
if (!result) {
NSLog(@"Error during copy: %@", [error localizedDescription]);
}
[pool release];
return result;
}
- (int) parse_args:(NSArray *) args
{
int i;
int argc = [args count];
mUpdater.mApplicationPath = NSToString( [args objectAtIndex:0] );
for( i = 1; i < argc; i++ )
{
NSString* ns_arg = [args objectAtIndex:i];
const char *arg = [ns_arg UTF8String];
if ((!strcmp(arg, "-url")) && (i < argc))
{
mUpdater.mUpdateURL = NSToString( [args objectAtIndex:(++i)] );
}
else if ((!strcmp(arg, "-name")) && (i < argc))
{
mUpdater.mProductName = NSToString( [args objectAtIndex:(++i)] );
}
else if ((!strcmp(arg, "-bundleid")) && (i < argc))
{
mUpdater.mBundleID = NSToString( [args objectAtIndex:(++i)] );
}
else if ((!strcmp(arg, "-dmg")) && (i < argc))
{
mUpdater.mDmgFile = NSToString( [args objectAtIndex:(++i)] );
}
else if ((!strcmp(arg, "-marker")) && (i < argc))
{
mUpdater.mMarkerPath = NSToString( [args objectAtIndex:(++i)] );
}
}
return 0;
}
bool isDirWritable(const std::string& dir_name)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *fullPath = [NSString stringWithCString:dir_name.c_str()
encoding:[NSString defaultCStringEncoding]];
NSFileManager *fm = [NSFileManager defaultManager];
bool result = [fm isWritableFileAtPath:fullPath];
[pool release];
return result;
}
std::string* getUserTrashFolder()
{
std::string *result;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *trash_str=[NSHomeDirectory() stringByAppendingPathComponent:@".Trash"];
result = NSToString( trash_str );
[pool release];
return result;
}
bool isFSRefViewerBundle(const std::string& targetURL)
{
bool result = false;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *fullPath = [NSString stringWithCString:targetURL.c_str()
encoding:[NSString defaultCStringEncoding]];
NSBundle *targetBundle = [NSBundle bundleWithPath:fullPath];
NSString *targetBundleStr = [targetBundle bundleIdentifier];
NSString *sourceBundleStr = [NSString stringWithCString:mUpdater.mBundleID->c_str()
encoding:[NSString defaultCStringEncoding]];
result = [targetBundleStr isEqualToString:sourceBundleStr];
if(!result)
{
std::cout << "Target bundle ID mismatch." << std::endl;
}
[pool release];
return result;
}
- (IBAction)cancel:(id)sender
{
gCancelled = true;
sendDone();
}
- (void)stopAlert
{
NSAlert *alert = [[NSAlert alloc] init];
[alert setAlertStyle:NSInformationalAlertStyle];
[alert setMessageText:@"Error"];
[alert setInformativeText:@"An error occurred while updating Second Life. Please download the latest version from www.secondlife.com."];
[alert beginSheetModalForWindow:_window
modalDelegate:self
didEndSelector:@selector(stopAlertDidEnd:returnCode:
contextInfo:)
contextInfo:nil];
}
- (void)stopAlertDidEnd:(NSAlert *)alert
returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
[alert release];
}
@end

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
/**
* @file mac_updater.h
* @brief
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include <iostream>
#include <pthread.h>
#include <boost/filesystem.hpp>
#ifndef LL_MAC_UPDATER_H
#define LL_MAC_UPDATER_H
extern bool gCancelled;
extern bool gFailure;
void *updatethreadproc(void*);
std::string* walkParents( signed int depth, std::string* childpath );
std::string* getUserTrashFolder();
void setProgress(int cur, int max);
void setProgressText(const std::string& str);
void sendProgress(int cur, int max, std::string str);
void sendDone();
void sendStopAlert();
bool isFSRefViewerBundle(const std::string& targetURL);
bool isDirWritable(const std::string& dir_name);
bool mkTempDir(boost::filesystem::path& temp_dir);
bool copyDir(const std::string& src_dir, const std::string& dest_dir);
int oldmain();
class LLMacUpdater
{
public:
LLMacUpdater();
void doUpdate();
const std::string walkParents( signed int depth, const std::string& childpath );
bool isApplication(const std::string& app_str);
void filterFile(const char* filename);
bool findAppBundleOnDiskImage(const boost::filesystem::path& dir_path,
boost::filesystem::path& path_found);
bool verifyDirectory(const boost::filesystem::path* directory, bool isParent=false);
bool getViewerDir(boost::filesystem::path &app_dir);
bool downloadDMG(const std::string& dmgName, boost::filesystem::path* temp_dir);
bool doMount(const std::string& dmgName, char* deviceNode, const boost::filesystem::path& temp_dir);
bool moveApplication (const boost::filesystem::path& app_dir,
const boost::filesystem::path& temp_dir,
boost::filesystem::path& aside_dir);
bool doInstall(const boost::filesystem::path& app_dir,
const boost::filesystem::path& temp_dir,
boost::filesystem::path& mount_dir,
bool replacingTarget);
void* updatethreadproc(void*);
static void* sUpdatethreadproc(void*);
public:
std::string *mUpdateURL;
std::string *mProductName;
std::string *mBundleID;
std::string *mDmgFile;
std::string *mMarkerPath;
std::string *mApplicationPath;
static LLMacUpdater *sInstance;
};
#endif

34
indra/mac_updater/main.m Normal file
View File

@ -0,0 +1,34 @@
/**
* @file main.m
* @brief
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
int retVal = NSApplicationMain(argc, (const char **)argv);
return retVal;
}

View File

@ -97,6 +97,9 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 0
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
@ -126,13 +129,16 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// Mid Graphics Settings
// Medium Low Graphics Settings
//
list Mid
list LowMid
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
@ -153,11 +159,74 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// High Graphics Settings (purty)
// Medium Graphics Settings (standard)
//
list Mid
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// Medium High Graphics Settings (deferred enabled)
//
list MidHigh
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Graphics Settings (deferred + SSAO)
//
list High
RenderAnisotropic 1 1
@ -180,9 +249,43 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Ultra Graphics Settings (deferred + SSAO + shadows)
//
list HighUltra
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 2
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// Ultra graphics (REALLY PURTY!)
//
@ -227,57 +330,36 @@ RenderDeferredSSAO 1 0
//
list Class0
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 1 Hardware
//
list Class1
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 2 Hardware
//
list Class2
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 3 Hardware (deferred enabled)
// Class 3 Hardware
//
list Class3
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 0
//
// Class 4 Hardware (deferred + SSAO)
// Class 4 Hardware
//
list Class4
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// Class 5 Hardware (deferred + SSAO + shadows)
// Class 5 Hardware
//
list Class5
RenderVBOEnable 1 1
RenderShadowDetail 1 2
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// VRAM > 512MB

View File

@ -94,6 +94,9 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
@ -122,13 +125,16 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
VertexShaderEnable 1 0
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// Mid Graphics Settings
// Medium Low Graphics Settings
//
list Mid
list LowMid
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
@ -137,9 +143,9 @@ RenderAvatarVP 1 1
RenderFarClip 1 96
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 8
RenderLocalLights 1 1
RenderMaxPartCount 1 2048
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 1.0
@ -149,11 +155,74 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// High Graphics Settings (purty)
// Medium Graphics Settings (standard)
//
list Mid
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// Medium High Graphics Settings (deferred enabled)
//
list MidHigh
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Graphics Settings (deferred + SSAO)
//
list High
RenderAnisotropic 1 1
@ -164,9 +233,9 @@ RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderLocalLights 1 1
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
@ -176,6 +245,39 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Ultra Graphics Settings (deferred + SSAO + shadows)
//
list HighUltra
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 2
WLSkyDetail 1 48
RenderFSAASamples 1 2
@ -223,56 +325,37 @@ RenderDeferredSSAO 1 0
//
list Class0
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 1 Hardware
//
list Class1
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 2 Hardware
//
list Class2
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 3 Hardware (deferred enabled)
// Class 3 Hardware
//
list Class3
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 0
//
// Class 4 Hardware (deferred + SSAO)
// Class 4 Hardware
//
list Class4
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// Class 5 Hardware (deferred + SSAO + shadows)
// Class 5 Hardware
//
list Class5
RenderVBOEnable 1 1
RenderShadowDetail 1 2
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// VRAM > 512MB
//

View File

@ -1,4 +1,4 @@
version 34
version 35
// The version number above should be implemented IF AND ONLY IF some
// change has been made that is sufficiently important to justify
// resetting the graphics preferences of all users to the recommended
@ -96,6 +96,9 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
VertexShaderEnable 1 0
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
@ -124,13 +127,16 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// Mid Graphics Settings
// Medium Low Graphics Settings
//
list Mid
list LowMid
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
@ -139,9 +145,9 @@ RenderAvatarVP 1 1
RenderFarClip 1 96
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 8
RenderLocalLights 1 1
RenderMaxPartCount 1 2048
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 1.0
@ -151,11 +157,74 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// High Graphics Settings (purty)
// Medium Graphics Settings (standard)
//
list Mid
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// Medium High Graphics Settings (deferred enabled)
//
list MidHigh
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Graphics Settings (deferred + SSAO)
//
list High
RenderAnisotropic 1 1
@ -166,9 +235,9 @@ RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderLocalLights 1 1
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
@ -178,9 +247,43 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Ultra Graphics Settings (deferred + SSAO + shadows)
//
list HighUltra
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 2
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// Ultra graphics (REALLY PURTY!)
//
@ -216,65 +319,41 @@ RenderFSAASamples 1 2
//
list Unknown
RenderVBOEnable 1 0
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 0 Hardware (just old)
//
list Class0
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 1 Hardware
//
list Class1
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 2 Hardware
//
list Class2
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 3 Hardware (deferred enabled)
// Class 3 Hardware
//
list Class3
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 0
//
// Class 4 Hardware (deferred + SSAO)
// Class 4 Hardware
//
list Class4
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// Class 5 Hardware (deferred + SSAO + shadows)
// Class 5 Hardware
//
list Class5
RenderVBOEnable 1 1
RenderShadowDetail 1 2
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// No Pixel Shaders available

View File

@ -96,6 +96,9 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
VertexShaderEnable 1 0
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
@ -124,13 +127,16 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// Mid Graphics Settings
// Medium Low Graphics Settings
//
list Mid
list LowMid
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
@ -139,9 +145,9 @@ RenderAvatarVP 1 1
RenderFarClip 1 96
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 8
RenderLocalLights 1 1
RenderMaxPartCount 1 2048
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 1.0
@ -151,11 +157,74 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 0
//
// High Graphics Settings (purty)
// Medium Graphics Settings (standard)
//
list Mid
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 0
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// Medium High Graphics Settings (deferred enabled)
//
list MidHigh
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 0
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Graphics Settings (deferred + SSAO)
//
list High
RenderAnisotropic 1 1
@ -166,9 +235,9 @@ RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderLocalLights 1 1
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
@ -178,6 +247,39 @@ RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 0
WLSkyDetail 1 48
RenderFSAASamples 1 2
//
// High Ultra Graphics Settings (deferred + SSAO + shadows)
//
list HighUltra
RenderAnisotropic 1 1
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 1.0
RenderAvatarPhysicsLODFactor 1 1.0
RenderAvatarVP 1 1
RenderFarClip 1 128
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 9
RenderMaxPartCount 1 4096
RenderObjectBump 1 1
RenderLocalLights 1 1
RenderReflectionDetail 1 0
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTransparentWater 1 1
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 1.125
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
RenderDeferred 1 1
RenderDeferredSSAO 1 1
RenderShadowDetail 1 2
WLSkyDetail 1 48
RenderFSAASamples 1 2
@ -216,65 +318,42 @@ RenderFSAASamples 1 2
//
list Unknown
RenderVBOEnable 1 0
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 0 Hardware (just old)
//
list Class0
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 1 Hardware
//
list Class1
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 2 Hardware
//
list Class2
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 0
RenderDeferredSSAO 1 0
//
// Class 3 Hardware (deferred enabled)
// Class 3 Hardware
//
list Class3
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 0
//
// Class 4 Hardware (deferred + SSAO)
//
list Class4
RenderVBOEnable 1 1
RenderShadowDetail 1 0
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// Class 5 Hardware (deferred + SSAO + shadows)
// Class 5 Hardware
//
list Class5
RenderVBOEnable 1 1
RenderShadowDetail 1 2
RenderDeferred 1 1
RenderDeferredSSAO 1 1
//
// VRAM > 512MB

View File

@ -536,6 +536,46 @@ LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::addList(const LLSD&
return result;
}
LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::replaceList(const LLSD& newList)
{
AddListResult result = AddListInvalidList;
if ( listIsValid( newList ) )
{
std::string listName = newList[AUTOREPLACE_LIST_NAME].asString();
bool listFound = false;
S32 search_index;
LLSD targetList;
// The following is working around the fact that LLSD arrays containing maps also seem to have undefined entries... see LLSD-30
for ( search_index = 0, targetList = mLists[0];
!listFound && search_index < mLists.size();
search_index += 1, targetList = mLists[search_index]
)
{
if ( targetList.isMap() )
{
if ( listNameMatches( targetList, listName) )
{
LL_DEBUGS("AutoReplace")<<"list to replace found at "<<search_index<<LL_ENDL;
mLists.erase(search_index);
mLists.insert(search_index, newList);
listFound = true;
result = AddListOk;
}
}
}
if ( ! listFound )
{
LL_WARNS("AutoReplace") << "attempt to replace unconfigured list" << LL_ENDL;
}
}
else
{
LL_WARNS("AutoReplace") << "attempt to add invalid list" << LL_ENDL;
}
return result;
}
bool LLAutoReplaceSettings::removeReplacementList(std::string listName)
{
bool found = false;

View File

@ -67,6 +67,9 @@ class LLAutoReplaceSettings
/// Inserts a new list at the end of the priority order
AddListResult addList(const LLSD& newList);
/// Inserts a list in place of an existing list of the same name
AddListResult replaceList(const LLSD& newList);
/// Removes the named list, @returns false if not found
bool removeReplacementList(std::string listName);

View File

@ -1630,6 +1630,7 @@ void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar)
LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
renderRigged(avatar, RIGGED_ALPHA);
gGL.setColorMask(true, false);
}
}
@ -1646,6 +1647,7 @@ void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar)
LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA);
gGL.setColorMask(true, false);
}
}

View File

@ -499,6 +499,10 @@ void LLFeatureManager::parseGPUTable(std::string filename)
{
LL_WARNS("RenderInit") << "GPU '" << rawRenderer << "' not recognized" << LL_ENDL;
}
#if LL_DARWIN // never go over "Mid" settings by default on OS X
mGPUClass = llmin(mGPUClass, GPU_CLASS_2);
#endif
}
// responder saves table into file
@ -708,34 +712,27 @@ void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures)
{ //same as low, but with "Basic Shaders" enabled
maskFeatures("Low");
}
maskFeatures("Class0");
break;
case 1:
maskFeatures("Mid");
maskFeatures("Class1");
maskFeatures("LowMid");
break;
case 2:
maskFeatures("High");
maskFeatures("Class2");
maskFeatures("Mid");
break;
case 3:
maskFeatures("High");
maskFeatures("Class3");
maskFeatures("MidHigh");
break;
case 4:
maskFeatures("High");
maskFeatures("Class4");
break;
case 5:
maskFeatures("High");
maskFeatures("Class5");
maskFeatures("HighUltra");
break;
case 6:
maskFeatures("Ultra");
break;
default:
maskFeatures("Low");
maskFeatures("Class0");
break;
}

View File

@ -478,14 +478,25 @@ bool LLFloaterAutoReplaceSettings::callbackNewListName(const LLSD& notification,
bool LLFloaterAutoReplaceSettings::callbackListNameConflict(const LLSD& notification, const LLSD& response)
{
LLSD newList = notification["payload"]["list"];
std::string listName = LLAutoReplaceSettings::getListName(newList);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch ( option )
{
case 0:
// Replace current list
LL_INFOS("AutoReplace")<<"option 'replace current list' selected"<<LL_ENDL;
if ( LLAutoReplaceSettings::AddListOk == mSettings.replaceList(newList) )
{
LL_INFOS("AutoReplace") << "replaced list '"<<listName<<"'"<<LL_ENDL;
mSelectedListName = listName;
updateListNames();
updateListNamesControls();
updateReplacementsList();
}
else
{
LL_WARNS("AutoReplace")<<"failed to replace list '"<<listName<<"'"<<LL_ENDL;
}
break;
case 1:
@ -503,14 +514,27 @@ bool LLFloaterAutoReplaceSettings::callbackListNameConflict(const LLSD& notifica
void LLFloaterAutoReplaceSettings::onDeleteList()
{
std::string listName= mListNames->getFirstSelected()->getColumn(0)->getValue().asString();
mSettings.removeReplacementList(listName); // remove from the copy of settings
mReplacementsList->deleteSelectedItems(); // remove from the scrolling list
mSelectedListName.clear();
updateListNames();
updateListNamesControls();
updateReplacementsList();
std::string listName = mListNames->getSelectedValue().asString();
if ( ! listName.empty() )
{
if ( mSettings.removeReplacementList(listName) )
{
LL_INFOS("AutoReplace")<<"deleted list '"<<listName<<"'"<<LL_ENDL;
mReplacementsList->deleteSelectedItems(); // remove from the scrolling list
mSelectedListName.clear();
updateListNames();
updateListNamesControls();
updateReplacementsList();
}
else
{
LL_WARNS("AutoReplace")<<"failed to delete list '"<<listName<<"'"<<LL_ENDL;
}
}
else
{
LL_DEBUGS("AutoReplace")<<"no list selected for delete"<<LL_ENDL;
}
}
void LLFloaterAutoReplaceSettings::onExportList()

View File

@ -54,23 +54,21 @@ LLMenuOptionPathfindingRebakeNavmesh::LLMenuOptionPathfindingRebakeNavmesh()
LLMenuOptionPathfindingRebakeNavmesh::~LLMenuOptionPathfindingRebakeNavmesh()
{
if (mRebakeNavMeshMode == kRebakeNavMesh_RequestSent)
{
LL_WARNS("navmeshRebaking") << "During destruction of the LLMenuOptionPathfindingRebakeNavmesh "
<< "singleton, the mode indicates that a request has been sent for which a response has yet "
<< "to be received. This could contribute to a crash on exit." << LL_ENDL;
}
llassert(!mIsInitialized);
if (mIsInitialized)
{
if (mRebakeNavMeshMode == kRebakeNavMesh_RequestSent)
{
LL_WARNS("navmeshRebaking") << "During destruction of the LLMenuOptionPathfindingRebakeNavmesh "
<< "singleton, the mode indicates that a request has been sent for which a response has yet "
<< "to be received. This could contribute to a crash on exit." << LL_ENDL;
}
quit();
}
}
void LLMenuOptionPathfindingRebakeNavmesh::initialize()
{
llassert(!mIsInitialized);
if (!mIsInitialized)
{
mIsInitialized = true;
@ -94,7 +92,6 @@ void LLMenuOptionPathfindingRebakeNavmesh::initialize()
void LLMenuOptionPathfindingRebakeNavmesh::quit()
{
llassert(mIsInitialized);
if (mIsInitialized)
{
if (mNavMeshSlot.connected())
@ -175,51 +172,60 @@ void LLMenuOptionPathfindingRebakeNavmesh::handleAgentState(BOOL pCanRebakeRegio
void LLMenuOptionPathfindingRebakeNavmesh::handleRebakeNavMeshResponse(bool pResponseStatus)
{
llassert(mIsInitialized);
if (getMode() == kRebakeNavMesh_RequestSent)
if (mIsInitialized)
{
setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
}
if (getMode() == kRebakeNavMesh_RequestSent)
{
setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
}
if (!pResponseStatus)
{
LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
if (!pResponseStatus)
{
LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
}
}
}
void LLMenuOptionPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus)
{
llassert(mIsInitialized);
ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default;
if (pNavMeshStatus.isValid())
if (mIsInitialized)
{
switch (pNavMeshStatus.getStatus())
ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default;
if (pNavMeshStatus.isValid())
{
case LLPathfindingNavMeshStatus::kPending :
case LLPathfindingNavMeshStatus::kRepending :
rebakeNavMeshMode = kRebakeNavMesh_Available;
break;
case LLPathfindingNavMeshStatus::kBuilding :
rebakeNavMeshMode = kRebakeNavMesh_InProgress;
break;
case LLPathfindingNavMeshStatus::kComplete :
rebakeNavMeshMode = kRebakeNavMesh_NotAvailable;
break;
default :
rebakeNavMeshMode = kRebakeNavMesh_Default;
llassert(0);
break;
switch (pNavMeshStatus.getStatus())
{
case LLPathfindingNavMeshStatus::kPending :
case LLPathfindingNavMeshStatus::kRepending :
rebakeNavMeshMode = kRebakeNavMesh_Available;
break;
case LLPathfindingNavMeshStatus::kBuilding :
rebakeNavMeshMode = kRebakeNavMesh_InProgress;
break;
case LLPathfindingNavMeshStatus::kComplete :
rebakeNavMeshMode = kRebakeNavMesh_NotAvailable;
break;
default :
rebakeNavMeshMode = kRebakeNavMesh_Default;
llassert(0);
break;
}
}
}
setMode(rebakeNavMeshMode);
setMode(rebakeNavMeshMode);
}
}
void LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed()
{
llassert(mIsInitialized);
createNavMeshStatusListenerForCurrentRegion();
mCanRebakeRegion = FALSE;
LLPathfindingManager::getInstance()->requestGetAgentState();
if (mIsInitialized)
{
createNavMeshStatusListenerForCurrentRegion();
mCanRebakeRegion = FALSE;
LLPathfindingManager::getInstance()->requestGetAgentState();
}
}
void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegion()

View File

@ -361,7 +361,20 @@ public:
mModelData(model_data),
mObserverHandle(observer_handle)
{
if (mThread)
{
mThread->startRequest();
}
}
~LLWholeModelFeeResponder()
{
if (mThread)
{
mThread->stopRequest();
}
}
virtual void completed(U32 status,
const std::string& reason,
const LLSD& content)
@ -372,7 +385,6 @@ public:
cc = llsd_from_file("fake_upload_error.xml");
}
mThread->mPendingUploads--;
dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num));
LLWholeModelFeeObserver* observer = mObserverHandle.get();
@ -415,7 +427,20 @@ public:
mModelData(model_data),
mObserverHandle(observer_handle)
{
if (mThread)
{
mThread->startRequest();
}
}
~LLWholeModelUploadResponder()
{
if (mThread)
{
mThread->stopRequest();
}
}
virtual void completed(U32 status,
const std::string& reason,
const LLSD& content)
@ -426,7 +451,6 @@ public:
cc = llsd_from_file("fake_upload_error.xml");
}
mThread->mPendingUploads--;
dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num));
LLWholeModelUploadObserver* observer = mObserverHandle.get();
@ -1622,7 +1646,7 @@ void LLMeshUploadThread::doWholeModelUpload()
mCurlRequest->process();
//sleep for 10ms to prevent eating a whole core
apr_sleep(10000);
} while (!LLAppViewer::isQuitting() && mCurlRequest->getQueued() > 0);
} while (!LLAppViewer::isQuitting() && mPendingUploads > 0);
}
delete mCurlRequest;
@ -1644,7 +1668,6 @@ void LLMeshUploadThread::requestWholeModelFee()
wholeModelToLLSD(model_data,false);
dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num));
mPendingUploads++;
LLCurlRequest::headers_t headers;
{
@ -1661,7 +1684,7 @@ void LLMeshUploadThread::requestWholeModelFee()
mCurlRequest->process();
//sleep for 10ms to prevent eating a whole core
apr_sleep(10000);
} while (!LLApp::isQuitting() && mCurlRequest->getQueued() > 0);
} while (!LLApp::isQuitting() && mPendingUploads > 0);
delete mCurlRequest;
mCurlRequest = NULL;

View File

@ -405,6 +405,9 @@ public:
LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
~LLMeshUploadThread();
void startRequest() { ++mPendingUploads; }
void stopRequest() { --mPendingUploads; }
bool finished() { return mFinished; }
virtual void run();
void preStart();

View File

@ -1484,7 +1484,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
updateRadius();
mDrawable->movePartition();
return res;
}
@ -3595,7 +3595,6 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
if (LLFloater::isVisible(gFloaterTools) && getAvatar()->isSelf())
{
updateRiggedVolume();
genBBoxes(FALSE);
volume = mRiggedVolume;
transform = false;
}

View File

@ -48,7 +48,7 @@ public:
/*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask) { return 42; }
/*virtual*/ BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap) { fname = fname + "_NEXT"; return false; }
/*virtual*/ void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname) { fname = "RANDOM_FILE"; }
/*virtual*/ BOOL fileExists(const std::string &filename) const { return false; }
/*virtual*/ bool fileExists(const std::string &filename) const { return false; }
};
LLDir_stub gDirUtil;

View File

@ -63,7 +63,7 @@ class LLDir_Mock : public LLDir
const std::string &mask,
std::string &fname) {}
std::string getCurPath() { return ""; }
BOOL fileExists(const std::string &filename) const { return false; }
bool fileExists(const std::string &filename) const { return false; }
std::string getLLPluginLauncher() { return ""; }
std::string getLLPluginFilename(std::string base_name) { return ""; }