diff --git a/doc/contributions.txt b/doc/contributions.txt index f7c297025300ef1bf95fb58eabb0cc4ada316495..26f37a4dc8df31d4d64f4be6eb66df5107681ece 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -4,7 +4,7 @@ along with the issue identifier corresponding to the patches we've received from them. To see more about these contributions, visit http://jira.secondlife.com/ and enter the issue identifier. -Able Whitman - VWR-650 +Able Whitman - VWR-650, VWR-1460 Alissa Sabre - VWR-81, VWR-83, VWR-171, VWR-251, VWR-414, VWR-415, VWR-459, VWR-606, VWR-652, VWR-1351, VWR-1410 Argent Stonecutter - VWR-68 Benja Kepler - VWR-746 @@ -16,7 +16,7 @@ Dale Glass - VWR-120, VWR-560 Drewan Keats - VWR-28, VWR-248, VWR-412 Duckless Vandyke - VWR-383 Dylan Haskell - VWR-72 -Dzonatas Sol - VWR-198, VWR-878, VWR-1704, VWR-1705 +Dzonatas Sol - VWR-198, VWR-878, VWR-1704, VWR-1705, VWR-1729, VWR-975 Eddy Stryker - VWR-15, VWR-23, VWR-1468 EponymousDylan Ra - VWR-1465 Fee Larsson - VWR-1314 @@ -24,6 +24,7 @@ Fremont Cunningham - VWR-1147 Gigs Taggart - VWR-71, VWR-326, VWR-1217, VWR-1434 Ginko Bayliss - VWR-4 Grazer Kline - VWR-1092 +Gudmund Shepherd - VWR-1594 Hikkoshi Sakai - VWR-429 Hiro Sommambulist - VWR-66, VWR-97, VWR-100, VWR-105, VWR-108, VWR-118, VWR-132, VWR-136, VWR-143 Iskar Ariantho - VWR-1223 @@ -31,22 +32,22 @@ Jacek Antonelli - VWR-165, VWR-188, VWR-427, VWR-597 Joghert LeSabre - VWR-64 Kage Pixel - VWR-11 Kunnis Basiat - VWR-82 -Nicholaz Beresford - VWR-132, VWR-176, VWR-364, VWR-691, VWR-793, VWR-794, VWR-802, VWR-803, VWR-804, VWR-805, VWR-808, VWR-809, VWR-810, VWR-823, VWR-856, VWR-869, VWR-870, VWR-871, VWR-873, VWR-908, VWR-966, VWR-1221, VWR-1270, VWR-1296, VWR-1410, VWR-1418, VWR-1453, VWR-1455, VWR-1470, VWR-1578, VWR-1626, VWR-1655, VWR-1698, VWR-1706, VWR-1723 McCabe Maxsted - VWR-1318 +Nicholaz Beresford - VWR-132, VWR-176, VWR-364, VWR-691, VWR-793, VWR-794, VWR-802, VWR-803, VWR-804, VWR-805, VWR-808, VWR-809, VWR-810, VWR-823, VWR-856, VWR-869, VWR-870, VWR-871, VWR-873, VWR-908, VWR-966, VWR-1221, VWR-1270, VWR-1296, VWR-1410, VWR-1418, VWR-1453, VWR-1455, VWR-1470, VWR-1578, VWR-1626, VWR-1655, VWR-1698, VWR-1706, VWR-1723, VWR-1732, VWR-1861 Paul Churchill - VWR-20 Paula Innis - VWR-30, VWR-1049 Peekay Semyorka - VWR-7, VWR-19, VWR-49, VWR-79 Ryozu Kojima - VWR-287 SignpostMarv Martin - VWR-154, VWR-155 Simon Nolan - VWR-409 -SpacedOut Frye - VWR-57, VWR-94, VWR-121, VWR-123 +SpacedOut Frye - VWR-57, VWR-94, VWR-121, VWR-123, VWR-1823 Stevex Janus - VWR-1182 Still Defiant - VWR-207, VWR-446 Strife Onizuka - SVC-9, VWR-74, VWR-85, VWR-148 tenebrous pau - VWR-247 TBBle Kurosawa - VWR-938, VWR-941, VWR-944, VWR-945 Tharax Ferraris - VWR-605 -Thraxis Epsilon - SVC-371 +Thraxis Epsilon - VWR-383, SVC-371 +Whoops Babii - VWR-1640 Zi Ree - VWR-671, VWR-682, VWR-1140 Zipherius Turas - VWR-76, VWR-77 - diff --git a/indra/lib/python/indra/__init__.py b/indra/lib/python/indra/__init__.py index 7db53666e8c38a80df9cae0a8b82a79a6a73f748..bbfdbaf98dd570d8838d423a4e3501cbbc5d0f9a 100644 --- a/indra/lib/python/indra/__init__.py +++ b/indra/lib/python/indra/__init__.py @@ -1,5 +1,7 @@ -# @file __init__.py -# @brief Initialization file for the indra module. -# -# Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. -# $License$ +"""\ +@file __init__.py +@brief Initialization file for the indra module. + +Copyright (c) 2006-2007, Linden Research, Inc. +$License$ +""" diff --git a/indra/linux_crash_logger/linux_crash_logger.cpp b/indra/linux_crash_logger/linux_crash_logger.cpp index 1b7d2870dcab4fb63a46d590261d3a707f9927a8..54c257b77b0dce6afb6078eeae488f4a0c8fa591 100644 --- a/indra/linux_crash_logger/linux_crash_logger.cpp +++ b/indra/linux_crash_logger/linux_crash_logger.cpp @@ -34,10 +34,8 @@ static const char dialog_text[] = "Second Life appears to have crashed.\n" "This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, which are used for debugging purposes only.\n" "Sending crash reports is the best way to help us improve the quality of Second Life.\n" -"If you continue to experience this problem, please try one of the following:\n" -"- Contact support by email at support@lindenlab.com\n" -"- If you can log-in, please contact Live Help by using menu Help > Live Help.\n" -"- Search the Second Life Knowledge Base at http://secondlife.com/knowledgebase/\n" +"If you continue to experience this problem, please try:\n" +"- Contacting support by visiting http://www.secondlife.com/support\n" "\n" "Send crash report?"; diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index e7cfe564f81c103ed72456f119f7493896944eeb..c8c565a05b9369483f49b52d5c94f5c661b8b739 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -235,24 +235,24 @@ bool CProcessor::AnalyzeIntelProcessor() /* 0x03 */ "0.13 micron Intel Celeron", /* 0x04 */ "0.13 micron Intel Pentium III", /* 0x05 */ "", - /* 0x06 */ "0.13 micron Intel Pentium III mobile", - /* 0x07 */ "0.13 micron Intel Celeron mobile", + /* 0x06 */ "0.13 micron Intel Pentium III Mobile", + /* 0x07 */ "0.13 micron Intel Celeron Mobile", /* 0x08 */ "0.18 micron Intel Pentium 4", /* 0x09 */ "0.13 micron Intel Pentium 4", - /* 0x0A */ "0.13 micron Intel Pentium 4", + /* 0x0A */ "0.13 micron Intel Celeron", /* 0x0B */ "0.13 micron Intel Pentium 4 Xeon", - /* 0x0C */ "", + /* 0x0C */ "Intel Xeon MP", /* 0x0D */ "", /* 0x0E */ "0.18 micron Intel Pentium 4 Xeon", - /* 0x0F */ "", + /* 0x0F */ "Mobile Intel Celeron", /* 0x10 */ "", - /* 0x11 */ "", + /* 0x11 */ "Mobile Genuine Intel", /* 0x12 */ "Intel Celeron M", - /* 0x13 */ "mobile Intel Celeron", + /* 0x13 */ "Mobile Intel Celeron", /* 0x14 */ "Intel Celeron", - /* 0x15 */ "mobile Intel", + /* 0x15 */ "Mobile Genuine Intel", /* 0x16 */ "Intel Pentium M", - /* 0x17 */ "mobile Intel Celeron", + /* 0x17 */ "Mobile Intel Celeron", }; // Only override the brand if we have it in the lookup table. We should @@ -427,17 +427,21 @@ bool CProcessor::AnalyzeIntelProcessor() case 1: // Model = 8, Brand id = 1: Celeron (on-die L2 cache) processor model strncat(strCPUName, "Intel Celeron (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; - case 2: // Model = 8, Brand id = 2: Pentium III (on-die L2 cache) processor model (my current cpu :-)) + case 2: // Model = 8, Brand id = 2: Pentium III (on-die L2 cache) processor model (my current cpu :-)) strncat(strCPUName, "Intel Pentium III (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; case 3: // Model = 8, Brand id = 3: Pentium III Xeon (on-die L2 cache) processor model - strncat(strCPUName, "Intel Pentium III Xeon (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ + strncat(strCPUName, "Intel Pentium III Xeon (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; default: // ... strncat(strCPUName, "Intel Pentium III core (unknown model, 0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; } break; + case 9: // Model = 9: Intel Pentium M processor, Intel Celeron M processor, model 9 + strcpy(CPUInfo.strModel, "Intel Pentium M Series Processor"); /*Flawfinder: ignore*/ + strncat(strCPUName, "Intel Pentium M Series Processor", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ + break; case 0xA: // Model = 0xA: Pentium III/Xeon/Celeron (1 or 2 MB on-die L2 cache) processor model strcpy(CPUInfo.strModel, "Intel Pentium III/Celeron/Pentium III Xeon - internal L2 cache, 0.18 micron"); /*Flawfinder: ignore*/ // Exact detection: @@ -446,11 +450,11 @@ bool CProcessor::AnalyzeIntelProcessor() case 1: // Model = 0xA, Brand id = 1: Celeron (1 or 2 MB on-die L2 cache (does it exist??)) processor model strncat(strCPUName, "Intel Celeron (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; - case 2: // Model = 0xA, Brand id = 2: Pentium III (1 or 2 MB on-die L2 cache (never seen...)) processor model + case 2: // Model = 0xA, Brand id = 2: Pentium III (1 or 2 MB on-die L2 cache (never seen...)) processor model strncat(strCPUName, "Intel Pentium III (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; case 3: // Model = 0xA, Brand id = 3: Pentium III Xeon (1 or 2 MB on-die L2 cache) processor model - strncat(strCPUName, "Intel Pentium III Xeon (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ + strncat(strCPUName, "Intel Pentium III Xeon (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; default: // Getting bored of this............ strncat(strCPUName, "Intel Pentium III core (unknown model, 0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ @@ -465,24 +469,28 @@ bool CProcessor::AnalyzeIntelProcessor() case 3: // Model = 0xB, Brand id = 3: Celeron (Tualatin core) processor model strncat(strCPUName, "Intel Celeron (Tualatin core, 0.13 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; - case 4: // Model = 0xB, Brand id = 4: Pentium III (Tualatin core) processor model + case 4: // Model = 0xB, Brand id = 4: Pentium III (Tualatin core) processor model strncat(strCPUName, "Intel Pentium III (Tualatin core, 0.13 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; case 7: // Model = 0xB, Brand id = 7: Celeron mobile (Tualatin core) processor model - strncat(strCPUName, "Intel Celeron mobile (Tualatin core, 0.13 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ + strncat(strCPUName, "Intel Celeron mobile (Tualatin core, 0.13 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; default: // *bored* strncat(strCPUName, "Intel Pentium III Tualatin core (unknown model, 0.13 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; } break; + case 0xD: // Model = 0xD: Intel Pentium M processor, Intel Celeron M processor, model D + strcpy(CPUInfo.strModel, "Intel Pentium M Series Processor"); /*Flawfinder: ignore*/ + strncat(strCPUName, "Intel Pentium M Series Processor", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ + break; case 0xE: // Model = 0xE: Intel Core Duo processor, Intel Core Solo processor, model E - strcpy(CPUInfo.strModel, "Intel Core Duo/Solo Processor"); /*Flawfinder: ignore*/ - strncat(strCPUName, "Intel Core Duo/Solo Processor", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ + strcpy(CPUInfo.strModel, "Intel Core Series Processor"); /*Flawfinder: ignore*/ + strncat(strCPUName, "Intel Core Series Processor", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; case 0xF: // Model = 0xF: Intel Core 2 Duo processor, model F - strcpy(CPUInfo.strModel, "Intel Core2 Duo Processor"); /*Flawfinder: ignore*/ - strncat(strCPUName, "Intel Core2 Duo Processor", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ + strcpy(CPUInfo.strModel, "Intel Core 2 Series Processor"); /*Flawfinder: ignore*/ + strncat(strCPUName, "Intel Core 2 Series Processor", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/ break; default: // *more bored* strcpy(CPUInfo.strModel, "Unknown Intel Pentium Pro/2/3, Core"); /*Flawfinder: ignore*/ diff --git a/indra/llcommon/llprocessor.h b/indra/llcommon/llprocessor.h index 9060e8aa95b7f3ec601f62702f901d029d681876..7a09f37d0c463b0526fb076d023d13ef2f7304bc 100644 --- a/indra/llcommon/llprocessor.h +++ b/indra/llcommon/llprocessor.h @@ -20,6 +20,20 @@ #define PROCESSOR_FREQUENCY_MEASURE_AVAILABLE #endif +#if LL_MSVC && _M_X64 +# define LL_X86_64 1 +# define LL_X86 1 +#elif LL_MSVC && _M_IX86 +# define LL_X86 1 +#elif LL_GNUC && ( defined(__amd64__) || defined(__x86_64__) ) +# define LL_X86_64 1 +# define LL_X86 1 +#elif LL_GNUC && ( defined(__i386__) ) +# define LL_X86 1 +#elif LL_GNUC && ( defined(__powerpc__) || defined(__ppc__) ) +# define LL_PPC 1 +#endif + typedef struct ProcessorExtensions { diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 87d31987ce0f5097206e79356bae50e32a017525..b6d927d0f3c4a68fcf2a7886ab97915a63ca965c 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -17,7 +17,7 @@ # include "zlib/zlib.h" #endif -#include "processor.h" +#include "llprocessor.h" #if LL_WINDOWS # define WIN32_LEAN_AND_MEAN @@ -28,6 +28,8 @@ # include <sys/utsname.h> #elif LL_LINUX # include <sys/utsname.h> +# include <unistd.h> +# include <sys/sysinfo.h> const char MEMINFO_FILE[] = "/proc/meminfo"; const char CPUINFO_FILE[] = "/proc/cpuinfo"; #endif @@ -236,7 +238,7 @@ U32 LLOSInfo::getProcessVirtualSizeKB() #if LL_WINDOWS #endif #if LL_LINUX - FILE* status_filep = LLFile::fopen("/proc/self/status", "r"); /* Flawfinder: ignore */ + FILE* status_filep = LLFile::fopen("/proc/self/status", "rb"); S32 numRead = 0; char buff[STATUS_SIZE]; /* Flawfinder: ignore */ @@ -279,7 +281,7 @@ U32 LLOSInfo::getProcessResidentSizeKB() #if LL_WINDOWS #endif #if LL_LINUX - FILE* status_filep = LLFile::fopen("/proc/self/status", "r"); /* Flawfinder: ignore */ + FILE* status_filep = LLFile::fopen("/proc/self/status", "rb"); if (status_filep != NULL) { S32 numRead = 0; @@ -320,6 +322,7 @@ U32 LLOSInfo::getProcessResidentSizeKB() LLCPUInfo::LLCPUInfo() { + std::ostringstream out; CProcessor proc; const ProcessorInfo* info = proc.GetCPUInfo(); // proc.WriteInfoTextFile("procInfo.txt"); @@ -328,6 +331,63 @@ LLCPUInfo::LLCPUInfo() mHasAltivec = info->_Ext.Altivec_Extensions; mCPUMhz = (S32)(proc.GetCPUFrequency(50)/1000000.0); mFamily.assign( info->strFamily ); + mCPUString = "Unknown"; + +#if LL_WINDOWS || LL_DARWIN || LL_SOLARIS + out << proc.strCPUName; + if (200 < mCPUMhz && mCPUMhz < 10000) // *NOTE: cpu speed is often way wrong, do a sanity check + { + out << " (" << mCPUMhz << " MHz)"; + } + mCPUString = out.str(); + +#elif LL_LINUX + std::map< LLString, LLString > cpuinfo; + FILE* cpuinfo_fp = LLFile::fopen(CPUINFO_FILE, "rb"); + if(cpuinfo_fp) + { + char line[MAX_STRING]; + memset(line, 0, MAX_STRING); + while(fgets(line, MAX_STRING, cpuinfo_fp)) + { + // /proc/cpuinfo on Linux looks like: + // name\t*: value\n + char* tabspot = strchr( line, '\t' ); + if (tabspot == NULL) + continue; + char* colspot = strchr( tabspot, ':' ); + if (colspot == NULL) + continue; + char* spacespot = strchr( colspot, ' ' ); + if (spacespot == NULL) + continue; + char* nlspot = strchr( line, '\n' ); + if (nlspot == NULL) + nlspot = line + strlen( line ); // Fallback to terminating NUL + std::string linename( line, tabspot ); + LLString llinename(linename); + LLString::toLower(llinename); + std::string lineval( spacespot + 1, nlspot ); + cpuinfo[ llinename ] = lineval; + } + fclose(cpuinfo_fp); + } +# if LL_X86 + LLString flags = " " + cpuinfo["flags"] + " "; + LLString::toLower(flags); + mHasSSE = ( flags.find( " sse " ) != std::string::npos ); + mHasSSE2 = ( flags.find( " sse2 " ) != std::string::npos ); + + F64 mhz; + if (LLString::convertToF64(cpuinfo["cpu mhz"], mhz) + && 200.0 < mhz && mhz < 10000.0) + { + mCPUMhz = (S32)llrint(mhz); + } + if (!cpuinfo["model name"].empty()) + mCPUString = cpuinfo["model name"]; +# endif // LL_X86 +#endif // LL_LINUX } bool LLCPUInfo::hasAltivec() const @@ -352,25 +412,7 @@ S32 LLCPUInfo::getMhz() const std::string LLCPUInfo::getCPUString() const { -#if LL_WINDOWS || LL_DARWIN || LL_SOLARIS - std::ostringstream out; - - CProcessor proc; - (void) proc.GetCPUInfo(); - out << proc.strCPUName << " "; - - F32 freq = (F32)(proc.GetCPUFrequency(50) / 1000000.0); - - // cpu speed is often way wrong, do a sanity check - if (200.f < freq && freq < 10000.f) - { - out << "(" << (S32)(freq) << " MHz)"; - } - - return out.str(); -#else - return "Can't get terse CPU information"; -#endif + return mCPUString; } void LLCPUInfo::stream(std::ostream& s) const @@ -385,38 +427,41 @@ void LLCPUInfo::stream(std::ostream& s) const } else { - s << "Unable to collect processor info"; + s << "Unable to collect processor information" << std::endl; } #else // *NOTE: This works on linux. What will it do on other systems? - FILE* cpuinfo = LLFile::fopen(CPUINFO_FILE, "r"); /* Flawfinder: ignore */ + FILE* cpuinfo = LLFile::fopen(CPUINFO_FILE, "rb"); if(cpuinfo) { - char line[MAX_STRING]; /* Flawfinder: ignore */ + char line[MAX_STRING]; memset(line, 0, MAX_STRING); while(fgets(line, MAX_STRING, cpuinfo)) { - line[strlen(line)-1] = ' '; /*Flawfinder: ignore*/ + line[strlen(line)-1] = ' '; s << line; } fclose(cpuinfo); + s << std::endl; } else { - s << "Unable to collect memory information"; + s << "Unable to collect processor information" << std::endl; } #endif + // These are interesting as they reflect our internal view of the + // CPU's attributes regardless of platform + s << "->mHasSSE: " << (U32)mHasSSE << std::endl; + s << "->mHasSSE2: " << (U32)mHasSSE2 << std::endl; + s << "->mHasAltivec: " << (U32)mHasAltivec << std::endl; + s << "->mCPUMhz: " << mCPUMhz << std::endl; + s << "->mCPUString: " << mCPUString << std::endl; } LLMemoryInfo::LLMemoryInfo() { } -#if LL_LINUX -#include <unistd.h> -#include <sys/sysinfo.h> -#endif - U32 LLMemoryInfo::getPhysicalMemory() const { #if LL_WINDOWS @@ -481,7 +526,7 @@ void LLMemoryInfo::stream(std::ostream& s) const s << "Total Physical Kb: " << phys << std::endl; #else // *NOTE: This works on linux. What will it do on other systems? - FILE* meminfo = LLFile::fopen(MEMINFO_FILE,"r"); /* Flawfinder: ignore */ + FILE* meminfo = LLFile::fopen(MEMINFO_FILE,"rb"); if(meminfo) { char line[MAX_STRING]; /* Flawfinder: ignore */ diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 4b6fbe149b4049b13b2da8037db23dfeb5691fc0..4c80e2877cb7833fb47b69a979fb9ab5ba472a7d 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -66,6 +66,7 @@ class LLCPUInfo bool mHasAltivec; S32 mCPUMhz; std::string mFamily; + std::string mCPUString; }; class LLMemoryInfo diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index d28cf96fa0909dffd769386e912c5ad634cc2aaf..d93748d069e4c1fc37047e7d0d8ac4ef76e2bb7a 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -69,7 +69,8 @@ LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& co mCurGlowStrength(0.f), mNeedsHighlight(FALSE), mCommitOnReturn(TRUE), - mImagep( NULL ) + mImagep( NULL ), + mIsDirty( FALSE ) { mUnselectedLabel = name; mSelectedLabel = name; @@ -251,8 +252,12 @@ void LLButton::onCommit() { (*mClickedCallback)( mCallbackUserData ); } + + mIsDirty = TRUE; } + + BOOL LLButton::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) { BOOL handled = FALSE; @@ -262,7 +267,8 @@ BOOL LLButton::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) { (*mClickedCallback)( mCallbackUserData ); } - handled = TRUE; + handled = TRUE; + mIsDirty = TRUE; } return handled; } @@ -279,6 +285,7 @@ BOOL LLButton::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ) (*mClickedCallback)( mCallbackUserData ); } handled = TRUE; + mIsDirty = TRUE; } } return handled; @@ -339,6 +346,8 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) { (*mClickedCallback)( mCallbackUserData ); } + + mIsDirty = TRUE; } mMouseDownTimer.stop(); @@ -741,6 +750,7 @@ void LLButton::setToggleState(BOOL b) void LLButton::setValue(const LLSD& value ) { mToggleState = value.asBoolean(); + mIsDirty = FALSE; } LLSD LLButton::getValue() const diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 470c34fb644d71bcce486df85a0ad7144b221dda..ba77220a7b30cd2fdd02d71c62ac452b45378367 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -80,6 +80,8 @@ class LLButton // HACK: "committing" a button is the same as clicking on it. virtual void onCommit(); + virtual BOOL isDirty() { return mIsDirty; }; // Returns TRUE if the user has clicked on the button at all + void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; } void setSelectedLabelColor( const LLColor4& c ) { mSelectedLabelColor = c; } @@ -256,6 +258,8 @@ class LLButton LLPointer<LLImageGL> mImagep; + BOOL mIsDirty; + static LLFrameTimer sFlashingTimer; }; diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 215f6d40ede3500781cb3d72de4825e88b58ff14..6c181acc941a90c91096ef13410e25778e2b5e8b 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -247,6 +247,18 @@ void LLCheckBoxCtrl::setControlName(const LLString& control_name, LLView* contex mButton->setControlName(control_name, context); } + +// virtual Returns TRUE if the user has modified this control. +BOOL LLCheckBoxCtrl::isDirty() +{ + if ( mButton ) + { + return mButton->isDirty(); + } + return FALSE; // Shouldn't get here +} + + // virtual LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const { diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index b2f9c959745f8a14452e5f8f19ea5d1df51d05a5..76b197125dd4a6c09934456ae6ddbfcd32af7a69 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -90,6 +90,8 @@ class LLCheckBoxCtrl static void onButtonPress(void *userdata); + virtual BOOL isDirty(); // Returns TRUE if the user has modified this control. + protected: // note: value is stored in toggle state of button LLButton* mButton; diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index b3eff3c8e2ea1a8519a38e0216c03ddb5b812cac..110e40b92d451d8f13e241e6f5b15e28e5fdc4e4 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -107,6 +107,7 @@ class LLLineEditor virtual void setRect(const LLRect& rect); virtual BOOL acceptsTextInput() const; virtual void onCommit(); + virtual BOOL isDirty() { return ( mText.getString() != mPrevText ); }; // Returns TRUE if the user has changed value at all // assumes UTF8 text virtual void setValue(const LLSD& value ); diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index f07cbec3287fc83ff0cd9a5e356780555c43bb92..7b96ec5655027582eb149bf30976ecda22f4fa55 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -128,6 +128,9 @@ class LLUICtrl } }; + // Returns TRUE if the user has modified this control. Editable controls should override this. + virtual BOOL isDirty() { return FALSE; }; + protected: virtual void onFocusReceived(); virtual void onFocusLost(); diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index 19c51b08b23e896ed1a14a2368e40b52440df0fe..2ff1028f741be64eb0fdc0b3f563219f90453b33 100644 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -757,7 +757,7 @@ BOOL lscript_compile(char *filename, BOOL is_god_like = FALSE) S32 yywrap() { -#ifdef FLEX_SCANNER +#if defined(FLEX_SCANNER) && !defined(LL_WINDOWS) // get gcc to stop complaining about lack of use of yyunput (void) yyunput; #endif diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt index 297fd0a0630601fc612d4a3c5f42df669488bb93..e07384cc93e3c3bec05d79c49ee303308578df79 100644 --- a/indra/newview/linux_tools/client-readme.txt +++ b/indra/newview/linux_tools/client-readme.txt @@ -235,9 +235,8 @@ For problems and discussion concerning unofficial (not secondlife.com) releases, please contact your packager or the SLDev mailing list: <https://lists.secondlife.com/cgi-bin/mailman/listinfo/sldev> -In-world help: Please use the 'Help' menu in the client for general -non-Linux-specific Second Life help including live support from the fabulous -'Help Request' team. +In-world help: Please use the 'Help' menu in the client for various +non-Linux-specific Second Life help options. In-world discussion: There is a 'Linux Client Users' group inside Second Life which is free to join. You can find it by pressing diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index dbbe1affb95d868b5db6dedbaa5ffb4f105a2382..45f0b448e291e6f097c5b8065fce2b4096165360 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -6750,7 +6750,7 @@ void LLAgent::removeWearable( EWearableType type ) if( old_wearable->isDirty() ) { // Bring up view-modal dialog: Save changes? Yes, No, Cancel - gViewerWindow->alertXml("WearableSave", LLAgent::onRemoveWearableDialog, (void*)(S32)type ); + gViewerWindow->alertXml("WearableSave", LLAgent::onRemoveWearableDialog, (void*)type ); return; } else diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 1e9acc96c1fc99ded62a7b9d45e23a954b95d627..4b18c0c91a8b1e035549a8f17d3e588ce9046817 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2453,6 +2453,10 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata) U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); + // Remove leading/trailing whitespace (common when copying/pasting) + LLString::trim(music_url); + LLString::trim(media_url); + // Push data into current parcel parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); parcel->setMusicURL(music_url.c_str()); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index d8ed27173dfa732909d9ae0a805986b8c0609e89..365926863e68c2e6303f1ff60750edbb0242522b 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -159,6 +159,8 @@ LLFloaterWorldMap::LLFloaterWorldMap() mCompletingRegionName(""), mWaitingForTracker(FALSE), mExactMatch(FALSE), + mIsClosing(FALSE), + mSetToUserPosition(TRUE), mTrackedLocation(0,0,0), mTrackedStatus(LLTracker::TRACKING_NOTHING) { @@ -335,6 +337,9 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) gFloaterWorldMap->buildAvatarIDList(); gFloaterWorldMap->buildLandmarkIDLists(); + + // If nothing is being tracked, set flag so the user position will be found + gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } if (center_on_target) @@ -497,7 +502,7 @@ void LLFloaterWorldMap::draw() childSetEnabled("Teleport", (BOOL)tracking_status); // childSetEnabled("Clear", (BOOL)tracking_status); childSetEnabled("Show Destination", (BOOL)tracking_status || gWorldMap->mIsTrackingUnknownLocation); - childSetEnabled("copy_slurl", (BOOL)tracking_status); + childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); setMouseOpaque(TRUE); mDragHandle->setMouseOpaque(TRUE); @@ -641,7 +646,8 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) return; } - LLString sim_name = gWorldMap->simNameFromPosGlobal( pos_global ); + LLString sim_name; + gWorldMap->simNameFromPosGlobal( pos_global, sim_name ); F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); LLString full_name = llformat("%s (%d, %d, %d)", @@ -662,15 +668,51 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) void LLFloaterWorldMap::updateLocation() { + bool gotSimName; + + LLTracker::ETrackingStatus status = LLTracker::getTrackingStatus(); + // These values may get updated by a message, so need to check them every frame // The fields may be changed by the user, so only update them if the data changes LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); if (pos_global.isExactlyZero()) { + LLVector3d agentPos = gAgent.getPositionGlobal(); + + // Set to avatar's current postion if nothing is selected + if ( status == LLTracker::TRACKING_NOTHING && mSetToUserPosition ) + { + // Make sure we know where we are before setting the current user position + LLString agent_sim_name; + gotSimName = gWorldMap->simNameFromPosGlobal( agentPos, agent_sim_name ); + if ( gotSimName ) + { + mSetToUserPosition = FALSE; + + // Fill out the location field + childSetValue("location", agent_sim_name); + + // Figure out where user is + LLVector3d agentPos = gAgent.getPositionGlobal(); + + S32 agent_x = llround( (F32)fmod( agentPos.mdV[VX], (F64)REGION_WIDTH_METERS ) ); + S32 agent_y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) ); + S32 agent_z = llround( (F32)agentPos.mdV[VZ] ); + + childSetValue("spin x", LLSD(agent_x) ); + childSetValue("spin y", LLSD(agent_y) ); + childSetValue("spin z", LLSD(agent_z) ); + + // Set the current SLURL + mSLURL = LLWeb::escapeURL( llformat("http://slurl.com/secondlife/%s/%d/%d/%d", + agent_sim_name.c_str(), agent_x, agent_y, agent_z) ); + } + } + return; // invalid location } - LLTracker::ETrackingStatus status = LLTracker::getTrackingStatus(); - LLString sim_name = gWorldMap->simNameFromPosGlobal( pos_global ); + LLString sim_name; + gotSimName = gWorldMap->simNameFromPosGlobal( pos_global, sim_name ); if ((status != LLTracker::TRACKING_NOTHING) && (status != mTrackedStatus || pos_global != mTrackedLocation || sim_name != mTrackedSimName)) { @@ -697,8 +739,16 @@ void LLFloaterWorldMap::updateLocation() childSetValue("spin y", LLSD(region_y) ); childSetValue("spin z", LLSD((F32)pos_global.mdV[VZ]) ); - mSLURL = LLWeb::escapeURL(llformat("http://slurl.com/secondlife/%s/%d/%d/%d", - sim_name.c_str(), llround(region_x), llround(region_y), llround((F32)pos_global.mdV[VZ]))); + // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL + if ( gotSimName ) + { + mSLURL = LLWeb::escapeURL(llformat("http://slurl.com/secondlife/%s/%d/%d/%d", + sim_name.c_str(), llround(region_x), llround(region_y), llround((F32)pos_global.mdV[VZ]))); + } + else + { // Empty SLURL will disable the "Copy SLURL to clipboard" button + mSLURL = ""; + } } } @@ -1082,6 +1132,9 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata ) self->trackLandmark( item_id); onShowTargetBtn(self); + + // Reset to user postion if nothing is tracked + self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } // static @@ -1133,6 +1186,10 @@ void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata ) self->trackAvatar(new_avatar_id, name); onShowTargetBtn(self); } + else + { // Reset to user postion if nothing is tracked + self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); + } } // static @@ -1188,6 +1245,8 @@ void LLFloaterWorldMap::onClearBtn(void* data) self->mTrackedStatus = LLTracker::TRACKING_NOTHING; LLTracker::stopTracking((void *)(intptr_t)TRUE); gWorldMap->mIsTrackingUnknownLocation = FALSE; + self->mSLURL = ""; // Clear the SLURL since it's invalid + self->mSetToUserPosition = TRUE; // Revert back to the current user position } // static @@ -1206,6 +1265,10 @@ void LLFloaterWorldMap::onShowTargetBtn(void* data) void LLFloaterWorldMap::onShowAgentBtn(void* data) { LLWorldMapView::setPan( 0, 0, FALSE); // FALSE == animate + + // Set flag so user's location will be displayed if not tracking anything else + LLFloaterWorldMap* self = (LLFloaterWorldMap*)data; + self->mSetToUserPosition = TRUE; } // static diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 5867ea179c321d3edce89426d1995cd58382aaa9..37143b4c1bb5163c3970b50f4296abbfa3f6f139 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -156,6 +156,7 @@ class LLFloaterWorldMap : public LLFloater BOOL mExactMatch; BOOL mIsClosing; + BOOL mSetToUserPosition; LLVector3d mTrackedLocation; LLTracker::ETrackingStatus mTrackedStatus; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 79e33151158b40599fbeeafc957382d72436a761..34a062576f3e2bd4efe66f0e96af7c81cf4f800e 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -548,16 +548,15 @@ void LLFolderViewItem::rename(const LLString& new_name) if( !new_name.empty() ) { mLabel = new_name.c_str(); - BOOL is_renamed = TRUE; if( mListener ) { - is_renamed = mListener->renameItem(new_name); - } - if(mParentFolder && is_renamed) - { - mParentFolder->resort(this); + mListener->renameItem(new_name); + + if(mParentFolder) + { + mParentFolder->resort(this); + } } - //refresh(); } } @@ -2970,7 +2969,10 @@ void LLFolderView::sanitizeSelection() // store off current item in case it is automatically deselected // and we want to preserve context LLFolderViewItem* original_selected_item = getCurSelectedItem(); - + + // Cache "Show all folders" filter setting + BOOL show_all_folders = (getRoot()->getShowFolderState() == LLInventoryFilter::SHOW_ALL_FOLDERS); + std::vector<LLFolderViewItem*> items_to_remove; selected_items_t::iterator item_iter; for (item_iter = mSelectedItems.begin(); item_iter != mSelectedItems.end(); ++item_iter) @@ -2981,10 +2983,20 @@ void LLFolderView::sanitizeSelection() BOOL visible = item->potentiallyVisible(); // initialize from filter state for this item // modify with parent open and filters states LLFolderViewFolder* parent_folder = item->getParentFolder(); - while(parent_folder) + if ( parent_folder ) { - visible = visible && parent_folder->isOpen() && parent_folder->potentiallyVisible(); - parent_folder = parent_folder->getParentFolder(); + if ( show_all_folders ) + { // "Show all folders" is on, so this folder is visible + visible = TRUE; + } + else + { // Move up through parent folders and see what's visible + while(parent_folder) + { + visible = visible && parent_folder->isOpen() && parent_folder->potentiallyVisible(); + parent_folder = parent_folder->getParentFolder(); + } + } } // deselect item if any ancestor is closed or didn't pass filter requirements. @@ -3000,7 +3012,7 @@ void LLFolderView::sanitizeSelection() for (other_item_iter = mSelectedItems.begin(); other_item_iter != mSelectedItems.end(); ++other_item_iter) { LLFolderViewItem* other_item = *other_item_iter; - for(LLFolderViewFolder* parent_folder = other_item->getParentFolder(); parent_folder; parent_folder = parent_folder->getParentFolder()) + for( parent_folder = other_item->getParentFolder(); parent_folder; parent_folder = parent_folder->getParentFolder()) { if (parent_folder == item) { @@ -3339,19 +3351,30 @@ void LLFolderView::openSelectedItems( void ) { S32 left, top; gFloaterView->getNewFloaterPosition(&left, &top); - LLMultiPreview* multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); - - LLFloater::setFloaterHost(multi_previewp); + gFloaterView->getNewFloaterPosition(&left, &top); + LLMultiProperties* multi_propertiesp = new LLMultiProperties(LLRect(left, top, left + 300, top - 100)); selected_items_t::iterator item_it; for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) { - (*item_it)->open(); /* Flawfinder: ignore */ + // IT_{OBJECT,ATTACHMENT} creates LLProperties + // floaters; others create LLPreviews. Put + // each one in the right type of container. + LLFolderViewEventListener* listener = (*item_it)->getListener(); + bool is_prop = listener && (listener->getInventoryType() == LLInventoryType::IT_OBJECT || listener->getInventoryType() == LLInventoryType::IT_ATTACHMENT); + if (is_prop) + LLFloater::setFloaterHost(multi_propertiesp); + else + LLFloater::setFloaterHost(multi_previewp); + (*item_it)->open(); } LLFloater::setFloaterHost(NULL); - multi_previewp->open(); /* Flawfinder: ignore */ + // *NOTE: LLMulti* will safely auto-delete when open'd + // without any children. + multi_previewp->open(); + multi_propertiesp->open(); } } } diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index d66916e8f103f07557cbb4bbb705a25fe682f954..be1c26381b1dd247384298f7c35f1321faa384b9 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -186,6 +186,11 @@ void LLGestureManager::activateGestureWithAsset(const LLUUID& item_id, BOOL inform_server, BOOL deactivate_similar) { + if( !gAssetStorage ) + { + llwarns << "LLGestureManager::activateGestureWithAsset without valid gAssetStorage" << llendl; + return; + } // If gesture is already active, nothing to do. if (isGestureActive(item_id)) { diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index b9b9cda4e89a1d0fd111c263b3dfb7369fc93161..afba55f4aa87385842daad4c9f792dbe1cdc2722 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -85,20 +85,20 @@ LLPanelClassified::LLPanelClassified(BOOL in_finder) mPriceForListing(0), mDataRequested(FALSE), mPaidFor(FALSE), - mPosGlobal(), - mSnapshotCtrl(NULL), - mNameEditor(NULL), - mDescEditor(NULL), - mLocationEditor(NULL), + mPosGlobal(), + mSnapshotCtrl(NULL), + mNameEditor(NULL), + mDescEditor(NULL), + mLocationEditor(NULL), mCategoryCombo(NULL), + mMatureCheck(NULL), + mAutoRenewCheck(NULL), mUpdateBtn(NULL), - mTeleportBtn(NULL), - mMapBtn(NULL), + mTeleportBtn(NULL), + mMapBtn(NULL), mProfileBtn(NULL), mInfoText(NULL), - mMatureCheck(NULL), - mAutoRenewCheck(NULL), - mSetBtn(NULL), + mSetBtn(NULL), mClickThroughText(NULL) { sAllPanels.push_back(this); @@ -825,6 +825,7 @@ void LLPanelClassified::onCommitAny(LLUICtrl* ctrl, void* data) void LLPanelClassified::onFocusReceived(LLUICtrl* ctrl, void* data) { // allow the data to be saved + // Dave/Simon TODO: replace this with better isDirty() functionality onCommitAny(ctrl, data); } diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index ca6a05eb31a8a0306bd4f8701403acb6f9c4b1c0..21f6f9263cd0d91b63ae75d8285c38d70b7c28f0 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -95,8 +95,8 @@ class LLPanelClassified : public LLPanel BOOL mInFinder; bool mDirty; bool mForceClose; - LLUUID mClassifiedID; - LLUUID mRequestedID; + LLUUID mClassifiedID; + LLUUID mRequestedID; LLUUID mCreatorID; LLUUID mParcelID; S32 mPriceForListing; @@ -109,24 +109,25 @@ class LLPanelClassified : public LLPanel BOOL mPaidFor; LLString mSimName; - LLVector3d mPosGlobal; + LLVector3d mPosGlobal; - LLTextureCtrl* mSnapshotCtrl; - LLLineEditor* mNameEditor; + // Values the user may change + LLTextureCtrl* mSnapshotCtrl; + LLLineEditor* mNameEditor; LLLineEditor* mDateEditor; - LLTextEditor* mDescEditor; - LLLineEditor* mLocationEditor; + LLTextEditor* mDescEditor; + LLLineEditor* mLocationEditor; LLComboBox* mCategoryCombo; + LLCheckBoxCtrl* mMatureCheck; + LLCheckBoxCtrl* mAutoRenewCheck; LLButton* mUpdateBtn; - LLButton* mTeleportBtn; - LLButton* mMapBtn; + LLButton* mTeleportBtn; + LLButton* mMapBtn; LLButton* mProfileBtn; LLTextBox* mInfoText; - LLCheckBoxCtrl* mMatureCheck; - LLCheckBoxCtrl* mAutoRenewCheck; - LLButton* mSetBtn; + LLButton* mSetBtn; LLTextBox* mClickThroughText; LLRect mSnapshotSize; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index ab735c97ad499c06ec1550a5943c57428686ae34..117f0207932528e2e7a801e8785a777a0651f594 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -191,6 +191,7 @@ static bool gGotUseCircuitCodeAck = false; LLString gInitialOutfit; LLString gInitialOutfitGender; // "male" or "female" +static bool gUseCircuitCallbackCalled = false; // // local function declaration @@ -775,6 +776,15 @@ BOOL idle_startup() snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ } + // Dave S temp reversion of SL-49082 fix - this code breaks command line urls. I'll fix this with + // the control isDirty() functionality tomorrow. + + //if ( userPickedServer ) + //{ // User picked a grid from the popup, so clear the stored urls so they will be re-generated from gUserServerChoice + // auth_uris.clear(); + // resetURIs(); + //} + LLString location; LLPanelLogin::getLocation( location ); LLURLSimString::setString( location ); @@ -1514,12 +1524,21 @@ BOOL idle_startup() { update_texture_fetch(); + if ( gViewerWindow != NULL && gToolMgr != NULL ) + { // This isn't the first logon attempt, so show the UI + gViewerWindow->setNormalControlsVisible( TRUE ); + } + // Initialize UI if (!gNoRender) { // Initialize all our tools. Must be done after saved settings loaded. - gToolMgr = new LLToolMgr(); - gToolMgr->initTools(); + if ( gToolMgr == NULL ) + { + gToolMgr = new LLToolMgr(); + gToolMgr->initTools(); + } + // Quickly get something onscreen to look at. gViewerWindow->initWorldUI(); @@ -1550,14 +1569,20 @@ BOOL idle_startup() gXferManager->registerCallbacks(gMessageSystem); - gCacheName = new LLCacheName(gMessageSystem); - gCacheName->addObserver(callback_cache_name); - - // Load stored cache if possible - load_name_cache(); + if ( gCacheName == NULL ) + { + gCacheName = new LLCacheName(gMessageSystem); + gCacheName->addObserver(callback_cache_name); + + // Load stored cache if possible + load_name_cache(); + } // Data storage for map of world. - gWorldMap = new LLWorldMap(); + if ( gWorldMap == NULL ) + { + gWorldMap = new LLWorldMap(); + } // register null callbacks for audio until the audio system is initialized gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL); @@ -1639,6 +1664,9 @@ BOOL idle_startup() { llwarns << "Attempting to connect to simulator with a zero circuit code!" << llendl; } + + gUseCircuitCallbackCalled = FALSE; + msg->enableCircuit(first_sim, TRUE); // now, use the circuit info to tell simulator about us! llinfos << "viewer: UserLoginLocationReply() Enabling " << first_sim << " with code " << msg->mOurCircuitCode << llendl; @@ -2780,10 +2808,9 @@ void use_circuit_callback(void**, S32 result) { // bail if we're quitting. if(gQuit) return; - static bool called = false; - if(!called) + if( !gUseCircuitCallbackCalled ) { - called = true; + gUseCircuitCallbackCalled = true; if (result) { // Make sure user knows something bad happened. JC @@ -3701,5 +3728,8 @@ void reset_login() { gStartupState = STATE_LOGIN_SHOW; - // do cleanup here of in-world UI? + if ( gViewerWindow ) + { // Hide menus and normal buttons + gViewerWindow->setNormalControlsVisible( FALSE ); + } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3e097d56000ce55593d62db1e8001938ad430ac6..bc0be1b5a2616b66afd52a276e34723d88d05400 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7431,7 +7431,7 @@ class LLViewCheckRenderType : public view_listener_t bool new_value = false; if (type == "particles") { - new_value = LLPipeline::toggleRenderTypeControlNegated((void *)(S32)LLPipeline::RENDER_TYPE_PARTICLES); + new_value = LLPipeline::toggleRenderTypeControlNegated((void *)LLPipeline::RENDER_TYPE_PARTICLES); } gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 0038c0cf1c62dc596b6e7550dbf63a9eb999f78d..7215f7948f7df073960fb5b4c0fcfb5b7e26e701 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -202,7 +202,7 @@ class LLFileUploadImage : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - const char* filename = upload_pick((void *)(S32)LLFilePicker::FFLOAD_IMAGE); + const char* filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE); if (filename) { LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename); @@ -216,7 +216,7 @@ class LLFileUploadSound : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_WAV)); + const char* filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV); if (filename) { LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); @@ -230,7 +230,7 @@ class LLFileUploadAnim : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_ANIM)); + const char* filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM); if (filename) { LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d6b553415364dd99d6840172e2e36ec734dc7398..dd2c1c6d76dc9bc7f7ea6404ec6df2dc525458e7 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1813,117 +1813,120 @@ void LLViewerWindow::initWorldUI() S32 width = mRootView->getRect().getWidth(); LLRect full_window(0, height, width, 0); - LLRect bar_rect(-1, STATUS_BAR_HEIGHT, width+1, -1); - gToolBar = new LLToolBar("toolbar", bar_rect); - - LLRect chat_bar_rect(-1,CHAT_BAR_HEIGHT, width+1, -1); - chat_bar_rect.translate(0, STATUS_BAR_HEIGHT-1); - gChatBar = new LLChatBar("chat", chat_bar_rect); - - bar_rect.translate(0, STATUS_BAR_HEIGHT-1); - bar_rect.translate(0, CHAT_BAR_HEIGHT-1); - gOverlayBar = new LLOverlayBar("overlay", bar_rect); - - // panel containing chatbar, toolbar, and overlay, over floaters - LLRect bottom_rect(-1, 2*STATUS_BAR_HEIGHT + CHAT_BAR_HEIGHT, width+1, -1); - gBottomPanel = new LLBottomPanel("bottom panel", bottom_rect); + if ( gToolBar == NULL ) // Don't re-enter if objects are alreay created + { + LLRect bar_rect(-1, STATUS_BAR_HEIGHT, width+1, -1); + gToolBar = new LLToolBar("toolbar", bar_rect); - // the order here is important - gBottomPanel->addChild(gChatBar); - gBottomPanel->addChild(gToolBar); - gBottomPanel->addChild(gOverlayBar); - mRootView->addChild(gBottomPanel); + LLRect chat_bar_rect(-1,CHAT_BAR_HEIGHT, width+1, -1); + chat_bar_rect.translate(0, STATUS_BAR_HEIGHT-1); + gChatBar = new LLChatBar("chat", chat_bar_rect); - // View for hover information - gHoverView = new LLHoverView("gHoverView", full_window); - gHoverView->setVisible(TRUE); - mRootView->addChild(gHoverView); + bar_rect.translate(0, STATUS_BAR_HEIGHT-1); + bar_rect.translate(0, CHAT_BAR_HEIGHT-1); + gOverlayBar = new LLOverlayBar("overlay", bar_rect); - // - // Map - // - // TODO: Move instance management into class - gFloaterMap = new LLFloaterMap("Map"); - gFloaterMap->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); - gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") ); + // panel containing chatbar, toolbar, and overlay, over floaters + LLRect bottom_rect(-1, 2*STATUS_BAR_HEIGHT + CHAT_BAR_HEIGHT, width+1, -1); + gBottomPanel = new LLBottomPanel("bottom panel", bottom_rect); - // keep onscreen - gFloaterView->adjustToFitScreen(gFloaterMap, FALSE); + // the order here is important + gBottomPanel->addChild(gChatBar); + gBottomPanel->addChild(gToolBar); + gBottomPanel->addChild(gOverlayBar); + mRootView->addChild(gBottomPanel); - if (gSavedSettings.getBOOL("ShowCameraControls")) - { - LLFloaterCamera::show(NULL); - } - - if (gSavedSettings.getBOOL("ShowMovementControls")) - { - LLFloaterMove::show(NULL); - } - - // Must have one global chat floater so it can actually store - // the history. JC - gFloaterChat = new LLFloaterChat(); - gFloaterChat->setVisible( FALSE ); + // View for hover information + gHoverView = new LLHoverView("gHoverView", full_window); + gHoverView->setVisible(TRUE); + mRootView->addChild(gHoverView); - if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) gFloaterChat->loadHistory(); + // + // Map + // + // TODO: Move instance management into class + gFloaterMap = new LLFloaterMap("Map"); + gFloaterMap->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); + gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") ); - gIMView = new LLIMView("gIMView", LLRect() ); - gIMView->setFollowsAll(); - mRootView->addChild(gIMView); + // keep onscreen + gFloaterView->adjustToFitScreen(gFloaterMap, FALSE); - LLRect morph_view_rect = full_window; - morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); - morph_view_rect.mTop = full_window.mTop - 32; - gMorphView = new LLMorphView("gMorphView", morph_view_rect ); - mRootView->addChild(gMorphView); - gMorphView->setVisible(FALSE); + if (gSavedSettings.getBOOL("ShowCameraControls")) + { + LLFloaterCamera::show(NULL); + } + + if (gSavedSettings.getBOOL("ShowMovementControls")) + { + LLFloaterMove::show(NULL); + } + + // Must have one global chat floater so it can actually store + // the history. JC + gFloaterChat = new LLFloaterChat(); + gFloaterChat->setVisible( FALSE ); + + if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) gFloaterChat->loadHistory(); + + gIMView = new LLIMView("gIMView", LLRect() ); + gIMView->setFollowsAll(); + mRootView->addChild(gIMView); + + LLRect morph_view_rect = full_window; + morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); + morph_view_rect.mTop = full_window.mTop - 32; + gMorphView = new LLMorphView("gMorphView", morph_view_rect ); + mRootView->addChild(gMorphView); + gMorphView->setVisible(FALSE); - gFloaterMute = new LLFloaterMute(); - gFloaterMute->setVisible(FALSE); + gFloaterMute = new LLFloaterMute(); + gFloaterMute->setVisible(FALSE); - LLWorldMapView::initClass(); + LLWorldMapView::initClass(); - LLRect world_map_rect = gSavedSettings.getRect("FloaterWorldMapRect"); - // if 0,0,0,0 then use fullscreen - if (world_map_rect.mTop == 0 - && world_map_rect.mLeft == 0 - && world_map_rect.mRight == 0 - && world_map_rect.mBottom == 0) - { - world_map_rect.set(0, height-TOOL_BAR_HEIGHT, width, STATUS_BAR_HEIGHT); - world_map_rect.stretch(-4); - gSavedSettings.setRect("FloaterWorldMapRect", world_map_rect); - } - gFloaterWorldMap = new LLFloaterWorldMap(); - gFloaterWorldMap->setVisible(FALSE); + LLRect world_map_rect = gSavedSettings.getRect("FloaterWorldMapRect"); + // if 0,0,0,0 then use fullscreen + if (world_map_rect.mTop == 0 + && world_map_rect.mLeft == 0 + && world_map_rect.mRight == 0 + && world_map_rect.mBottom == 0) + { + world_map_rect.set(0, height-TOOL_BAR_HEIGHT, width, STATUS_BAR_HEIGHT); + world_map_rect.stretch(-4); + gSavedSettings.setRect("FloaterWorldMapRect", world_map_rect); + } + gFloaterWorldMap = new LLFloaterWorldMap(); + gFloaterWorldMap->setVisible(FALSE); - // - // Tools for building - // + // + // Tools for building + // - // Toolbox floater - init_menus(); + // Toolbox floater + init_menus(); - gFloaterTools = new LLFloaterTools(); - gFloaterTools->setVisible(FALSE); + gFloaterTools = new LLFloaterTools(); + gFloaterTools->setVisible(FALSE); - // Status bar - S32 menu_bar_height = gMenuBarView->getRect().getHeight(); - LLRect root_rect = gViewerWindow->getRootView()->getRect(); - LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); - gStatusBar = new LLStatusBar("status", status_rect); - gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); + // Status bar + S32 menu_bar_height = gMenuBarView->getRect().getHeight(); + LLRect root_rect = gViewerWindow->getRootView()->getRect(); + LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); + gStatusBar = new LLStatusBar("status", status_rect); + gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); - gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); - gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); - // sync bg color with menu bar - gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() ); + gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); + gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); + // sync bg color with menu bar + gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() ); - gViewerWindow->getRootView()->addChild(gStatusBar); + gViewerWindow->getRootView()->addChild(gStatusBar); - // menu holder appears on top to get first pass at all mouse events - gViewerWindow->getRootView()->sendChildToFront(gMenuHolder); + // menu holder appears on top to get first pass at all mouse events + gViewerWindow->getRootView()->sendChildToFront(gMenuHolder); + } } @@ -2144,6 +2147,23 @@ void LLViewerWindow::reshape(S32 width, S32 height) } } + +// Hide normal UI when a logon fails +void LLViewerWindow::setNormalControlsVisible( BOOL visible ) +{ + if ( gBottomPanel ) + gBottomPanel->setVisible( visible ); + + if ( gMenuBarView ) + gMenuBarView->setVisible( visible ); + + if ( gStatusBar ) + gStatusBar->setVisible( visible ); +} + + + + void LLViewerWindow::drawDebugText() { mDebugText->draw(); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index af5ffd79144370dbf03e1a63bd607bf26ca423d9..91bf0d9918c186db712b7eea9c21d3c2e8dd8ed8 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -154,6 +154,9 @@ class LLViewerWindow : public LLWindowCallbacks BOOL handleKey(KEY key, MASK mask); void handleScrollWheel (S32 clicks); + // Hide normal UI when a logon fails, re-show everything when logon is attempted again + void setNormalControlsVisible( BOOL visible ); + // Handle the application becoming active (frontmost) or inactive //BOOL handleActivate(BOOL activate); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index e61b5f1af565a4e3c7910e1804da0fd1ac424432..6fea695353bb4998890444ff2aafc073ac0fffb1 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -225,20 +225,25 @@ LLSimInfo* LLWorldMap::simInfoFromName(const LLString& sim_name) return sim_info; } -LLString LLWorldMap::simNameFromPosGlobal(const LLVector3d& pos_global) +bool LLWorldMap::simNameFromPosGlobal(const LLVector3d& pos_global, LLString & outSimName ) { + bool gotSimName = true; + U64 handle = to_region_handle(pos_global); sim_info_map_t::iterator it = mSimInfoMap.find(handle); if (it != mSimInfoMap.end()) { LLSimInfo* info = (*it).second; - return info->mName.c_str(); + outSimName = info->mName.c_str(); } else { - return "(unknown region)"; + gotSimName = false; + outSimName = "(unknown region)"; } + + return gotSimName; } void LLWorldMap::setCurrentLayer(S32 layer, bool request_layer) diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index 76ab88de1e933fb5836824f3b96fa6f3e48a9b78..bdf8a7e735dc8c8b3a7066ede50a3d17479a38dd 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -115,8 +115,8 @@ class LLWorldMap // Returns simulator information for named sim, or NULL if non-existent LLSimInfo* simInfoFromName(const LLString& sim_name); - // Returns simulator name - LLString simNameFromPosGlobal(const LLVector3d& pos_global); + // Gets simulator name for a global position, returns true if it was found + bool simNameFromPosGlobal(const LLVector3d& pos_global, LLString & outSimName ); // Sets the current layer void setCurrentLayer(S32 layer, bool request_layer = false); diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 0fe81baae920e70da17f6e1296b913f3ce37d62c..c93b302312f792f3e7bbf2904927562957a9021e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -414,6 +414,7 @@ def construct(self): self.path("libuuid.so", "libuuid.so.1") self.path("libSDL-1.2.so.0") self.path("libELFIO.so") + #self.path("libresolv.so") - don't bundle #self.path("libtcmalloc.so.0") - bugged #self.path("libstacktrace.so.0") - probably bugged self.path("libllkdu.so", "../bin/libllkdu.so") # llkdu goes in bin for some reason