summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/linux_crash_logger/llcrashloggerlinux.cpp2
-rw-r--r--indra/llcommon/indra_constants.h2
-rw-r--r--indra/llcommon/llapr.cpp4
-rw-r--r--indra/llcommon/llfasttimer.h2
-rw-r--r--indra/llcommon/llversionviewer.h2
-rwxr-xr-xindra/llcrashlogger/llcrashlogger.cpp20
-rw-r--r--indra/llui/llbutton.cpp12
-rw-r--r--indra/llui/llcombobox.cpp10
-rw-r--r--indra/llui/llcombobox.h1
-rw-r--r--indra/llui/llctrlselectioninterface.h1
-rw-r--r--indra/llui/llfloater.cpp22
-rw-r--r--indra/llui/llpanel.cpp34
-rw-r--r--indra/llui/llpanel.h1
-rw-r--r--indra/llui/llradiogroup.h1
-rw-r--r--indra/llui/llscrolllistctrl.cpp205
-rw-r--r--indra/llui/llscrolllistctrl.h16
-rw-r--r--indra/llui/llview.cpp35
-rw-r--r--indra/llwindow/llwindowwin32.cpp11
-rw-r--r--indra/llxml/llcontrol.cpp21
-rw-r--r--indra/newview/English.lproj/InfoPlist.strings4
-rw-r--r--indra/newview/Info-SecondLife.plist2
-rw-r--r--indra/newview/llappviewer.cpp166
-rw-r--r--indra/newview/llappviewer.h18
-rw-r--r--indra/newview/llappviewermacosx.cpp5
-rw-r--r--indra/newview/llfasttimerview.cpp20
-rw-r--r--indra/newview/llfilepicker.cpp2
-rw-r--r--indra/newview/llfloaterfriends.cpp2
-rw-r--r--indra/newview/llfloaterworldmap.cpp33
-rw-r--r--indra/newview/llgroupmgr.cpp167
-rw-r--r--indra/newview/llgroupmgr.h41
-rw-r--r--indra/newview/llimpanel.cpp6
-rw-r--r--indra/newview/llnamelistctrl.cpp5
-rw-r--r--indra/newview/lloverlaybar.cpp24
-rw-r--r--indra/newview/lloverlaybar.h7
-rw-r--r--indra/newview/llpanelavatar.cpp6
-rw-r--r--indra/newview/llpanelclassified.cpp38
-rw-r--r--indra/newview/llpanelclassified.h1
-rw-r--r--indra/newview/llpanelgroupgeneral.cpp5
-rw-r--r--indra/newview/llpanelgroupgeneral.h2
-rw-r--r--indra/newview/llpanelgroupinvite.cpp6
-rw-r--r--indra/newview/llpanelgrouproles.cpp109
-rw-r--r--indra/newview/llpanelgrouproles.h3
-rw-r--r--indra/newview/llpanellogin.cpp6
-rw-r--r--indra/newview/llselectmgr.cpp19
-rw-r--r--indra/newview/llstartup.cpp6
-rw-r--r--indra/newview/llstatusbar.cpp2
-rw-r--r--indra/newview/lltexturecache.cpp6
-rw-r--r--indra/newview/lltoolbar.cpp4
-rw-r--r--indra/newview/llviewermessage.cpp16
-rw-r--r--indra/newview/llviewerparcelmgr.cpp9
-rw-r--r--indra/newview/llviewerwindow.cpp16
-rw-r--r--indra/win_crash_logger/llcrashloggerwindows.cpp4
52 files changed, 622 insertions, 540 deletions
diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp
index 26a8f0cb2a..e0a6e2608e 100644
--- a/indra/linux_crash_logger/llcrashloggerlinux.cpp
+++ b/indra/linux_crash_logger/llcrashloggerlinux.cpp
@@ -55,8 +55,6 @@
static const char dialog_text[] =
"Second Life appears to have crashed or frozen last time it ran.\n"
"This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, all of which are used for debugging purposes only.\n"
-"In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help!\n"
-"This report is NOT read by Customer Support. If you have billing or other questions, contact support by visiting http://www.secondlife.com/support\n"
"\n"
"Send crash report?";
diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index 46f46e2433..a0fb086029 100644
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -340,7 +340,7 @@ const U32 MAP_ITEM_CLASSIFIED = 0x08;
// Crash reporter behavior
const char* const CRASH_SETTINGS_FILE = "crash_settings.xml";
-const char* const CRASH_BEHAVIOR_SETTING = "CrashLogBehavior";
+const char* const CRASH_BEHAVIOR_SETTING = "CrashSubmitBehavior";
const S32 CRASH_BEHAVIOR_ASK = 0;
const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1;
const S32 CRASH_BEHAVIOR_NEVER_SEND = 2;
diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp
index 861cf814e2..3512f2fb17 100644
--- a/indra/llcommon/llapr.cpp
+++ b/indra/llcommon/llapr.cpp
@@ -293,6 +293,7 @@ bool ll_apr_file_remove(const LLString& filename, apr_pool_t* pool)
if (s != APR_SUCCESS)
{
lldebugs << "ll_apr_file_remove failed on file: " << filename << llendl;
+ ll_apr_warn_status(s);
return false;
}
return true;
@@ -306,6 +307,7 @@ bool ll_apr_file_rename(const LLString& filename, const LLString& newname, apr_p
if (s != APR_SUCCESS)
{
lldebugs << "ll_apr_file_rename failed on file: " << filename << llendl;
+ ll_apr_warn_status(s);
return false;
}
return true;
@@ -362,6 +364,7 @@ bool ll_apr_dir_make(const LLString& dirname, apr_pool_t* pool)
if (s != APR_SUCCESS)
{
lldebugs << "ll_apr_dir_make failed on file: " << dirname << llendl;
+ ll_apr_warn_status(s);
return false;
}
return true;
@@ -375,6 +378,7 @@ bool ll_apr_dir_remove(const LLString& dirname, apr_pool_t* pool)
if (s != APR_SUCCESS)
{
lldebugs << "ll_apr_dir_remove failed on file: " << dirname << llendl;
+ ll_apr_warn_status(s);
return false;
}
return true;
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 08edce4bc4..3c7232daa8 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -92,6 +92,8 @@ public:
// newview specific
FTM_MESSAGES,
+ FTM_MOUSEHANDLER,
+ FTM_KEYHANDLER,
FTM_REBUILD,
FTM_STATESORT,
FTM_STATESORT_DRAWABLE,
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 415f17f068..c5bac32e91 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -35,7 +35,7 @@
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 19;
const S32 LL_VERSION_PATCH = 0;
-const S32 LL_VERSION_BUILD = 0;
+const S32 LL_VERSION_BUILD = 2;
const char * const LL_CHANNEL = "Second Life Release";
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index 04b7d688e5..9ea0cef7be 100755
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -83,7 +83,9 @@ void LLCrashLoggerText::updateApplication(LLString message)
}
LLCrashLogger::LLCrashLogger() :
-mSentCrashLogs(false)
+ mCrashBehavior(CRASH_BEHAVIOR_ASK),
+ mCrashInPreviousExec(false),
+ mSentCrashLogs(false)
{
}
@@ -206,8 +208,7 @@ S32 LLCrashLogger::loadCrashBehaviorSetting()
bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior)
{
- if (crash_behavior < CRASH_BEHAVIOR_ASK) return false;
- if (crash_behavior > CRASH_BEHAVIOR_NEVER_SEND) return false;
+ if (crash_behavior != CRASH_BEHAVIOR_ASK && crash_behavior != CRASH_BEHAVIOR_ALWAYS_SEND) return false;
mCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior);
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE);
@@ -290,18 +291,7 @@ bool LLCrashLogger::init()
llinfos << "Show the user dialog" << llendl;
mCrashBehavior = CRASH_BEHAVIOR_ASK;
}
-
- LLSD server = getOption("user");
- if(server.isDefined())
- {
- mGridName = server.asString();
- llinfos << "Got userserver " << mGridName << llendl;
- }
- else
- {
- mGridName = "agni";
- }
-
+
LLSD name = getOption("name");
if(name.isDefined())
{
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 6c27ccc037..435e1d1701 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -956,37 +956,37 @@ S32 round_up(S32 grid, S32 value)
void LLButton::setImageUnselected(const LLString &image_name)
{
- setImageUnselected(LLUI::getUIImageByName(image_name));
+ setImageUnselected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name));
mImageUnselectedName = image_name;
}
void LLButton::setImageSelected(const LLString &image_name)
{
- setImageSelected(LLUI::getUIImageByName(image_name));
+ setImageSelected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name));
mImageSelectedName = image_name;
}
void LLButton::setImageHoverSelected(const LLString &image_name)
{
- setImageHoverSelected(LLUI::getUIImageByName(image_name));
+ setImageHoverSelected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name));
mImageHoverSelectedName = image_name;
}
void LLButton::setImageHoverUnselected(const LLString &image_name)
{
- setImageHoverUnselected(LLUI::getUIImageByName(image_name));
+ setImageHoverUnselected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name));
mImageHoverUnselectedName = image_name;
}
void LLButton::setImageDisabled(const LLString &image_name)
{
- setImageDisabled(LLUI::getUIImageByName(image_name));
+ setImageDisabled(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name));
mImageDisabledName = image_name;
}
void LLButton::setImageDisabledSelected(const LLString &image_name)
{
- setImageDisabledSelected(LLUI::getUIImageByName(image_name));
+ setImageDisabledSelected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name));
mImageDisabledSelectedName = image_name;
}
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 250ca523d2..ca02305f32 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -642,12 +642,16 @@ void LLComboBox::showList()
mList->setFocus(TRUE);
+ // register ourselves as a "top" control
+ // effectively putting us into a special draw layer
+ // and not affecting the bounding rectangle calculation
+ gFocusMgr.setTopCtrl(this);
+
// Show the list and push the button down
mButton->setToggleState(TRUE);
mList->setVisible(TRUE);
setUseBoundingRect(TRUE);
- gFocusMgr.setTopCtrl(this);
}
void LLComboBox::hideList()
@@ -1081,6 +1085,10 @@ BOOL LLComboBox::operateOnAll(EOperation op)
return FALSE;
}
+BOOL LLComboBox::selectItemRange( S32 first, S32 last )
+{
+ return mList->selectItemRange(first, last);
+}
//
diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h
index 13c2455d61..0d6c3aef2e 100644
--- a/indra/llui/llcombobox.h
+++ b/indra/llui/llcombobox.h
@@ -156,6 +156,7 @@ public:
virtual BOOL getCanSelect() const { return TRUE; }
virtual BOOL selectFirstItem() { return setCurrentByIndex(0); }
virtual BOOL selectNthItem( S32 index ) { return setCurrentByIndex(index); }
+ virtual BOOL selectItemRange( S32 first, S32 last );
virtual S32 getFirstSelectedIndex() const { return getCurrentIndex(); }
virtual BOOL setCurrentByID( const LLUUID& id );
virtual LLUUID getCurrentID() const; // LLUUID::null if no items in menu
diff --git a/indra/llui/llctrlselectioninterface.h b/indra/llui/llctrlselectioninterface.h
index e43e20a4c0..eb89a0833d 100644
--- a/indra/llui/llctrlselectioninterface.h
+++ b/indra/llui/llctrlselectioninterface.h
@@ -58,6 +58,7 @@ public:
virtual BOOL selectFirstItem() = 0;
virtual BOOL selectNthItem( S32 index ) = 0;
+ virtual BOOL selectItemRange( S32 first, S32 last ) = 0;
virtual S32 getFirstSelectedIndex() const = 0;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 5c1f8429d1..68719bea40 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1343,21 +1343,7 @@ void LLFloater::draw()
}
}
- if( getDefaultButton() )
- {
- if (gFocusMgr.childHasKeyboardFocus( this ) && getDefaultButton()->getEnabled())
- {
- LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus();
- // is this button a direct descendent and not a nested widget (e.g. checkbox)?
- BOOL focus_is_child_button = focus_ctrl->getWidgetType() == WIDGET_TYPE_BUTTON && focus_ctrl->getParent() == this;
- // only enable default button when current focus is not a button
- getDefaultButton()->setBorderEnabled(!focus_is_child_button);
- }
- else
- {
- getDefaultButton()->setBorderEnabled(FALSE);
- }
- }
+ LLPanel::updateDefaultBtn();
// draw children
LLView* focused_child = gFocusMgr.getKeyboardFocus();
@@ -1368,6 +1354,7 @@ void LLFloater::draw()
focused_child->setVisible(FALSE);
}
+ // don't call LLPanel::draw() since we've implemented custom background rendering
LLView::draw();
if( isBackgroundVisible() )
@@ -2568,6 +2555,11 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
{
mTabContainer->selectTabPanel(floaterp);
}
+ else
+ {
+ // reassert visible tab (hiding new floater if necessary)
+ mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex());
+ }
floaterp->setHost(this);
if (isMinimized())
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 6554a25dcf..4c16683704 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -211,6 +211,11 @@ void LLPanel::draw()
}
}
+ updateDefaultBtn();
+}
+
+void LLPanel::updateDefaultBtn()
+{
if( mDefaultBtn)
{
if (gFocusMgr.childHasKeyboardFocus( this ) && mDefaultBtn->getEnabled())
@@ -353,6 +358,13 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent )
if( getVisible() && getEnabled() &&
gFocusMgr.childHasKeyboardFocus(this) && !called_from_parent )
{
+ // handle user hitting ESC to defocus
+ if (key == KEY_ESCAPE)
+ {
+ gFocusMgr.setKeyboardFocus(NULL);
+ return TRUE;
+ }
+
LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus();
// If we have a default button, click it when
// return is pressed, unless current focus is a return-capturing button
@@ -1298,6 +1310,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
}
}
}
+ layout_stackp->updateLayout();
return layout_stackp;
}
@@ -1408,10 +1421,14 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
{
// panels that are not fully visible do not count towards shrink headroom
if ((*panel_it)->mVisibleAmt < 1.f)
+ {
continue;
+ }
// if currently resizing a panel or the panel is flagged as not automatically resizing
// only track total available headroom, but don't use it for automatic resize logic
- if ((*panel_it)->mResizeBar->hasMouseCapture() || (!(*panel_it)->mAutoResize && !force_resize))
+ if ((*panel_it)->mResizeBar->hasMouseCapture()
+ || (!(*panel_it)->mAutoResize
+ && !force_resize))
{
if (mOrientation == HORIZONTAL)
{
@@ -1464,7 +1481,9 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
S32 delta_size = 0;
// if panel can automatically resize (not animating, and resize flag set)...
- if ((*panel_it)->mVisibleAmt == 1.f && (force_resize || (*panel_it)->mAutoResize) && !(*panel_it)->mResizeBar->hasMouseCapture())
+ if ((*panel_it)->mVisibleAmt == 1.f
+ && (force_resize || (*panel_it)->mAutoResize)
+ && !(*panel_it)->mResizeBar->hasMouseCapture())
{
if (mOrientation == HORIZONTAL)
{
@@ -1472,7 +1491,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
if (pixels_to_distribute < 0)
{
// shrink proportionally to amount over minimum
- delta_size = llround((F32)pixels_to_distribute * (F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available);
+ delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * (F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available) : 0;
}
else
{
@@ -1491,7 +1510,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
if (pixels_to_distribute < 0)
{
// shrink proportionally to amount over minimum
- delta_size = llround((F32)pixels_to_distribute * (F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available);
+ delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * (F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available) : 0;
}
else
{
@@ -1583,9 +1602,10 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
}
// not enough room to fit existing contents
- if (!force_resize
- && ((cur_y != -mPanelSpacing)
- || (cur_x != getRect().getWidth() + mPanelSpacing)))
+ if (force_resize == FALSE
+ // layout did not complete by reaching target position
+ && ((mOrientation == VERTICAL && cur_y != -mPanelSpacing)
+ || (mOrientation == HORIZONTAL && cur_x != getRect().getWidth() + mPanelSpacing)))
{
// do another layout pass with all stacked elements contributing
// even those that don't usually resize
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index 2fdf95df58..6c2df683e4 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -119,6 +119,7 @@ public:
BOOL isBackgroundOpaque() const { return mBgOpaque; }
void setDefaultBtn(LLButton* btn = NULL);
void setDefaultBtn(const LLString& id);
+ void updateDefaultBtn();
void setLabel(const LLStringExplicit& label) { mLabel = label; }
LLString getLabel() const { return mLabel; }
diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h
index d35bd741d7..3e01e8223c 100644
--- a/indra/llui/llradiogroup.h
+++ b/indra/llui/llradiogroup.h
@@ -121,6 +121,7 @@ public:
/*virtual*/ BOOL getCanSelect() const { return TRUE; }
/*virtual*/ BOOL selectFirstItem() { return setSelectedIndex(0); }
/*virtual*/ BOOL selectNthItem( S32 index ) { return setSelectedIndex(index); }
+ /*virtual*/ BOOL selectItemRange( S32 first, S32 last ) { return setSelectedIndex(first); }
/*virtual*/ S32 getFirstSelectedIndex() const { return getSelectedIndex(); }
/*virtual*/ BOOL setCurrentByID( const LLUUID& id );
/*virtual*/ LLUUID getCurrentID() const; // LLUUID::null if no items in menu
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 94053980e6..4227a34777 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -220,22 +220,14 @@ LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font,
: LLScrollListCell(width),
mText( text ),
mFont( font ),
+ mColor(color),
+ mUseColor(use_color),
mFontStyle( font_style ),
mFontAlignment( font_alignment ),
mVisible( visible ),
mHighlightCount( 0 ),
mHighlightOffset( 0 )
{
- if (use_color)
- {
- mColor = new LLColor4();
- mColor->setVec(color);
- }
- else
- {
- mColor = NULL;
- }
-
sCount++;
// initialize rounded rect image
@@ -248,7 +240,6 @@ LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font,
LLScrollListText::~LLScrollListText()
{
sCount--;
- delete mColor;
}
S32 LLScrollListText::getContentWidth() const
@@ -259,11 +250,8 @@ S32 LLScrollListText::getContentWidth() const
void LLScrollListText::setColor(const LLColor4& color)
{
- if (!mColor)
- {
- mColor = new LLColor4();
- }
- *mColor = color;
+ mColor = color;
+ mUseColor = TRUE;
}
void LLScrollListText::setText(const LLStringExplicit& text)
@@ -279,14 +267,14 @@ void LLScrollListText::setValue(const LLSD& text)
void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color) const
{
- const LLColor4* display_color;
- if (mColor)
+ LLColor4 display_color;
+ if (mUseColor)
{
display_color = mColor;
}
else
{
- display_color = &color;
+ display_color = color;
}
if (mHighlightCount > 0)
@@ -333,7 +321,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
}
mFont->render(mText.getWString(), 0,
start_x, 2.f,
- *display_color,
+ display_color,
mFontAlignment,
LLFontGL::BOTTOM,
mFontStyle,
@@ -524,6 +512,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect,
mNeedsScroll(FALSE),
mCanSelect(TRUE),
mDisplayColumnHeaders(FALSE),
+ mColumnsDirty(FALSE),
mMaxItemCount(INT_MAX),
mMaxContentWidth(0),
mBackgroundVisible( TRUE ),
@@ -636,7 +625,6 @@ void LLScrollListCtrl::clearRows()
mScrollLines = 0;
mLastSelected = NULL;
- calcMaxContentWidth(NULL);
updateLayout();
mDirty = FALSE;
}
@@ -768,7 +756,7 @@ void LLScrollListCtrl::updateLayout()
mScrollbar->setDocSize( getItemCount() );
mScrollbar->setVisible(scrollbar_visible);
- updateColumns();
+ dirtyColumns();
}
// Attempt to size the control to show all items.
@@ -846,7 +834,6 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
}
updateLineHeightInsert(item);
- calcMaxContentWidth(item);
updateLayout();
}
@@ -854,17 +841,14 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
return not_too_big;
}
-void LLScrollListCtrl::calcMaxContentWidth(LLScrollListItem* added_item)
+void LLScrollListCtrl::calcColumnWidths()
{
const S32 HEADING_TEXT_PADDING = 30;
const S32 COLUMN_TEXT_PADDING = 20;
- if (added_item == NULL)
- {
- mMaxContentWidth = 0;
- }
+ mMaxContentWidth = 0;
- S32 item_content_width = 0;
+ S32 max_item_width = 0;
ordered_columns_t::iterator column_itor;
for (column_itor = mColumnsIndexed.begin(); column_itor != mColumnsIndexed.end(); ++column_itor)
@@ -872,31 +856,37 @@ void LLScrollListCtrl::calcMaxContentWidth(LLScrollListItem* added_item)
LLScrollListColumn* column = *column_itor;
if (!column) continue;
- if (!added_item)
+ // update column width
+ S32 new_width = column->mWidth;
+ if (column->mRelWidth >= 0)
{
- // update on all items
- column->mMaxContentWidth = column->mHeader ? LLFontGL::sSansSerifSmall->getWidth(column->mLabel) + mColumnPadding + HEADING_TEXT_PADDING : 0;
- item_list::iterator iter;
- for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
- {
- LLScrollListCell* cellp = (*iter)->getColumn(column->mIndex);
- if (!cellp) continue;
+ new_width = (S32)llround(column->mRelWidth*mItemListRect.getWidth());
+ }
+ else if (column->mDynamicWidth)
+ {
+ new_width = (mItemListRect.getWidth() - mTotalStaticColumnWidth) / mNumDynamicWidthColumns;
+ }
- column->mMaxContentWidth = llmax(LLFontGL::sSansSerifSmall->getWidth(cellp->getValue().asString()) + mColumnPadding + COLUMN_TEXT_PADDING, column->mMaxContentWidth);
- }
+ if (new_width != column->mWidth)
+ {
+ column->mWidth = new_width;
}
- else
+
+ // update max content width for this column, by looking at all items
+ column->mMaxContentWidth = column->mHeader ? LLFontGL::sSansSerifSmall->getWidth(column->mLabel) + mColumnPadding + HEADING_TEXT_PADDING : 0;
+ item_list::iterator iter;
+ for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
{
- LLScrollListCell* cellp = added_item->getColumn(column->mIndex);
+ LLScrollListCell* cellp = (*iter)->getColumn(column->mIndex);
if (!cellp) continue;
column->mMaxContentWidth = llmax(LLFontGL::sSansSerifSmall->getWidth(cellp->getValue().asString()) + mColumnPadding + COLUMN_TEXT_PADDING, column->mMaxContentWidth);
}
- item_content_width += column->mMaxContentWidth;
+ max_item_width += column->mMaxContentWidth;
}
- mMaxContentWidth = llmax(mMaxContentWidth, item_content_width);
+ mMaxContentWidth = max_item_width;
}
const S32 SCROLL_LIST_ROW_PAD = 2;
@@ -932,29 +922,9 @@ void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp)
void LLScrollListCtrl::updateColumns()
{
- mColumnsIndexed.resize(mColumns.size());
-
- std::map<LLString, LLScrollListColumn>::iterator column_itor;
- for (column_itor = mColumns.begin(); column_itor != mColumns.end(); ++column_itor)
- {
- LLScrollListColumn *column = &column_itor->second;
- S32 new_width = column->mWidth;
- if (column->mRelWidth >= 0)
- {
- new_width = (S32)llround(column->mRelWidth*mItemListRect.getWidth());
- }
- else if (column->mDynamicWidth)
- {
- new_width = (mItemListRect.getWidth() - mTotalStaticColumnWidth) / mNumDynamicWidthColumns;
- }
-
- if (new_width != column->mWidth)
- {
- column->mWidth = new_width;
- }
- mColumnsIndexed[column_itor->second.mIndex] = column;
- }
+ calcColumnWidths();
+ // propagate column widths to individual cells
item_list::iterator iter;
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
{
@@ -969,7 +939,7 @@ void LLScrollListCtrl::updateColumns()
}
}
- // update headers
+ // update column headers
std::vector<LLScrollListColumn*>::iterator column_ordered_it;
S32 left = mItemListRect.mLeft;
LLColumnHeader* last_header = NULL;
@@ -1004,6 +974,7 @@ void LLScrollListCtrl::updateColumns()
}
}
+ //FIXME: stretch the entire last column if it is resizable (gestures windows shows truncated text in last column)
// expand last column header we encountered to full list width
if (last_header)
{
@@ -1061,28 +1032,42 @@ BOOL LLScrollListCtrl::selectFirstItem()
return success;
}
-
+// Deselects all other items
+// virtual
BOOL LLScrollListCtrl::selectNthItem( S32 target_index )
{
- if (mItemList.empty()) return FALSE;
+ return selectItemRange(target_index, target_index);
+}
- // Deselects all other items
- BOOL success = FALSE;
- S32 index = 0;
+// virtual
+BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index )
+{
+ if (mItemList.empty())
+ {
+ return FALSE;
+ }
- target_index = llclamp(target_index, 0, (S32)mItemList.size() - 1);
+ S32 listlen = (S32)mItemList.size();
+ first_index = llclamp(first_index, 0, listlen-1);
+
+ if (last_index < 0)
+ last_index = listlen-1;
+ else
+ last_index = llclamp(last_index, first_index, listlen-1);
- item_list::iterator iter;
- for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ BOOL success = FALSE;
+ S32 index = 0;
+ for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); iter++)
{
LLScrollListItem *itemp = *iter;
- if( target_index == index )
+ if( index >= first_index && index <= last_index )
{
if( itemp->getEnabled() )
{
- selectItem(itemp);
+ selectItem(itemp, FALSE);
success = TRUE;
- mOriginalSelection = target_index;
+ if (!success)
+ mOriginalSelection = first_index;
}
}
else
@@ -1131,7 +1116,7 @@ void LLScrollListCtrl::swapWithPrevious(S32 index)
void LLScrollListCtrl::deleteSingleItem(S32 target_index)
{
- if (target_index >= (S32)mItemList.size())
+ if (target_index < 0 || target_index >= (S32)mItemList.size())
{
return;
}
@@ -1144,7 +1129,7 @@ void LLScrollListCtrl::deleteSingleItem(S32 target_index)
}
delete itemp;
mItemList.erase(mItemList.begin() + target_index);
- calcMaxContentWidth(NULL);
+ dirtyColumns();
}
//FIXME: refactor item deletion
@@ -1169,7 +1154,7 @@ void LLScrollListCtrl::deleteItems(const LLSD& sd)
}
}
- calcMaxContentWidth(NULL);
+ dirtyColumns();
}
void LLScrollListCtrl::deleteSelectedItems()
@@ -1189,7 +1174,7 @@ void LLScrollListCtrl::deleteSelectedItems()
}
}
mLastSelected = NULL;
- calcMaxContentWidth(NULL);
+ dirtyColumns();
}
void LLScrollListCtrl::highlightNthItem(S32 target_index)
@@ -1243,7 +1228,7 @@ S32 LLScrollListCtrl::getItemIndex( LLScrollListItem* target_item ) const
return -1;
}
-S32 LLScrollListCtrl::getItemIndex( LLUUID& target_id ) const
+S32 LLScrollListCtrl::getItemIndex( const LLUUID& target_id ) const
{
S32 index = 0;
item_list::const_iterator iter;
@@ -1730,6 +1715,12 @@ void LLScrollListCtrl::draw()
gl_rect_2d(background);
}
+ if (mColumnsDirty)
+ {
+ updateColumns();
+ mColumnsDirty = FALSE;
+ }
+
drawItems();
if (mBorder)
@@ -1996,9 +1987,8 @@ BOOL LLScrollListCtrl::handleClick(S32 x, S32 y, MASK mask)
gFocusMgr.setMouseCapture(this);
mNeedsScroll = TRUE;
}
- // otherwise we already have this item selected
- // so propagate state of cell to rest of selected column
- else
+
+ // propagate state of cell to rest of selected column
{
// propagate value of this cell to other selected items
// and commit the respective widgets
@@ -2534,6 +2524,23 @@ void LLScrollListCtrl::sortItems()
setSorted(TRUE);
}
+void LLScrollListCtrl::dirtyColumns()
+{
+ mColumnsDirty = TRUE;
+
+ // need to keep mColumnsIndexed up to date
+ // just in case someone indexes into it immediately
+ mColumnsIndexed.resize(mColumns.size());
+
+ std::map<LLString, LLScrollListColumn>::iterator column_itor;
+ for (column_itor = mColumns.begin(); column_itor != mColumns.end(); ++column_itor)
+ {
+ LLScrollListColumn *column = &column_itor->second;
+ mColumnsIndexed[column_itor->second.mIndex] = column;
+ }
+}
+
+
S32 LLScrollListCtrl::getScrollPos() const
{
return mScrollbar->getDocPos();
@@ -2724,6 +2731,12 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
S32 search_column = 0;
node->getAttributeS32("search_column", search_column);
+ S32 sort_column = -1;
+ node->getAttributeS32("sort_column", sort_column);
+
+ BOOL sort_ascending = TRUE;
+ node->getAttributeBOOL("sort_ascending", sort_ascending);
+
LLUICtrlCallback callback = NULL;
LLScrollListCtrl* scroll_list = new LLScrollListCtrl(
@@ -2748,6 +2761,11 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
scroll_list->setSearchColumn(search_column);
+ if (sort_column >= 0)
+ {
+ scroll_list->sortByColumn(sort_column, sort_ascending);
+ }
+
LLSD columns;
S32 index = 0;
LLXMLNodePtr child;
@@ -3010,7 +3028,7 @@ void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos)
}
}
- updateColumns();
+ dirtyColumns();
}
// static
@@ -3241,13 +3259,14 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p
col_index++;
}
- S32 num_columns = mColumns.size();
- for (S32 column = 0; column < num_columns; ++column)
+ // add dummy cells for missing columns
+ for (column_map_t::iterator column_it = mColumns.begin(); column_it != mColumns.end(); ++column_it)
{
- if (new_item->getColumn(column) == NULL)
+ S32 column_idx = column_it->second.mIndex;
+ if (new_item->getColumn(column_idx) == NULL)
{
- LLScrollListColumn* column_ptr = mColumnsIndexed[column];
- new_item->setColumn(column, new LLScrollListText("", gResMgr->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL));
+ LLScrollListColumn* column_ptr = &column_it->second;
+ new_item->setColumn(column_idx, new LLScrollListText("", gResMgr->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL));
}
}
@@ -3649,7 +3668,7 @@ LLView* LLColumnHeader::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_d
void LLColumnHeader::userSetShape(const LLRect& new_rect)
{
S32 new_width = new_rect.getWidth();
- S32 delta_width = new_width - getRect().getWidth();
+ S32 delta_width = new_width - (getRect().getWidth() /*+ mColumn->mParentCtrl->getColumnPadding()*/);
if (delta_width != 0)
{
@@ -3721,6 +3740,8 @@ void LLColumnHeader::userSetShape(const LLRect& new_rect)
}
// tell scroll list to layout columns again
+ // do immediate update to get proper feedback to resize handle
+ // which needs to know how far the resize actually went
mColumn->mParentCtrl->updateColumns();
}
}
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index d889512ee6..6edb2939dd 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -120,7 +120,8 @@ public:
private:
LLUIString mText;
const LLFontGL* mFont;
- LLColor4* mColor;
+ LLColor4 mColor;
+ U8 mUseColor;
U8 mFontStyle;
LLFontGL::HAlign mFontAlignment;
BOOL mVisible;
@@ -467,6 +468,7 @@ public:
BOOL handleClick(S32 x, S32 y, MASK mask);
BOOL selectFirstItem();
BOOL selectNthItem( S32 index );
+ BOOL selectItemRange( S32 first, S32 last );
BOOL selectItemAt(S32 x, S32 y, MASK mask);
void deleteSingleItem( S32 index );
@@ -486,7 +488,7 @@ public:
virtual BOOL getCanSelect() const { return mCanSelect; }
S32 getItemIndex( LLScrollListItem* item ) const;
- S32 getItemIndex( LLUUID& item_id ) const;
+ S32 getItemIndex( const LLUUID& item_id ) const;
LLScrollListItem* addCommentText( const LLString& comment_text, EAddPosition pos = ADD_BOTTOM);
LLScrollListItem* addSeparator(EAddPosition pos);
@@ -587,7 +589,7 @@ public:
static void onClickColumn(void *userdata);
void updateColumns();
- void calcMaxContentWidth(LLScrollListItem* changed_item);
+ void calcColumnWidths();
S32 getMaxContentWidth() { return mMaxContentWidth; }
void setDisplayHeading(BOOL display);
@@ -616,6 +618,9 @@ public:
S32 selectMultiple( LLDynamicArray<LLUUID> ids );
void sortItems();
+ // manually call this whenever editing list items in place to flag need for resorting
+ void setSorted(BOOL sorted) { mSorted = sorted; }
+ void dirtyColumns(); // some operation has potentially affected column layout or ordering
protected:
// "Full" interface: use this when you're creating a list that has one or more of the following:
@@ -649,7 +654,6 @@ private:
void selectItem(LLScrollListItem* itemp, BOOL single_select = TRUE);
void deselectItem(LLScrollListItem* itemp);
void commitIfChanged();
- void setSorted(BOOL sorted) { mSorted = sorted; }
BOOL setSort(S32 column, BOOL ascending);
@@ -670,6 +674,7 @@ private:
BOOL mNeedsScroll;
BOOL mCanSelect;
BOOL mDisplayColumnHeaders;
+ BOOL mColumnsDirty;
item_list mItemList;
@@ -710,7 +715,8 @@ private:
BOOL mSorted;
- std::map<LLString, LLScrollListColumn> mColumns;
+ typedef std::map<LLString, LLScrollListColumn> column_map_t;
+ column_map_t mColumns;
BOOL mDirty;
S32 mOriginalSelection;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 1014f17898..56e24085ac 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -760,18 +760,10 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
}
}
- if( !handled && !called_from_parent)
+ if( !handled && !called_from_parent && mParentView)
{
- if (mIsFocusRoot)
- {
- // stop processing at focus root
- handled = FALSE;
- }
- else if (mParentView)
- {
- // Upward traversal
- handled = mParentView->handleKey( key, mask, FALSE );
- }
+ // Upward traversal
+ handled = mParentView->handleKey( key, mask, FALSE );
}
return handled;
}
@@ -806,18 +798,10 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
}
- if (!handled && !called_from_parent)
+ if (!handled && !called_from_parent && mParentView)
{
- if (mIsFocusRoot)
- {
- // stop processing at focus root
- handled = FALSE;
- }
- else if(mParentView)
- {
- // Upward traversal
- handled = mParentView->handleUnicodeChar(uni_char, FALSE);
- }
+ // Upward traversal
+ handled = mParentView->handleUnicodeChar(uni_char, FALSE);
}
return handled;
@@ -1448,7 +1432,12 @@ void LLView::updateBoundingRect()
for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
{
LLView* childp = *child_it;
- if (!childp->getVisible()) continue;
+ // ignore invisible and "top" children when calculating bounding rect
+ // such as combobox popups
+ if (!childp->getVisible() || childp == gFocusMgr.getTopCtrl())
+ {
+ continue;
+ }
LLRect child_bounding_rect = childp->getBoundingRect();
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 7e93d3ecf4..3c270d9175 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2201,6 +2201,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_SYSKEYUP:
eat_keystroke = FALSE;
case WM_KEYUP:
+ {
+ LLFastTimer t2(LLFastTimer::FTM_KEYHANDLER);
+
if (gDebugWindowProc)
{
llinfos << "Debug WindowProc WM_KEYUP "
@@ -2214,7 +2217,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// pass on to windows
break;
-
+ }
case WM_IME_SETCONTEXT:
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2283,6 +2286,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_LBUTTONDOWN:
{
+ LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2340,6 +2344,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_LBUTTONUP:
{
+ LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
//if (gDebugClicks)
//{
// llinfos << "WndProc left button up" << llendl;
@@ -2370,6 +2375,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
{
+ LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2400,6 +2406,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONUP:
{
+ LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
// Because we move the cursor position in the app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
@@ -2426,6 +2433,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_MBUTTONDOWN:
// case WM_MBUTTONDBLCLK:
{
+ LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2456,6 +2464,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_MBUTTONUP:
{
+ LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
// Because we move the cursor position in tllviewerhe app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 11f3c132bb..78b2181e86 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -1235,12 +1235,25 @@ void LLControlGroup::resetToDefaults()
}
//============================================================================
-// FIrst-use
+// First-use
+static LLString get_warn_name(const LLString& name)
+{
+ LLString warnname = "Warn" + name;
+ for (LLString::iterator iter = warnname.begin(); iter != warnname.end(); ++iter)
+ {
+ char c = *iter;
+ if (!isalnum(c))
+ {
+ *iter = '_';
+ }
+ }
+ return warnname;
+}
void LLControlGroup::addWarning(const LLString& name)
{
- LLString warnname = "Warn" + name;
+ LLString warnname = get_warn_name(name);
if(!mNameTable[warnname])
{
LLString comment = LLString("Enables ") + name + LLString(" warning dialog");
@@ -1251,13 +1264,13 @@ void LLControlGroup::addWarning(const LLString& name)
BOOL LLControlGroup::getWarning(const LLString& name)
{
- LLString warnname = "Warn" + name;
+ LLString warnname = get_warn_name(name);
return getBOOL(warnname);
}
void LLControlGroup::setWarning(const LLString& name, BOOL val)
{
- LLString warnname = "Warn" + name;
+ LLString warnname = get_warn_name(name);
setBOOL(warnname, val);
}
diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings
index 8944cb8d81..76c69153c9 100644
--- a/indra/newview/English.lproj/InfoPlist.strings
+++ b/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/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist
index 5956f9bd8d..c93fbe0986 100644
--- a/indra/newview/Info-SecondLife.plist
+++ b/indra/newview/Info-SecondLife.plist
@@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
- <string>1.19.0.0</string>
+ <string>1.19.0.2</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 075a7089de..fe1d93c7bc 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -252,7 +252,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;
@@ -316,6 +316,7 @@ BOOL gRandomizeFramerate = FALSE;
BOOL gPeriodicSlowFrame = FALSE;
BOOL gQAMode = FALSE;
+BOOL gLLErrorActivated = FALSE;
////////////////////////////////////////////////////////////
// Internal globals... that should be removed.
@@ -337,6 +338,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;
@@ -923,7 +927,6 @@ LLTextureFetch* LLAppViewer::sTextureFetch = NULL;
LLAppViewer::LLAppViewer() :
mMarkerFile(NULL),
- mLastExecFroze(false),
mCrashBehavior(CRASH_BEHAVIOR_ASK),
mReportedCrash(false),
mNumSessions(0),
@@ -1912,6 +1915,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);
}
@@ -2092,7 +2099,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;
//
@@ -2112,25 +2119,19 @@ bool LLAppViewer::initConfiguration()
{
llinfos << "Sending crash report." << llendl;
- removeMarkerFile();
#if LL_WINDOWS
std::string exe_path = gDirUtilp->getAppRODataDir();
exe_path += gDirUtilp->getDirDelimiter();
exe_path += "win_crash_logger.exe";
- std::string arg_string = "-previous -user ";
- arg_string += gGridName;
- arg_string += " -name \"";
- arg_string += gSecondLife;
- arg_string += "\"";
+ std::string arg_string = "-previous ";
// Spawn crash logger.
// NEEDS to wait until completion, otherwise log files will get smashed.
_spawnl(_P_WAIT, exe_path.c_str(), exe_path.c_str(), arg_string.c_str(), NULL);
#elif LL_DARWIN
std::string command_str;
command_str = "crashreporter.app/Contents/MacOS/crashreporter ";
- command_str += "-previous -user ";
- command_str += gGridName;
+ command_str += "-previous";
// XXX -- We need to exit fullscreen mode for this to work.
// XXX -- system() also doesn't wait for completion. Hmm...
system(command_str.c_str()); /* Flawfinder: Ignore */
@@ -2145,10 +2146,6 @@ bool LLAppViewer::initConfiguration()
char* const cmdargv[] =
{(char*)cmd.c_str(),
(char*)"-previous",
- (char*)"-user",
- (char*)gGridName,
- (char*)"-name",
- (char*)gSecondLife.c_str(),
NULL};
pid_t pid = fork();
if (pid == 0)
@@ -2476,6 +2473,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;
@@ -2502,6 +2520,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();
@@ -2519,7 +2540,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
@@ -2557,71 +2578,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;
@@ -2630,20 +2649,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;
}
@@ -2652,14 +2665,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/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 32501b4642..9518636f87 100644
--- a/indra/newview/llappviewer.h
+++ b/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/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index 11605ecf73..2d7091a075 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -112,10 +112,7 @@ void LLAppViewerMacOSX::handleCrashReporting()
{
// Macintosh
LLString command_str;
- command_str = "crashreporter.app/Contents/MacOS/crashreporter ";
- command_str += "-user ";
- command_str += gGridName;
- command_str += " &"; // This backgrounds the command so system() doesn't block until the crashreporter exits.
+ command_str = "open crashreporter.app";
system(command_str.c_str()); /* Flawfinder: ignore */
// Sometimes signals don't seem to quit the viewer.
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 654c33bb93..7c1ec514e5 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/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/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 5fd0c4ca06..0108ac205e 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -1036,7 +1036,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/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp
index 30326dc496..f5942cfbdd 100644
--- a/indra/newview/llfloaterfriends.cpp
+++ b/indra/newview/llfloaterfriends.cpp
@@ -344,7 +344,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/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 9da923e739..1344b6ef22 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -832,15 +832,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;
@@ -852,11 +854,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);
}
@@ -869,15 +869,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();
@@ -898,6 +900,7 @@ void LLFloaterWorldMap::buildLandmarkIDLists()
items,
LLInventoryModel::EXCLUDE_TRASH,
is_landmark);
+
std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers());
S32 count = items.count();
@@ -910,7 +913,9 @@ void LLFloaterWorldMap::buildLandmarkIDLists()
mLandmarkAssetIDList.put( item->getAssetUUID() );
mLandmarkItemIDList.put( item->getUUID() );
}
+
list->sortByColumn("landmark name", TRUE);
+
list->selectFirstItem();
}
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp
index 82a42a18b5..bb6abcd95b 100644
--- a/indra/newview/llgroupmgr.cpp
+++ b/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<LLUUID,LLGroupRoleData*>::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<LLUUID,LLRoleData>::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<LLUUID,LLRoleData>::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<LLUUID,LLRoleData>::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<LLUUID,LLGroupRoleData*>::iterator it = gmd->mRoles.begin();
- std::map<LLUUID,LLGroupRoleData*>::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<LLUUID,LLGroupRoleData*>::iterator it = gmd->mRoles.begin();
- std::map<LLUUID,LLGroupRoleData*>::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<LLUUID,LLRoleData>::iterator it;
- std::map<LLUUID,LLRoleData>::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<LLUUID, LLGroupMgrGroupData*>::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<LLGroupTitle>::iterator iter = group_datap->mTitles.begin();
- std::vector<LLGroupTitle>::iterator end = group_datap->mTitles.end();
-
- for ( ; iter != end; ++iter)
+ for (std::vector<LLGroupTitle>::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<LLUUID,
bool start_message = true;
LLMessageSystem* msg = gMessageSystem;
- std::map<LLUUID,LLUUID>::iterator it = member_role_pairs.begin();
- std::map<LLUUID,LLUUID>::iterator end = member_role_pairs.end();
- for ( ; it != end; ++it)
+ for (std::map<LLUUID,LLUUID>::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<LLUUID>::iterator it = member_ids.begin();
- std::vector<LLUUID>::iterator end = member_ids.end();
- for ( ; it != end; ++it)
+ for (std::vector<LLUUID>::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<LLUUID,LLGroupRoleData*>::iterator rit = (*mit).second->roleBegin();
- std::map<LLUUID,LLGroupRoleData*>::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/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h
index 76040f9636..ee848ec16d 100644
--- a/indra/newview/llgroupmgr.h
+++ b/indra/newview/llgroupmgr.h
@@ -58,6 +58,8 @@ class LLGroupMemberData
friend class LLGroupMgrGroupData;
public:
+ typedef std::map<LLUUID,LLGroupRoleData*> 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<LLUUID,LLGroupRoleData*>::iterator roleBegin() { return mRoles.begin(); }
- std::map<LLUUID,LLGroupRoleData*>::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<LLUUID,LLGroupRoleData*> mRoles;
+ role_list_t mRolesList;
};
struct LLRoleData
@@ -185,8 +187,6 @@ struct lluuid_pair_less
}
};
-typedef std::map<lluuid_pair,LLRoleMemberChange,lluuid_pair_less> change_map;
-
struct LLGroupTitle
{
std::string mTitle;
@@ -231,17 +231,16 @@ public:
BOOL isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; }
public:
- typedef std::map<LLUUID,LLGroupMemberData*> member_list;
- typedef member_list::iterator member_iter;
- typedef std::map<LLUUID,LLGroupRoleData*> role_list;
- typedef role_list::iterator role_iter;
-
- member_list mMembers;
- role_list mRoles;
+ typedef std::map<LLUUID,LLGroupMemberData*> member_list_t;
+ typedef std::map<LLUUID,LLGroupRoleData*> role_list_t;
+ typedef std::map<lluuid_pair,LLRoleMemberChange,lluuid_pair_less> change_map_t;
+ typedef std::map<LLUUID,LLRoleData> role_data_map_t;
+ member_list_t mMembers;
+ role_list_t mRoles;
- change_map mRoleMemberChanges;
- std::map<LLUUID,LLRoleData> mRoleChanges;
+ change_map_t mRoleMemberChanges;
+ role_data_map_t mRoleChanges;
std::vector<LLGroupTitle> 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<LLUUID,LLGroupMgrObserver*>::iterator observer_iter;
- std::multimap<LLUUID,LLGroupMgrObserver*> mObservers;
- typedef std::map<LLUUID, LLGroupMgrGroupData*>::iterator group_iter;
- std::map<LLUUID, LLGroupMgrGroupData*> mGroups;
+ typedef std::multimap<LLUUID,LLGroupMgrObserver*> observer_multimap_t;
+ observer_multimap_t mObservers;
+ typedef std::map<LLUUID, LLGroupMgrGroupData*> group_map_t;
+ group_map_t mGroups;
};
extern LLGroupMgr* gGroupMgr;
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index c26e9de423..445095a12b 100644
--- a/indra/newview/llimpanel.cpp
+++ b/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/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index a3faa55a06..5f1afccbdc 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -205,7 +205,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);
@@ -258,9 +258,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/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp
index 8af83af272..53066aa52d 100644
--- a/indra/newview/lloverlaybar.cpp
+++ b/indra/newview/lloverlaybar.cpp
@@ -160,11 +160,10 @@ void LLOverlayBar::layoutButtons()
{
LLView* state_buttons_panel = getChildByName("state_buttons", TRUE);
- if (state_buttons_panel)
+ if (state_buttons_panel && state_buttons_panel->getVisible())
{
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)
{
@@ -360,24 +359,7 @@ void LLOverlayBar::mediaPlay(void*)
}
//static
-void LLOverlayBar::mediaPause(void*)
-{
-
- LLViewerParcelMedia::pause();
-}
-
-//static
-void LLOverlayBar::mediaStop(void*)
-{
- if (!gOverlayBar)
- {
- return;
- }
- LLViewerParcelMedia::stop();
-}
-
-//static
-void LLOverlayBar::musicPlay(void*)
+void LLOverlayBar::toggleMusicPlay(void*)
{
if (!gOverlayBar)
{
diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h
index 90ab8d057a..741095e408 100644
--- a/indra/newview/lloverlaybar.h
+++ b/indra/newview/lloverlaybar.h
@@ -77,11 +77,8 @@ public:
static void onClickResetView(void* data);
//static media helper functions
- static void mediaPlay(void*);
- static void mediaPause(void*);
- static void mediaStop(void*);
-
- static void musicPlay(void*);
+ static void toggleMediaPlay(void*);
+ static void toggleMusicPlay(void*);
static void musicPause(void*);
static void musicStop(void*);
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 7c8acd3947..9a0eef9a10 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -570,7 +570,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)
@@ -600,6 +601,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());
}
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index e24d258a22..fcf3eea7eb 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -672,6 +672,8 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
self->mPaidFor = TRUE;
self->mUpdateBtn->setLabel(self->getString("update_txt"));
+
+ self->resetDirty();
}
}
@@ -814,6 +816,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)
@@ -837,22 +858,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/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h
index f28795a4f2..e3705705db 100644
--- a/indra/newview/llpanelclassified.h
+++ b/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/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 2e55cfb30a..64c4354d36 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -748,9 +748,8 @@ void LLPanelGroupGeneral::updateMembers()
all_timer.reset();
S32 i = 0;
- LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end();
- for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME;
+ for( ; mMemberProgress != gdatap->mMembers.end() && i<UPDATE_MEMBERS_PER_FRAME;
++mMemberProgress, ++i)
{
//llinfos << "Adding " << iter->first << ", " << iter->second->getTitle() << llendl;
@@ -791,7 +790,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/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h
index b17a66d0a3..ab1ccef89e 100644
--- a/indra/newview/llpanelgroupgeneral.h
+++ b/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/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index 229daf44ff..e51afa30ea 100644
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/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/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index 6ca3e1e085..8034ed6f03 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/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;
@@ -998,8 +998,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);
@@ -1040,7 +1040,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;
@@ -1134,7 +1134,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;
@@ -1218,41 +1218,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<LLScrollListItem*> selection = mMembersList->getAllSelected();
- if (selection.empty()) return;
-
- std::vector<LLScrollListItem*>::iterator itor;
- for (itor = selection.begin() ;
+ if (selection.empty())
+ {
+ return;
+ }
+
+ for (std::vector<LLScrollListItem*>::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)
@@ -1442,15 +1430,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
@@ -1500,11 +1484,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)
@@ -1521,8 +1500,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
@@ -1535,13 +1515,13 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
{
std::vector<LLUUID> 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);
@@ -1550,12 +1530,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<LLUUID,LLGroupRoleData*>::iterator current_role =
- member_data->roleBegin();
- std::map<LLUUID,LLGroupRoleData*>::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(),
@@ -1588,13 +1564,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;
@@ -1692,7 +1665,7 @@ void LLPanelGroupMembersSubTab::updateMembers()
return;
}
- LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end();
+ LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
S32 i = 0;
for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME;
@@ -1976,8 +1949,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)
{
@@ -2160,8 +2133,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);
@@ -2169,7 +2142,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;
@@ -2622,8 +2595,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)
@@ -2643,8 +2616,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/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h
index 6d2c6ab4cf..89264abc94 100644
--- a/indra/newview/llpanelgrouproles.h
+++ b/indra/newview/llpanelgrouproles.h
@@ -202,7 +202,6 @@ public:
protected:
typedef std::map<LLUUID, LLRoleMemberChangeType> role_change_data_map_t;
- typedef std::map<LLUUID, role_change_data_map_t*>::iterator member_role_change_iter;
typedef std::map<LLUUID, role_change_data_map_t*> member_role_changes_map_t;
bool matchesSearchFilter(const std::string& fullname);
@@ -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/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index b65835fed3..a27295c7b5 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -367,6 +367,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);
@@ -478,6 +483,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/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index d80a9ee053..ffc53f0dd5 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -3649,14 +3649,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/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 423954800f..455fcc7bc0 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1016,7 +1016,7 @@ BOOL idle_startup()
gAcceptTOS,
gAcceptCriticalMessage,
gViewerDigest,
- gLastExecFroze,
+ gLastExecEvent,
requested_options,
hashed_mac_string,
LLAppViewer::instance()->getSerialNumber());
@@ -2767,8 +2767,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/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index d64b3864b3..00331a2e23 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -468,6 +468,8 @@ void LLStatusBar::refresh()
childSetVisible("buyland", canBuyLand);
if (canBuyLand)
{
+ //HACK: layout tweak until this is all xml
+ x += 9;
childGetRect( "buyland", buttonRect );
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect( "buyland", r );
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 02eff4d587..b60ef6c5ac 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -492,7 +492,11 @@ bool LLTextureCacheWorker::doWrite()
idx = mCache->getHeaderCacheEntry(mID, true, &mImageSize); // touch entry
if (idx >= 0)
{
- llassert_always(cur_imagesize <= 0 || mImageSize == cur_imagesize);
+ if(cur_imagesize > 0 && mImageSize != cur_imagesize)
+ {
+ llwarns << "Header cache entry size: " << cur_imagesize << " != mImageSize: " << mImageSize << llendl;
+ offset = 0; // re-write header
+ }
mState = offset < TEXTURE_CACHE_ENTRY_SIZE ? HEADER : BODY;
}
else
diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp
index 444a2d1524..0fb7fbba4c 100644
--- a/indra/newview/lltoolbar.cpp
+++ b/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/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index e9839d64dc..cf71694e13 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2667,6 +2667,13 @@ void process_avatar_init_complete(LLMessageSystem* msg, void**)
}
*/
+static void display_release_message(S32, void* data)
+{
+ std::string* msg = (std::string*)data;
+ LLFloaterReleaseMsg::displayMessage(msg->c_str());
+ delete msg;
+}
+
void process_agent_movement_complete(LLMessageSystem* msg, void**)
{
gAgentMovementCompleted = TRUE;
@@ -2835,8 +2842,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun());
gAgent.sendReliableMessage();
- LLFloaterReleaseMsg::displayMessage(version_channel_char);
-
+ if (LLFloaterReleaseMsg::checkVersion(version_channel_char))
+ {
+ LLNotifyBox::showXml("ServerVersionChanged", display_release_message, new std::string(version_channel_char) );
+ }
}
void process_crossed_region(LLMessageSystem* msg, void**)
@@ -3491,7 +3500,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/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 290650e251..08a73b343c 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1739,9 +1739,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());
}
}
}
@@ -1755,7 +1755,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/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5dcf4fdb5d..9e8a7c2a9b 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3006,7 +3006,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);
@@ -3028,7 +3028,8 @@ BOOL LLViewerWindow::handlePerFrameHover()
// snap floaters to top of chat bar/button strip
LLView* chatbar_and_buttons = gOverlayBar->getChild<LLView>("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;
@@ -3040,6 +3041,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/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp
index ab8f6939f1..e6d859a08a 100644
--- a/indra/win_crash_logger/llcrashloggerwindows.cpp
+++ b/indra/win_crash_logger/llcrashloggerwindows.cpp
@@ -319,7 +319,8 @@ bool LLCrashLoggerWindows::mainLoop()
else if (mCrashBehavior == CRASH_BEHAVIOR_ASK)
{
gHwndReport = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PREVREPORTBOX), 0, NULL);
- LRESULT result = SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_SETCHECK, 1, 0);
+ // Ignore result
+ (void) SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_SETCHECK, 1, 0);
// Include the product name in the caption and various dialog items.
ProcessCaption(gHwndReport);
ProcessDlgItemText(gHwndReport, IDC_STATIC_MSG);
@@ -340,6 +341,7 @@ bool LLCrashLoggerWindows::mainLoop()
ShowWindow(gHwndReport, SW_SHOW );
MSG msg;
+ msg.wParam = 0;
while (!LLApp::isQuitting() && GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);