Updates to LLScrollListCtrl and related inter-dependencies. Also added ability to set face texture to 'None' (LLUUID::null).

This commit is contained in:
Shyotl
2012-12-08 00:56:58 -06:00
parent f80394fc02
commit 9fb4e677a6
49 changed files with 1281 additions and 1081 deletions

View File

@@ -56,6 +56,7 @@ public:
};
LLDynamicArray(S32 size=0) : std::vector<Type>(size) { if (size < BlockSize) std::vector<Type>::reserve(BlockSize); }
LLDynamicArray(const std::vector<Type>& copy) : std::vector<Type>(copy) {}
void reset() { std::vector<Type>::clear(); }

View File

@@ -615,7 +615,7 @@ void LLComboBox::showList()
S32 min_width = getRect().getWidth();
S32 max_width = llmax(min_width, MAX_COMBO_WIDTH);
// make sure we have up to date content width metrics
mList->calcColumnWidths();
mList->updateColumnWidths();
S32 list_width = llclamp(mList->getMaxContentWidth(), min_width, max_width);
if (mListPosition == BELOW)
@@ -707,7 +707,7 @@ void LLComboBox::hideList()
mButton->setToggleState(FALSE);
mList->setVisible(FALSE);
mList->highlightNthItem(-1);
mList->mouseOverHighlightNthItem(-1);
setUseBoundingRect(FALSE);
if( gFocusMgr.getTopCtrl() == this )
@@ -731,7 +731,7 @@ void LLComboBox::onButtonDown(void *userdata)
if (last_selected_item)
{
// highlight the original selection before potentially selecting a new item
self->mList->highlightNthItem(self->mList->getItemIndex(last_selected_item));
self->mList->mouseOverHighlightNthItem(self->mList->getItemIndex(last_selected_item));
}
if( self->mPrearrangeCallback )
@@ -839,7 +839,7 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask)
if (last_selected_item)
{
// highlight the original selection before potentially selecting a new item
mList->highlightNthItem(mList->getItemIndex(last_selected_item));
mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item));
}
result = mList->handleKeyHere(key, mask);
@@ -873,7 +873,7 @@ BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char)
if (last_selected_item)
{
// highlight the original selection before potentially selecting a new item
mList->highlightNthItem(mList->getItemIndex(last_selected_item));
mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item));
}
result = mList->handleUnicodeCharHere(uni_char);
if (mList->getLastSelectedItem() != last_selected_item)

View File

@@ -57,7 +57,7 @@ const BOOL BORDER_NO = FALSE;
* With or without border,
* Can contain LLUICtrls.
*/
class LLPanel : public LLUICtrl, public boost::signals2::trackable
class LLPanel : public LLUICtrl
{
public:

File diff suppressed because it is too large Load Diff

View File

@@ -51,6 +51,7 @@
#include "lldate.h"
// <edit>
#include "lllineeditor.h"
#include <boost/function.hpp>
// </edit>
/*
@@ -69,13 +70,13 @@ public:
virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const = 0; // truncate to given width, if possible
virtual S32 getWidth() const {return mWidth;}
virtual S32 getContentWidth() const { return 0; }
virtual S32 getHeight() const = 0;
virtual S32 getHeight() const { return 0; }
virtual const LLSD getValue() const { return LLStringUtil::null; }
virtual void setValue(const LLSD& value) { }
virtual BOOL getVisible() const { return TRUE; }
virtual void setWidth(S32 width) { mWidth = width; }
virtual void highlightText(S32 offset, S32 num_chars) {}
virtual BOOL isText() const = 0;
virtual BOOL isText() const { return FALSE; }
virtual void setColor(const LLColor4&) {}
virtual void onCommit() {};
@@ -86,19 +87,6 @@ private:
S32 mWidth;
};
/*
* Draws a horizontal line.
*/
class LLScrollListSeparator : public LLScrollListCell
{
public:
LLScrollListSeparator(S32 width);
virtual ~LLScrollListSeparator() {};
virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; // truncate to given width, if possible
virtual S32 getHeight() const;
virtual BOOL isText() const { return FALSE; }
};
/*
* Cell displaying a text label.
*/
@@ -108,22 +96,27 @@ public:
LLScrollListText( const std::string& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE);
/*virtual*/ ~LLScrollListText();
virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const;
virtual S32 getContentWidth() const;
virtual S32 getHeight() const;
virtual void setValue(const LLSD& value);
virtual const LLSD getValue() const;
virtual BOOL getVisible() const;
virtual void highlightText(S32 offset, S32 num_chars);
/*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const;
/*virtual*/ S32 getContentWidth() const;
/*virtual*/ S32 getHeight() const;
/*virtual*/ void setValue(const LLSD& value);
/*virtual*/ const LLSD getValue() const;
/*virtual*/ BOOL getVisible() const;
/*virtual*/ void highlightText(S32 offset, S32 num_chars);
virtual void setColor(const LLColor4&);
virtual BOOL isText() const;
/*virtual*/ void setColor(const LLColor4&);
/*virtual*/ BOOL isText() const;
S32 getTextWidth() const { return mTextWidth;}
void setTextWidth(S32 value) { mTextWidth = value;}
virtual void setWidth(S32 width) { LLScrollListCell::setWidth(width); mTextWidth = width; }
void setText(const LLStringExplicit& text);
void setFontStyle(const U8 font_style) { mFontStyle = font_style; }
void setFontStyle(const U8 font_style);
private:
LLUIString mText;
S32 mTextWidth;
const LLFontGL* mFont;
LLColor4 mColor;
U8 mUseColor;
@@ -138,18 +131,6 @@ private:
static U32 sCount;
};
class LLScrollListDate : public LLScrollListText
{
public:
LLScrollListDate( const LLDate& date, const LLFontGL* font, S32 width=0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE);
virtual void setValue(const LLSD& value);
virtual const LLSD getValue() const;
private:
LLDate mDate;
};
/*
* Cell displaying an image.
*/
@@ -159,24 +140,22 @@ public:
LLScrollListIcon( LLUIImagePtr icon, S32 width = 0);
LLScrollListIcon(const LLSD& value, S32 width = 0);
/*virtual*/ ~LLScrollListIcon();
virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const;
virtual S32 getWidth() const;
virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; }
virtual const LLSD getValue() const { return mIcon.isNull() ? LLStringUtil::null : mIcon->getName(); }
virtual void setColor(const LLColor4&);
virtual BOOL isText()const { return FALSE; }
virtual void setValue(const LLSD& value);
/*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const;
/*virtual*/ S32 getWidth() const;
/*virtual*/ S32 getHeight() const;
/*virtual*/ const LLSD getValue() const;
/*virtual*/ void setColor(const LLColor4&);
/*virtual*/ void setValue(const LLSD& value);
// <edit>
void setClickCallback(BOOL (*callback)(void*), void* user_data);
void setClickCallback(boost::function<bool (void)> cb);
virtual BOOL handleClick();
// </edit>
private:
LLUIImagePtr mIcon;
LLPointer<LLUIImage> mIcon;
LLColor4 mColor;
// <edit>
BOOL (*mCallback)(void*);
void* mUserData;
boost::function<bool (void)> mCallback;
// </edit>
};
@@ -188,22 +167,33 @@ class LLScrollListCheck : public LLScrollListCell
public:
LLScrollListCheck( LLCheckBoxCtrl* check_box, S32 width = 0);
/*virtual*/ ~LLScrollListCheck();
virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const;
virtual S32 getHeight() const { return 0; }
virtual const LLSD getValue() const { return mCheckBox->getValue(); }
virtual void setValue(const LLSD& value) { mCheckBox->setValue(value); }
virtual void onCommit() { mCheckBox->onCommit(); }
/*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const;
/*virtual*/ S32 getHeight() const { return 0; }
/*virtual*/ const LLSD getValue() const;
/*virtual*/ void setValue(const LLSD& value);
/*virtual*/ void onCommit();
virtual BOOL handleClick();
virtual void setEnabled(BOOL enable) { mCheckBox->setEnabled(enable); }
/*virtual*/ BOOL handleClick();
/*virtual*/ void setEnabled(BOOL enable);
LLCheckBoxCtrl* getCheckBox() { return mCheckBox; }
virtual BOOL isText() const { return FALSE; }
private:
LLCheckBoxCtrl* mCheckBox;
};
class LLScrollListDate : public LLScrollListText
{
public:
LLScrollListDate( const LLDate& date, const LLFontGL* font, S32 width=0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE);
virtual void setValue(const LLSD& value);
virtual const LLSD getValue() const;
private:
LLDate mDate;
};
// <edit>
class LLScrollListLineEditor : public LLScrollListCell
{
@@ -228,43 +218,12 @@ private:
};
// </edit>
/*
* A simple data class describing a column within a scroll list.
*/
class LLScrollListColumn
class LLScrollListColumn;
class LLScrollColumnHeader : public LLComboBox
{
public:
LLScrollListColumn();
LLScrollListColumn(const LLSD &sd, LLScrollListCtrl* parent);
void setWidth(S32 width);
S32 getWidth() const { return mWidth; }
// Public data is fine so long as this remains a simple struct-like data class.
// If it ever gets any smarter than that, these should all become private
// with protected or public accessor methods added as needed. -MG
std::string mName;
std::string mSortingColumn;
BOOL mSortAscending;
std::string mLabel;
F32 mRelWidth;
BOOL mDynamicWidth;
S32 mMaxContentWidth;
S32 mIndex;
LLScrollListCtrl* mParentCtrl;
class LLColumnHeader* mHeader;
LLFontGL::HAlign mFontAlignment;
private:
S32 mWidth;
};
class LLColumnHeader : public LLComboBox
{
public:
LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL);
~LLColumnHeader();
LLScrollColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL);
~LLScrollColumnHeader();
/*virtual*/ void draw();
/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
@@ -301,7 +260,44 @@ private:
LLColor4 mImageOverlayColor;
};
class LLScrollListItem
/*
* A simple data class describing a column within a scroll list.
*/
class LLScrollListColumn
{
public:
typedef enum e_sort_direction
{
DESCENDING,
ASCENDING
} ESortDirection;
LLScrollListColumn();
LLScrollListColumn(const LLSD &sd, LLScrollListCtrl* parent);
void setWidth(S32 width);
S32 getWidth() const { return mWidth; }
// Public data is fine so long as this remains a simple struct-like data class.
// If it ever gets any smarter than that, these should all become private
// with protected or public accessor methods added as needed. -MG
std::string mName;
std::string mSortingColumn;
ESortDirection mSortDirection;
std::string mLabel;
F32 mRelWidth;
BOOL mDynamicWidth;
S32 mMaxContentWidth;
S32 mIndex;
LLScrollListCtrl* mParentCtrl;
LLScrollColumnHeader* mHeader;
LLFontGL::HAlign mFontAlignment;
private:
S32 mWidth;
};
class LLScrollListItem : public LLHandleProvider<LLScrollListItem>
{
public:
LLScrollListItem( BOOL enabled = TRUE, void* userdata = NULL, const LLUUID& uuid = LLUUID::null )
@@ -314,7 +310,7 @@ public:
void setSelected( BOOL b ) { mSelected = b; }
BOOL getSelected() const { return mSelected; }
void setEnabled( BOOL b );
void setEnabled( BOOL b ) { mEnabled = b; }
BOOL getEnabled() const { return mEnabled; }
void setUserdata( void* userdata ) { mUserdata = userdata; }
@@ -323,9 +319,12 @@ public:
void setToolTip(const std::string tool_tip) { mToolTip=tool_tip; }
std::string getToolTip() { return mToolTip; }
LLUUID getUUID() const { return mItemValue.asUUID(); }
virtual LLUUID getUUID() const { return mItemValue.asUUID(); }
LLSD getValue() const { return mItemValue; }
void setRect(LLRect rect) { mRectangle = rect; }
LLRect getRect() const { return mRectangle; }
// If width = 0, just use the width of the text. Otherwise override with
// specified width in pixels.
void addColumn( const std::string& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE)
@@ -341,9 +340,9 @@ public:
void setColumn( S32 column, LLScrollListCell *cell );
S32 getNumColumns() const { return mColumns.size(); }
S32 getNumColumns() const;
LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; }
LLScrollListCell *getColumn(const S32 i) const;
std::string getContentsCSV() const;
@@ -356,29 +355,7 @@ private:
LLSD mItemValue;
std::string mToolTip;
std::vector<LLScrollListCell *> mColumns;
};
/*
* A graphical control representing a scrollable table.
* Cells in the table can be simple text or more complicated things
* such as icons or even interactive elements like check boxes.
*/
class LLScrollListItemComment : public LLScrollListItem
{
public:
LLScrollListItemComment(const std::string& comment_string, const LLColor4& color);
/*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding);
private:
LLColor4 mColor;
};
class LLScrollListItemSeparator : public LLScrollListItem
{
public:
LLScrollListItemSeparator();
/*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding);
LLRect mRectangle;
};
class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler,
@@ -386,13 +363,37 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler,
{
public:
typedef boost::function<void (void)> callback_t;
template<typename T> struct maximum
{
typedef T result_type;
template<typename InputIterator>
T operator()(InputIterator first, InputIterator last) const
{
// If there are no slots to call, just return the
// default-constructed value
if(first == last ) return T();
T max_value = *first++;
while (first != last) {
if (max_value < *first)
max_value = *first;
++first;
}
return max_value;
}
};
typedef boost::signals2::signal<S32 (S32,const LLScrollListItem*,const LLScrollListItem*),maximum<S32> > sort_signal_t;
LLScrollListCtrl(
const std::string& name,
const LLRect& rect,
void (*commit_callback)(LLUICtrl*, void*),
void* callback_userdata,
BOOL allow_multiple_selection,
BOOL draw_border = TRUE);
BOOL draw_border = TRUE, bool draw_heading = false);
virtual ~LLScrollListCtrl();
@@ -416,6 +417,7 @@ public:
virtual void setColumnLabel(const std::string& column, const std::string& label);
virtual LLScrollListColumn* getColumn(S32 index);
virtual LLScrollListColumn* getColumn(const std::string& name);
virtual S32 getNumColumns() const { return mColumnsIndexed.size(); }
// Adds a single element, from an array of:
@@ -466,7 +468,12 @@ public:
void deleteSelectedItems();
void deselectAllItems(BOOL no_commit_on_change = FALSE); // by default, go ahead and commit on selection change
void highlightNthItem( S32 index );
void clearHighlightedItems();
virtual void mouseOverHighlightNthItem( S32 index );
S32 getHighlightedItemInx() const { return mHighlightedItem; }
void setDoubleClickCallback( callback_t cb ) { mOnDoubleClickCallback = cb; }
void setMaximumSelectCallback( callback_t cb ) { mOnMaximumSelectCallback = cb; }
void setSortChangedCallback( callback_t cb ) { mOnSortChangedCallback = cb; }
@@ -483,7 +490,7 @@ public:
S32 getItemIndex( LLScrollListItem* item ) const;
S32 getItemIndex( const LLUUID& item_id ) const;
LLScrollListItem* addCommentText( const std::string& comment_text, EAddPosition pos = ADD_BOTTOM);
void setCommentText( const std::string& comment_text);
LLScrollListItem* addSeparator(EAddPosition pos);
// "Simple" interface: use this when you're creating a list that contains only unique strings, only
@@ -494,6 +501,7 @@ public:
BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE ); // FALSE if item not found
BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE);
BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE);
LLScrollListItem* getItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 );
const std::string getSelectedItemLabel(S32 column = 0) const;
LLSD getSelectedValue();
@@ -506,7 +514,8 @@ public:
LLScrollListItem* getFirstSelected() const;
virtual S32 getFirstSelectedIndex() const;
std::vector<LLScrollListItem*> getAllSelected() const;
LLDynamicArray<LLUUID> getSelectedIDs();
uuid_vec_t getSelectedIDs(); //Helper. Much like getAllSelected, but just provides a LLUUID vec
S32 getNumSelected() const;
LLScrollListItem* getLastSelectedItem() const { return mLastSelected; }
// iterate over all items
@@ -581,17 +590,26 @@ public:
LLRect getItemListRect() { return mItemListRect; }
/// Returns rect, in local coords, of a given row/column
LLRect getCellRect(S32 row_index, S32 column_index);
// Used "internally" by the scroll bar.
static void onScrollChange( S32 new_pos, LLScrollbar* src, void* userdata );
static void onClickColumn(void *userdata);
void updateColumns();
void calcColumnWidths();
virtual void updateColumns();
S32 calcMaxContentWidth();
bool updateColumnWidths();
S32 getMaxContentWidth() { return mMaxContentWidth; }
void setDisplayHeading(BOOL display);
void setHeadingHeight(S32 heading_height);
/**
* Sets max visible lines without scroolbar, if this value equals to 0,
* then display all items.
*/
void setPageLines(S32 page_lines );
void setCollapseEmptyColumns(BOOL collapse);
LLScrollListItem* hitItem(S32 x,S32 y);
@@ -613,17 +631,25 @@ public:
std::string getSortColumnName();
BOOL getSortAscending() { return mSortColumns.empty() ? TRUE : mSortColumns.back().second; }
BOOL needsSorting();
BOOL hasSortOrder() const;
void clearSortOrder();
S32 selectMultiple( LLDynamicArray<LLUUID> ids );
void sortItems();
S32 selectMultiple( uuid_vec_t ids );
// conceptually const, but mutates mItemList
void updateSort() const;
// sorts a list without affecting the permanent sort order (so further list insertions can be unsorted, for example)
void sortOnce(S32 column, BOOL ascending);
// manually call this whenever editing list items in place to flag need for resorting
void setSorted(BOOL sorted) { mSorted = sorted; }
void setNeedsSort(bool val = true) { mSorted = !val; }
void dirtyColumns(); // some operation has potentially affected column layout or ordering
boost::signals2::connection setSortCallback(sort_signal_t::slot_type cb )
{
if (!mSortCallback) mSortCallback = new sort_signal_t();
return mSortCallback->connect(cb);
}
protected:
// "Full" interface: use this when you're creating a list that has one or more of the following:
// * contains icons
@@ -645,11 +671,13 @@ protected:
typedef std::deque<LLScrollListItem *> item_list;
item_list& getItemList() { return mItemList; }
void updateLineHeight();
private:
void selectPrevItem(BOOL extend_selection);
void selectNextItem(BOOL extend_selection);
void drawItems();
void updateLineHeight();
void updateLineHeightInsert(LLScrollListItem* item);
void reportInvalidInput();
BOOL isRepeatedChars(const LLWString& string) const;
@@ -657,10 +685,7 @@ private:
void deselectItem(LLScrollListItem* itemp);
void commitIfChanged();
BOOL setSort(S32 column, BOOL ascending);
S32 mCurIndex; // For get[First/Next]Data
S32 mCurSelectedIndex; // For get[First/Next]Selected
S32 getLinesPerPage();
S32 mLineHeight; // the max height of a single line
S32 mScrollLines; // how many lines we've scrolled down
@@ -668,18 +693,19 @@ private:
S32 mHeadingHeight; // the height of the column header buttons, if visible
U32 mMaxSelectable;
LLScrollbar* mScrollbar;
BOOL mAllowMultipleSelection;
BOOL mAllowKeyboardMovement;
BOOL mCommitOnKeyboardMovement;
BOOL mCommitOnSelectionChange;
BOOL mSelectionChanged;
BOOL mNeedsScroll;
BOOL mMouseWheelOpaque;
BOOL mCanSelect;
BOOL mDisplayColumnHeaders;
BOOL mColumnsDirty;
bool mAllowMultipleSelection;
bool mAllowKeyboardMovement;
bool mCommitOnKeyboardMovement;
bool mCommitOnSelectionChange;
bool mSelectionChanged;
bool mNeedsScroll;
bool mMouseWheelOpaque;
bool mCanSelect;
bool mDisplayColumnHeaders;
bool mColumnsDirty;
bool mColumnWidthsDirty;
item_list mItemList;
mutable item_list mItemList;
LLScrollListItem *mLastSelected;
@@ -710,6 +736,8 @@ private:
S32 mHighlightedItem;
class LLViewBorder* mBorder;
LLView *mCommentTextView;
LLWString mSearchString;
LLFrameTimer mSearchTimer;
@@ -718,12 +746,12 @@ private:
S32 mTotalStaticColumnWidth;
S32 mTotalColumnPadding;
BOOL mSorted;
mutable bool mSorted;
typedef std::map<std::string, LLScrollListColumn> column_map_t;
typedef std::map<std::string, LLScrollListColumn*> column_map_t;
column_map_t mColumns;
BOOL mDirty;
bool mDirty;
S32 mOriginalSelection;
typedef std::vector<LLScrollListColumn*> ordered_columns_t;
@@ -732,8 +760,7 @@ private:
typedef std::pair<S32, BOOL> sort_column_t;
std::vector<sort_column_t> mSortColumns;
// HACK: Did we draw one selected item this frame?
BOOL mDrewSelected;
sort_signal_t* mSortCallback;
}; // end class LLScrollListCtrl

View File

@@ -30,7 +30,7 @@
#include "llfloaterchat.h"
ASFloaterContactGroups* ASFloaterContactGroups::sInstance = NULL;
LLDynamicArray<LLUUID> ASFloaterContactGroups::mSelectedUUIDs;
uuid_vec_t ASFloaterContactGroups::mSelectedUUIDs;
LLSD ASFloaterContactGroups::mContactGroupData;
ASFloaterContactGroups::ASFloaterContactGroups()
@@ -40,7 +40,7 @@ ASFloaterContactGroups::ASFloaterContactGroups()
}
// static
void ASFloaterContactGroups::show(LLDynamicArray<LLUUID> ids)
void ASFloaterContactGroups::show(const uuid_vec_t& ids)
{
if (!sInstance)
sInstance = new ASFloaterContactGroups();
@@ -84,7 +84,8 @@ void ASFloaterContactGroups::onBtnAdd(void* userdata)
self->createContactGroup(name);
combo->selectByValue(name);
}
for (S32 i = (self->mSelectedUUIDs.count() - 1); i >= 0; --i)
uuid_vec_t::reverse_iterator it = self->mSelectedUUIDs.rbegin();
for (;it != self->mSelectedUUIDs.rend();++it)
{
//self->addContactMember(combo->getSimple(), self->mSelectedUUIDs.get(i));
}
@@ -98,19 +99,21 @@ void ASFloaterContactGroups::onBtnRemove(void* userdata)
if(self)
{
if (self->mSelectedUUIDs.count() > 0)
if (!self->mSelectedUUIDs.empty())
{
LLScrollListCtrl* scroller = self->getChild<LLScrollListCtrl>("group_scroll_list");
if(scroller != NULL)
{
for (S32 i = (self->mSelectedUUIDs.count() - 1); i >= 0; --i)
uuid_vec_t::size_type i = self->mSelectedUUIDs.size();
uuid_vec_t::reverse_iterator it = self->mSelectedUUIDs.rbegin();
for (;it != self->mSelectedUUIDs.rend();++it)
{
std::string i_str;
LLResMgr::getInstance()->getIntegerString(i_str, i);
LLChat msg("Adding index " + i_str + ": " + self->mSelectedUUIDs.get(i).asString());
LLResMgr::getInstance()->getIntegerString(i_str, --i);
LLChat msg("Adding index " + i_str + ": " + it->asString());
LLFloaterChat::addChat(msg);
self->addContactMember(scroller->getValue().asString(), self->mSelectedUUIDs.get(i));
self->addContactMember(scroller->getValue().asString(), *it);
}
}
}

View File

@@ -29,7 +29,7 @@ public:
virtual ~ASFloaterContactGroups();
// by convention, this shows the floater and does instance management
static void show(LLDynamicArray<LLUUID> ids);
static void show(const uuid_vec_t& ids);
void populateGroupList();
void populateActiveGroupList(LLUUID to_add);
@@ -47,7 +47,7 @@ public:
private:
//assuming we just need one, which is typical
static ASFloaterContactGroups* sInstance;
static LLDynamicArray<LLUUID> mSelectedUUIDs;
static uuid_vec_t mSelectedUUIDs;
static LLSD mContactGroupData;
};

View File

@@ -300,8 +300,6 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
if(LLUUID::parseUUID(avatarKey, &tempUUID))
{
char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */
LLDynamicArray<LLUUID> ids;
ids.push_back(tempUUID);
std::string tpMsg="Join me!";
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_StartLure);
@@ -312,11 +310,8 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
msg->addU8Fast(_PREHASH_LureType, (U8)0);
msg->addStringFast(_PREHASH_Message, tpMsg);
for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
msg->nextBlockFast(_PREHASH_TargetData);
msg->addUUIDFast(_PREHASH_TargetID, *itr);
}
msg->addUUIDFast(_PREHASH_TargetID, tempUUID);
gAgent.sendReliableMessage();
snprintf(buffer,sizeof(buffer),"Offered TP to key %s",tempUUID.asString().c_str());
cmdline_printchat(std::string(buffer));

View File

@@ -234,7 +234,7 @@ void JCFloaterAreaSearch::results()
if (!(sInstance->getVisible())) return;
if (sRequested > 0 && sInstance->mLastUpdateTimer.getElapsedTimeF32() < min_refresh_interval) return;
//llinfos << "results()" << llendl;
LLDynamicArray<LLUUID> selected = sInstance->mResultList->getSelectedIDs();
uuid_vec_t selected = sInstance->mResultList->getSelectedIDs();
S32 scrollpos = sInstance->mResultList->getScrollPos();
sInstance->mResultList->deleteAllItems();
S32 i;
@@ -302,7 +302,7 @@ void JCFloaterAreaSearch::results()
}
}
sInstance->mResultList->sortItems();
sInstance->mResultList->updateSort();
sInstance->mResultList->selectMultiple(selected);
sInstance->mResultList->setScrollPos(scrollpos);
sInstance->mCounterText->setText(llformat("%d listed/%d pending/%d total", sInstance->mResultList->getItemCount(), sRequested, sObjectDetails.size()));

View File

@@ -208,7 +208,7 @@ BOOL LLFloaterScriptQueue::start()
buffer = getString ("Starting", args);
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
list->addCommentText(buffer);
list->setCommentText(buffer);
return nextObject();
}
@@ -244,7 +244,7 @@ BOOL LLFloaterScriptQueue::nextObject()
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
mDone = TRUE;
list->addCommentText(getString("Done"));
list->setCommentText(getString("Done"));
childSetEnabled("close",TRUE);
}
return successful_start;
@@ -325,7 +325,7 @@ LLFloaterCompileQueue* LLFloaterCompileQueue::create(BOOL mono)
}
LLScrollListCtrl* list = queue->getChild<LLScrollListCtrl>("queue output");
list->addCommentText(message.c_str());
list->setCommentText(message.c_str());
}
private:
@@ -520,7 +520,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
if(queue && (buffer.size() > 0))
{
LLScrollListCtrl* list = queue->getChild<LLScrollListCtrl>("queue output");
list->addCommentText(buffer);
list->setCommentText(buffer);
}
delete data;
}
@@ -707,7 +707,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj,
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
std::string buffer;
buffer = getString("Resetting") + LLTrans::getString(":") + " " + item->getName();
list->addCommentText(buffer);
list->setCommentText(buffer);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ScriptReset);
msg->nextBlockFast(_PREHASH_AgentData);
@@ -769,7 +769,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj,
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
std::string buffer;
buffer = getString("Running") + LLTrans::getString(":") + " " + item->getName();
list->addCommentText(buffer);
list->setCommentText(buffer);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_SetScriptRunning);
@@ -833,7 +833,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj,
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
std::string buffer;
buffer = getString("NotRunning") + LLTrans::getString(":") + " " + item->getName();
list->addCommentText(buffer);
list->setCommentText(buffer);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_SetScriptRunning);

View File

@@ -610,7 +610,7 @@ void LLPanelActiveSpeakers::refreshSpeakers()
}
// we potentially modified the sort order by touching the list items
mSpeakerList->setSorted(FALSE);
mSpeakerList->setNeedsSort();
LLPointer<LLSpeaker> selected_speakerp = mSpeakerMgr->findSpeaker(selected_id);
// update UI for selected participant

View File

@@ -631,9 +631,9 @@ void LLFloaterAvatarList::expireAvatarList()
(it++)->getAlive();
else
{
std::swap(*it,mAvatars.back());
*it = mAvatars.back();
mAvatars.pop_back();
if(!mAvatars.size())
if(mAvatars.empty())
return;
}
}
@@ -674,7 +674,7 @@ void LLFloaterAvatarList::refreshAvatarList()
// We rebuild the list fully each time it's refreshed
// The assumption is that it's faster to refill it and sort than
// to rebuild the whole list.
LLDynamicArray<LLUUID> selected = mAvatarList->getSelectedIDs();
uuid_vec_t selected = mAvatarList->getSelectedIDs();
S32 scrollpos = mAvatarList->getScrollPos();
mAvatarList->deleteAllItems();
@@ -961,7 +961,7 @@ void LLFloaterAvatarList::refreshAvatarList()
}
// finish
mAvatarList->sortItems();
mAvatarList->updateSort();
mAvatarList->selectMultiple(selected);
mAvatarList->setScrollPos(scrollpos);
@@ -974,8 +974,8 @@ void LLFloaterAvatarList::refreshAvatarList()
void LLFloaterAvatarList::onClickIM()
{
//llinfos << "LLFloaterFriends::onClickIM()" << llendl;
LLDynamicArray<LLUUID> ids = mAvatarList->getSelectedIDs();
if (ids.size() > 0)
const uuid_vec_t ids = mAvatarList->getSelectedIDs();
if (!ids.empty())
{
if (ids.size() == 1)
{
@@ -1004,7 +1004,7 @@ void LLFloaterAvatarList::onClickIM()
void LLFloaterAvatarList::onClickTeleportOffer()
{
LLDynamicArray<LLUUID> ids = mAvatarList->getSelectedIDs();
uuid_vec_t ids = mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
handle_lure(ids);
@@ -1106,7 +1106,7 @@ BOOL LLFloaterAvatarList::handleKeyHere(KEY key, MASK mask)
if (( KEY_RETURN == key ) && (MASK_SHIFT == mask))
{
LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
uuid_vec_t ids = self->mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
if (ids.size() == 1)
@@ -1425,12 +1425,12 @@ static void cmd_estate_ban(const LLAvatarListEntry* entry) { LLPanelEstateInfo::
void LLFloaterAvatarList::doCommand(avlist_command_t func, bool single/*=false*/)
{
LLDynamicArray<LLUUID> ids;
uuid_vec_t ids;
if(!single)
ids = mAvatarList->getSelectedIDs();
else
ids.put(getSelectedID());
for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
ids.push_back(getSelectedID());
for (uuid_vec_t::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID& avid = *itr;
if(avid.isNull())
@@ -1565,10 +1565,10 @@ void LLFloaterAvatarList::onClickEject()
void LLFloaterAvatarList::onClickMute()
{
LLDynamicArray<LLUUID> ids = mAvatarList->getSelectedIDs();
uuid_vec_t ids = mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
for (uuid_vec_t::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID agent_id = *itr;

View File

@@ -499,6 +499,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
}
LLSD element;
element["id"] = avatar_id; // value
element["columns"][0]["column"] = "name";
element["columns"][0]["value"] = avatar_name;
search_results->addElement(element);
}

View File

@@ -95,7 +95,7 @@ void LLFloaterBulkPermission::doApply()
LLSelectMgr::getInstance()->getSelection()->applyToNodes(&gatherer);
if(mObjectIDs.empty())
{
list->addCommentText(getString("nothing_to_modify_text"));
list->setCommentText(getString("nothing_to_modify_text"));
}
else
{
@@ -180,7 +180,7 @@ void LLFloaterBulkPermission::onCommitCopy(LLUICtrl* ctrl, void* data)
BOOL LLFloaterBulkPermission::start()
{
// note: number of top-level objects to modify is mObjectIDs.count().
getChild<LLScrollListCtrl>("queue output")->addCommentText(getString("start_text"));
getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("start_text"));
return nextObject();
}
@@ -203,7 +203,7 @@ BOOL LLFloaterBulkPermission::nextObject()
if(isDone() && !mDone)
{
getChild<LLScrollListCtrl>("queue output")->addCommentText(getString("done_text"));
getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("done_text"));
mDone = TRUE;
}
return successful_start;
@@ -349,7 +349,7 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, LLInv
status_text.setArg("[STATUS]", "");
}
list->addCommentText(status_text.getString());
list->setCommentText(status_text.getString());
//TODO if we are an object inside an object we should check a recuse flag and if set
//open the inventory of the object and recurse - Michelle2 Zenovka

View File

@@ -78,8 +78,7 @@ const F32 CONTEXT_FADE_TIME = 0.08f;
//////////////////////////////////////////////////////////////////////////////
// default ctor
LLFloaterColorPicker::
LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate )
LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate )
: LLFloater (std::string("Color Picker Floater")),
mComponents ( 3 ),
mMouseDownInLumRegion ( FALSE ),
@@ -124,10 +123,7 @@ LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate )
}
}
//////////////////////////////////////////////////////////////////////////////
// dtor
LLFloaterColorPicker::
~LLFloaterColorPicker()
LLFloaterColorPicker::~LLFloaterColorPicker()
{
// destroy the UI we created
destroyUI ();
@@ -135,9 +131,7 @@ LLFloaterColorPicker::
//////////////////////////////////////////////////////////////////////////////
//
void
LLFloaterColorPicker::
createUI ()
void LLFloaterColorPicker::createUI ()
{
// build the majority of the gui using the factory builder
LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" );
@@ -184,9 +178,7 @@ createUI ()
//////////////////////////////////////////////////////////////////////////////
//
void
LLFloaterColorPicker::
showUI ()
void LLFloaterColorPicker::showUI ()
{
setVisible ( TRUE );
setFocus ( TRUE );
@@ -219,26 +211,24 @@ showUI ()
//////////////////////////////////////////////////////////////////////////////
// called after the dialog is rendered
BOOL
LLFloaterColorPicker::
postBuild()
BOOL LLFloaterColorPicker::postBuild()
{
mCancelBtn = getChild<LLButton>( "cancel_btn" );
mCancelBtn->setClickedCallback ( boost::bind(&LLFloaterColorPicker::onClickCancel,this) );
mCancelBtn->setClickedCallback ( onClickCancel, this );
mSelectBtn = getChild<LLButton>( "select_btn");
mSelectBtn->setClickedCallback ( boost::bind(&LLFloaterColorPicker::onClickSelect,this) );
mSelectBtn->setClickedCallback ( onClickSelect, this );
mSelectBtn->setFocus ( TRUE );
mPipetteBtn = getChild<LLButton>("color_pipette" );
mPipetteBtn->setImages(std::string("eye_button_inactive.tga"), std::string("eye_button_active.tga"));
mPipetteBtn->setClickedCallback( boost::bind(&LLFloaterColorPicker::onClickPipette,this) );
mPipetteBtn->setClickedCallback( boost::bind(&LLFloaterColorPicker::onClickPipette,this ));
mApplyImmediateCheck = getChild<LLCheckBoxCtrl>("apply_immediate");
mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately"));
mApplyImmediateCheck->setCommitCallback(boost::bind(&LLFloaterColorPicker::onImmediateCheck,this));
mApplyImmediateCheck->setCommitCallback(onImmediateCheck, this);
childSetCommitCallback("rspin", onTextCommit, (void*)this );
childSetCommitCallback("gspin", onTextCommit, (void*)this );
@@ -248,14 +238,14 @@ postBuild()
childSetCommitCallback("lspin", onTextCommit, (void*)this );
childSetCommitCallback("hexval", onHexCommit, (void*)this );
LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterColorPicker::onColorSelect, this, _1));
return TRUE;
}
//////////////////////////////////////////////////////////////////////////////
//
void
LLFloaterColorPicker::
initUI ( F32 rValIn, F32 gValIn, F32 bValIn )
void LLFloaterColorPicker::initUI ( F32 rValIn, F32 gValIn, F32 bValIn )
{
// start catching lose-focus events from entry widgets
enableTextCallbacks ( TRUE );
@@ -277,9 +267,7 @@ initUI ( F32 rValIn, F32 gValIn, F32 bValIn )
//////////////////////////////////////////////////////////////////////////////
//
void
LLFloaterColorPicker::
destroyUI ()
void LLFloaterColorPicker::destroyUI ()
{
// shut down pipette tool if active
stopUsingPipette();
@@ -295,7 +283,7 @@ destroyUI ()
if ( mSwatchView )
{
this->removeChild ( mSwatchView );
delete mSwatchView;
mSwatchView->die();;
mSwatchView = NULL;
}
}
@@ -303,9 +291,7 @@ destroyUI ()
//////////////////////////////////////////////////////////////////////////////
//
F32
LLFloaterColorPicker::
hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn )
F32 LLFloaterColorPicker::hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn )
{
if ( valHUeIn < 0.0f ) valHUeIn += 1.0f;
if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f;
@@ -317,9 +303,7 @@ hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn )
//////////////////////////////////////////////////////////////////////////////
//
void
LLFloaterColorPicker::
hslToRgb ( F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32& bValOut )
void LLFloaterColorPicker::hslToRgb ( F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32& bValOut )
{
if ( sValIn < 0.00001f )
{
@@ -347,9 +331,7 @@ hslToRgb ( F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32&
//////////////////////////////////////////////////////////////////////////////
// mutator for original RGB value
void
LLFloaterColorPicker::
setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn )
void LLFloaterColorPicker::setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn )
{
origR = origRIn;
origG = origGIn;
@@ -358,9 +340,7 @@ setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn )
//////////////////////////////////////////////////////////////////////////////
// accessor for original RGB value
void
LLFloaterColorPicker::
getOrigRgb ( F32& origROut, F32& origGOut, F32& origBOut )
void LLFloaterColorPicker::getOrigRgb ( F32& origROut, F32& origGOut, F32& origBOut )
{
origROut = origR;
origGOut = origG;
@@ -369,9 +349,7 @@ getOrigRgb ( F32& origROut, F32& origGOut, F32& origBOut )
//////////////////////////////////////////////////////////////////////////////
// mutator for current RGB value
void
LLFloaterColorPicker::
setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn )
void LLFloaterColorPicker::setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn )
{
// save current RGB
curR = curRIn;
@@ -391,9 +369,7 @@ setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn )
//////////////////////////////////////////////////////////////////////////////
// accessor for current RGB value
void
LLFloaterColorPicker::
getCurRgb ( F32& curROut, F32& curGOut, F32& curBOut )
void LLFloaterColorPicker::getCurRgb ( F32& curROut, F32& curGOut, F32& curBOut )
{
curROut = curR;
curGOut = curG;
@@ -402,9 +378,7 @@ getCurRgb ( F32& curROut, F32& curGOut, F32& curBOut )
//////////////////////////////////////////////////////////////////////////////
// mutator for current HSL value
void
LLFloaterColorPicker::
setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn )
void LLFloaterColorPicker::setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn )
{
// save current HSL
curH = curHIn;
@@ -417,9 +391,7 @@ setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn )
//////////////////////////////////////////////////////////////////////////////
// accessor for current HSL value
void
LLFloaterColorPicker::
getCurHsl ( F32& curHOut, F32& curSOut, F32& curLOut )
void LLFloaterColorPicker::getCurHsl ( F32& curHOut, F32& curSOut, F32& curLOut )
{
curHOut = curH;
curSOut = curS;
@@ -428,9 +400,7 @@ getCurHsl ( F32& curHOut, F32& curSOut, F32& curLOut )
//////////////////////////////////////////////////////////////////////////////
// called when 'cancel' clicked
void
LLFloaterColorPicker::
onClickCancel ( void* data )
void LLFloaterColorPicker::onClickCancel ( void* data )
{
if (data)
{
@@ -446,9 +416,7 @@ onClickCancel ( void* data )
//////////////////////////////////////////////////////////////////////////////
// called when 'select' clicked
void
LLFloaterColorPicker::
onClickSelect ( void* data )
void LLFloaterColorPicker::onClickSelect ( void* data )
{
if (data)
{
@@ -463,31 +431,23 @@ onClickSelect ( void* data )
}
}
void LLFloaterColorPicker::onClickPipette( void* data )
void LLFloaterColorPicker::onClickPipette()
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if ( self)
{
BOOL pipette_active = self->mPipetteBtn->getToggleState();
BOOL pipette_active = mPipetteBtn->getToggleState();
pipette_active = !pipette_active;
if (pipette_active)
{
LLToolPipette::getInstance()->setSelectCallback(onColorSelect, self);
LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance());
}
else
{
LLToolMgr::getInstance()->clearTransientTool();
}
}
}
//////////////////////////////////////////////////////////////////////////////
// called when 'text is committed' - i,e. focus moves from a text field
void
LLFloaterColorPicker::
onTextCommit ( LLUICtrl* ctrl, void* data )
void LLFloaterColorPicker::onTextCommit ( LLUICtrl* ctrl, void* data )
{
if ( data )
{
@@ -499,22 +459,13 @@ onTextCommit ( LLUICtrl* ctrl, void* data )
}
}
void LLFloaterColorPicker::onImmediateCheck()
void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data)
{
gSavedSettings.setBOOL("ApplyColorImmediately", mApplyImmediateCheck->get());
if (mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( getSwatch(), LLColorSwatchCtrl::COLOR_CHANGE );
}
}
void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te, void *data )
{
LLFloaterColorPicker* self = (LLFloaterColorPicker*)data;
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if (self)
{
self->setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]);
gSavedSettings.setBOOL("ApplyColorImmediately", self->mApplyImmediateCheck->get());
if (self->mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
@@ -522,6 +473,15 @@ void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te, void *data )
}
}
void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te)
{
setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]);
if (mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
}
void LLFloaterColorPicker::onMouseCaptureLost()
{
setMouseDownInHueRegion(FALSE);
@@ -673,9 +633,7 @@ void LLFloaterColorPicker::draw()
//////////////////////////////////////////////////////////////////////////////
// find a complimentary color to the one passed in that can be used to highlight
const LLColor4&
LLFloaterColorPicker::
getComplimentaryColor ( const LLColor4& backgroundColor )
const LLColor4& LLFloaterColorPicker::getComplimentaryColor ( const LLColor4& backgroundColor )
{
// going to base calculation on luminance
F32 hVal, sVal, lVal;
@@ -695,9 +653,7 @@ getComplimentaryColor ( const LLColor4& backgroundColor )
//////////////////////////////////////////////////////////////////////////////
// draw color palette
void
LLFloaterColorPicker::
drawPalette ()
void LLFloaterColorPicker::drawPalette ()
{
S32 curEntry = 0;
@@ -759,9 +715,7 @@ std::string RGBToHex(int rNum, int gNum, int bNum)
}
//Called when a hex value is entered into the Hex field - Convert and set values.
void
LLFloaterColorPicker::
onHexCommit ( LLUICtrl* ctrl, void* data )
void LLFloaterColorPicker::onHexCommit ( LLUICtrl* ctrl, void* data )
{
if ( data )
{
@@ -834,9 +788,7 @@ enableTextCallbacks ( BOOL stateIn )
//////////////////////////////////////////////////////////////////////////////
//
void
LLFloaterColorPicker::
onTextEntryChanged ( LLUICtrl* ctrl )
void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl )
{
// value in RGB boxes changed
std::string name = ctrl->getName();
@@ -905,9 +857,7 @@ onTextEntryChanged ( LLUICtrl* ctrl )
//////////////////////////////////////////////////////////////////////////////
//
BOOL
LLFloaterColorPicker::
updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn )
BOOL LLFloaterColorPicker::updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn )
{
if ( xPosIn >= mRGBViewerImageLeft &&
xPosIn <= mRGBViewerImageLeft + mRGBViewerImageWidth &&
@@ -943,9 +893,7 @@ updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn )
//////////////////////////////////////////////////////////////////////////////
//
BOOL
LLFloaterColorPicker::
handleMouseDown ( S32 x, S32 y, MASK mask )
BOOL LLFloaterColorPicker::handleMouseDown ( S32 x, S32 y, MASK mask )
{
// make it the frontmost
gFloaterView->bringToFront(this);
@@ -1047,9 +995,7 @@ handleMouseDown ( S32 x, S32 y, MASK mask )
//////////////////////////////////////////////////////////////////////////////
//
BOOL
LLFloaterColorPicker::
handleHover ( S32 x, S32 y, MASK mask )
BOOL LLFloaterColorPicker::handleHover ( S32 x, S32 y, MASK mask )
{
// if we're the front most window
if ( isFrontmost () )
@@ -1125,9 +1071,7 @@ void LLFloaterColorPicker::onClose(bool app_quitting)
//////////////////////////////////////////////////////////////////////////////
// reverts state once mouse button is released
BOOL
LLFloaterColorPicker::
handleMouseUp ( S32 x, S32 y, MASK mask )
BOOL LLFloaterColorPicker::handleMouseUp ( S32 x, S32 y, MASK mask )
{
getWindow()->setCursor ( UI_CURSOR_ARROW );
@@ -1202,9 +1146,7 @@ handleMouseUp ( S32 x, S32 y, MASK mask )
//////////////////////////////////////////////////////////////////////////////
// cancel current color selection, revert to original and close picker
void
LLFloaterColorPicker::
cancelSelection ()
void LLFloaterColorPicker::cancelSelection ()
{
// restore the previous color selection
setCurRgb ( getOrigR (), getOrigG (), getOrigB () );

View File

@@ -123,11 +123,11 @@ class LLFloaterColorPicker
// callbacks
static void onClickCancel ( void* data );
static void onClickSelect ( void* data );
static void onClickPipette ( void* data );
void onClickPipette ( );
static void onTextCommit ( LLUICtrl* ctrl, void* data );
static void onImmediateCheck ( LLUICtrl* ctrl, void* data );
static void onHexCommit ( LLUICtrl* ctrl, void* data );
void onImmediateCheck();
static void onColorSelect( const LLTextureEntry& te, void *data );
void onColorSelect( const LLTextureEntry& te );
private:
// turns on or off text entry commit call backs
void enableTextCallbacks ( BOOL stateIn );

View File

@@ -166,13 +166,7 @@ BOOL LLFloaterExploreSounds::tick()
// Save scroll pos and selection so they can be restored
S32 scroll_pos = list->getScrollPos();
LLDynamicArray<LLUUID> selected_ids;
std::vector<LLScrollListItem*> selected_items = list->getAllSelected();
std::vector<LLScrollListItem*>::iterator selection_iter = selected_items.begin();
std::vector<LLScrollListItem*>::iterator selection_end = selected_items.end();
for(; selection_iter != selection_end; ++selection_iter)
selected_ids.push_back((*selection_iter)->getUUID());
uuid_vec_t selected_ids = list->getSelectedIDs();
list->clearRows();
std::list<LLUUID> unique_asset_list;

View File

@@ -168,7 +168,7 @@ void LLPanelFriends::updateFriends(U32 changed_mask)
// if the maximum amount of friends are selected
mShowMaxSelectWarning = false;
LLDynamicArray<LLUUID> selected_friends = getSelectedIDs();
const uuid_vec_t selected_friends = mFriendsList->getSelectedIDs();
if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
{
refreshNames(changed_mask);
@@ -187,13 +187,13 @@ void LLPanelFriends::updateFriends(U32 changed_mask)
tick();
}
}
if(selected_friends.size() > 0)
if(!selected_friends.empty())
{
// only non-null if friends was already found. This may fail,
// but we don't really care here, because refreshUI() will
// clean up the interface.
friends_list->setCurrentByID(selected_id);
for(LLDynamicArray<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr)
for(uuid_vec_t::const_iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr)
{
friends_list->setSelectedByValue(*itr, true);
}
@@ -587,7 +587,7 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh
void LLPanelFriends::refreshRightsChangeList()
{
LLDynamicArray<LLUUID> friends = getSelectedIDs();
const uuid_vec_t friends = mFriendsList->getSelectedIDs();
S32 num_selected = friends.size();
bool can_offer_teleport = num_selected >= 1;
@@ -610,7 +610,7 @@ void LLPanelFriends::refreshRightsChangeList()
processing_label->setVisible(false);
} Making Dummy View -HgB */
const LLRelationship* friend_status = NULL;
for(LLDynamicArray<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr)
for(uuid_vec_t::const_iterator itr = friends.begin(); itr != friends.end(); ++itr)
{
friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr);
if (friend_status)
@@ -659,7 +659,7 @@ struct SortFriendsByID
void LLPanelFriends::refreshNames(U32 changed_mask)
{
LLDynamicArray<LLUUID> selected_ids = getSelectedIDs();
const uuid_vec_t selected_ids = mFriendsList->getSelectedIDs();
S32 pos = mFriendsList->getScrollPos();
// get all buddies we know about
@@ -685,7 +685,7 @@ void LLPanelFriends::refreshNames(U32 changed_mask)
// Changed item in place, need to request sort and update columns
// because we might have changed data in a column on which the user
// has already sorted. JC
mFriendsList->sortItems();
mFriendsList->updateSort();
// re-select items
mFriendsList->selectMultiple(selected_ids);
@@ -787,18 +787,6 @@ void LLPanelFriends::refreshUI()
refreshRightsChangeList();
}
LLDynamicArray<LLUUID> LLPanelFriends::getSelectedIDs()
{
LLUUID selected_id;
LLDynamicArray<LLUUID> friend_ids;
std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected();
for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr)
{
friend_ids.push_back((*itr)->getUUID());
}
return friend_ids;
}
// static
void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data)
{
@@ -818,8 +806,8 @@ void LLPanelFriends::onClickProfile(void* user_data)
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickProfile()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
LLUUID agent_id = ids[0];
BOOL online;
@@ -834,7 +822,7 @@ void LLPanelFriends::onClickAssign(void* user_data)
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
if (panelp)
{
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
ASFloaterContactGroups::show(ids);
}
}
@@ -885,8 +873,8 @@ void LLPanelFriends::onClickIM(void* user_data)
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickIM()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
if(ids.size() == 1)
{
@@ -959,13 +947,12 @@ bool LLPanelFriends::callbackAddFriend(const LLSD& notification, const LLSD& res
}
// static
void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names,
const std::vector<LLUUID>& ids,
void* )
void LLPanelFriends::onPickAvatar( const uuid_vec_t& ids,
const std::vector<LLAvatarName>& names )
{
if (names.empty()) return;
if (ids.empty()) return;
requestFriendshipDialog(ids[0], names[0]);
requestFriendshipDialog(ids[0], names[0].getCompleteName());
}
// static
@@ -1001,7 +988,7 @@ void LLPanelFriends::onClickAddFriend(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onPickAvatar, user_data, FALSE, TRUE);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1, _2), FALSE, TRUE);
if (root_floater)
{
root_floater->addDependentFloater(picker);
@@ -1014,9 +1001,9 @@ void LLPanelFriends::onClickRemove(void* user_data)
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
LLSD args;
if(ids.size() > 0)
if(!ids.empty())
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
@@ -1053,7 +1040,7 @@ void LLPanelFriends::onClickRemove(void* user_data)
}
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
for (uuid_vec_t::const_iterator it = ids.begin();
it != ids.end();
++it)
{
@@ -1257,8 +1244,8 @@ void LLPanelFriends::onClickOfferTeleport(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
handle_lure(ids);
}
@@ -1269,8 +1256,8 @@ void LLPanelFriends::onClickPay(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() == 1)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
handle_pay_by_id(ids[0]);
}
@@ -1281,7 +1268,7 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command
if (ids.empty()) return;
LLSD args;
if(ids.size() > 0)
if(!ids.empty())
{
rights_map_t* rights = new rights_map_t(ids);

View File

@@ -41,6 +41,7 @@
#include "lleventtimer.h"
#include "llcallingcard.h"
class LLAvatarName;
class LLFriendObserver;
class LLRelationship;
class LLScrollListItem;
@@ -126,15 +127,12 @@ private:
void confirmModifyRights(rights_map_t& ids, EGrantRevoke command);
void sendRightsGrant(rights_map_t& ids);
// return LLUUID::null if nothing is selected
LLDynamicArray<LLUUID> getSelectedIDs();
// callback methods
static void onSelectName(LLUICtrl* ctrl, void* user_data);
static void onChangeContactGroup(LLUICtrl* ctrl, void* user_data);
static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
static void onPickAvatar(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names );
static void onContactSearchEdit(const std::string& search_string, void* user_data);
static void onClickIM(void* user_data);
static void onClickAssign(void* user_data);

View File

@@ -1499,7 +1499,7 @@ void LLPanelLandObjects::onClickRefresh(void* userdata)
// ready the list for results
self->mOwnerList->deleteAllItems();
self->mOwnerList->addCommentText(LLTrans::getString("Searching"));
self->mOwnerList->setCommentText(LLTrans::getString("Searching"));
self->mOwnerList->setEnabled(FALSE);
self->mFirstReply = TRUE;
@@ -1526,8 +1526,6 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
return;
}
const LLFontGL* FONT = LLFontGL::getFontSansSerif();
// Extract all of the owners.
S32 rows = msg->getNumberOfBlocksFast(_PREHASH_Data);
//uuid_list_t return_ids;
@@ -1568,44 +1566,64 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
BOOL in_sim = (std::find(avatar_ids.begin(), avatar_ids.end(), owner_id) != avatar_ids.end());
LLScrollListItem *row = new LLScrollListItem( TRUE, NULL, owner_id);
LLSD item;
item["id"] = owner_id;
LLSD& row = item["columns"];
LLSD icon_column;
LLSD status_column;
icon_column["type"] = "icon";
icon_column["column"] = "type";
status_column["font"] = "SANSSERIF";
status_column["column"] = "online_status";
if (is_group_owned)
{
row->addColumn(self->mIconGroup);
row->addColumn(OWNER_GROUP, FONT);
icon_column["value"] = self->mIconGroup->getName();
status_column["value"] = OWNER_GROUP;
}
else if (in_sim)
{
row->addColumn(self->mIconAvatarInSim);
row->addColumn(OWNER_INSIM, FONT);
icon_column["value"] = self->mIconAvatarInSim->getName();
status_column["value"] = OWNER_INSIM;
}
else if (is_online)
{
row->addColumn(self->mIconAvatarOnline);
row->addColumn(OWNER_ONLINE, FONT);
icon_column["value"] = self->mIconAvatarOnline->getName();
status_column["value"] = OWNER_ONLINE;
}
else // offline
{
row->addColumn(self->mIconAvatarOffline);
row->addColumn(OWNER_OFFLINE, FONT);
icon_column["value"] = self->mIconAvatarOffline->getName();
status_column["value"] = OWNER_OFFLINE;
}
row.append(icon_column);
row.append(status_column);
// Placeholder for name.
row->addColumn(LLStringUtil::null, FONT);
LLAvatarName av_name;
LLAvatarNameCache::get(owner_id, &av_name);
LLSD name_column;
name_column["value"] = av_name.getCompleteName();
name_column["font"] = "SANSSERIF";
name_column["column"] = "name";
row.append(name_column);
object_count_str = llformat("%d", object_count);
row->addColumn(object_count_str, FONT);
LLSD count_column;
count_column["value"] = llformat("%d", object_count);
count_column["font"] = "SANSSERIF";
count_column["column"] = "count";
row.append(count_column);
row->addColumn(formatted_time((time_t)most_recent_time), FONT);
LLSD time_column;
time_column["value"] = formatted_time((time_t)most_recent_time);
time_column["font"] = "SANSSERIF";
time_column["column"] = "mostrecent";
row.append(time_column);
if (is_group_owned)
{
if( is_group_owned )
self->mOwnerList->addGroupNameItem(row, ADD_BOTTOM);
}
else
{
self->mOwnerList->addNameItem(row, ADD_BOTTOM);
}
lldebugs << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent")
<< ") owns " << object_count << " objects." << llendl;
@@ -1613,7 +1631,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
// check for no results
if (0 == self->mOwnerList->getItemCount())
{
self->mOwnerList->addCommentText(LLTrans::getString("NoneFound"));
self->mOwnerList->setCommentText(LLTrans::getString("NoneFound"));
}
else
{
@@ -2439,7 +2457,11 @@ void LLPanelLandAccess::refresh()
childSetLabelArg("GroupCheck", "[GROUP]", group_name );
// Allow list
if (mListAccess)
{
// Clear the sort order so we don't re-sort on every add.
mListAccess->clearSortOrder();
mListAccess->deleteAllItems();
S32 count = parcel->mAccessList.size();
childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count));
childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST));
@@ -2475,13 +2497,17 @@ void LLPanelLandAccess::refresh()
}
suffix.append(" " + getString("remaining") + ")");
}
if (mListAccess)
mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
}
mListAccess->sortByName(TRUE);
}
// Ban List
if(mListBanned)
{
// Clear the sort order so we don't re-sort on every add.
mListBanned->clearSortOrder();
mListBanned->deleteAllItems();
S32 count = parcel->mBanList.size();
childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",count));
@@ -2520,6 +2546,7 @@ void LLPanelLandAccess::refresh()
}
mListBanned->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
}
mListBanned->sortByName(TRUE);
}
if(parcel->getRegionDenyAnonymousOverride())

View File

@@ -636,18 +636,18 @@ void LLFloaterMessageLog::refreshNetList()
{
LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(1);
icon->setValue("icon_net_close_circuit.tga");
icon->setClickCallback(onClickCloseCircuit, itemp);
icon->setClickCallback(boost::bind(&LLFloaterMessageLog::onClickCloseCircuit, itemp));
}
else
{
LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(1);
icon->setValue("icon_net_close_circuit_gray.tga");
icon->setClickCallback(NULL, NULL);
//icon->setClickCallback(NULL);
}
// Event queue isn't even supported yet... FIXME
LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(2);
icon->setValue("icon_net_close_eventpoll_gray.tga");
icon->setClickCallback(NULL, NULL);
//icon->setClickCallback(NULL);
}
if(selected_id.notNull()) scrollp->selectByID(selected_id);
if(scroll_pos < scrollp->getItemCount()) scrollp->setScrollPos(scroll_pos);

View File

@@ -92,7 +92,7 @@ void LLFloaterNewIM::addSpecial(const LLUUID& uuid, const std::string& name,
LLSD row;
row["id"] = uuid;
row["name"] = name;
row["target"] = "SPECIAL";
row["target"] = LLNameListCtrl::SPECIAL;
row["columns"][0]["value"] = name;
row["columns"][0]["width"] = COL_1_WIDTH;
row["columns"][0]["font"] = "SANSSERIF";
@@ -113,7 +113,7 @@ void LLFloaterNewIM::addGroup(const LLUUID& uuid, void* data, BOOL bold, BOOL on
{
LLSD row;
row["id"] = uuid;
row["target"] = "GROUP";
row["target"] = LLNameListCtrl::GROUP;
row["columns"][0]["value"] = ""; // name will be looked up
row["columns"][0]["width"] = COL_1_WIDTH;
row["columns"][0]["font"] = "SANSSERIF";
@@ -132,12 +132,10 @@ void LLFloaterNewIM::addGroup(const LLUUID& uuid, void* data, BOOL bold, BOOL on
void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online)
{
std::string fullname;
gCacheName->getFullName(uuid, fullname);
LLSD row;
row["id"] = uuid;
row["columns"][0]["value"] = fullname;
row["target"] = LLNameListCtrl::INDIVIDUAL;
row["columns"][0]["value"] = "";
row["columns"][0]["width"] = COL_1_WIDTH;
row["columns"][0]["font"] = "SANSSERIF";
row["columns"][0]["font-style"] = online ? "BOLD" : "NORMAL";

View File

@@ -3200,7 +3200,8 @@ bool LLDispatchSetEstateAccess::operator()(
if (allowed_agent_name_list)
{
//allowed_agent_name_list->deleteAllItems();
// Don't sort these as we add them, sort them when we are done.
allowed_agent_name_list->clearSortOrder();
for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
{
LLUUID id;
@@ -3208,7 +3209,7 @@ bool LLDispatchSetEstateAccess::operator()(
allowed_agent_name_list->addNameItem(id);
}
panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE);
allowed_agent_name_list->sortByColumnIndex(0, TRUE);
allowed_agent_name_list->sortByName(TRUE);
}
}
@@ -3225,6 +3226,8 @@ bool LLDispatchSetEstateAccess::operator()(
if (allowed_group_name_list)
{
// Don't sort these as we add them, sort them when we are done.
allowed_group_name_list->clearSortOrder();
allowed_group_name_list->deleteAllItems();
for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++)
{
@@ -3233,7 +3236,7 @@ bool LLDispatchSetEstateAccess::operator()(
allowed_group_name_list->addGroupNameItem(id);
}
panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE);
allowed_group_name_list->sortByColumnIndex(0, TRUE);
allowed_group_name_list->sortByName(TRUE);
}
}
@@ -3257,7 +3260,9 @@ bool LLDispatchSetEstateAccess::operator()(
if (banned_agent_name_list)
{
//banned_agent_name_list->deleteAllItems();
// Don't sort these as we add them, sort them when we are done.
banned_agent_name_list->clearSortOrder();
for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
{
LLUUID id;
@@ -3265,7 +3270,7 @@ bool LLDispatchSetEstateAccess::operator()(
banned_agent_name_list->addNameItem(id);
}
panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE);
banned_agent_name_list->sortByColumnIndex(0, TRUE);
banned_agent_name_list->sortByName(TRUE);
}
}
@@ -3280,6 +3285,9 @@ bool LLDispatchSetEstateAccess::operator()(
panel->getChild<LLNameListCtrl>("estate_manager_name_list");
if (estate_manager_name_list)
{
// Don't sort these as we add them, sort them when we are done.
estate_manager_name_list->clearSortOrder();
estate_manager_name_list->deleteAllItems(); // Clear existing entries
// There should be only ESTATE_MAX_MANAGERS people in the list, but if the database gets more (SL-46107) don't
@@ -3292,7 +3300,7 @@ bool LLDispatchSetEstateAccess::operator()(
estate_manager_name_list->addNameItem(id);
}
panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE);
estate_manager_name_list->sortByColumnIndex(0, TRUE);
estate_manager_name_list->sortByName(TRUE);
}
}

View File

@@ -250,7 +250,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
if (total_count == 0 && list->getItemCount() == 0)
{
list->addCommentText(getString("none_descriptor"));
list->setCommentText(getString("none_descriptor"));
}
else
{

View File

@@ -1593,7 +1593,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
else
{
// if we found nothing, say "none"
list->addCommentText(LLTrans::getString("worldmap_results_none_found"));
list->setCommentText(LLTrans::getString("worldmap_results_none_found"));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
}

View File

@@ -792,7 +792,7 @@ void LLGestureMgr::update()
if (gesture->mDoneCallback)
{
gesture->mDoneCallback(gesture, gesture->mCallbackData);
gesture->mDoneCallback(gesture);
// callback might have deleted gesture, can't
// rely on this pointer any more
@@ -1299,7 +1299,7 @@ void LLGestureMgr::stopGesture(LLMultiGesture* gesture)
if (gesture->mDoneCallback)
{
gesture->mDoneCallback(gesture, gesture->mCallbackData);
gesture->mDoneCallback(gesture);
// callback might have deleted gesture, can't
// rely on this pointer any more

View File

@@ -619,11 +619,11 @@ BOOL LLFloaterInventoryBackup::postBuild(void)
status_column["column"] = "status";
status_column["value"] = "Pending";
LLScrollListItem* scroll_itemp = list->addElement(element, ADD_BOTTOM);
/*LLScrollListItem* scroll_itemp = */list->addElement(element, ADD_BOTTOM);
//hack to stop crashing
LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(LIST_TYPE);
icon->setClickCallback(NULL, NULL);
//LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(LIST_TYPE);
//icon->setClickCallback(NULL);
}
// Setup and go!

View File

@@ -32,13 +32,16 @@
#include "llviewerprecompiledheaders.h"
#include "llnamelistctrl.h"
#include <boost/tokenizer.hpp>
#include "llnamelistctrl.h"
#include "llavatarnamecache.h"
#include "llcachename.h"
#include "llagent.h"
#include "llinventory.h"
#include "lltrans.h"
static LLRegisterWidget<LLNameListCtrl> r("name_list");
@@ -51,12 +54,14 @@ LLNameListCtrl::LLNameListCtrl(const std::string& name,
void* userdata,
BOOL allow_multiple_selection,
BOOL draw_border,
bool draw_heading,
S32 name_column_index,
const std::string& tooltip)
: LLScrollListCtrl(name, rect, cb, userdata, allow_multiple_selection,
draw_border),
draw_border,draw_heading),
mNameColumnIndex(name_column_index),
mAllowCallingCardDrop(FALSE)
mAllowCallingCardDrop(FALSE),
mShortNames(FALSE)
{
setToolTip(tooltip);
LLNameListCtrl::sInstances.insert(this);
@@ -71,19 +76,22 @@ LLNameListCtrl::~LLNameListCtrl()
// public
BOOL LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
BOOL enabled, std::string const& suffix)
LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
BOOL enabled, const std::string& suffix)
{
//llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl;
std::string fullname;
BOOL result = gCacheName->getFullName(agent_id, fullname);
LLSD item;
item["id"] = agent_id;
item["enabled"] = enabled;
item["target"] = INDIVIDUAL;
item["suffix"] = suffix;
LLSD& column = item["columns"][0];
column["value"] = "";
column["font"] = "SANSSERIF";
column["column"] = "name";
fullname.append(suffix);
addStringUUIDItem(fullname, agent_id, pos, enabled);
return result;
return addNameItemRow(item, pos);
}
// virtual, public
@@ -134,79 +142,99 @@ BOOL LLNameListCtrl::handleDragAndDrop(
return handled;
}
// public
void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos,
BOOL enabled)
{
//llinfos << "LLNameListCtrl::addGroupNameItem " << group_id << llendl;
std::string group_name;
gCacheName->getGroupName(group_id, group_name);
addStringUUIDItem(group_name, group_id, pos, enabled);
LLSD item;
item["id"] = group_id;
item["enabled"] = enabled;
item["target"] = GROUP;
LLSD& column = item["columns"][0];
column["value"] = "";
column["font"] = "SANSSERIF";
column["column"] = "name";
addNameItemRow(item, pos);
}
// public
void LLNameListCtrl::addGroupNameItem(LLScrollListItem* item, EAddPosition pos)
void LLNameListCtrl::addGroupNameItem(LLSD& item, EAddPosition pos)
{
//llinfos << "LLNameListCtrl::addGroupNameItem " << item->getUUID() << llendl;
std::string group_name;
gCacheName->getGroupName(item->getUUID(), group_name);
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
((LLScrollListText*)cell)->setText( std::string(group_name) );
addItem(item, pos);
item["target"] = GROUP;
addNameItemRow(item, pos);
}
BOOL LLNameListCtrl::addNameItem(LLScrollListItem* item, EAddPosition pos)
LLScrollListItem* LLNameListCtrl::addNameItem(LLSD& item, EAddPosition pos)
{
//llinfos << "LLNameListCtrl::addNameItem " << item->getUUID() << llendl;
std::string fullname;
BOOL result = gCacheName->getFullName(item->getUUID(), fullname);
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
((LLScrollListText*)cell)->setText( fullname );
addItem(item, pos);
// this column is resizable
LLScrollListColumn* columnp = getColumn(mNameColumnIndex);
if (columnp && columnp->mHeader)
{
columnp->mHeader->setHasResizableElement(TRUE);
}
return result;
item["target"] = INDIVIDUAL;
return addNameItemRow(item, pos);
}
LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos, void* userdata)
{
return addNameItemRow(value, pos, userdata);
}
LLScrollListItem* LLNameListCtrl::addNameItemRow(const LLSD& value, EAddPosition pos, void* userdata)
{
LLScrollListItem* item = LLScrollListCtrl::addElement(value, pos, userdata);
if (!item) return NULL;
LLUUID id = item->getUUID();
// use supplied name by default
std::string fullname = value["name"].asString();
if (value["target"].asString() == "GROUP")
switch(value["target"].asInteger())
{
gCacheName->getGroupName(item->getUUID(), fullname);
case GROUP:
gCacheName->getGroupName(id, fullname);
// fullname will be "nobody" if group not found
}
else if (value["target"].asString() == "SPECIAL")
{
break;
case SPECIAL:
// just use supplied name
}
else // normal resident
break;
case INDIVIDUAL:
{
std::string name;
if (gCacheName->getFullName(item->getUUID(), name))
LLAvatarName av_name;
if (id.isNull())
{
fullname = name;
fullname = LLTrans::getString("AvatarNameNobody");
}
else if (LLAvatarNameCache::get(id, &av_name))
{
if (mShortNames)
fullname = av_name.mDisplayName;
else
fullname = av_name.getCompleteName();
}
else
{
fullname = " ( " + LLTrans::getString("LoadingData") + " ) ";
// ...schedule a callback
LLAvatarNameCache::get(id,
boost::bind(&LLNameListCtrl::onAvatarNameCache,
this, _1, _2, item->getHandle()));
}
break;
}
default:
break;
}
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
((LLScrollListText*)cell)->setText( fullname );
// Append optional suffix.
std::string suffix = value["suffix"];
if(!suffix.empty())
{
fullname.append(suffix);
}
LLScrollListCell* cell = item->getColumn(mNameColumnIndex);
if (cell && !fullname.empty() && cell->getValue().asString().empty())
{
cell->setValue(fullname);
}
dirtyColumns();
@@ -223,54 +251,53 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos
// public
void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
{
BOOL item_exists = selectByID( agent_id );
if(item_exists)
// Find the item specified with agent_id.
S32 idx = -1;
for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++)
{
S32 index = getItemIndex(getFirstSelected());
if(index >= 0)
LLScrollListItem* item = *it;
if (item->getUUID() == agent_id)
{
deleteSingleItem(index);
idx = getItemIndex(item);
break;
}
}
// Remove it.
if (idx >= 0)
{
selectNthItem(idx); // not sure whether this is needed, taken from previous implementation
deleteSingleItem(idx);
}
}
// public
void LLNameListCtrl::refresh(const LLUUID& agent_id, const std::string& full_name)
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name,
LLHandle<LLScrollListItem> item)
{
//llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " "
// << last << "'" << llendl;
std::string name;
if (mShortNames)
name = av_name.mDisplayName;
else
name = av_name.getCompleteName();
// TODO: scan items for that ID, fix if necessary
item_list::iterator iter;
for (iter = getItemList().begin(); iter != getItemList().end(); iter++)
LLScrollListItem* list_item = item.get();
if (list_item && list_item->getUUID() == agent_id)
{
LLScrollListItem* item = *iter;
if (item->getUUID() == agent_id)
{
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
if (cell)
{
((LLScrollListText*)cell)->setText( full_name );
}
cell->setValue(name);
setNeedsSort();
}
}
dirtyColumns();
}
// static
void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& full_name)
void LLNameListCtrl::sortByName(BOOL ascending)
{
std::set<LLNameListCtrl*>::iterator it;
for (it = LLNameListCtrl::sInstances.begin();
it != LLNameListCtrl::sInstances.end();
++it)
{
LLNameListCtrl* ctrl = *it;
ctrl->refresh(id, full_name);
}
sortByColumnIndex(mNameColumnIndex,ascending);
}
// virtual
@@ -320,9 +347,9 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
NULL,
multi_select,
draw_border,
name_column_index);
name_list->setDisplayHeading(draw_heading);
draw_heading,
name_column_index
);
if (node->hasAttribute("heading_height"))
{
S32 heading_height;
@@ -439,7 +466,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
while(token_iter != tokens.end())
{
const std::string& line = *token_iter;
name_list->addCommentText(line);
name_list->setCommentText(line);
++token_iter;
}

View File

@@ -37,17 +37,26 @@
#include "llscrolllistctrl.h"
class LLAvatarName;
class LLNameListCtrl
: public LLScrollListCtrl
: public LLScrollListCtrl, public LLInstanceTracker<LLNameListCtrl>
{
public:
typedef enum e_name_type
{
INDIVIDUAL,
GROUP,
SPECIAL
} ENameType;
LLNameListCtrl(const std::string& name,
const LLRect& rect,
LLUICtrlCallback callback,
void* userdata,
BOOL allow_multiple_selection,
BOOL draw_border = TRUE,
bool draw_heading = false,
S32 name_column_index = 0,
const std::string& tooltip = LLStringUtil::null);
virtual ~LLNameListCtrl();
@@ -57,36 +66,38 @@ public:
// Add a user to the list by name. It will be added, the name
// requested from the cache, and updated as necessary.
BOOL addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM,
LLScrollListItem* addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM,
BOOL enabled = TRUE, std::string const& suffix = LLStringUtil::null);
BOOL addNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM);
LLScrollListItem* addNameItem(LLSD& item, EAddPosition pos = ADD_BOTTOM);
virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL);
/*virtual*/ LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL);
LLScrollListItem* addNameItemRow(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL);
// Add a user to the list by name. It will be added, the name
// requested from the cache, and updated as necessary.
void addGroupNameItem(const LLUUID& group_id, EAddPosition pos = ADD_BOTTOM,
BOOL enabled = TRUE);
void addGroupNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM);
void addGroupNameItem(LLSD& item, EAddPosition pos = ADD_BOTTOM);
void removeNameItem(const LLUUID& agent_id);
void refresh(const LLUUID& agent_id, const std::string& full_name);
static void refreshAll(const LLUUID& id, const std::string& full_name);
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
// LLView interface
/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
EAcceptance *accept,
std::string& tooltip_msg);
void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; }
void sortByName(BOOL ascending);
private:
static std::set<LLNameListCtrl*> sInstances;
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, LLHandle<LLScrollListItem> item);
S32 mNameColumnIndex;
BOOL mAllowCallingCardDrop;
bool mShortNames; // display name only, no SLID
};
#endif

View File

@@ -320,7 +320,7 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType
// }
if (0 == pAvatarGroups->group_list.size())
{
group_list->addCommentText(getString("None"));
group_list->setCommentText(getString("None"));
}
for(LLAvatarGroups::group_list_t::const_iterator it = pAvatarGroups->group_list.begin();

View File

@@ -212,7 +212,7 @@ void LLPanelDirBrowser::updateResultCount()
// add none found response
if (list->getItemCount() == 0)
{
list->addCommentText(LLTrans::getString("NoneFound"));
list->setCommentText(LLTrans::getString("NoneFound"));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
}
@@ -1222,7 +1222,7 @@ void LLPanelDirBrowser::setupNewSearch()
// ready the list for results
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
list->addCommentText(LLTrans::getString("Searching"));
list->setCommentText(LLTrans::getString("Searching"));
childDisable("results");
mResultsReceived = 0;

View File

@@ -544,7 +544,7 @@ void LLPanelFace::getState()
bool identical;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
texture_ctrl->setFallbackImageName( "" ); //Singu Note: Don't show the 'locked' image when the texid is null.
// Texture
{
LLUUID id;
@@ -552,8 +552,14 @@ void LLPanelFace::getState()
{
LLUUID get(LLViewerObject* object, S32 te)
{
LLViewerTexture* image = object->getTEImage(te);
//LLViewerTexture* image = object->getTEImage(te);
LLTextureEntry* image = object->getTE(te); //Singu Note: Use this instead of the above.
//The above actually returns LLViewerFetchedTexture::sDefaultImagep when
//the texture id is null, which gives us IMG_DEFAULT, not LLUUID::null
//Such behavior prevents the 'None' button from ever greying out in the face panel.
return image ? image->getID() : LLUUID::null;
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id );

View File

@@ -854,6 +854,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
LLSD row;
row["columns"][0]["value"] = pending.str();
row["columns"][0]["column"] = "name";
mListVisibleMembers->setEnabled(FALSE);
mListVisibleMembers->addElement(row);
@@ -918,7 +919,7 @@ void LLPanelGroupGeneral::updateMembers()
sSDTime += sd_timer.getElapsedTimeF32();
element_timer.reset();
mListVisibleMembers->addElement(row);//, ADD_SORTED);
mListVisibleMembers->addNameItem(row);
sElementTime += element_timer.getElapsedTimeF32();
}
sAllTime += all_timer.getElapsedTimeF32();

View File

@@ -138,9 +138,10 @@ void LLPanelGroupInvite::impl::addUsers(const std::vector<std::string>& names,
//add the name to the names list
LLSD row;
row["id"] = id;
row["columns"][0]["column"] = "name";
row["columns"][0]["value"] = name;
mInvitees->addElement(row);
mInvitees->addNameItem(row);
}
}

View File

@@ -676,7 +676,7 @@ BOOL LLPanelGroupLandMoney::postBuild()
{
if ( mImplementationp->mGroupParcelsp )
{
mImplementationp->mGroupParcelsp->addCommentText(
mImplementationp->mGroupParcelsp->setCommentText(
mImplementationp->mCantViewParcelsText);
mImplementationp->mGroupParcelsp->setEnabled(FALSE);
}

View File

@@ -450,7 +450,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
if (1 == count && id.isNull())
{
// Only one entry, the dummy entry.
mNoticesList->addCommentText(mNoNoticesStr);
mNoticesList->setCommentText(mNoNoticesStr);
mNoticesList->setEnabled(FALSE);
return;
}
@@ -493,7 +493,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
mNoticesList->addElement(row, ADD_BOTTOM);
}
mNoticesList->sortItems();
mNoticesList->updateSort();
}
void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data)

View File

@@ -1615,7 +1615,7 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc)
retrieved << "Retrieving role member mappings...";
}
mMembersList->setEnabled(FALSE);
mMembersList->addCommentText(retrieved.str());
mMembersList->setCommentText(retrieved.str());
}
}
@@ -1680,7 +1680,7 @@ void LLPanelGroupMembersSubTab::updateMembers()
row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus();
row["columns"][2]["font"] = "SANSSERIF_SMALL";
mMembersList->addElement(row);//, ADD_SORTED);
mMembersList->addNameItem(row);
mHasMatch = TRUE;
}
}
@@ -1694,7 +1694,7 @@ void LLPanelGroupMembersSubTab::updateMembers()
else
{
mMembersList->setEnabled(FALSE);
mMembersList->addCommentText(std::string("No match."));
mMembersList->setCommentText(std::string("No match."));
}
}
else

View File

@@ -916,19 +916,19 @@ void LLPanelGroupVoting::impl::addPendingActiveScrollListItem(unsigned int curre
<< current
<< "\\" << expected << ")";
mProposals->addCommentText(pending.str());
mProposals->setCommentText(pending.str());
}
void LLPanelGroupVoting::impl::addNoActiveScrollListItem(EAddPosition pos)
{
// *TODO: translate
mProposals->addCommentText(std::string("There are currently no active proposals"), pos);
mProposals->setCommentText(std::string("There are currently no active proposals"));
}
void LLPanelGroupVoting::impl::addNoHistoryScrollListItem(EAddPosition pos)
{
// *TODO: translate
mVotesHistory->addCommentText(std::string("There are currently no archived proposals"), pos);
mVotesHistory->setCommentText(std::string("There are currently no archived proposals"));
}
void LLPanelGroupVoting::impl::addPendingHistoryScrollListItem(unsigned int current,
@@ -941,7 +941,7 @@ void LLPanelGroupVoting::impl::addPendingHistoryScrollListItem(unsigned int curr
<< current
<< "\\" << expected << ")";
mVotesHistory->addCommentText(pending.str());
mVotesHistory->setCommentText(pending.str());
}

View File

@@ -1321,8 +1321,8 @@ LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect,
void LLPreviewLSL::callbackLSLCompileSucceeded()
{
llinfos << "LSL Bytecode saved" << llendl;
mScriptEd->mErrorList->addCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->addCommentText(LLTrans::getString("SaveComplete"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
}
@@ -1931,8 +1931,8 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
bool is_script_running)
{
lldebugs << "LSL Bytecode saved" << llendl;
mScriptEd->mErrorList->addCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->addCommentText(LLTrans::getString("SaveComplete"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
}
@@ -2518,7 +2518,7 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
else
{
llinfos << "Compile worked!" << llendl;
mScriptEd->mErrorList->addCommentText(LLTrans::getString("CompileSuccessfulSaving"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessfulSaving"));
if(gAssetStorage)
{
llinfos << "LLLiveLSLEditor::saveAsset "
@@ -2593,7 +2593,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
if(self)
{
// Tell the user that the compile worked.
self->mScriptEd->mErrorList->addCommentText(LLTrans::getString("SaveComplete"));
self->mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
// close the window if this completes both uploads
self->getWindow()->decBusyCount();
self->mPendingUploads--;

View File

@@ -1593,7 +1593,10 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid)
// Texture picker defaults aren't inventory items
// * Don't need to worry about permissions for them
// * Can just apply the texture and be done with it.
objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
//objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
objectp->setTETexture(te, mImageID); //Singu note: setTETexture will allow the real id to be passed to LLPrimitive::setTETexture,
// even if it's null. setTEImage would actually pass down IMG_DEFAULT under such a case,
// which we don't want.
}
return true;
}
@@ -1756,7 +1759,10 @@ BOOL LLSelectMgr::selectionRevertTextures()
}
else
{
object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
//object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
object->setTETexture(te, id); //Singu note: setTETexture will allow the real id to be passed to LLPrimitive::setTETexture,
// even if it's null. setTEImage would actually pass down IMG_DEFAULT under such a case,
// which we don't want.
}
}
}

View File

@@ -307,7 +307,6 @@ bool process_login_success_response(std::string &password);
void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group)
{
LLNameListCtrl::refreshAll(id, full_name);
LLNameBox::refreshAll(id, full_name, is_group);
LLNameEditor::refreshAll(id, full_name, is_group);

View File

@@ -161,18 +161,19 @@ public:
static void onBtnSetToDefault( void* userdata );
static void onBtnSelect( void* userdata );
static void onBtnCancel( void* userdata );
static void onBtnPipette( void* userdata );
void onBtnPipette( );
static void onBtnUUID( void* userdata );
//static void onBtnRevert( void* userdata );
static void onBtnWhite( void* userdata );
static void onBtnNone( void* userdata );
static void onBtnInvisible( void* userdata );
static void onBtnAlpha( void* userdata );
static void onBtnClear( void* userdata );
static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data);
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
static void onShowFolders(LLUICtrl* ctrl, void* userdata);
static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata);
static void onSearchEdit(const std::string& search_string, void* user_data );
static void onTextureSelect( const LLTextureEntry& te, void *data );
void onTextureSelect( const LLTextureEntry& te );
// tag: vaa emerald local_asset_browser [begin]
// static void onBtnLocal( void* userdata );
@@ -250,81 +251,9 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
mNonImmediateFilterPermMask(non_immediate_filter_perm_mask),
mContextConeOpacity(0.f)
{
mCanApplyImmediately = can_apply_immediately;
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml");
mTentativeLabel = getChild<LLTextBox>("Multiple");
mResolutionLabel = getChild<LLTextBox>("unknown");
childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
childSetAction("Alpha", LLFloaterTexturePicker::onBtnAlpha,this);
childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
childSetAction("Invisible", LLFloaterTexturePicker::onBtnInvisible,this);
// tag: vaa emerald local_asset_browser [begin]
// childSetAction("Local", LLFloaterTexturePicker::onBtnLocal, this);
// childSetAction("Server", LLFloaterTexturePicker::onBtnServer, this);
childSetAction("Add", LLFloaterTexturePicker::onBtnAdd, this);
childSetAction("Remove", LLFloaterTexturePicker::onBtnRemove, this);
childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this);
mLocalScrollCtrl = getChild<LLScrollListCtrl>("local_name_list");
mLocalScrollCtrl->setCallbackUserData(this);
mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit);
LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl );
// tag: vaa emerald local_asset_browser [end]
childSetCommitCallback("show_folders_check", onShowFolders, this);
childSetVisible("show_folders_check", FALSE);
mSearchEdit = getChild<LLSearchEditor>("inventory search editor");
mSearchEdit->setSearchCallback(onSearchEdit, this);
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
if(mInventoryPanel)
{
U32 filter_types = 0x0;
filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
mInventoryPanel->setFilterPermMask(immediate_filter_perm_mask);
mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, _1, _2, (void*)this));
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setAllowMultiSelect(FALSE);
// store this filter as the default one
mInventoryPanel->getRootFolder()->getFilter()->markDefault();
// Commented out to stop opening all folders with textures
// mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE);
// don't put keyboard focus on selected item, because the selection callback
// will assume that this was user input
mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
}
mCanApplyImmediately = can_apply_immediately;
mNoCopyTextureSelected = FALSE;
childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately"));
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
if (!can_apply_immediately)
{
childSetEnabled("show_folders_check", FALSE);
}
childSetAction("Pipette", LLFloaterTexturePicker::onBtnPipette,this);
childSetAction("ApplyUUID", LLFloaterTexturePicker::onBtnUUID,this);
childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this);
// update permission filter once UI is fully initialized
updateFilterPermMask();
setCanMinimize(FALSE);
@@ -532,7 +461,80 @@ BOOL LLFloaterTexturePicker::postBuild()
setTitle(pick + mLabel);
}
mTentativeLabel = getChild<LLTextBox>("Multiple");
mResolutionLabel = getChild<LLTextBox>("unknown");
childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
childSetAction("None", LLFloaterTexturePicker::onBtnNone,this);
childSetAction("Alpha", LLFloaterTexturePicker::onBtnAlpha,this);
childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
childSetAction("Invisible", LLFloaterTexturePicker::onBtnInvisible,this);
// tag: vaa emerald local_asset_browser [begin]
// childSetAction("Local", LLFloaterTexturePicker::onBtnLocal, this);
// childSetAction("Server", LLFloaterTexturePicker::onBtnServer, this);
childSetAction("Add", LLFloaterTexturePicker::onBtnAdd, this);
childSetAction("Remove", LLFloaterTexturePicker::onBtnRemove, this);
childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this);
mLocalScrollCtrl = getChild<LLScrollListCtrl>("local_name_list");
mLocalScrollCtrl->setCallbackUserData(this);
mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit);
LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl );
// tag: vaa emerald local_asset_browser [end]
childSetCommitCallback("show_folders_check", onShowFolders, this);
childSetVisible("show_folders_check", FALSE);
mSearchEdit = getChild<LLSearchEditor>("inventory search editor");
mSearchEdit->setSearchCallback(onSearchEdit, this);
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
if(mInventoryPanel)
{
U32 filter_types = 0x0;
filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask);
mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2));
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setAllowMultiSelect(FALSE);
// store this filter as the default one
mInventoryPanel->getRootFolder()->getFilter()->markDefault();
// Commented out to stop opening all folders with textures
// mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE);
// don't put keyboard focus on selected item, because the selection callback
// will assume that this was user input
mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
}
mNoCopyTextureSelected = FALSE;
childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately"));
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
if (!mCanApplyImmediately)
{
childSetEnabled("show_folders_check", FALSE);
}
getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
childSetAction("ApplyUUID", LLFloaterTexturePicker::onBtnUUID,this);
childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this);
// update permission filter once UI is fully initialized
updateFilterPermMask();
LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1));
return TRUE;
}
@@ -624,6 +626,7 @@ void LLFloaterTexturePicker::draw()
childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID());
childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID );
childSetEnabled("None", mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
childSetEnabled("Invisible", mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID );
childSetEnabled("Alpha", mImageAssetID != mAlphaImageAssetID );
@@ -758,6 +761,13 @@ void LLFloaterTexturePicker::onBtnWhite(void* userdata)
self->commitIfImmediateSet();
}
// static
void LLFloaterTexturePicker::onBtnNone(void* userdata)
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
self->setImageID( LLUUID::null );
self->commitIfImmediateSet();
}
// static
void LLFloaterTexturePicker::onBtnInvisible(void* userdata)
@@ -876,26 +886,18 @@ void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl *ctrl, void *userdata)
// tag: vaa emerald local_asset_browser [end]
// static
void LLFloaterTexturePicker::onBtnPipette( void* userdata )
void LLFloaterTexturePicker::onBtnPipette()
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
if ( self)
{
BOOL pipette_active = self->childGetValue("Pipette").asBoolean();
BOOL pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean();
pipette_active = !pipette_active;
if (pipette_active)
{
LLToolPipette::getInstance()->setSelectCallback(onTextureSelect, self);
LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance());
}
else
{
LLToolMgr::getInstance()->clearTransientTool();
}
}
}
// static
@@ -916,33 +918,32 @@ void LLFloaterTexturePicker::onBtnUUID( void* userdata )
}
// static
void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)data;
if (items.size())
{
LLFolderViewItem* first_item = items.front();
LLInventoryItem* itemp = gInventory.getItem(first_item->getListener()->getUUID());
self->mNoCopyTextureSelected = FALSE;
mNoCopyTextureSelected = FALSE;
if (itemp)
{
// <dogmode>
if (itemp->getPermissions().getMaskOwner() & PERM_ALL)
self->childSetValue("texture_uuid", self->mImageAssetID);
childSetValue("texture_uuid", mImageAssetID);
else
self->childSetValue("texture_uuid", LLUUID::null.asString());
childSetValue("texture_uuid", LLUUID::null.asString());
// </dogmode>
if (!itemp->getPermissions().allowCopyBy(gAgent.getID()))
{
self->mNoCopyTextureSelected = TRUE;
mNoCopyTextureSelected = TRUE;
}
self->mImageAssetID = itemp->getAssetUUID();
self->mIsDirty = TRUE;
mImageAssetID = itemp->getAssetUUID();
mIsDirty = TRUE;
if (user_action)
{
// only commit intentional selections, not implicit ones
self->commitIfImmediateSet();
commitIfImmediateSet();
}
}
}
@@ -1017,32 +1018,28 @@ void LLFloaterTexturePicker::onSearchEdit(const std::string& search_string, void
picker->mInventoryPanel->setFilterSubString(upper_case_search_string);
}
//static
void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te, void *data )
void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te )
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)data;
LLUUID inventory_item_id = self->findItemID(te.getID(), TRUE);
if (self && inventory_item_id.notNull())
LLUUID inventory_item_id = findItemID(te.getID(), TRUE);
if (inventory_item_id.notNull())
{
LLToolPipette::getInstance()->setResult(TRUE, "");
self->setImageID(te.getID());
self->mNoCopyTextureSelected = FALSE;
setImageID(te.getID());
mNoCopyTextureSelected = FALSE;
LLInventoryItem* itemp = gInventory.getItem(inventory_item_id);
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
{
// no copy texture
self->mNoCopyTextureSelected = TRUE;
mNoCopyTextureSelected = TRUE;
}
else
{
self->childSetValue("texture_uuid", inventory_item_id.asString());
childSetValue("texture_uuid", inventory_item_id.asString());
}
self->commitIfImmediateSet();
commitIfImmediateSet();
}
else
{

View File

@@ -1089,14 +1089,17 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
{
return;
}
LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id);
//LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id);
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
S32 num_faces = hit_obj->getNumTEs();
for( S32 face = 0; face < num_faces; face++ )
{
// update viewer side image in anticipation of update from simulator
hit_obj->setTEImage(face, image);
//hit_obj->setTEImage(face, image);
hit_obj->setTETexture(face, asset_id); //Singu note: setTETexture will allow the real id to be passed to LLPrimitive::setTETexture,
// even if it's null. setTEImage would actually pass down IMG_DEFAULT under such a case,
// which we don't want.
dialog_refresh_all();
}
// send the update to the simulator
@@ -1157,9 +1160,12 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
return;
}
// update viewer side image in anticipation of update from simulator
LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id);
//LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id);
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
hit_obj->setTEImage(hit_face, image);
//hit_obj->setTEImage(hit_face, image);
hit_obj->setTETexture(hit_face, asset_id); //Singu note: setTETexture will allow the real id to be passed to LLPrimitive::setTETexture,
// even if it's null. setTEImage would actually pass down IMG_DEFAULT under such a case,
// which we don't want.
dialog_refresh_all();
// send the update to the simulator

View File

@@ -55,8 +55,6 @@ LLToolPipette::LLToolPipette()
: LLTool(std::string("Pipette")),
mSuccess(TRUE)
{
mSelectCallback = NULL;
mUserData = NULL;
}
@@ -106,6 +104,15 @@ BOOL LLToolPipette::handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky
return TRUE;
}
void LLToolPipette::setTextureEntry(const LLTextureEntry* entry)
{
if (entry)
{
mTextureEntry = *entry;
mSignal(mTextureEntry);
}
}
void LLToolPipette::pickCallback(const LLPickInfo& pick_info)
{
LLViewerObject* hit_obj = pick_info.getObject();
@@ -118,18 +125,9 @@ void LLToolPipette::pickCallback(const LLPickInfo& pick_info)
{
//TODO: this should highlight the selected face only
LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj);
LLToolPipette::getInstance()->mTextureEntry = *hit_obj->getTE(pick_info.mObjectFace);
if (LLToolPipette::getInstance()->mSelectCallback)
{
LLToolPipette::getInstance()->mSelectCallback(LLToolPipette::getInstance()->mTextureEntry, LLToolPipette::getInstance()->mUserData);
const LLTextureEntry* entry = hit_obj->getTE(pick_info.mObjectFace);
LLToolPipette::getInstance()->setTextureEntry(entry);
}
}
}
void LLToolPipette::setSelectCallback(select_callback callback, void* user_data)
{
mSelectCallback = callback;
mUserData = user_data;
}
void LLToolPipette::setResult(BOOL success, const std::string& msg)

View File

@@ -56,18 +56,19 @@ public:
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen);
typedef void (*select_callback)(const LLTextureEntry& te, void *data);
void setSelectCallback(select_callback callback, void* user_data);
// Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots
typedef boost::signals2::signal<void (const LLTextureEntry& te)> signal_t;
void setToolSelectCallback(const signal_t::slot_type& cb) { mSignal.connect(cb); }
void setResult(BOOL success, const std::string& msg);
void setTextureEntry(const LLTextureEntry* entry);
static void pickCallback(const LLPickInfo& pick_info);
protected:
LLTextureEntry mTextureEntry;
select_callback mSelectCallback;
signal_t mSignal;
BOOL mSuccess;
std::string mTooltipMsg;
void* mUserData;
};
#endif //LL_LLTOOLPIPETTE_H

View File

@@ -773,7 +773,7 @@ Only large parcels can be listed in search.
mouse_opaque="true" name="Snapshot:" v_pad="0" width="278">
Snapshot:
</text>
<texture_picker allow_no_texture="false" bottom="-349" can_apply_immediately="false"
<texture_picker allow_no_texture="true" bottom="-349" can_apply_immediately="false"
default_image_name="" enabled="true" follows="left|top" height="135"
label="" left="10" mouse_opaque="true" name="snapshot_ctrl"
tool_tip="Click to choose a picture" width="180" />

View File

@@ -30,6 +30,9 @@
<button bottom="-252" enabled="false" follows="left|bottom" font="SansSerifSmall"
halign="center" height="20" label="Invisible" label_selected="Invisible" left="72"
mouse_opaque="true" name="Invisible" scale_image="true" width="64" />
<button bottom="-276" enabled="true" follows="left|bottom" font="SansSerifSmall"
halign="center" height="20" label="None" label_selected="None" left="4"
mouse_opaque="true" name="None" scale_image="true" width="64" />
<check_box bottom="-305" enabled="true" follows="left|bottom" font="SansSerifSmall"
height="20" initial_value="true" label="Show Folders" left="4"
mouse_opaque="true" name="show_folders_check" radio_style="false"

View File

@@ -1261,7 +1261,7 @@
<panel border="true" bottom="-383" follows="left|top|right|bottom" height="367"
label="Texture" left="1" mouse_opaque="false" name="Texture" width="270">
<texture_picker allow_no_texture="false" allow_invisible_texture="true" bottom="-90" can_apply_immediately="true"
<texture_picker allow_no_texture="true" allow_invisible_texture="true" bottom="-90" can_apply_immediately="true"
default_image_name="Default" follows="left|top" height="80" label="Texture"
left="10" mouse_opaque="true" name="texture control"
tool_tip="Click to choose a picture" width="64" />