From 7bdb4845afdd157f95281293803567090e3f992a Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:29 -0500 Subject: Second Life viewer sources 1.19.0.2 --- .../indra/newview/English.lproj/InfoPlist.strings | 4 +- linden/indra/newview/Info-SecondLife.plist | 2 +- linden/indra/newview/llappviewer.cpp | 152 +++++----- linden/indra/newview/llappviewer.h | 18 +- linden/indra/newview/llcontroldef.cpp | 7 +- linden/indra/newview/llfasttimerview.cpp | 20 +- linden/indra/newview/llfilepicker.cpp | 2 +- linden/indra/newview/llfloateractivespeakers.cpp | 328 +++++++++++++-------- linden/indra/newview/llfloateractivespeakers.h | 61 +++- linden/indra/newview/llfloaterfriends.cpp | 2 +- linden/indra/newview/llfloaterworldmap.cpp | 33 ++- linden/indra/newview/llgroupmgr.cpp | 167 +++++------ linden/indra/newview/llgroupmgr.h | 41 +-- linden/indra/newview/llimpanel.cpp | 6 +- linden/indra/newview/llmediaremotectrl.cpp | 4 +- linden/indra/newview/llnamelistctrl.cpp | 5 +- linden/indra/newview/lloverlaybar.cpp | 5 +- linden/indra/newview/lloverlaybar.h | 4 +- linden/indra/newview/llpanelavatar.cpp | 6 +- linden/indra/newview/llpanelclassified.cpp | 38 ++- linden/indra/newview/llpanelclassified.h | 1 + linden/indra/newview/llpanelgroupgeneral.cpp | 5 +- linden/indra/newview/llpanelgroupgeneral.h | 2 +- linden/indra/newview/llpanelgroupinvite.cpp | 6 +- linden/indra/newview/llpanelgrouproles.cpp | 109 +++---- linden/indra/newview/llpanelgrouproles.h | 3 +- linden/indra/newview/llpanellogin.cpp | 6 + linden/indra/newview/llselectmgr.cpp | 19 +- linden/indra/newview/llstartup.cpp | 6 +- linden/indra/newview/lltoolbar.cpp | 4 +- linden/indra/newview/llurlsimstring.cpp | 4 +- linden/indra/newview/llviewercontrol.cpp | 11 +- linden/indra/newview/llviewerimagelist.cpp | 6 +- linden/indra/newview/llviewermessage.cpp | 3 +- linden/indra/newview/llviewerparcelmgr.cpp | 13 +- linden/indra/newview/llviewerwindow.cpp | 16 +- linden/indra/newview/newview_vc8.vcproj | 2 +- linden/indra/newview/releasenotes.txt | 39 +++ linden/indra/newview/res/newViewRes.rc | 8 +- .../skins/xui/de/panel_preferences_general.xml | 2 +- .../skins/xui/en-us/floater_active_speakers.xml | 1 + .../indra/newview/skins/xui/en-us/floater_test.xml | 47 +-- .../indra/newview/skins/xui/en-us/panel_avatar.xml | 1 - .../indra/newview/skins/xui/en-us/panel_bars.xml | 6 +- .../skins/xui/en-us/panel_speaker_controls.xml | 2 +- 45 files changed, 700 insertions(+), 527 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings index 8944cb8..76c6915 100644 --- a/linden/indra/newview/English.lproj/InfoPlist.strings +++ b/linden/indra/newview/English.lproj/InfoPlist.strings @@ -1,5 +1,5 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 1.19.0.0"; -CFBundleGetInfoString = "Second Life version 1.19.0.0, Copyright 2004-2007 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version 1.19.0.2"; +CFBundleGetInfoString = "Second Life version 1.19.0.2, Copyright 2004-2007 Linden Research, Inc."; diff --git a/linden/indra/newview/Info-SecondLife.plist b/linden/indra/newview/Info-SecondLife.plist index 5956f9b..c93fbe0 100644 --- a/linden/indra/newview/Info-SecondLife.plist +++ b/linden/indra/newview/Info-SecondLife.plist @@ -32,7 +32,7 @@ CFBundleVersion - 1.19.0.0 + 1.19.0.2 CSResourcesFileMapped diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index c357b8f..2933fe9 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -270,7 +270,7 @@ BOOL gAcceptTOS = FALSE; BOOL gAcceptCriticalMessage = FALSE; LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. -BOOL gLastExecFroze = FALSE; +eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL; LLSD gDebugInfo; @@ -334,6 +334,7 @@ BOOL gRandomizeFramerate = FALSE; BOOL gPeriodicSlowFrame = FALSE; BOOL gQAMode = FALSE; +BOOL gLLErrorActivated = FALSE; //////////////////////////////////////////////////////////// // Internal globals... that should be removed. @@ -355,6 +356,9 @@ static LLString gArgs; static LLString gOldSettingsFileName; static const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; +const char* MARKER_FILE_NAME = "SecondLife.exec_marker"; +const char* ERROR_MARKER_FILE_NAME = "SecondLife.error_marker"; +const char* LLERROR_MARKER_FILE_NAME = "SecondLife.llerror_marker"; static BOOL gDoDisconnect = FALSE; static LLString gLaunchFileOnQuit; @@ -957,7 +961,6 @@ LLTextureFetch* LLAppViewer::sTextureFetch = NULL; LLAppViewer::LLAppViewer() : mMarkerFile(NULL), - mLastExecFroze(false), mCrashBehavior(CRASH_BEHAVIOR_ASK), mReportedCrash(false), mNumSessions(0), @@ -1983,6 +1986,10 @@ void errorCallback(const std::string &error_string) #ifndef LL_RELEASE_FOR_DOWNLOAD OSMessageBox(error_string.c_str(), "Fatal Error", OSMB_OK); #endif + + //Set the ErrorActivated global so we know to create a marker file + gLLErrorActivated = true; + LLError::crashAndLoop(error_string); } @@ -2163,7 +2170,7 @@ bool LLAppViewer::initConfiguration() initMarkerFile(); #if LL_SEND_CRASH_REPORTS - if (gLastExecFroze) + if (gLastExecEvent == LAST_EXEC_FROZE) { llinfos << "Last execution froze, requesting to send crash report." << llendl; // @@ -2549,6 +2556,27 @@ void LLAppViewer::handleViewerCrash() gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath().c_str(); gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName(); + //Write out the crash status file + //Use marker file style setup, as that's the simplest, especially since + //we're already in a crash situation + if (gDirUtilp) + { + LLString crash_file_name; + if(gLLErrorActivated) crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LLERROR_MARKER_FILE_NAME); + else crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME); + llinfos << "Creating crash marker file " << crash_file_name << llendl; + apr_file_t* crash_file = ll_apr_file_open(crash_file_name, LL_APR_W); + if (crash_file) + { + llinfos << "Created crash marker file " << crash_file_name << llendl; + } + else + { + llwarns << "Cannot create error marker file " << crash_file_name << llendl; + } + apr_file_close(crash_file); + } + if (gMessageSystem && gDirUtilp) { std::string filename; @@ -2575,6 +2603,9 @@ void LLAppViewer::handleViewerCrash() pApp->closeDebug(); LLError::logToFile(""); + // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked + pApp->removeMarkerFile(); + // Call to pure virtual, handled by platform specifc llappviewer instance. pApp->handleCrashReporting(); @@ -2592,7 +2623,7 @@ bool LLAppViewer::anotherInstanceRunning() // We create a marker file when the program starts and remove the file when it finishes. // If the file is currently locked, that means another process is already running. - std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); + std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, MARKER_FILE_NAME); llinfos << "Checking marker file for lock..." << llendl; // If file doesn't exist, we create it @@ -2630,71 +2661,69 @@ bool LLAppViewer::anotherInstanceRunning() void LLAppViewer::initMarkerFile() { - // *FIX:Mani - an actually cross platform LLFile lib would be nice. - -#if LL_SOLARIS - struct flock fl; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 1; -#endif - // We create a marker file when the program starts and remove the file when it finishes. - // If the file is currently locked, that means another process is already running. - // If the file exists and isn't locked, we crashed on the last run. - std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); + //First, check for the existence of other files. + //There are marker files for two different types of crashes + + mMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,MARKER_FILE_NAME); llinfos << "Checking marker file for lock..." << llendl; - FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); // Flawfinder: ignore + //We've got 4 things to test for here + // - Other Process Running (SecondLife.exec_marker present, locked) + // - Freeze (SecondLife.exec_marker present, not locked) + // - LLError Crash (SecondLife.llerror_marker present) + // - Other Crash (SecondLife.error_marker present) + // These checks should also remove these files for the last 2 cases if they currently exist + + //LLError/Error checks. Only one of these should ever happen at a time. + LLString llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); + LLString error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); + apr_file_t* fMarker = ll_apr_file_open(llerror_marker_file, LL_APR_RB); + if(fMarker != NULL) + { + apr_file_close(fMarker); + llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl; + gLastExecEvent = LAST_EXEC_LLERROR_CRASH; + } + + fMarker = ll_apr_file_open(error_marker_file, LL_APR_RB); + if(fMarker != NULL) + { + apr_file_close(fMarker); + llinfos << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << llendl; + gLastExecEvent = LAST_EXEC_OTHER_CRASH; + } + + ll_apr_file_remove(llerror_marker_file); + ll_apr_file_remove(error_marker_file); + + //Freeze case checks + fMarker = ll_apr_file_open(mMarkerFileName, LL_APR_RB); if (fMarker != NULL) { // File exists, try opening with write permissions - fclose(fMarker); - fMarker = LLFile::fopen(marker_file.c_str(), "wb"); // Flawfinder: ignxore + apr_file_close(fMarker); + fMarker = ll_apr_file_open(mMarkerFileName, LL_APR_WB); if (fMarker == NULL) { // Another instance is running. Skip the rest of these operations. llinfos << "Marker file is locked." << llendl; return; } -#if LL_DARWIN || LL_LINUX || LL_SOLARIS - // Try to lock it. On Mac, this is the only way to test if it's actually locked. - if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) + if (apr_file_lock(fMarker, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) //flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) { - // Lock failed - somebody else has it. - fclose(fMarker); + apr_file_close(fMarker); llinfos << "Marker file is locked." << llendl; return; } -#endif - // No other instances; we'll lock this file now & delete on quit. - fclose(fMarker); - gLastExecFroze = TRUE; + apr_file_close(fMarker); + gLastExecEvent = LAST_EXEC_FROZE; llinfos << "Exec marker found: program froze on previous execution" << llendl; } // Create the marker file for this execution & lock it -// FILE *fp_executing_marker; -#if LL_WINDOWS - mMarkerFile = LLFile::_fsopen(marker_file.c_str(), "w", _SH_DENYWR); -#else - mMarkerFile = LLFile::fopen(marker_file.c_str(), "w"); // Flawfinder: ignore - if (mMarkerFile) - { - int fd = fileno(mMarkerFile); - // Attempt to lock -#if LL_SOLARIS - fl.l_type = F_WRLCK; - if (fcntl(fd, F_SETLK, &fl) == -1) -#else - if (flock(fd, LOCK_EX | LOCK_NB) == -1) -#endif - { - llinfos << "Failed to lock file." << llendl; - } - } -#endif + mMarkerFile = ll_apr_file_open(mMarkerFileName, LL_APR_W); if (mMarkerFile) { llinfos << "Marker file created." << llendl; @@ -2703,20 +2732,14 @@ void LLAppViewer::initMarkerFile() { llinfos << "Failed to create marker file." << llendl; } + if (apr_file_lock(mMarkerFile, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + { + apr_file_close(mMarkerFile); + llinfos << "Marker file cannot be locked." << llendl; + return; + } -#if LL_WINDOWS - // Clean up SecondLife.dmp files, to avoid confusion - llinfos << "Removing SecondLife.dmp" << llendl; - std::string dmp_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.dmp"); - LLFile::remove(dmp_filename.c_str()); -#endif - - // This is to keep the crash reporter from constantly sending stale message logs - // We wipe the message file now. - llinfos << "Removing message.log" << llendl; - std::string message_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "message.log"); - LLFile::remove(message_filename.c_str()); - + llinfos << "Marker file locked." << llendl; llinfos << "Exiting initMarkerFile()." << llendl; } @@ -2725,14 +2748,9 @@ void LLAppViewer::removeMarkerFile() llinfos << "removeMarkerFile()" << llendl; if (mMarkerFile != NULL) { - fclose(mMarkerFile); + ll_apr_file_remove( mMarkerFileName ); mMarkerFile = NULL; } - if( gDirUtilp ) - { - LLString marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); - ll_apr_file_remove( marker_file ); - } } void LLAppViewer::forceQuit() diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h index 1078d71..ddf51b3 100644 --- a/linden/indra/newview/llappviewer.h +++ b/linden/indra/newview/llappviewer.h @@ -115,6 +115,8 @@ public: bool isInProductionGrid(); + void removeMarkerFile(); + // LLAppViewer testing helpers. // *NOTE: These will potentially crash the viewer. Only for debugging. virtual void forceErrorLLError(); @@ -148,7 +150,6 @@ private: bool anotherInstanceRunning(); void initMarkerFile(); - void removeMarkerFile(); void idle(); void idleShutdown(); @@ -163,8 +164,8 @@ private: bool mSecondInstance; // Is this a second instance of the app? - FILE *mMarkerFile; // A file created to indicate the app is running. - bool mLastExecFroze; // Set on init if the marker file was found. + LLString mMarkerFileName; + apr_file_t* mMarkerFile; // A file created to indicate the app is running. LLOSInfo mSysOSInfo; S32 mCrashBehavior; @@ -224,7 +225,16 @@ extern BOOL gAcceptTOS; extern BOOL gAcceptCriticalMessage; extern LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. -extern BOOL gLastExecFroze; // llstartup + +typedef enum +{ + LAST_EXEC_NORMAL = 0, + LAST_EXEC_FROZE, + LAST_EXEC_LLERROR_CRASH, + LAST_EXEC_OTHER_CRASH +} eLastExecEvent; + +extern eLastExecEvent gLastExecEvent; // llstartup extern U32 gFrameCount; extern U32 gForegroundFrameCount; diff --git a/linden/indra/newview/llcontroldef.cpp b/linden/indra/newview/llcontroldef.cpp index 23a1753..c30c9a6 100644 --- a/linden/indra/newview/llcontroldef.cpp +++ b/linden/indra/newview/llcontroldef.cpp @@ -76,9 +76,10 @@ void declare_settings() { - // Somewhat under 1024 by 768 - const S32 WINDOW_WIDTH = 800; - const S32 WINDOW_HEIGHT = 600; + // Somewhat under 1024 by 768, to give space for Windows task bar / Mac menu bar + // to emphasize window isn't actually maximized. + const S32 WINDOW_WIDTH = 1000; + const S32 WINDOW_HEIGHT = 700; //------------------------------------------------------------------------ // Color constants diff --git a/linden/indra/newview/llfasttimerview.cpp b/linden/indra/newview/llfasttimerview.cpp index 14dc08c..6364fd2 100644 --- a/linden/indra/newview/llfasttimerview.cpp +++ b/linden/indra/newview/llfasttimerview.cpp @@ -76,7 +76,9 @@ static LLColor4 green9(0.6f, 1.0f, 0.6f, 1.0f); static struct ft_display_info ft_display_table[] = { { LLFastTimer::FTM_FRAME, "Frame", &LLColor4::white, 0 }, - { LLFastTimer::FTM_MESSAGES, " Messages", &LLColor4::grey1, 0 }, + { LLFastTimer::FTM_MESSAGES, " System Messages", &LLColor4::grey1, 1 }, + { LLFastTimer::FTM_MOUSEHANDLER, " Mouse", &LLColor4::grey1, 0 }, + { LLFastTimer::FTM_KEYHANDLER, " Keyboard", &LLColor4::grey1, 0 }, { LLFastTimer::FTM_SLEEP, " Sleep", &LLColor4::grey2, 0 }, { LLFastTimer::FTM_IDLE, " Idle", &blue0, 0 }, { LLFastTimer::FTM_PUMP, " Pump", &LLColor4::magenta2, 1 }, @@ -184,14 +186,14 @@ static struct ft_display_info ft_display_table[] = { LLFastTimer::FTM_SWAP, " Swap", &LLColor4::pink1, 0 }, { LLFastTimer::FTM_CLIENT_COPY, " Client Copy", &LLColor4::red1, 1}, -// { LLFastTimer::FTM_TEMP1, " Temp1", &LLColor4::red1, 0 }, -// { LLFastTimer::FTM_TEMP2, " Temp2", &LLColor4::magenta1, 0 }, -// { LLFastTimer::FTM_TEMP3, " Temp3", &LLColor4::red2, 0 }, -// { LLFastTimer::FTM_TEMP4, " Temp4", &LLColor4::magenta2, 0 }, -// { LLFastTimer::FTM_TEMP5, " Temp5", &LLColor4::red3, 0 }, -// { LLFastTimer::FTM_TEMP6, " Temp6", &LLColor4::magenta3, 0 }, -// { LLFastTimer::FTM_TEMP7, " Temp7", &LLColor4::red4, 0 }, -// { LLFastTimer::FTM_TEMP8, " Temp8", &LLColor4::magenta4, 0 }, + { LLFastTimer::FTM_TEMP1, " Temp1", &LLColor4::red1, 0 }, + { LLFastTimer::FTM_TEMP2, " Temp2", &LLColor4::magenta1, 0 }, + { LLFastTimer::FTM_TEMP3, " Temp3", &LLColor4::red2, 0 }, + { LLFastTimer::FTM_TEMP4, " Temp4", &LLColor4::magenta2, 0 }, + { LLFastTimer::FTM_TEMP5, " Temp5", &LLColor4::red3, 0 }, + { LLFastTimer::FTM_TEMP6, " Temp6", &LLColor4::magenta3, 0 }, + { LLFastTimer::FTM_TEMP7, " Temp7", &LLColor4::red4, 0 }, + { LLFastTimer::FTM_TEMP8, " Temp8", &LLColor4::magenta4, 0 }, { LLFastTimer::FTM_OTHER, " Other", &red0 } }; diff --git a/linden/indra/newview/llfilepicker.cpp b/linden/indra/newview/llfilepicker.cpp index 107c271..6233443 100644 --- a/linden/indra/newview/llfilepicker.cpp +++ b/linden/indra/newview/llfilepicker.cpp @@ -1034,7 +1034,7 @@ GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, GTK_STOCK_SAVE : GTK_STOCK_OPEN), GTK_RESPONSE_ACCEPT, - NULL); + (gchar *)NULL); mStoreFilenames.win = win; mStoreFilenames.contextName = context; diff --git a/linden/indra/newview/llfloateractivespeakers.cpp b/linden/indra/newview/llfloateractivespeakers.cpp index 877ebca..8432d21 100644 --- a/linden/indra/newview/llfloateractivespeakers.cpp +++ b/linden/indra/newview/llfloateractivespeakers.cpp @@ -135,6 +135,16 @@ LLSD LLSpeakerVoiceModerationEvent::getValue() return LLString("voice"); } +LLSpeakerListChangeEvent::LLSpeakerListChangeEvent(LLSpeakerMgr* source, const LLUUID& speaker_id) +: LLEvent(source, "Speaker added/removed from speaker mgr"), + mSpeakerID(speaker_id) +{ +} + +LLSD LLSpeakerListChangeEvent::getValue() +{ + return mSpeakerID; +} // helper sort class struct LLSortRecentSpeakers @@ -210,9 +220,9 @@ void* LLFloaterActiveSpeakers::createSpeakersPanel(void* data) } // -// LLPanelActiveSpeakers::LLSpeakerListener +// LLPanelActiveSpeakers::SpeakerMuteListener // -bool LLPanelActiveSpeakers::LLSpeakerListener::handleEvent(LLPointer event, const LLSD& userdata) +bool LLPanelActiveSpeakers::SpeakerMuteListener::handleEvent(LLPointer event, const LLSD& userdata) { LLPointer speakerp = (LLSpeaker*)event->getSource(); if (speakerp.isNull()) return false; @@ -231,6 +241,35 @@ bool LLPanelActiveSpeakers::LLSpeakerListener::handleEvent(LLPointer ev // +// LLPanelActiveSpeakers::SpeakerAddListener +// +bool LLPanelActiveSpeakers::SpeakerAddListener::handleEvent(LLPointer event, const LLSD& userdata) +{ + mPanel->addSpeaker(event->getValue().asUUID()); + return true; +} + + +// +// LLPanelActiveSpeakers::SpeakerRemoveListener +// +bool LLPanelActiveSpeakers::SpeakerRemoveListener::handleEvent(LLPointer event, const LLSD& userdata) +{ + mPanel->removeSpeaker(event->getValue().asUUID()); + return true; +} + +// +// LLPanelActiveSpeakers::SpeakerClearListener +// +bool LLPanelActiveSpeakers::SpeakerClearListener::handleEvent(LLPointer event, const LLSD& userdata) +{ + mPanel->mSpeakerList->clearRows(); + return true; +} + + +// // LLPanelActiveSpeakers // LLPanelActiveSpeakers::LLPanelActiveSpeakers(LLSpeakerMgr* data_source, BOOL show_text_chatters) : @@ -243,12 +282,14 @@ LLPanelActiveSpeakers::LLPanelActiveSpeakers(LLSpeakerMgr* data_source, BOOL sho mSpeakerMgr(data_source) { setMouseOpaque(FALSE); - mSpeakerListener = new LLSpeakerListener(this); -} - -LLPanelActiveSpeakers::~LLPanelActiveSpeakers() -{ - + mSpeakerMuteListener = new SpeakerMuteListener(this); + mSpeakerAddListener = new SpeakerAddListener(this); + mSpeakerRemoveListener = new SpeakerRemoveListener(this); + mSpeakerClearListener = new SpeakerClearListener(this); + + mSpeakerMgr->addListener(mSpeakerAddListener, "add"); + mSpeakerMgr->addListener(mSpeakerRemoveListener, "remove"); + mSpeakerMgr->addListener(mSpeakerClearListener, "clear"); } BOOL LLPanelActiveSpeakers::postBuild() @@ -283,6 +324,57 @@ BOOL LLPanelActiveSpeakers::postBuild() return TRUE; } +void LLPanelActiveSpeakers::addSpeaker(const LLUUID& speaker_id) +{ + if (mSpeakerList->getItemIndex(speaker_id) >= 0) + { + // already have this speaker + return; + } + + LLPointer speakerp = mSpeakerMgr->findSpeaker(speaker_id); + if (speakerp) + { + // since we are forced to sort by text, encode sort order as string + LLString speaking_order_sort_string = llformat("%010d", speakerp->mSortIndex); + + LLSD row; + row["id"] = speaker_id; + + LLSD& columns = row["columns"]; + + columns[0]["column"] = "icon_speaking_status"; + columns[0]["type"] = "icon"; + columns[0]["value"] = gViewerArt.getString("icn_active-speakers-dot-lvl0.tga"); + + LLString speaker_name; + if (speakerp->mDisplayName.empty()) + { + speaker_name = LLCacheName::getDefaultName(); + } + else + { + speaker_name = speakerp->mDisplayName; + } + columns[1]["column"] = "speaker_name"; + columns[1]["type"] = "text"; + columns[1]["value"] = speaker_name; + + columns[2]["column"] = "speaking_status"; + columns[2]["type"] = "text"; + + // print speaking ordinal in a text-sorting friendly manner + columns[2]["value"] = speaking_order_sort_string; + + mSpeakerList->addElement(row); + } +} + +void LLPanelActiveSpeakers::removeSpeaker(const LLUUID& speaker_id) +{ + mSpeakerList->deleteSingleItem(mSpeakerList->getItemIndex(speaker_id)); +} + void LLPanelActiveSpeakers::handleSpeakerSelect() { LLUUID speaker_id = mSpeakerList->getValue().asUUID(); @@ -296,8 +388,8 @@ void LLPanelActiveSpeakers::handleSpeakerSelect() childSetValue("moderator_allow_voice", selected_speakerp ? !selected_speakerp->mModeratorMutedVoice : TRUE); childSetValue("moderator_allow_text", selected_speakerp ? !selected_speakerp->mModeratorMutedText : TRUE); - mSpeakerListener->clearDispatchers(); - selected_speakerp->addListener(mSpeakerListener); + mSpeakerMuteListener->clearDispatchers(); + selected_speakerp->addListener(mSpeakerMuteListener); } } @@ -307,159 +399,131 @@ void LLPanelActiveSpeakers::refreshSpeakers() LLUUID selected_id = mSpeakerList->getSelectedValue().asUUID(); S32 scroll_pos = mSpeakerList->getScrollInterface()->getScrollPos(); - BOOL sort_ascending = mSpeakerList->getSortAscending(); - LLString sort_column = mSpeakerList->getSortColumnName(); - // TODO: put this in xml - // enforces default sort column of speaker status - if (sort_column.empty()) - { - sort_column = "speaking_status"; - } - mSpeakerMgr->update(); - // clear scrolling list widget of names - mSpeakerList->clearRows(); + const LLString icon_image_0 = gViewerArt.getString("icn_active-speakers-dot-lvl0.tga"); + const LLString icon_image_1 = gViewerArt.getString("icn_active-speakers-dot-lvl1.tga"); + const LLString icon_image_2 = gViewerArt.getString("icn_active-speakers-dot-lvl2.tga"); + + + std::vector items = mSpeakerList->getAllData(); + + LLUUID mute_icon_image = LLUUID(gViewerArt.getString("mute_icon.tga")); LLSpeakerMgr::speaker_list_t speaker_list; mSpeakerMgr->getSpeakerList(&speaker_list, mShowTextChatters); - for (LLSpeakerMgr::speaker_list_t::const_iterator speaker_it = speaker_list.begin(); speaker_it != speaker_list.end(); ++speaker_it) + for (std::vector::iterator item_it = items.begin(); + item_it != items.end(); + ++item_it) { - LLUUID speaker_id = (*speaker_it)->mID; - LLPointer speakerp = (*speaker_it); + LLScrollListItem* itemp = (*item_it); + LLUUID speaker_id = itemp->getUUID(); + + LLPointer speakerp = mSpeakerMgr->findSpeaker(speaker_id); + if (!speakerp) + { + continue; + } // since we are forced to sort by text, encode sort order as string LLString speaking_order_sort_string = llformat("%010d", speakerp->mSortIndex); - LLSD row; - row["id"] = speaker_id; + LLScrollListCell* icon_cell = itemp->getColumn(0); + if (icon_cell) + { - row["columns"][0]["column"] = "icon_speaking_status"; - row["columns"][0]["type"] = "icon"; - LLString icon_image_id; + LLString icon_image_id; - S32 icon_image_idx = llmin(2, llfloor((speakerp->mSpeechVolume / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 3.f)); - switch(icon_image_idx) - { - case 0: - icon_image_id = gViewerArt.getString("icn_active-speakers-dot-lvl0.tga"); - break; - case 1: - icon_image_id = gViewerArt.getString("icn_active-speakers-dot-lvl1.tga"); - break; - case 2: - icon_image_id = gViewerArt.getString("icn_active-speakers-dot-lvl2.tga"); - break; - } - //if (speakerp->mTyping) - //{ - // S32 typing_anim_idx = llround(mIconAnimationTimer.getElapsedTimeF32() * TYPING_ANIMATION_FPS) % 3; - // switch(typing_anim_idx) - // { - // case 0: - // row["columns"][0]["overlay"] = LLUUID(gViewerArt.getString("icn_active-speakers-typing1.tga")); - // break; - // case 1: - // row["columns"][0]["overlay"] = LLUUID(gViewerArt.getString("icn_active-speakers-typing2.tga")); - // break; - // case 2: - // row["columns"][0]["overlay"] = LLUUID(gViewerArt.getString("icn_active-speakers-typing3.tga")); - // break; - // default: - // break; - // } - //} - - LLColor4 icon_color; - if (speakerp->mStatus == LLSpeaker::STATUS_MUTED) - { - row["columns"][0]["value"] = gViewerArt.getString("mute_icon.tga"); - if(speakerp->mModeratorMutedVoice) + S32 icon_image_idx = llmin(2, llfloor((speakerp->mSpeechVolume / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 3.f)); + switch(icon_image_idx) { - icon_color.setVec(0.5f, 0.5f, 0.5f, 1.f); + case 0: + icon_image_id = icon_image_0; + break; + case 1: + icon_image_id = icon_image_1; + break; + case 2: + icon_image_id = icon_image_2; + break; + } + + LLColor4 icon_color; + if (speakerp->mStatus == LLSpeaker::STATUS_MUTED) + { + icon_cell->setValue(mute_icon_image); + if(speakerp->mModeratorMutedVoice) + { + icon_color.setVec(0.5f, 0.5f, 0.5f, 1.f); + } + else + { + icon_color.setVec(1.f, 71.f / 255.f, 71.f / 255.f, 1.f); + } } else { - icon_color.setVec(1.f, 71.f / 255.f, 71.f / 255.f, 1.f); + icon_cell->setValue(icon_image_id); + icon_color = speakerp->mDotColor; + + if (speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE) // if voice is disabled for this speaker + { + // non voice speakers have hidden icons, render as transparent + icon_color.setVec(0.f, 0.f, 0.f, 0.f); + } } - } - else - { - row["columns"][0]["value"] = icon_image_id; - icon_color = speakerp->mDotColor; - if (speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE) // if voice is disabled for this speaker + icon_cell->setColor(icon_color); + + if (speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE && speakerp->mStatus != LLSpeaker::STATUS_MUTED) // if voice is disabled for this speaker { // non voice speakers have hidden icons, render as transparent - icon_color.setVec(0.f, 0.f, 0.f, 0.f); + icon_cell->setColor(LLColor4::transparent); } } - row["columns"][0]["color"] = icon_color.getValue(); - - if (speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE && speakerp->mStatus != LLSpeaker::STATUS_MUTED) // if voice is disabled for this speaker - { - // non voice speakers have hidden icons, render as transparent - row["columns"][0]["color"] = LLColor4(0.f, 0.f, 0.f, 0.f).getValue(); - } - row["columns"][1]["column"] = "speaker_name"; - row["columns"][1]["type"] = "text"; - if (speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL) + // update name column + LLScrollListCell* name_cell = itemp->getColumn(1); + if (name_cell) { - // draw inactive speakers in gray - row["columns"][1]["color"] = LLColor4::grey4.getValue(); - } + if (speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL) + { + // draw inactive speakers in gray + name_cell->setColor(LLColor4::grey4); + } - LLString speaker_name; - if (speakerp->mDisplayName.empty()) - { - speaker_name = LLCacheName::getDefaultName(); - } - else - { - speaker_name = speakerp->mDisplayName; + LLString speaker_name; + if (speakerp->mDisplayName.empty()) + { + speaker_name = LLCacheName::getDefaultName(); + } + else + { + speaker_name = speakerp->mDisplayName; + } + + if (speakerp->mIsModerator) + { + speaker_name += LLString(" ") + getFormattedUIString("moderator_label"); + } + + name_cell->setValue(speaker_name); + ((LLScrollListText*)name_cell)->setFontStyle(speakerp->mIsModerator ? LLFontGL::BOLD : LLFontGL::NORMAL); } - if (speakerp->mIsModerator) + // update speaking order column + LLScrollListCell* speaking_status_cell = itemp->getColumn(2); + if (speaking_status_cell) { - speaker_name += LLString(" ") + getFormattedUIString("moderator_label"); + // print speaking ordinal in a text-sorting friendly manner + speaking_status_cell->setValue(speaking_order_sort_string); } - row["columns"][1]["value"] = speaker_name; - row["columns"][1]["font-style"] = speakerp->mIsModerator ? "BOLD" : "NORMAL"; - - row["columns"][2]["column"] = "speaking_status"; - row["columns"][2]["type"] = "text"; - - // print speaking ordinal in a text-sorting friendly manner - row["columns"][2]["value"] = speaking_order_sort_string; - - mSpeakerList->addElement(row); } - //restore sort order, selection, etc - mSpeakerList->sortByColumn(sort_column, sort_ascending); - - // temporarily disable commit callback while restoring original selection - mSpeakerList->setCommitCallback(NULL); - - // make sure something is selected - if (selected_id.isNull()) - { - mSpeakerList->selectFirstItem(); - handleSpeakerSelect(); - } - else - { - // reselect original speaker but don't call handleSpeakerSelect() - // as that would change the moderation mute checkboxes before they - // have had time to get confirmation from the server - mSpeakerList->selectByValue(selected_id); - } - - mSpeakerList->setCommitCallback(onSelectSpeaker); + // we potentially modified the sort order by touching the list items + mSpeakerList->setSorted(FALSE); LLPointer selected_speakerp = mSpeakerMgr->findSpeaker(selected_id); - if (gMuteListp) { @@ -847,6 +911,7 @@ LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const LLString& speakerp->mStatus = status; mSpeakers.insert(std::make_pair(speakerp->mID, speakerp)); mSpeakersSorted.push_back(speakerp); + fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "add"); } else { @@ -974,6 +1039,8 @@ void LLSpeakerMgr::update() // remove speakers that have been gone too long if (speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL && speakerp->mActivityTimer.hasExpired()) { + fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "remove"); + mSpeakers.erase(speakerp->mID); sorted_speaker_it = mSpeakersSorted.erase(sorted_speaker_it); } @@ -1221,6 +1288,7 @@ void LLActiveSpeakerMgr::updateSpeakerList() // always populate from active voice channel if (LLVoiceChannel::getCurrentVoiceChannel() != mVoiceChannel) { + fireEvent(new LLSpeakerListChangeEvent(this, LLUUID::null), "clear"); mSpeakers.clear(); mSpeakersSorted.clear(); mVoiceChannel = LLVoiceChannel::getCurrentVoiceChannel(); diff --git a/linden/indra/newview/llfloateractivespeakers.h b/linden/indra/newview/llfloateractivespeakers.h index cded35d..1088be3 100644 --- a/linden/indra/newview/llfloateractivespeakers.h +++ b/linden/indra/newview/llfloateractivespeakers.h @@ -37,6 +37,7 @@ #include "llvoiceclient.h" #include "llframetimer.h" #include "llevent.h" +#include class LLScrollListCtrl; class LLButton; @@ -106,7 +107,17 @@ public: /*virtual*/ LLSD getValue(); }; -class LLSpeakerMgr +class LLSpeakerListChangeEvent : public LLEvent +{ +public: + LLSpeakerListChangeEvent(LLSpeakerMgr* source, const LLUUID& speaker_id); + /*virtual*/ LLSD getValue(); + +private: + const LLUUID& mSpeakerID; +}; + +class LLSpeakerMgr : public LLObservable { public: LLSpeakerMgr(LLVoiceChannel* channelp); @@ -196,7 +207,6 @@ class LLPanelActiveSpeakers : public LLPanel { public: LLPanelActiveSpeakers(LLSpeakerMgr* data_source, BOOL show_text_chatters); - virtual ~LLPanelActiveSpeakers(); /*virtual*/ BOOL postBuild(); @@ -222,16 +232,54 @@ public: static void onChangeModerationMode(LLUICtrl* ctrl, void* user_data); protected: - class LLSpeakerListener : public LLSimpleListener + class SpeakerMuteListener : public LLSimpleListener { public: - LLSpeakerListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {} + SpeakerMuteListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {} /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); LLPanelActiveSpeakers* mPanel; }; + friend class SpeakerAddListener; + class SpeakerAddListener : public LLSimpleListener + { + public: + SpeakerAddListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {} + + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + + LLPanelActiveSpeakers* mPanel; + }; + + friend class SpeakerRemoveListener; + class SpeakerRemoveListener : public LLSimpleListener + { + public: + SpeakerRemoveListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {} + + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + + LLPanelActiveSpeakers* mPanel; + }; + + + friend class SpeakerClearListener; + class SpeakerClearListener : public LLSimpleListener + { + public: + SpeakerClearListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {} + + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + + LLPanelActiveSpeakers* mPanel; + }; + + void addSpeaker(const LLUUID& id); + void removeSpeaker(const LLUUID& id); + + LLScrollListCtrl* mSpeakerList; LLUICtrl* mMuteVoiceCtrl; LLUICtrl* mMuteTextCtrl; @@ -240,7 +288,10 @@ protected: BOOL mShowTextChatters; LLSpeakerMgr* mSpeakerMgr; LLFrameTimer mIconAnimationTimer; - LLPointer mSpeakerListener; + LLPointer mSpeakerMuteListener; + LLPointer mSpeakerAddListener; + LLPointer mSpeakerRemoveListener; + LLPointer mSpeakerClearListener; }; extern LLLocalSpeakerMgr* gLocalSpeakerMgr; diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp index e6ff76b..0de8698 100644 --- a/linden/indra/newview/llfloaterfriends.cpp +++ b/linden/indra/newview/llfloaterfriends.cpp @@ -333,7 +333,7 @@ void LLPanelFriends::refreshRightsChangeList() struct SortFriendsByID { - bool SortFriendsByID::operator() (const LLScrollListItem* const a, const LLScrollListItem* const b) const + bool operator() (const LLScrollListItem* const a, const LLScrollListItem* const b) const { return a->getValue().asUUID() < b->getValue().asUUID(); } diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp index ee84537..7a8940d 100644 --- a/linden/indra/newview/llfloaterworldmap.cpp +++ b/linden/indra/newview/llfloaterworldmap.cpp @@ -852,15 +852,17 @@ void LLFloaterWorldMap::friendsChanged() void LLFloaterWorldMap::buildAvatarIDList() { LLCtrlListInterface *list = childGetListInterface("friend combo"); - if (!list) return; - + if (!list) + { + return; + } + // Delete all but the "None" entry S32 list_size = list->getItemCount(); - while (list_size > 1) + if (list_size > 1) { - list->selectNthItem(1); + list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); - --list_size; } LLSD default_column; @@ -872,11 +874,9 @@ void LLFloaterWorldMap::buildAvatarIDList() // Get all of the calling cards for avatar that are currently online LLCollectMappableBuddies collector; LLAvatarTracker::instance().applyFunctor(collector); - LLCollectMappableBuddies::buddy_map_t::iterator it; - LLCollectMappableBuddies::buddy_map_t::iterator end; - it = collector.mMappable.begin(); - end = collector.mMappable.end(); - for( ; it != end; ++it) + + for (LLCollectMappableBuddies::buddy_map_t::iterator it = collector.mMappable.begin(); + it != collector.mMappable.end(); ++it) { list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); } @@ -889,15 +889,17 @@ void LLFloaterWorldMap::buildAvatarIDList() void LLFloaterWorldMap::buildLandmarkIDLists() { LLCtrlListInterface *list = childGetListInterface("landmark combo"); - if (!list) return; + if (!list) + { + return; + } // Delete all but the "None" entry S32 list_size = list->getItemCount(); - while (list_size > 1) + if (list_size > 1) { - list->selectNthItem(1); + list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); - --list_size; } mLandmarkItemIDList.reset(); @@ -918,6 +920,7 @@ void LLFloaterWorldMap::buildLandmarkIDLists() items, LLInventoryModel::EXCLUDE_TRASH, is_landmark); + std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); S32 count = items.count(); @@ -930,7 +933,9 @@ void LLFloaterWorldMap::buildLandmarkIDLists() mLandmarkAssetIDList.put( item->getAssetUUID() ); mLandmarkItemIDList.put( item->getUUID() ); } + list->sortByColumn("landmark name", TRUE); + list->selectFirstItem(); } diff --git a/linden/indra/newview/llgroupmgr.cpp b/linden/indra/newview/llgroupmgr.cpp index 0dd8c6d..af6a6aa 100644 --- a/linden/indra/newview/llgroupmgr.cpp +++ b/linden/indra/newview/llgroupmgr.cpp @@ -96,16 +96,16 @@ LLGroupMemberData::~LLGroupMemberData() void LLGroupMemberData::addRole(const LLUUID& role, LLGroupRoleData* rd) { - mRoles[role] = rd; + mRolesList[role] = rd; } bool LLGroupMemberData::removeRole(const LLUUID& role) { - std::map::iterator it = mRoles.find(role); + role_list_t::iterator it = mRolesList.find(role); - if (it != mRoles.end()) + if (it != mRolesList.end()) { - mRoles.erase(it); + mRolesList.erase(it); return true; } @@ -233,7 +233,7 @@ LLGroupMgrGroupData::LLGroupMgrGroupData(const LLUUID& id) : BOOL LLGroupMgrGroupData::getRoleData(const LLUUID& role_id, LLRoleData& role_data) { - std::map::const_iterator it; + role_data_map_t::const_iterator it; // Do we have changes for it? it = mRoleChanges.find(role_id); @@ -246,7 +246,7 @@ BOOL LLGroupMgrGroupData::getRoleData(const LLUUID& role_id, LLRoleData& role_da } // Ok, no changes, hasn't been deleted, isn't a new role, just find the role. - role_list::const_iterator rit = mRoles.find(role_id); + role_list_t::const_iterator rit = mRoles.find(role_id); if (rit != mRoles.end()) { role_data = (*rit).second->getRoleData(); @@ -261,7 +261,7 @@ BOOL LLGroupMgrGroupData::getRoleData(const LLUUID& role_id, LLRoleData& role_da void LLGroupMgrGroupData::setRoleData(const LLUUID& role_id, LLRoleData role_data) { // If this is a newly created group, we need to change the data in the created list. - std::map::iterator it; + role_data_map_t::iterator it; it = mRoleChanges.find(role_id); if (it != mRoleChanges.end()) { @@ -280,7 +280,7 @@ void LLGroupMgrGroupData::setRoleData(const LLUUID& role_id, LLRoleData role_dat // Not a new role, so put it in the changes list. LLRoleData old_role_data; - role_iter rit = mRoles.find(role_id); + role_list_t::iterator rit = mRoles.find(role_id); if (rit != mRoles.end()) { bool data_change = ( ((*rit).second->mRoleData.mRoleDescription != role_data.mRoleDescription) @@ -337,7 +337,7 @@ void LLGroupMgrGroupData::createRole(const LLUUID& role_id, LLRoleData role_data void LLGroupMgrGroupData::deleteRole(const LLUUID& role_id) { - std::map::iterator it; + role_data_map_t::iterator it; // If this was a new role, just discard it. it = mRoleChanges.find(role_id); @@ -404,7 +404,7 @@ void LLGroupMgrGroupData::removeData() void LLGroupMgrGroupData::removeMemberData() { - for (member_iter mi = mMembers.begin(); mi != mMembers.end(); ++mi) + for (member_list_t::iterator mi = mMembers.begin(); mi != mMembers.end(); ++mi) { delete mi->second; } @@ -414,7 +414,7 @@ void LLGroupMgrGroupData::removeMemberData() void LLGroupMgrGroupData::removeRoleData() { - for (member_iter mi = mMembers.begin(); mi != mMembers.end(); ++mi) + for (member_list_t::iterator mi = mMembers.begin(); mi != mMembers.end(); ++mi) { LLGroupMemberData* data = mi->second; if (data) @@ -423,7 +423,7 @@ void LLGroupMgrGroupData::removeRoleData() } } - for (role_iter ri = mRoles.begin(); ri != mRoles.end(); ++ri) + for (role_list_t::iterator ri = mRoles.begin(); ri != mRoles.end(); ++ri) { LLGroupRoleData* data = ri->second; delete data; @@ -436,7 +436,7 @@ void LLGroupMgrGroupData::removeRoleData() void LLGroupMgrGroupData::removeRoleMemberData() { - for (member_iter mi = mMembers.begin(); mi != mMembers.end(); ++mi) + for (member_list_t::iterator mi = mMembers.begin(); mi != mMembers.end(); ++mi) { LLGroupMemberData* data = mi->second; if (data) @@ -445,7 +445,7 @@ void LLGroupMgrGroupData::removeRoleMemberData() } } - for (role_iter ri = mRoles.begin(); ri != mRoles.end(); ++ri) + for (role_list_t::iterator ri = mRoles.begin(); ri != mRoles.end(); ++ri) { LLGroupRoleData* data = ri->second; if (data) @@ -467,8 +467,8 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id, const LLUUID& member_id, LLRoleMemberChangeType rmc) { - role_iter ri = mRoles.find(role_id); - member_iter mi = mMembers.find(member_id); + role_list_t::iterator ri = mRoles.find(role_id); + member_list_t::iterator mi = mMembers.find(member_id); if (ri == mRoles.end() || mi == mMembers.end() ) @@ -511,7 +511,7 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id, role_member.first = role_id; role_member.second = member_id; - change_map::iterator it = mRoleMemberChanges.find(role_member); + change_map_t::iterator it = mRoleMemberChanges.find(role_member); if (it != mRoleMemberChanges.end()) { // There was already a role change for this role_member @@ -554,18 +554,15 @@ void LLGroupMgrGroupData::recalcAllAgentPowers() { LLGroupMemberData* gmd; - member_iter mit = mMembers.begin(); - member_iter mend = mMembers.end(); - for( ; mit != mend; ++mit) + for (member_list_t::iterator mit = mMembers.begin(); + mit != mMembers.end(); ++mit) { gmd = mit->second; if (!gmd) continue; - std::map::iterator it = gmd->mRoles.begin(); - std::map::iterator end = gmd->mRoles.end(); - gmd->mAgentPowers = 0; - for ( ; it != end; ++it) + for (LLGroupMemberData::role_list_t::iterator it = gmd->mRolesList.begin(); + it != gmd->mRolesList.end(); ++it) { LLGroupRoleData* grd = (*it).second; if (!grd) continue; @@ -577,18 +574,16 @@ void LLGroupMgrGroupData::recalcAllAgentPowers() void LLGroupMgrGroupData::recalcAgentPowers(const LLUUID& agent_id) { - member_iter mi = mMembers.find(agent_id); + member_list_t::iterator mi = mMembers.find(agent_id); if (mi == mMembers.end()) return; LLGroupMemberData* gmd = mi->second; if (!gmd) return; - std::map::iterator it = gmd->mRoles.begin(); - std::map::iterator end = gmd->mRoles.end(); - gmd->mAgentPowers = 0; - for ( ; it != end; ++it) + for (LLGroupMemberData::role_list_t::iterator it = gmd->mRolesList.begin(); + it != gmd->mRolesList.end(); ++it) { LLGroupRoleData* grd = (*it).second; if (!grd) continue; @@ -633,10 +628,8 @@ bool packRoleUpdateMessageBlock(LLMessageSystem* msg, void LLGroupMgrGroupData::sendRoleChanges() { // Commit changes locally - std::map::iterator it; - std::map::iterator end; LLGroupRoleData* grd; - role_iter role_it; + role_list_t::iterator role_it; LLMessageSystem* msg = gMessageSystem; bool start_message = true; @@ -645,16 +638,15 @@ void LLGroupMgrGroupData::sendRoleChanges() bool need_power_recalc = false; // Apply all changes - it = mRoleChanges.begin(); - end = mRoleChanges.end(); - for ( ; it != end; ++it) + for (role_data_map_t::iterator iter = mRoleChanges.begin(); + iter != mRoleChanges.end(); ) { + role_data_map_t::iterator it = iter++; // safely incrament iter const LLUUID& role_id = (*it).first; const LLRoleData& role_data = (*it).second; // Commit to local data set role_it = mRoles.find((*it).first); - LLGroupRoleData* group_role_data = (*role_it).second; if ( (mRoles.end() == role_it && RC_CREATE != role_data.mChangeType) || (mRoles.end() != role_it @@ -662,11 +654,13 @@ void LLGroupMgrGroupData::sendRoleChanges() { continue; } - + + // NOTE: role_it is valid EXCEPT for the RC_CREATE case switch (role_data.mChangeType) { case RC_CREATE: { + // NOTE: role_it is NOT valid in this case grd = new LLGroupRoleData(role_id, role_data, 0); mRoles[role_id] = grd; need_role_data = true; @@ -674,6 +668,7 @@ void LLGroupMgrGroupData::sendRoleChanges() } case RC_DELETE: { + LLGroupRoleData* group_role_data = (*role_it).second; delete group_role_data; mRoles.erase(role_it); need_role_cleanup = true; @@ -686,7 +681,8 @@ void LLGroupMgrGroupData::sendRoleChanges() case RC_UPDATE_DATA: default: { - group_role_data->setRoleData(role_data); + LLGroupRoleData* group_role_data = (*role_it).second; + group_role_data->setRoleData(role_data); // NOTE! might modify mRoleChanges! break; } } @@ -751,7 +747,7 @@ void LLGroupMgr::clearGroups() void LLGroupMgr::clearGroupData(const LLUUID& group_id) { - std::map::iterator iter = mGroups.find(group_id); + group_map_t::iterator iter = mGroups.find(group_id); if (iter != mGroups.end()) { delete (*iter).second; @@ -770,7 +766,7 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer) { return; } - observer_iter it; + observer_multimap_t::iterator it; it = mObservers.find(observer->getID()); while (it != mObservers.end()) { @@ -788,7 +784,7 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer) LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) { - group_iter gi = mGroups.find(id); + group_map_t::iterator gi = mGroups.find(id); if (gi != mGroups.end()) { @@ -800,7 +796,7 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) // static void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) { - llinfos << "LLGroupMgr::processGroupMembersReply" << llendl; + lldebugs << "LLGroupMgr::processGroupMembersReply" << llendl; LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) @@ -854,7 +850,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) std::string(online_status), is_owner); #if LL_DEBUG - LLGroupMgrGroupData::member_iter mit = group_datap->mMembers.find(member_id); + LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(member_id); if (mit != group_datap->mMembers.end()) { llinfos << " *** Received duplicate member data for agent " << member_id << llendl; @@ -894,7 +890,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) //static void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) { - llinfos << "LLGroupMgr::processGroupPropertiesReply" << llendl; + lldebugs << "LLGroupMgr::processGroupPropertiesReply" << llendl; LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) @@ -961,7 +957,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) // static void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) { - llinfos << "LLGroupMgr::processGroupRoleDataReply" << llendl; + lldebugs << "LLGroupMgr::processGroupRoleDataReply" << llendl; LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) @@ -1028,7 +1024,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) // static void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) { - llinfos << "LLGroupMgr::processGroupRoleMembersReply" << llendl; + lldebugs << "LLGroupMgr::processGroupRoleMembersReply" << llendl; LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) @@ -1061,8 +1057,8 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) LLGroupRoleData* rd = NULL; LLGroupMemberData* md = NULL; - LLGroupMgrGroupData::role_iter ri; - LLGroupMgrGroupData::member_iter mi; + LLGroupMgrGroupData::role_list_t::iterator ri; + LLGroupMgrGroupData::member_list_t::iterator mi; // If total_pairs == 0, there are no members in any custom roles. if (total_pairs > 0) @@ -1115,9 +1111,8 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) } else { - LLGroupMgrGroupData::member_iter mi = group_data->mMembers.begin(); - LLGroupMgrGroupData::member_iter end = group_data->mMembers.end(); - for ( ; mi != end; ++mi) + for (LLGroupMgrGroupData::member_list_t::iterator mi = group_data->mMembers.begin(); + mi != group_data->mMembers.end(); ++mi) { LLGroupMemberData* data = mi->second; if (data) @@ -1138,7 +1133,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) // static void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data) { - llinfos << "LLGroupMgr::processGroupTitlesReply" << llendl; + lldebugs << "LLGroupMgr::processGroupTitlesReply" << llendl; LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) @@ -1188,7 +1183,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data) // static void LLGroupMgr::processEjectGroupMemberReply(LLMessageSystem* msg, void ** data) { - llinfos << "processEjectGroupMemberReply" << llendl; + lldebugs << "processEjectGroupMemberReply" << llendl; LLUUID group_id; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id); BOOL success; @@ -1204,7 +1199,7 @@ void LLGroupMgr::processEjectGroupMemberReply(LLMessageSystem* msg, void ** data // static void LLGroupMgr::processJoinGroupReply(LLMessageSystem* msg, void ** data) { - llinfos << "processJoinGroupReply" << llendl; + lldebugs << "processJoinGroupReply" << llendl; LLUUID group_id; BOOL success; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id); @@ -1226,7 +1221,7 @@ void LLGroupMgr::processJoinGroupReply(LLMessageSystem* msg, void ** data) // static void LLGroupMgr::processLeaveGroupReply(LLMessageSystem* msg, void ** data) { - llinfos << "processLeaveGroupReply" << llendl; + lldebugs << "processLeaveGroupReply" << llendl; LLUUID group_id; BOOL success; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id); @@ -1291,7 +1286,7 @@ LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id) { LLGroupMgrGroupData* group_datap; - group_iter existing_group = gGroupMgr->mGroups.find(id); + group_map_t::iterator existing_group = gGroupMgr->mGroups.find(id); if (existing_group == gGroupMgr->mGroups.end()) { group_datap = new LLGroupMgrGroupData(id); @@ -1307,12 +1302,12 @@ LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id) void LLGroupMgr::notifyObservers(LLGroupChange gc) { - for (group_iter gi = mGroups.begin(); gi != mGroups.end(); ++gi) + for (group_map_t::iterator gi = mGroups.begin(); gi != mGroups.end(); ++gi) { if (gi->second->mChanged) { // find all observers for this group id - observer_iter oi = mObservers.find(gi->first); + observer_multimap_t::iterator oi = mObservers.find(gi->first); for (; oi != mObservers.end(); ++oi) { oi->second->changed(gc); @@ -1327,9 +1322,9 @@ void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap) if (mGroups.size() > MAX_CACHED_GROUPS) { // get rid of groups that aren't observed - for (group_iter gi = mGroups.begin(); gi != mGroups.end() && mGroups.size() > MAX_CACHED_GROUPS / 2; ) + for (group_map_t::iterator gi = mGroups.begin(); gi != mGroups.end() && mGroups.size() > MAX_CACHED_GROUPS / 2; ) { - observer_iter oi = mObservers.find(gi->first); + observer_multimap_t::iterator oi = mObservers.find(gi->first); if (oi == mObservers.end()) { // not observed @@ -1349,7 +1344,7 @@ void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap) void LLGroupMgr::sendGroupPropertiesRequest(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendGroupPropertiesRequest" << llendl; + lldebugs << "LLGroupMgr::sendGroupPropertiesRequest" << llendl; // This will happen when we get the reply //LLGroupMgrGroupData* group_datap = createGroupData(group_id); @@ -1365,7 +1360,7 @@ void LLGroupMgr::sendGroupPropertiesRequest(const LLUUID& group_id) void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendGroupMembersRequest" << llendl; + lldebugs << "LLGroupMgr::sendGroupMembersRequest" << llendl; LLGroupMgrGroupData* group_datap = createGroupData(group_id); if (group_datap->mMemberRequestID.isNull()) { @@ -1386,7 +1381,7 @@ void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id) void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendGroupRoleDataRequest" << llendl; + lldebugs << "LLGroupMgr::sendGroupRoleDataRequest" << llendl; LLGroupMgrGroupData* group_datap = createGroupData(group_id); if (group_datap->mRoleDataRequestID.isNull()) { @@ -1407,7 +1402,7 @@ void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id) void LLGroupMgr::sendGroupRoleMembersRequest(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendGroupRoleMembersRequest" << llendl; + lldebugs << "LLGroupMgr::sendGroupRoleMembersRequest" << llendl; LLGroupMgrGroupData* group_datap = createGroupData(group_id); if (group_datap->mRoleMembersRequestID.isNull()) @@ -1441,7 +1436,7 @@ void LLGroupMgr::sendGroupRoleMembersRequest(const LLUUID& group_id) void LLGroupMgr::sendGroupTitlesRequest(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendGroupTitlesRequest" << llendl; + lldebugs << "LLGroupMgr::sendGroupTitlesRequest" << llendl; LLGroupMgrGroupData* group_datap = createGroupData(group_id); group_datap->mTitles.clear(); @@ -1460,7 +1455,7 @@ void LLGroupMgr::sendGroupTitlesRequest(const LLUUID& group_id) void LLGroupMgr::sendGroupTitleUpdate(const LLUUID& group_id, const LLUUID& title_role_id) { - llinfos << "LLGroupMgr::sendGroupTitleUpdate" << llendl; + lldebugs << "LLGroupMgr::sendGroupTitleUpdate" << llendl; LLMessageSystem* msg = gMessageSystem; msg->newMessage("GroupTitleUpdate"); @@ -1474,10 +1469,8 @@ void LLGroupMgr::sendGroupTitleUpdate(const LLUUID& group_id, const LLUUID& titl // Save the change locally LLGroupMgrGroupData* group_datap = createGroupData(group_id); - std::vector::iterator iter = group_datap->mTitles.begin(); - std::vector::iterator end = group_datap->mTitles.end(); - - for ( ; iter != end; ++iter) + for (std::vector::iterator iter = group_datap->mTitles.begin(); + iter != group_datap->mTitles.end(); ++iter) { if (iter->mRoleID == title_role_id) { @@ -1521,7 +1514,7 @@ void LLGroupMgr::sendCreateGroupRequest(const std::string& name, void LLGroupMgr::sendUpdateGroupInfo(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendUpdateGroupInfo" << llendl; + lldebugs << "LLGroupMgr::sendUpdateGroupInfo" << llendl; LLGroupMgrGroupData* group_datap = createGroupData(group_id); LLMessageSystem* msg = gMessageSystem; @@ -1550,18 +1543,16 @@ void LLGroupMgr::sendUpdateGroupInfo(const LLUUID& group_id) void LLGroupMgr::sendGroupRoleMemberChanges(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendGroupRoleMemberChanges" << llendl; + lldebugs << "LLGroupMgr::sendGroupRoleMemberChanges" << llendl; LLGroupMgrGroupData* group_datap = createGroupData(group_id); if (group_datap->mRoleMemberChanges.empty()) return; LLMessageSystem* msg = gMessageSystem; - change_map::const_iterator citer = group_datap->mRoleMemberChanges.begin(); - change_map::const_iterator end = group_datap->mRoleMemberChanges.end(); bool start_message = true; - - for ( ; citer != end; ++citer) + for (LLGroupMgrGroupData::change_map_t::const_iterator citer = group_datap->mRoleMemberChanges.begin(); + citer != group_datap->mRoleMemberChanges.end(); ++citer) { if (start_message) { @@ -1618,9 +1609,8 @@ void LLGroupMgr::sendGroupMemberInvites(const LLUUID& group_id, std::map::iterator it = member_role_pairs.begin(); - std::map::iterator end = member_role_pairs.end(); - for ( ; it != end; ++it) + for (std::map::iterator it = member_role_pairs.begin(); + it != member_role_pairs.end(); ++it) { if (start_message) { @@ -1660,15 +1650,14 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, LLGroupMgrGroupData* group_datap = gGroupMgr->getGroupData(group_id); if (!group_datap) return; - std::vector::iterator it = member_ids.begin(); - std::vector::iterator end = member_ids.end(); - for ( ; it != end; ++it) + for (std::vector::iterator it = member_ids.begin(); + it != member_ids.end(); ++it) { // Can't use 'eject' to leave a group. if ((*it) == gAgent.getID()) continue; // Make sure they are in the group, and we need the member data - LLGroupMgrGroupData::member_iter mit = group_datap->mMembers.find(*it); + LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(*it); if (mit != group_datap->mMembers.end()) { // Add them to the message @@ -1693,9 +1682,8 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, } // Clean up groupmgr - std::map::iterator rit = (*mit).second->roleBegin(); - std::map::iterator rend = (*mit).second->roleEnd(); - for ( ; rit != rend; ++rit) + for (LLGroupMemberData::role_list_t::iterator rit = (*mit).second->roleBegin(); + rit != (*mit).second->roleEnd(); ++rit) { if ((*rit).first.notNull()) { @@ -1715,7 +1703,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id) { - llinfos << "LLGroupMgr::sendGroupRoleChanges" << llendl; + lldebugs << "LLGroupMgr::sendGroupRoleChanges" << llendl; LLGroupMgrGroupData* group_datap = getGroupData(group_id); if (group_datap && group_datap->pendingRoleChanges()) @@ -1730,7 +1718,7 @@ void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id) void LLGroupMgr::cancelGroupRoleChanges(const LLUUID& group_id) { - llinfos << "LLGroupMgr::cancelGroupRoleChanges" << llendl; + lldebugs << "LLGroupMgr::cancelGroupRoleChanges" << llendl; LLGroupMgrGroupData* group_datap = getGroupData(group_id); if (group_datap) group_datap->cancelRoleChanges(); @@ -1750,11 +1738,10 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) } LLXMLNodeList role_list; - LLXMLNodeList::iterator role_iter; root->getChildren("action_set", role_list, false); - for (role_iter = role_list.begin(); role_iter != role_list.end(); ++role_iter) + for (LLXMLNodeList::iterator role_iter = role_list.begin(); role_iter != role_list.end(); ++role_iter) { LLXMLNodePtr action_set = role_iter->second; diff --git a/linden/indra/newview/llgroupmgr.h b/linden/indra/newview/llgroupmgr.h index 7cef5ec..89be4bf 100644 --- a/linden/indra/newview/llgroupmgr.h +++ b/linden/indra/newview/llgroupmgr.h @@ -58,6 +58,8 @@ class LLGroupMemberData friend class LLGroupMgrGroupData; public: + typedef std::map role_list_t; + LLGroupMemberData(const LLUUID& id, S32 contribution, U64 agent_powers, @@ -75,11 +77,11 @@ public: const std::string& getOnlineStatus() const { return mOnlineStatus; } void addRole(const LLUUID& role, LLGroupRoleData* rd); bool removeRole(const LLUUID& role); - void clearRoles() { mRoles.clear(); }; - std::map::iterator roleBegin() { return mRoles.begin(); } - std::map::iterator roleEnd() { return mRoles.end(); } + void clearRoles() { mRolesList.clear(); }; + role_list_t::iterator roleBegin() { return mRolesList.begin(); } + role_list_t::iterator roleEnd() { return mRolesList.end(); } - BOOL isInRole(const LLUUID& role_id) { return (mRoles.find(role_id) != mRoles.end()); } + BOOL isInRole(const LLUUID& role_id) { return (mRolesList.find(role_id) != mRolesList.end()); } protected: LLUUID mID; @@ -88,7 +90,7 @@ protected: std::string mTitle; std::string mOnlineStatus; BOOL mIsOwner; - std::map mRoles; + role_list_t mRolesList; }; struct LLRoleData @@ -185,8 +187,6 @@ struct lluuid_pair_less } }; -typedef std::map change_map; - struct LLGroupTitle { std::string mTitle; @@ -231,17 +231,16 @@ public: BOOL isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; } public: - typedef std::map member_list; - typedef member_list::iterator member_iter; - typedef std::map role_list; - typedef role_list::iterator role_iter; - - member_list mMembers; - role_list mRoles; + typedef std::map member_list_t; + typedef std::map role_list_t; + typedef std::map change_map_t; + typedef std::map role_data_map_t; + member_list_t mMembers; + role_list_t mRoles; - change_map mRoleMemberChanges; - std::map mRoleChanges; + change_map_t mRoleMemberChanges; + role_data_map_t mRoleChanges; std::vector mTitles; @@ -298,6 +297,8 @@ struct LLRoleActionSet class LLGroupMgr { + LOG_CLASS(LLGroupMgr); + public: LLGroupMgr(); ~LLGroupMgr(); @@ -355,10 +356,10 @@ protected: LLGroupMgrGroupData* createGroupData(const LLUUID &id); protected: - typedef std::multimap::iterator observer_iter; - std::multimap mObservers; - typedef std::map::iterator group_iter; - std::map mGroups; + typedef std::multimap observer_multimap_t; + observer_multimap_t mObservers; + typedef std::map group_map_t; + group_map_t mGroups; }; extern LLGroupMgr* gGroupMgr; diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index b80b80b..193beb9 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -1370,9 +1370,13 @@ void LLFloaterIMPanel::draw() } } + // use embedded panel if available if (mSpeakerPanel) { - mSpeakerPanel->refreshSpeakers(); + if (mSpeakerPanel->getVisible()) + { + mSpeakerPanel->refreshSpeakers(); + } } else { diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp index 777cbc4..8bf9103 100644 --- a/linden/indra/newview/llmediaremotectrl.cpp +++ b/linden/indra/newview/llmediaremotectrl.cpp @@ -67,8 +67,8 @@ void LLMediaRemoteCtrl::build() BOOL LLMediaRemoteCtrl::postBuild() { - childSetAction("media_play",LLOverlayBar::mediaPlay,this); - childSetAction("music_play",LLOverlayBar::musicPlay,this); + childSetAction("media_play",LLOverlayBar::toggleMediaPlay,this); + childSetAction("music_play",LLOverlayBar::toggleMusicPlay,this); childSetAction("expand", onClickExpandBtn, this); return TRUE; diff --git a/linden/indra/newview/llnamelistctrl.cpp b/linden/indra/newview/llnamelistctrl.cpp index e645cc6..4b63b08 100644 --- a/linden/indra/newview/llnamelistctrl.cpp +++ b/linden/indra/newview/llnamelistctrl.cpp @@ -224,7 +224,7 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); ((LLScrollListText*)cell)->setText( fullname ); - calcMaxContentWidth(item); + dirtyColumns(); // this column is resizable LLScrollListColumn* columnp = getColumn(mNameColumnIndex); @@ -277,9 +277,10 @@ void LLNameListCtrl::refresh(const LLUUID& id, const char* first, cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); ((LLScrollListText*)cell)->setText( fullname ); - calcMaxContentWidth(item); } } + + dirtyColumns(); } diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 9ef2eba..e24cbc7 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -163,7 +163,6 @@ void LLOverlayBar::layoutButtons() { LLViewQuery query; LLWidgetTypeFilter widget_filter(WIDGET_TYPE_BUTTON); - query.addPreFilter(LLVisibleFilter::getInstance()); query.addPreFilter(LLEnabledFilter::getInstance()); query.addPreFilter(&widget_filter); @@ -333,7 +332,7 @@ void LLOverlayBar::onClickStandUp(void*) // *TODO: Move this into an audio manager abstraction //static -void LLOverlayBar::mediaPlay(void*) +void LLOverlayBar::toggleMediaPlay(void*) { if (!gOverlayBar) { @@ -361,7 +360,7 @@ void LLOverlayBar::mediaPlay(void*) } //static -void LLOverlayBar::musicPlay(void*) +void LLOverlayBar::toggleMusicPlay(void*) { if (!gOverlayBar) { diff --git a/linden/indra/newview/lloverlaybar.h b/linden/indra/newview/lloverlaybar.h index 46dbfef..c4bf2cf 100644 --- a/linden/indra/newview/lloverlaybar.h +++ b/linden/indra/newview/lloverlaybar.h @@ -78,8 +78,8 @@ public: static void onClickResetView(void* data); //static media helper functions - static void mediaPlay(void*); - static void musicPlay(void*); + static void toggleMediaPlay(void*); + static void toggleMusicPlay(void*); protected: static void* createMediaRemote(void* userdata); diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index dd4d6cf..664c9a6 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp @@ -575,7 +575,8 @@ LLPanelAvatarWeb::~LLPanelAvatarWeb() void LLPanelAvatarWeb::enableControls(BOOL self) { childSetEnabled("url_edit",self); - childSetVisible("status_text",!self); + childSetVisible("status_text",!self && !mURL.empty()); + childSetText("status_text", LLString::null); } void LLPanelAvatarWeb::setWebURL(std::string url) @@ -605,6 +606,9 @@ void LLPanelAvatarWeb::setWebURL(std::string url) { childSetVisible("profile_html",false); } + + BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); + childSetVisible("status_text",!own_avatar && !mURL.empty()); #if !LL_LIBXUL_ENABLED childSetVisible("load",false); diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp index 811527e..e8d6b0d 100644 --- a/linden/indra/newview/llpanelclassified.cpp +++ b/linden/indra/newview/llpanelclassified.cpp @@ -676,6 +676,8 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** self->mPaidFor = TRUE; self->mUpdateBtn->setLabel(self->childGetText("update_txt")); + + self->resetDirty(); } } @@ -823,6 +825,25 @@ void LLPanelClassified::callbackGotPriceForListing(S32 option, LLString text, vo } +void LLPanelClassified::resetDirty() +{ + // Tell all the widgets to reset their dirty state since the ad was just saved + if (mSnapshotCtrl) + mSnapshotCtrl->resetDirty(); + if (mNameEditor) + mNameEditor->resetDirty(); + if (mDescEditor) + mDescEditor->resetDirty(); + if (mLocationEditor) + mLocationEditor->resetDirty(); + mLocationChanged = false; + if (mCategoryCombo) + mCategoryCombo->resetDirty(); + if (mMatureCheck) + mMatureCheck->resetDirty(); + if (mAutoRenewCheck) + mAutoRenewCheck->resetDirty(); +} // invoked from callbackConfirmPublish void LLPanelClassified::confirmPublish(S32 option) @@ -846,22 +867,7 @@ void LLPanelClassified::confirmPublish(S32 option) tab->setCurrentTabName(mNameEditor->getText()); } - // Tell all the widgets to reset their dirty state since the ad was just saved - if (mSnapshotCtrl) - mSnapshotCtrl->resetDirty(); - if (mNameEditor) - mNameEditor->resetDirty(); - if (mDescEditor) - mDescEditor->resetDirty(); - if (mLocationEditor) - mLocationEditor->resetDirty(); - mLocationChanged = false; - if (mCategoryCombo) - mCategoryCombo->resetDirty(); - if (mMatureCheck) - mMatureCheck->resetDirty(); - if (mAutoRenewCheck) - mAutoRenewCheck->resetDirty(); + resetDirty(); } // static diff --git a/linden/indra/newview/llpanelclassified.h b/linden/indra/newview/llpanelclassified.h index 9c39d1b..087aae0 100644 --- a/linden/indra/newview/llpanelclassified.h +++ b/linden/indra/newview/llpanelclassified.h @@ -95,6 +95,7 @@ public: void sendClassifiedInfoRequest(); void sendClassifiedInfoUpdate(); + void resetDirty(); void confirmPublish(S32 option); static void processClassifiedInfoReply(LLMessageSystem* msg, void**); diff --git a/linden/indra/newview/llpanelgroupgeneral.cpp b/linden/indra/newview/llpanelgroupgeneral.cpp index 16e2ab7..1ecc2e5 100644 --- a/linden/indra/newview/llpanelgroupgeneral.cpp +++ b/linden/indra/newview/llpanelgroupgeneral.cpp @@ -762,9 +762,8 @@ void LLPanelGroupGeneral::updateMembers() all_timer.reset(); S32 i = 0; - LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); - for( ; mMemberProgress != end && imMembers.end() && ifirst << ", " << iter->second->getTitle() << llendl; @@ -805,7 +804,7 @@ void LLPanelGroupGeneral::updateMembers() sAllTime += all_timer.getElapsedTimeF32(); llinfos << "Updated " << i << " of " << UPDATE_MEMBERS_PER_FRAME << "members in the list." << llendl; - if (mMemberProgress == end) + if (mMemberProgress == gdatap->mMembers.end()) { llinfos << " member list completed." << llendl; mListVisibleMembers->setEnabled(TRUE); diff --git a/linden/indra/newview/llpanelgroupgeneral.h b/linden/indra/newview/llpanelgroupgeneral.h index 5c8b791..daf7bfa 100644 --- a/linden/indra/newview/llpanelgroupgeneral.h +++ b/linden/indra/newview/llpanelgroupgeneral.h @@ -110,7 +110,7 @@ private: LLTextBox *mActiveTitleLabel; LLComboBox *mComboActiveTitle; - LLGroupMgrGroupData::member_iter mMemberProgress; + LLGroupMgrGroupData::member_list_t::iterator mMemberProgress; }; #endif diff --git a/linden/indra/newview/llpanelgroupinvite.cpp b/linden/indra/newview/llpanelgroupinvite.cpp index 0879ae5..73900f0 100644 --- a/linden/indra/newview/llpanelgroupinvite.cpp +++ b/linden/indra/newview/llpanelgroupinvite.cpp @@ -165,7 +165,7 @@ void LLPanelGroupInvite::impl::submitInvitations() void LLPanelGroupInvite::impl::addRoleNames(LLGroupMgrGroupData* gdatap) { - LLGroupMgrGroupData::member_iter agent_iter = + LLGroupMgrGroupData::member_list_t::iterator agent_iter = gdatap->mMembers.find(gAgent.getID()); //get the member data for the agent if it exists @@ -191,8 +191,8 @@ void LLPanelGroupInvite::impl::addRoleNames(LLGroupMgrGroupData* gdatap) bool can_assign_limited = gAgent.hasPowerInGroup(mGroupID, GP_ROLE_ASSIGN_MEMBER_LIMITED); - LLGroupMgrGroupData::role_iter rit = gdatap->mRoles.begin(); - LLGroupMgrGroupData::role_iter end = gdatap->mRoles.end(); + LLGroupMgrGroupData::role_list_t::iterator rit = gdatap->mRoles.begin(); + LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end(); //populate the role list for ( ; rit != end; ++rit) diff --git a/linden/indra/newview/llpanelgrouproles.cpp b/linden/indra/newview/llpanelgrouproles.cpp index 3401bee..5a2d9db 100644 --- a/linden/indra/newview/llpanelgrouproles.cpp +++ b/linden/indra/newview/llpanelgrouproles.cpp @@ -70,7 +70,7 @@ bool agentCanAddToRole(const LLUUID& group_id, } //make sure the agent is in the group - LLGroupMgrGroupData::member_iter mi = gdatap->mMembers.find(gAgent.getID()); + LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find(gAgent.getID()); if (mi == gdatap->mMembers.end()) { return false; @@ -1010,8 +1010,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() // Build the assigned roles list. ////////////////////////////////// // Add each role to the assigned roles list. - LLGroupMgrGroupData::role_iter iter = gdatap->mRoles.begin(); - LLGroupMgrGroupData::role_iter end = gdatap->mRoles.end(); + LLGroupMgrGroupData::role_list_t::iterator iter = gdatap->mRoles.begin(); + LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end(); BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_EJECT); @@ -1052,7 +1052,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() if ((*member_iter) == gAgent.getID()) continue; // Look up the member data. - LLGroupMgrGroupData::member_iter mi = + LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find((*member_iter)); if (mi == gdatap->mMembers.end()) continue; LLGroupMemberData* member_data = (*mi).second; @@ -1146,7 +1146,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() if (!can_eject_members && !member_is_owner) { // Maybe we can eject them because we are an owner... - LLGroupMgrGroupData::member_iter mi = gdatap->mMembers.find(gAgent.getID()); + LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find(gAgent.getID()); if (mi != gdatap->mMembers.end()) { LLGroupMemberData* member_data = (*mi).second; @@ -1230,41 +1230,29 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, LLUUID member_id; - member_role_change_iter member_end = mMemberRoleChangeData.end(); - member_role_change_iter member; - role_change_data_map_t *role_change_datap; - role_change_data_map_t::iterator role_end; - role_change_data_map_t::iterator role; - std::vector selection = mMembersList->getAllSelected(); - if (selection.empty()) return; - - std::vector::iterator itor; - for (itor = selection.begin() ; + if (selection.empty()) + { + return; + } + + for (std::vector::iterator itor = selection.begin() ; itor != selection.end(); ++itor) { member_id = (*itor)->getUUID(); //see if we requested a change for this member before - member = mMemberRoleChangeData.find(member_id); - if ( member != member_end ) + if ( mMemberRoleChangeData.find(member_id) == mMemberRoleChangeData.end() ) { - //this member had previously had their role data changed - //so grab it - role_change_datap = (*member).second; - } - else - { - role_change_datap = new role_change_data_map_t; - mMemberRoleChangeData[member_id] = role_change_datap; + mMemberRoleChangeData[member_id] = new role_change_data_map_t; } + role_change_data_map_t* role_change_datap = mMemberRoleChangeData[member_id]; //now check to see if the selected group member //had changed his association with the selected role before - role_end = role_change_datap->end(); - role = role_change_datap->find(role_id); - if ( role != role_end ) + role_change_data_map_t::iterator role = role_change_datap->find(role_id); + if ( role != role_change_datap->end() ) { //see if the new change type cancels out the previous change if (role->second != type) @@ -1454,15 +1442,11 @@ void LLPanelGroupMembersSubTab::applyMemberChanges() //we need to add all of the changed roles data //for each member whose role changed - member_role_change_iter member_end = mMemberRoleChangeData.end(); - member_role_change_iter member = mMemberRoleChangeData.begin(); - - for (; member != member_end; member++) + for (member_role_changes_map_t::iterator member = mMemberRoleChangeData.begin(); + member != mMemberRoleChangeData.end(); ++member) { - role_change_data_map_t::iterator role_end = member->second->end(); - role_change_data_map_t::iterator role = member->second->begin(); - - for (; role != role_end; role++) + for (role_change_data_map_t::iterator role = member->second->begin(); + role != member->second->end(); ++role) { gdatap->changeRoleMember(role->first, //role_id member->first, //member_id @@ -1515,11 +1499,6 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag //if we are removing a role, we store that role id away //and then we have to build the powers up bases on the roles the agent //is in - member_role_change_iter member_end = mMemberRoleChangeData.end(); - member_role_change_iter member; - role_change_data_map_t *role_change_datap = NULL; - role_change_data_map_t::iterator role_end; - role_change_data_map_t::iterator role; LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); if (!gdatap) @@ -1536,8 +1515,9 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag } //see if there are unsaved role changes for this agent - member = mMemberRoleChangeData.find(agent_id); - if ( member != member_end ) + role_change_data_map_t* role_change_datap = NULL; + member_role_changes_map_t::iterator member = mMemberRoleChangeData.find(agent_id); + if ( member != mMemberRoleChangeData.end() ) { //this member has unsaved role changes //so grab them @@ -1550,13 +1530,13 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag { std::vector roles_to_be_removed; - role_end = role_change_datap->end(); - role = role_change_datap->begin(); - - for (; role != role_end; role++) + for (role_change_data_map_t::iterator role = role_change_datap->begin(); + role != role_change_datap->end(); ++ role) { if ( role->second == RMC_ADD ) + { new_powers |= gdatap->getRolePowers(role->first); + } else { roles_to_be_removed.push_back(role->first); @@ -1565,12 +1545,8 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag //loop over the member's current roles, summing up //the powers (not including the role we are removing) - std::map::iterator current_role = - member_data->roleBegin(); - std::map::iterator end_role = - member_data->roleEnd(); - - for (; current_role != end_role; current_role++) + for (LLGroupMemberData::role_list_t::iterator current_role = member_data->roleBegin(); + current_role != member_data->roleEnd(); ++current_role) { bool role_in_remove_list = (std::find(roles_to_be_removed.begin(), @@ -1603,13 +1579,10 @@ bool LLPanelGroupMembersSubTab::getRoleChangeType(const LLUUID& member_id, const LLUUID& role_id, LLRoleMemberChangeType& type) { - member_role_change_iter member_changes_iter; - role_change_data_map_t::iterator role_changes_iter; - - member_changes_iter = mMemberRoleChangeData.find(member_id); + member_role_changes_map_t::iterator member_changes_iter = mMemberRoleChangeData.find(member_id); if ( member_changes_iter != mMemberRoleChangeData.end() ) { - role_changes_iter = member_changes_iter->second->find(role_id); + role_change_data_map_t::iterator role_changes_iter = member_changes_iter->second->find(role_id); if ( role_changes_iter != member_changes_iter->second->end() ) { type = role_changes_iter->second; @@ -1707,7 +1680,7 @@ void LLPanelGroupMembersSubTab::updateMembers() return; } - LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); + LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ @@ -1997,8 +1970,8 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) LLScrollListItem* item = NULL; - LLGroupMgrGroupData::role_iter rit = gdatap->mRoles.begin(); - LLGroupMgrGroupData::role_iter end = gdatap->mRoles.end(); + LLGroupMgrGroupData::role_list_t::iterator rit = gdatap->mRoles.begin(); + LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end(); for ( ; rit != end; ++rit) { @@ -2181,8 +2154,8 @@ void LLPanelGroupRolesSubTab::buildMembersList() if (item->getUUID().isNull()) { // Special cased 'Everyone' role - LLGroupMgrGroupData::member_iter mit = gdatap->mMembers.begin(); - LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); + LLGroupMgrGroupData::member_list_t::iterator mit = gdatap->mMembers.begin(); + LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); for ( ; mit != end; ++mit) { mAssignedMembersList->addNameItem((*mit).first); @@ -2190,7 +2163,7 @@ void LLPanelGroupRolesSubTab::buildMembersList() } else { - LLGroupMgrGroupData::role_iter rit = gdatap->mRoles.find(item->getUUID()); + LLGroupMgrGroupData::role_list_t::iterator rit = gdatap->mRoles.find(item->getUUID()); if (rit != gdatap->mRoles.end()) { LLGroupRoleData* rdatap = (*rit).second; @@ -2643,8 +2616,8 @@ void LLPanelGroupActionsSubTab::handleActionSelect() if (gdatap->isMemberDataComplete()) { - LLGroupMgrGroupData::member_iter it = gdatap->mMembers.begin(); - LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); + LLGroupMgrGroupData::member_list_t::iterator it = gdatap->mMembers.begin(); + LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); LLGroupMemberData* gmd; for ( ; it != end; ++it) @@ -2664,8 +2637,8 @@ void LLPanelGroupActionsSubTab::handleActionSelect() if (gdatap->isRoleDataComplete()) { - LLGroupMgrGroupData::role_iter it = gdatap->mRoles.begin(); - LLGroupMgrGroupData::role_iter end = gdatap->mRoles.end(); + LLGroupMgrGroupData::role_list_t::iterator it = gdatap->mRoles.begin(); + LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end(); LLGroupRoleData* rmd; for ( ; it != end; ++it) diff --git a/linden/indra/newview/llpanelgrouproles.h b/linden/indra/newview/llpanelgrouproles.h index a44f1a3..f84cb93 100644 --- a/linden/indra/newview/llpanelgrouproles.h +++ b/linden/indra/newview/llpanelgrouproles.h @@ -202,7 +202,6 @@ public: protected: typedef std::map role_change_data_map_t; - typedef std::map::iterator member_role_change_iter; typedef std::map member_role_changes_map_t; bool matchesSearchFilter(char* first, char* last); @@ -224,7 +223,7 @@ protected: member_role_changes_map_t mMemberRoleChangeData; U32 mNumOwnerAdditions; - LLGroupMgrGroupData::member_iter mMemberProgress; + LLGroupMgrGroupData::member_list_t::iterator mMemberProgress; }; class LLPanelGroupRolesSubTab : public LLPanelGroupSubTab diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 6029c2f..24d235e 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -368,6 +368,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, childSetKeystrokeCallback("password_edit", onPassKey, this); childSetUserData("password_edit", this); + // change z sort of clickable text to be behind buttons + sendChildToBack(getChildByName("channel_text")); + sendChildToBack(getChildByName("version_text")); + sendChildToBack(getChildByName("forgot_password_text")); + LLLineEditor* edit = LLUICtrlFactory::getLineEditorByName(this, "password_edit"); if (edit) edit->setDrawAsterixes(TRUE); @@ -483,6 +488,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // Initialize visibility (and don't force visibility - use prefs) refreshLocation( false ); #endif + } void LLPanelLogin::setSiteIsAlive( bool alive ) diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index 6ddae78..bb0ccde 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp @@ -3647,14 +3647,25 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type) { selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition()); } + else + { + selectNode->mSavedPositionGlobal = object->getPositionGlobal(); + } } else { LLViewerObject* attachment_root = (LLViewerObject*)object->getParent(); - LLXform* parent_xform = attachment_root->mDrawable->getXform()->getParent(); - LLVector3 root_pos = (attachment_root->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); - LLQuaternion root_rot = (attachment_root->getRotation() * parent_xform->getWorldRotation()); - selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * root_rot) + root_pos); + LLXform* parent_xform = attachment_root ? attachment_root->mDrawable->getXform()->getParent() : NULL; + if (parent_xform) + { + LLVector3 root_pos = (attachment_root->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); + LLQuaternion root_rot = (attachment_root->getRotation() * parent_xform->getWorldRotation()); + selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * root_rot) + root_pos); + } + else + { + selectNode->mSavedPositionGlobal = object->getPositionGlobal(); + } } selectNode->mSavedRotation = object->getRenderRotation(); } diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 07aefad..2e7e609 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -1080,7 +1080,7 @@ BOOL idle_startup() gAcceptTOS, gAcceptCriticalMessage, gViewerDigest, - gLastExecFroze, + gLastExecEvent, requested_options, hashed_mac_string, LLAppViewer::instance()->getSerialNumber()); @@ -2887,8 +2887,8 @@ void update_dialog_callback(S32 option, void *userdata) llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl; - // *REMOVE:Mani The following call is handled through ~LLAppViewer. - // remove_marker_file(); // In case updater fails + //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. + LLAppViewer::instance()->removeMarkerFile(); // In case updater fails // Use spawn() to run asynchronously int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); diff --git a/linden/indra/newview/lltoolbar.cpp b/linden/indra/newview/lltoolbar.cpp index e3aa9a3..4120c2d 100644 --- a/linden/indra/newview/lltoolbar.cpp +++ b/linden/indra/newview/lltoolbar.cpp @@ -279,7 +279,7 @@ void LLToolBar::layoutButtons() // We actually want to extend "pad" pixels off the right edge of the // screen, such that the rightmost button is aligned. - S32 segment_width = llround((F32)(width) / ((F32)count - 1.f)); + S32 segment_width = llround((F32)(width) / ((F32)count - 1.f)); // ignore chat button S32 btn_width = segment_width - pad; // Evenly space all views @@ -314,7 +314,7 @@ void LLToolBar::layoutButtons() btn_view->reshape(r.getWidth(), r.getHeight()); i--; } - } + } } diff --git a/linden/indra/newview/llurlsimstring.cpp b/linden/indra/newview/llurlsimstring.cpp index 8113326..5829e73 100644 --- a/linden/indra/newview/llurlsimstring.cpp +++ b/linden/indra/newview/llurlsimstring.cpp @@ -75,9 +75,9 @@ void LLURLSimString::setString(const LLString& sim_string) // static S32 LLURLSimString::parseGridIdx(const LLString& in_string, S32 idx0, S32* res, S32 max) { - if (idx0 == INT_MAX || in_string[idx0] != '/') + if (idx0 == LLString::npos || in_string[idx0] != '/') { - return INT_MAX; // parse error + return LLString::npos; // parse error } idx0++; LLString::size_type idx1 = in_string.find_first_of('/', idx0); diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index 81f5cc1..99bc98a 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp @@ -261,7 +261,6 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) spinner4->setVisible(FALSE); color_swatch->setVisible(FALSE); childSetVisible("val_text", FALSE); - childSetVisible("boolean_combo", FALSE); mComment->setText(LLString::null); if (controlp) @@ -299,6 +298,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) case TYPE_U32: spinner1->setVisible(TRUE); spinner1->setLabel(LLString("value")); // Debug, don't translate + childSetVisible("boolean_combo", FALSE); if (!spinner1->hasFocus()) { spinner1->setValue(sd); @@ -311,6 +311,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) case TYPE_S32: spinner1->setVisible(TRUE); spinner1->setLabel(LLString("value")); // Debug, don't translate + childSetVisible("boolean_combo", FALSE); if (!spinner1->hasFocus()) { spinner1->setValue(sd); @@ -323,6 +324,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) case TYPE_F32: spinner1->setVisible(TRUE); spinner1->setLabel(LLString("value")); // Debug, don't translate + childSetVisible("boolean_combo", FALSE); if (!spinner1->hasFocus()) { spinner1->setPrecision(3); @@ -346,6 +348,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) break; case TYPE_STRING: childSetVisible("val_text", TRUE); + childSetVisible("boolean_combo", FALSE); if (!childHasFocus("val_text")) { childSetValue("val_text", sd); @@ -353,6 +356,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) break; case TYPE_VEC3: { + childSetVisible("boolean_combo", FALSE); LLVector3 v; v.setValue(sd); spinner1->setVisible(TRUE); @@ -380,6 +384,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) } case TYPE_VEC3D: { + childSetVisible("boolean_combo", FALSE); LLVector3d v; v.setValue(sd); spinner1->setVisible(TRUE); @@ -407,6 +412,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) } case TYPE_RECT: { + childSetVisible("boolean_combo", FALSE); LLRect r; r.setValue(sd); spinner1->setVisible(TRUE); @@ -457,6 +463,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) } case TYPE_COL4: { + childSetVisible("boolean_combo", FALSE); LLColor4 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); @@ -478,6 +485,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) } case TYPE_COL3: { + childSetVisible("boolean_combo", FALSE); LLColor3 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); @@ -486,6 +494,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) } case TYPE_COL4U: { + childSetVisible("boolean_combo", FALSE); LLColor4U clr; clr.setValue(sd); color_swatch->setVisible(TRUE); diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp index 9c74b4a..68edca8 100644 --- a/linden/indra/newview/llviewerimagelist.cpp +++ b/linden/indra/newview/llviewerimagelist.cpp @@ -129,7 +129,8 @@ void LLViewerImageList::doPreloadImages() // Speeds up startup by 4-5 seconds. JC if (!gPreloadImages) return; - + + LLViewerImage* image; // Images listed here are immediately decoded, before the login screen. // Since this slows down perceived viewer startup time, only include // images here for buttons/checkboxes/etc. that are immediately visible. @@ -289,7 +290,8 @@ void LLViewerImageList::doPreloadImages() preloadUIImage("object_tube_active.tga", LLUUID::null, FALSE); preloadUIImage("pixiesmall.tga", LLUUID::null, TRUE); preloadUIImage("script_error.tga", LLUUID::null, TRUE); - preloadUIImage("silhouette.tga", LLUUID::null, TRUE); + image = preloadUIImage("silhouette.tga", LLUUID::null, TRUE); + if (image) image->setClamp(FALSE, FALSE); preloadUIImage("status_no_build.tga", LLUUID::null, FALSE); preloadUIImage("status_buy_currency.tga", LLUUID::null, FALSE); preloadUIImage("status_buy_currency_pressed.tga", LLUUID::null, FALSE); diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index bad2f1c..fcebe70 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -3513,7 +3513,8 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) gViewerStats->mSimTotalUnackedBytes.addValue(stat_value / 1024.f); break; default: - llwarns << "Unknown stat id" << stat_id << llendl; +// llwarns << "Unknown stat id" << stat_id << llendl; + break; } } diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index 6ec29ae..4730799 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp @@ -588,13 +588,13 @@ void LLViewerParcelMgr::deselectLand() mSelectedDwell = 0.f; - notifyObservers(); - // invalidate parcel selection so that existing users of this selection can clean up mCurrentParcelSelection->setParcel(NULL); mFloatingParcelSelection->setParcel(NULL); // create new parcel selection mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel); + + notifyObservers(); // Notify observers *after* changing the parcel selection } } @@ -1803,9 +1803,9 @@ void optionally_start_music(const LLString& music_url) // now only play music when you enter a new parcel if the control is in PLAY state // changed as part of SL-4878 - if ( gOverlayBar && gOverlayBar->musicPlaying() ) + if ( gOverlayBar && gOverlayBar->musicPlaying()) { - LLOverlayBar::musicPlay(NULL); + gAudiop->startInternetStream(music_url.c_str()); } } } @@ -1819,7 +1819,10 @@ void callback_start_music(S32 option, void* data) { gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); llinfos << "Starting first parcel music " << music_url << llendl; - LLOverlayBar::musicPlay(NULL); + if ( gOverlayBar && gOverlayBar->musicPlaying()) + { + gAudiop->startInternetStream(music_url->c_str()); + } } else { diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index a8ff246..b0577e6 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -3000,7 +3000,7 @@ BOOL LLViewerWindow::handlePerFrameHover() } // Update rectangles for the various toolbars - if (gOverlayBar && gNotifyBoxView && gConsole) + if (gOverlayBar && gNotifyBoxView && gConsole && gToolBar) { LLRect bar_rect(-1, STATUS_BAR_HEIGHT, getWindowWidth()+1, -1); @@ -3022,7 +3022,8 @@ BOOL LLViewerWindow::handlePerFrameHover() // snap floaters to top of chat bar/button strip LLView* chatbar_and_buttons = gOverlayBar->getChildByName("chatbar_and_buttons", TRUE); - if (chatbar_and_buttons) + // find top of chatbar and strate buttons, if either are visible + if (chatbar_and_buttons && !chatbar_and_buttons->getLocalBoundingRect().isNull()) { // convert top/left corner of chatbar/buttons container to gFloaterView-relative coordinates S32 top, left; @@ -3034,6 +3035,17 @@ BOOL LLViewerWindow::handlePerFrameHover() gFloaterView); gFloaterView->setSnapOffsetBottom(top); } + else if (gToolBar->getVisible()) + { + S32 top, left; + gToolBar->localPointToOtherView( + gToolBar->getLocalBoundingRect().mLeft, + gToolBar->getLocalBoundingRect().mTop, + &left, + &top, + gFloaterView); + gFloaterView->setSnapOffsetBottom(top); + } else { gFloaterView->setSnapOffsetBottom(0); diff --git a/linden/indra/newview/newview_vc8.vcproj b/linden/indra/newview/newview_vc8.vcproj index e68e59a..fc8912d 100644 --- a/linden/indra/newview/newview_vc8.vcproj +++ b/linden/indra/newview/newview_vc8.vcproj @@ -341,7 +341,7 @@ WarningLevel="3" WarnAsError="true" Detect64BitPortabilityProblems="false" - DebugInformationFormat="4" + DebugInformationFormat="3" /> SL Release link overlaps Quit when viewer resized +* Redocking the Contact list causes the communicate UI to get ugly +* Clicking on gestures button moves open windows +* Pressing escape does not cause the chat history or inventory windows to lose focus +* Toggling voice causes layout problems in toolbar +* Problems loading certain settings files +* Deutsch "System Default" is translated as "System Error" in language preferences +* Viewer crash just after login +* Linux compile issue with g++ 4 +* Debug settings overrides do not work for booleans. +* reverted floater_test.xml to empty floater. + +Release Notes for Second Life 1.19.0(1) February 7th, 2008 +===================================== +Changes: +* Added second set of translated strings +* Region info message is now a passive notification +* Changed default SL window size to 1000x700, to allow buttons in UI to have proper labels + +Fixes: +* Preferences > Web has truncated text in the Address: section +* Korean viewer crashes on startup +* Stand up button etc dissapear offscreen after using mouselook +* Client-readme-voice.txt missing from open source distribution +* Clicking on another users classifieds ad then closing asks you to save changes +* Checking to select a role does not enable the apply button +* Stray 'Done" on the Profile Web tab + + Release Notes for Second Life 1.19.0(0) February 1st, 2008 ===================================== New features and changes: diff --git a/linden/indra/newview/res/newViewRes.rc b/linden/indra/newview/res/newViewRes.rc index 7ae5595..909393b 100644 --- a/linden/indra/newview/res/newViewRes.rc +++ b/linden/indra/newview/res/newViewRes.rc @@ -228,8 +228,8 @@ TOOLPIPETTE CURSOR "toolpipette.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,19,0,0 - PRODUCTVERSION 1,19,0,0 + FILEVERSION 1,19,0,2 + PRODUCTVERSION 1,19,0,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -246,12 +246,12 @@ BEGIN BEGIN VALUE "CompanyName", "Linden Lab" VALUE "FileDescription", "Second Life" - VALUE "FileVersion", "1.19.0.0" + VALUE "FileVersion", "1.19.0.2" VALUE "InternalName", "Second Life" VALUE "LegalCopyright", "Copyright © 2001-2007, Linden Research, Inc." VALUE "OriginalFilename", "SecondLife.exe" VALUE "ProductName", "Second Life" - VALUE "ProductVersion", "1.19.0.0" + VALUE "ProductVersion", "1.19.0.2" END END BLOCK "VarFileInfo" diff --git a/linden/indra/newview/skins/xui/de/panel_preferences_general.xml b/linden/indra/newview/skins/xui/de/panel_preferences_general.xml index da066a1..8433c81 100644 --- a/linden/indra/newview/skins/xui/de/panel_preferences_general.xml +++ b/linden/indra/newview/skins/xui/de/panel_preferences_general.xml @@ -71,7 +71,7 @@ - Systemfehler + Betriebssystem-Einstellung English (Englisch) diff --git a/linden/indra/newview/skins/xui/en-us/floater_active_speakers.xml b/linden/indra/newview/skins/xui/en-us/floater_active_speakers.xml index 933baad..259cb3d 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_active_speakers.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_active_speakers.xml @@ -26,6 +26,7 @@ draw_stripes="false" multi_select="false" search_column="1" + sort_column="2" > diff --git a/linden/indra/newview/skins/xui/en-us/floater_test.xml b/linden/indra/newview/skins/xui/en-us/floater_test.xml index 71a3bd4..f6d38ff 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_test.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_test.xml @@ -1,45 +1,6 @@ -