UI cleanup.

-Added ui-local transformation matrix.
-Gutted legacy commitcallbacks throughout ui widget ctors.
-Created filter_editor ui widget which issues commit on keypress
   -search_editor commits on focus loss/enter press
   -search_editor and filter_editor now have a built in 'x' button to clear text.
-LLComboBox::setPrearrangeCallback now uses boost::function
-LLComboBox::setTextEntryCallback now uses boost::function
-LLLineEditor::setKeystrokeCallback now uses boost::function
-LLLineEditor::setPrevalidate now uses boost::function
-LLPanel::childSetKeystrokeCallback removed
-LLPanel::childSetPrevalidate removed
-LLPanel::childSetActionTextbox now uses boost::function
-LLTextBox::setClickedCallback now uses boost::function
-LLTextEditor::setKeystrokeCallback added.
-Cleaned up JCFloaterAreaSearch
This commit is contained in:
Shyotl
2013-04-16 00:25:59 -05:00
parent 4cbf8b16b6
commit a5dad6be5c
191 changed files with 3020 additions and 3456 deletions

View File

@@ -38,180 +38,132 @@
#include "llscrolllistctrl.h"
#include "llagent.h"
#include "llfiltereditor.h"
#include "lltracker.h"
#include "llviewerobjectlist.h"
#include "llviewercontrol.h"
#include "jcfloaterareasearch.h"
JCFloaterAreaSearch* JCFloaterAreaSearch::sInstance = NULL;
LLViewerRegion* JCFloaterAreaSearch::sLastRegion = NULL;
S32 JCFloaterAreaSearch::sRequested = 0;
std::map<LLUUID, AObjectDetails> JCFloaterAreaSearch::sObjectDetails;
std::string JCFloaterAreaSearch::sSearchedName;
std::string JCFloaterAreaSearch::sSearchedDesc;
std::string JCFloaterAreaSearch::sSearchedOwner;
std::string JCFloaterAreaSearch::sSearchedGroup;
const std::string request_string = "JCFloaterAreaSearch::Requested_\xF8\xA7\xB5";
const F32 min_refresh_interval = 0.25f; // Minimum interval between list refreshes in seconds.
JCFloaterAreaSearch::JCFloaterAreaSearch() :
LLFloater(),
mCounterText(0),
mResultList(0)
JCFloaterAreaSearch::JCFloaterAreaSearch(const LLSD& data) :
LLFloater(),
mCounterText(0),
mResultList(0),
mLastRegion(0),
mStopped(false)
{
llassert_always(sInstance == NULL);
sInstance = this;
mLastUpdateTimer.reset();
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_area_search.xml");
}
JCFloaterAreaSearch::~JCFloaterAreaSearch()
{
sInstance = NULL;
}
void JCFloaterAreaSearch::close(bool app)
{
if (app)
if (app || mStopped)
{
LLFloater::close(app);
}
else
{
if (sInstance)
{
sInstance->setVisible(FALSE);
}
setVisible(FALSE);
}
}
BOOL JCFloaterAreaSearch::postBuild()
{
mResultList = getChild<LLScrollListCtrl>("result_list");
mResultList->setDoubleClickCallback(onDoubleClick,this);
mResultList->setDoubleClickCallback(boost::bind(&JCFloaterAreaSearch::onDoubleClick,this));
mResultList->sortByColumn("Name", TRUE);
mCounterText = getChild<LLTextBox>("counter");
childSetAction("Refresh", search, this);
childSetAction("Stop", cancel, this);
getChild<LLButton>("Refresh")->setClickedCallback(boost::bind(&JCFloaterAreaSearch::onRefresh,this));
getChild<LLButton>("Stop")->setClickedCallback(boost::bind(&JCFloaterAreaSearch::onStop,this));
childSetKeystrokeCallback("Name query chunk", onCommitLine, 0);
childSetKeystrokeCallback("Description query chunk", onCommitLine, 0);
childSetKeystrokeCallback("Owner query chunk", onCommitLine, 0);
childSetKeystrokeCallback("Group query chunk", onCommitLine, 0);
getChild<LLFilterEditor>("Name query chunk")->setCommitCallback(boost::bind(&JCFloaterAreaSearch::onCommitLine,this,_1,_2,LIST_OBJECT_NAME));
getChild<LLFilterEditor>("Description query chunk")->setCommitCallback(boost::bind(&JCFloaterAreaSearch::onCommitLine,this,_1,_2,LIST_OBJECT_DESC));
getChild<LLFilterEditor>("Owner query chunk")->setCommitCallback(boost::bind(&JCFloaterAreaSearch::onCommitLine,this,_1,_2,LIST_OBJECT_OWNER));
getChild<LLFilterEditor>("Group query chunk")->setCommitCallback(boost::bind(&JCFloaterAreaSearch::onCommitLine,this,_1,_2,LIST_OBJECT_GROUP));
return TRUE;
}
// static
void JCFloaterAreaSearch::checkRegion()
void JCFloaterAreaSearch::onOpen()
{
// Check if we changed region, and if we did, clear the object details cache.
LLViewerRegion* region = gAgent.getRegion();
if (region != sLastRegion)
{
sLastRegion = region;
sRequested = 0;
sObjectDetails.clear();
if (sInstance)
{
sInstance->mResultList->deleteAllItems();
sInstance->mCounterText->setText(std::string("Listed/Pending/Total"));
}
}
}
// static
void JCFloaterAreaSearch::toggle()
{
if (sInstance)
{
if (sInstance->getVisible())
{
sInstance->setVisible(FALSE);
}
else
{
checkRegion();
sInstance->setVisible(TRUE);
}
}
else
{
sInstance = new JCFloaterAreaSearch();
LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_area_search.xml");
}
}
// static
void JCFloaterAreaSearch::onDoubleClick(void *userdata)
{
JCFloaterAreaSearch *self = (JCFloaterAreaSearch*)userdata;
LLScrollListItem *item = self->mResultList->getFirstSelected();
if (!item) return;
LLUUID object_id = item->getUUID();
LLViewerObject* objectp = gObjectList.findObject(object_id);
if (objectp)
{
LLTracker::trackLocation(objectp->getPositionGlobal(), sObjectDetails[object_id].name, "", LLTracker::LOCATION_ITEM);
}
}
// static
void JCFloaterAreaSearch::cancel(void* data)
{
checkRegion();
if (sInstance)
{
sInstance->close(TRUE);
}
sSearchedName = "";
sSearchedDesc = "";
sSearchedOwner = "";
sSearchedGroup = "";
}
// static
void JCFloaterAreaSearch::search(void* data)
{
//llinfos << "Clicked search" << llendl;
checkRegion();
results();
}
// static
void JCFloaterAreaSearch::onCommitLine(LLLineEditor* line, void* user_data)
void JCFloaterAreaSearch::checkRegion(bool force_clear)
{
std::string name = line->getName();
std::string text = line->getText();
LLStringUtil::toLower(text);
line->setText(text);
if (name == "Name query chunk") sSearchedName = text;
else if (name == "Description query chunk") sSearchedDesc = text;
else if (name == "Owner query chunk") sSearchedOwner = text;
else if (name == "Group query chunk") sSearchedGroup = text;
//llinfos << "loaded " << name << " with "<< text << llendl;
if (text.length() > 3)
// Check if we changed region, and if we did, clear the object details cache.
LLViewerRegion* region = gAgent.getRegion();
if (force_clear || region != mLastRegion)
{
checkRegion();
results();
mLastRegion = region;
mPendingObjects.clear();
mCachedObjects.clear();
mResultList->deleteAllItems();
mCounterText->setText(std::string("Listed/Pending/Total"));
}
}
// static
void JCFloaterAreaSearch::requestIfNeeded(LLViewerObject *objectp)
void JCFloaterAreaSearch::onDoubleClick()
{
LLUUID object_id = objectp->getID();
if (sObjectDetails.count(object_id) == 0)
LLScrollListItem *item = mResultList->getFirstSelected();
if (!item) return;
LLUUID object_id = item->getUUID();
std::map<LLUUID,ObjectData>::iterator it = mCachedObjects.find(object_id);
if(it != mCachedObjects.end())
{
LLViewerObject* objectp = gObjectList.findObject(object_id);
if (objectp)
{
LLTracker::trackLocation(objectp->getPositionGlobal(), it->second.name, "", LLTracker::LOCATION_ITEM);
}
}
}
void JCFloaterAreaSearch::onStop()
{
mStopped = true;
mPendingObjects.clear();
mCounterText->setText(std::string("Stopped"));
}
void JCFloaterAreaSearch::onRefresh()
{
//llinfos << "Clicked search" << llendl;
mStopped = false;
checkRegion(true);
results();
}
void JCFloaterAreaSearch::onCommitLine(LLUICtrl* caller, const LLSD& value, OBJECT_COLUMN_ORDER type)
{
std::string text = value.asString();
LLStringUtil::toLower(text);
caller->setValue(text);
mFilterStrings[type] = text;
//llinfos << "loaded " << name << " with "<< text << llendl;
checkRegion();
results();
}
bool JCFloaterAreaSearch::requestIfNeeded(LLUUID object_id)
{
if (!mCachedObjects.count(object_id) && !mPendingObjects.count(object_id))
{
if(mStopped)
return true;
//llinfos << "not in list" << llendl;
AObjectDetails* details = &sObjectDetails[object_id];
details->name = request_string;
details->desc = request_string;
details->owner_id = LLUUID::null;
details->group_id = LLUUID::null;
mPendingObjects.insert(object_id);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
@@ -223,20 +175,20 @@ void JCFloaterAreaSearch::requestIfNeeded(LLViewerObject *objectp)
msg->addUUIDFast(_PREHASH_ObjectID, object_id);
gAgent.sendReliableMessage();
//llinfos << "Sent data request for object " << object_id << llendl;
sRequested++;
return true;
}
return false;
}
// static
void JCFloaterAreaSearch::results()
{
if (!sInstance) return;
if (!(sInstance->getVisible())) return;
if (sRequested > 0 && sInstance->mLastUpdateTimer.getElapsedTimeF32() < min_refresh_interval) return;
if (!getVisible()) return;
if (mPendingObjects.size() > 0 && mLastUpdateTimer.getElapsedTimeF32() < min_refresh_interval) return;
//llinfos << "results()" << llendl;
uuid_vec_t selected = sInstance->mResultList->getSelectedIDs();
S32 scrollpos = sInstance->mResultList->getScrollPos();
sInstance->mResultList->deleteAllItems();
uuid_vec_t selected = mResultList->getSelectedIDs();
S32 scrollpos = mResultList->getScrollPos();
mResultList->deleteAllItems();
S32 i;
S32 total = gObjectList.getNumObjects();
@@ -250,23 +202,18 @@ void JCFloaterAreaSearch::results()
!objectp->flagTemporary() && !objectp->flagTemporaryOnRez())
{
LLUUID object_id = objectp->getID();
if (sObjectDetails.count(object_id) == 0)
if(!requestIfNeeded(object_id))
{
//llinfos << "not all entries are \"\"" << llendl;
requestIfNeeded(objectp);
}
else
{
//llinfos << "all entries are \"\" or we have data" << llendl;
AObjectDetails* details = &sObjectDetails[object_id];
std::string object_name = details->name;
std::string object_desc = details->desc;
std::string object_owner;
std::string object_group;
gCacheName->getFullName(details->owner_id, object_owner);
gCacheName->getGroupName(details->group_id, object_group);
if (object_name != request_string)
std::map<LLUUID,ObjectData>::iterator it = mCachedObjects.find(object_id);
if(it != mCachedObjects.end())
{
//llinfos << "all entries are \"\" or we have data" << llendl;
std::string object_name = it->second.name;
std::string object_desc = it->second.desc;
std::string object_owner;
std::string object_group;
gCacheName->getFullName(it->second.owner_id, object_owner);
gCacheName->getGroupName(it->second.group_id, object_group);
//llinfos << "both names are loaded or aren't needed" << llendl;
std::string onU = object_owner;
std::string cnU = object_group;
@@ -274,62 +221,67 @@ void JCFloaterAreaSearch::results()
LLStringUtil::toLower(object_desc);
LLStringUtil::toLower(object_owner);
LLStringUtil::toLower(object_group);
if ((sSearchedName == "" || object_name.find(sSearchedName) != -1) &&
(sSearchedDesc == "" || object_desc.find(sSearchedDesc) != -1) &&
(sSearchedOwner == "" || object_owner.find(sSearchedOwner) != -1) &&
(sSearchedGroup == "" || object_group.find(sSearchedGroup) != -1))
if ((mFilterStrings[LIST_OBJECT_NAME].empty() || object_name.find(mFilterStrings[LIST_OBJECT_NAME]) != -1) &&
(mFilterStrings[LIST_OBJECT_DESC].empty() || object_desc.find(mFilterStrings[LIST_OBJECT_DESC]) != -1) &&
(mFilterStrings[LIST_OBJECT_OWNER].empty() || object_owner.find(mFilterStrings[LIST_OBJECT_OWNER]) != -1) &&
(mFilterStrings[LIST_OBJECT_GROUP].empty() || object_group.find(mFilterStrings[LIST_OBJECT_GROUP]) != -1))
{
//llinfos << "pass" << llendl;
LLSD element;
element["id"] = object_id;
element["columns"][LIST_OBJECT_NAME]["column"] = "Name";
element["columns"][LIST_OBJECT_NAME]["type"] = "text";
element["columns"][LIST_OBJECT_NAME]["value"] = details->name; //item->getName();//ai->second//"avatar_icon";
element["columns"][LIST_OBJECT_NAME]["value"] = it->second.name;
element["columns"][LIST_OBJECT_DESC]["column"] = "Description";
element["columns"][LIST_OBJECT_DESC]["type"] = "text";
element["columns"][LIST_OBJECT_DESC]["value"] = details->desc; //ai->second;
element["columns"][LIST_OBJECT_DESC]["value"] = it->second.desc;
element["columns"][LIST_OBJECT_OWNER]["column"] = "Owner";
element["columns"][LIST_OBJECT_OWNER]["type"] = "text";
element["columns"][LIST_OBJECT_OWNER]["value"] = onU; //ai->first;
element["columns"][LIST_OBJECT_OWNER]["value"] = onU;
element["columns"][LIST_OBJECT_GROUP]["column"] = "Group";
element["columns"][LIST_OBJECT_GROUP]["type"] = "text";
element["columns"][LIST_OBJECT_GROUP]["value"] = cnU; //ai->second;
sInstance->mResultList->addElement(element, ADD_BOTTOM);
mResultList->addElement(element, ADD_BOTTOM);
}
}
}
}
}
}
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()));
sInstance->mLastUpdateTimer.reset();
mResultList->updateSort();
mResultList->selectMultiple(selected);
mResultList->setScrollPos(scrollpos);
mCounterText->setText(llformat("%d listed/%d pending/%d total", mResultList->getItemCount(), mPendingObjects.size(), mPendingObjects.size()+mCachedObjects.size()));
mLastUpdateTimer.reset();
}
// static
void JCFloaterAreaSearch::processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data)
{
checkRegion();
JCFloaterAreaSearch* floater = findInstance();
if(!floater)
return;
floater->checkRegion();
LLUUID object_id;
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_ObjectID, object_id);
bool exists = (sObjectDetails.count(object_id) != 0);
AObjectDetails* details = &sObjectDetails[object_id];
if (!exists || details->name == request_string)
{
// We cache unknown objects (to avoid having to request them later)
// and requested objects.
if (exists && sRequested > 0) sRequested--;
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, details->owner_id);
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, details->group_id);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, details->name);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, details->desc);
gCacheName->get(details->owner_id, false, boost::bind(&JCFloaterAreaSearch::results));
gCacheName->get(details->group_id, true, boost::bind(&JCFloaterAreaSearch::results));
//llinfos << "Got info for " << (exists ? "requested" : "unknown") << " object " << object_id << llendl;
}
std::set<LLUUID>::iterator it = floater->mPendingObjects.find(object_id);
if(it != floater->mPendingObjects.end())
floater->mPendingObjects.erase(it);
//else if(floater->mCachedObjects.count(object_id)) //Let entries update.
// return;
ObjectData* data = &floater->mCachedObjects[object_id];
// We cache unknown objects (to avoid having to request them later)
// and requested objects.
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, data->owner_id);
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, data->group_id);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, data->name);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, data->desc);
gCacheName->get(data->owner_id, false, boost::bind(&JCFloaterAreaSearch::results,floater));
gCacheName->get(data->group_id, true, boost::bind(&JCFloaterAreaSearch::results,floater));
//llinfos << "Got info for " << (exists ? "requested" : "unknown") << " object " << object_id << llendl;
}

View File

@@ -40,59 +40,53 @@ class LLTextBox;
class LLScrollListCtrl;
class LLViewerRegion;
struct AObjectDetails
{
LLUUID id;
std::string name;
std::string desc;
LLUUID owner_id;
LLUUID group_id;
};
class JCFloaterAreaSearch : public LLFloater
class JCFloaterAreaSearch : public LLFloater, public LLFloaterSingleton<JCFloaterAreaSearch>
{
public:
JCFloaterAreaSearch();
JCFloaterAreaSearch(const LLSD& data);
virtual ~JCFloaterAreaSearch();
/*virtual*/ BOOL postBuild();
/*virtual*/ void close(bool app = false);
/*virtual*/ void onOpen();
static void results();
static void toggle();
static JCFloaterAreaSearch* getInstance() { return sInstance; }
void results();
static void processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data);
private:
static void checkRegion();
static void cancel(void* data);
static void search(void* data);
static void onCommitLine(LLLineEditor* line, void* user_data);
static void requestIfNeeded(LLViewerObject *objectp);
static void onDoubleClick(void *userdata);
enum OBJECT_COLUMN_ORDER
{
LIST_OBJECT_NAME,
LIST_OBJECT_NAME = 0,
LIST_OBJECT_DESC,
LIST_OBJECT_OWNER,
LIST_OBJECT_GROUP
LIST_OBJECT_GROUP,
LIST_OBJECT_COUNT
};
static JCFloaterAreaSearch* sInstance;
static S32 sRequested;
void checkRegion(bool force_clear = false);
void onStop();
void onRefresh();
void onCommitLine(LLUICtrl* caller, const LLSD& value, OBJECT_COLUMN_ORDER type);
bool requestIfNeeded(LLUUID object_id);
void onDoubleClick();
LLTextBox* mCounterText;
LLScrollListCtrl* mResultList;
LLFrameTimer mLastUpdateTimer;
LLViewerRegion* mLastRegion;
bool mStopped;
static std::map<LLUUID, AObjectDetails> sObjectDetails;
struct ObjectData
{
LLUUID id;
std::string name;
std::string desc;
LLUUID owner_id;
LLUUID group_id;
};
std::set<LLUUID> mPendingObjects;
std::map<LLUUID, ObjectData> mCachedObjects;
static std::string sSearchedName;
static std::string sSearchedDesc;
static std::string sSearchedOwner;
static std::string sSearchedGroup;
static LLViewerRegion* sLastRegion;
std::string mFilterStrings[LIST_OBJECT_COUNT];
};

View File

@@ -41,7 +41,6 @@
#include "llfeaturemanager.h"
#include "lluictrlfactory.h"
#include "lltexteditor.h"
#include "llalertdialog.h"
#include "llerrorcontrol.h"
#include "lleventtimer.h"
#include "llviewertexturelist.h"
@@ -55,6 +54,7 @@
#include "llmarketplacenotifications.h"
#include "llmd5.h"
#include "llmeshrepository.h"
#include "llmodaldialog.h"
#include "llpumpio.h"
#include "llimpanel.h"
#include "llmimetypes.h"

View File

@@ -87,7 +87,7 @@ const F32 AGENT_TYPING_TIMEOUT = 5.f; // seconds
LLChatBar *gChatBar = NULL;
// legacy calllback glue
void toggleChatHistory(LLUICtrl*, const LLSD&);
void toggleChatHistory();
//void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel);
// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.2a
void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel);
@@ -138,7 +138,7 @@ LLChatBar::~LLChatBar()
BOOL LLChatBar::postBuild()
{
if (LLUICtrl* history_ctrl = findChild<LLUICtrl>("History"))
history_ctrl->setCommitCallback(toggleChatHistory);
history_ctrl->setCommitCallback(boost::bind(&toggleChatHistory));
if (LLUICtrl* say_ctrl = getChild<LLUICtrl>("Say"))
say_ctrl->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1));
@@ -149,8 +149,7 @@ BOOL LLChatBar::postBuild()
mInputEditor = findChild<LLLineEditor>("Chat Editor");
if (mInputEditor)
{
mInputEditor->setCallbackUserData(this);
mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke);
mInputEditor->setKeystrokeCallback(boost::bind(&LLChatBar::onInputEditorKeystroke,this));
mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost));
mInputEditor->setFocusReceivedCallback(boost::bind(&LLChatBar::onInputEditorGainFocus));
mInputEditor->setCommitOnFocusLost( FALSE );
@@ -545,13 +544,10 @@ void LLChatBar::stopChat()
gSavedSettings.setBOOL("ChatVisible", FALSE);
}
// static
void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
void LLChatBar::onInputEditorKeystroke()
{
LLChatBar* self = (LLChatBar *)userdata;
LLWString raw_text;
if (self->mInputEditor) raw_text = self->mInputEditor->getWText();
if (mInputEditor) raw_text = mInputEditor->getWText();
// Can't trim the end, because that will cause autocompletion
// to eat trailing spaces that might be part of a gesture.
@@ -580,8 +576,8 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
// the selection will already be deleted, but we need to trim
// off the character before
std::string new_text = raw_text.substr(0, length-1);
self->mInputEditor->setText( new_text );
self->mInputEditor->setCursorToEnd();
mInputEditor->setText( new_text );
mInputEditor->setCursorToEnd();
length = length - 1;
}
*/
@@ -600,15 +596,15 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
if (LLGestureMgr::instance().matchPrefix(utf8_trigger, &utf8_out_str))
{
if (self->mInputEditor)
if (mInputEditor)
{
std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size());
self->mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part
S32 outlength = self->mInputEditor->getLength(); // in characters
mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part
S32 outlength = mInputEditor->getLength(); // in characters
// Select to end of line, starting from the character
// after the last one the user typed.
self->mInputEditor->setSelection(length, outlength);
mInputEditor->setSelection(length, outlength);
}
}
@@ -890,7 +886,7 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl)
}
}
void toggleChatHistory(LLUICtrl* ctrl, const LLSD&)
void toggleChatHistory()
{
LLFloaterChat::toggleInstance(LLSD());
}

View File

@@ -85,7 +85,7 @@ public:
void onClickSay(LLUICtrl* ctrl);
static void onTabClick( void* userdata );
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
void onInputEditorKeystroke();
static void onInputEditorFocusLost();
static void onInputEditorGainFocus();

View File

@@ -53,37 +53,8 @@
static LLRegisterWidget<LLColorSwatchCtrl> r("color_swatch");
LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const LLColor4& color,
void (*commit_callback)(LLUICtrl* ctrl, void* userdata),
void* userdata )
: LLUICtrl(name, rect, TRUE, commit_callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP),
mValid( TRUE ),
mColor( color ),
mBorderColor( gColors.getColor("DefaultHighlightLight") ),
mCanApplyImmediately(FALSE),
mOnCancelCallback(NULL),
mOnSelectCallback(NULL)
{
mCaption = new LLTextBox( name,
LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ),
name,
LLFontGL::getFontSansSerifSmall() );
mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM );
addChild( mCaption );
// Scalable UI made this off-by-one, I don't know why. JC
LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0);
border_rect.mBottom += BTN_HEIGHT_SMALL;
mBorder = new LLViewBorder(std::string("border"), border_rect, LLViewBorder::BEVEL_IN);
addChild(mBorder);
mAlphaGradientImage = LLUI::getUIImage("color_swatch_alpha.tga");
}
LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color,
void (*commit_callback)(LLUICtrl* ctrl, void* userdata),
void* userdata )
: LLUICtrl(name, rect, TRUE, commit_callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP),
LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color)
: LLUICtrl(name, rect, TRUE, NULL, FOLLOWS_LEFT | FOLLOWS_TOP),
mValid( TRUE ),
mColor( color ),
mBorderColor( gColors.getColor("DefaultHighlightLight") ),
@@ -217,26 +188,34 @@ void LLColorSwatchCtrl::draw()
// Check state
if ( mValid )
{
// Draw the color swatch
gl_rect_2d_checkerboard( calcScreenRect(), interior );
gl_rect_2d(interior, mColor, TRUE);
LLColor4 opaque_color = mColor;
opaque_color.mV[VALPHA] = 1.f;
gGL.color4fv(opaque_color.mV);
if (mAlphaGradientImage.notNull())
if (!mColor.isOpaque())
{
gGL.pushMatrix();
gl_rect_2d_checkerboard( calcScreenRect(), interior );
// Draw the color swatch
}
gl_rect_2d(interior, mColor, TRUE);
if (!mColor.isOpaque())
{
LLColor4 opaque_color = mColor;
opaque_color.mV[VALPHA] = 1.f;
gGL.color4fv(opaque_color.mV);
if (mAlphaGradientImage.notNull())
{
mAlphaGradientImage->draw(interior, mColor);
gGL.pushMatrix();
{
mAlphaGradientImage->draw(interior, mColor);
}
gGL.popMatrix();
}
gGL.popMatrix();
}
}
else
{
if (!mFallbackImageName.empty())
{
LLPointer<LLViewerFetchedTexture> fallback_image = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName);
LLPointer<LLViewerFetchedTexture> fallback_image = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName, TRUE,
LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
if( fallback_image->getComponents() == 4 )
{
gl_rect_2d_checkerboard( calcScreenRect(), interior );
@@ -388,8 +367,6 @@ LLView* LLColorSwatchCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa
BOOL can_apply_immediately = FALSE;
node->getAttributeBOOL("can_apply_immediately", can_apply_immediately);
LLUICtrlCallback callback = NULL;
if (label.empty())
{
label.assign(node->getValue());
@@ -399,9 +376,7 @@ LLView* LLColorSwatchCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa
name,
rect,
label,
color,
callback,
NULL );
color );
color_swatch->setCanApplyImmediately(can_apply_immediately);
color_swatch->initFromXML(node, parent);

View File

@@ -56,12 +56,7 @@ public:
COLOR_CANCEL
} EColorPickOp;
LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const LLColor4& color,
void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata),
void* callback_userdata);
LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color,
void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata),
void* callback_userdata);
LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color);
~LLColorSwatchCtrl ();

View File

@@ -113,7 +113,7 @@ public:
bool considerUpdateCurrency();
// return true if update needed
void currencyKey(S32);
static void onCurrencyKey(LLLineEditor* caller, void* data);
void onCurrencyKey(LLLineEditor* caller);
void prepare();
void updateUI();
@@ -337,13 +337,9 @@ void LLCurrencyUIManager::Impl::currencyKey(S32 value)
mCurrencyChanged = true;
}
// static
void LLCurrencyUIManager::Impl::onCurrencyKey(
LLLineEditor* caller, void* data)
void LLCurrencyUIManager::Impl::onCurrencyKey(LLLineEditor* caller)
{
S32 value = atoi(caller->getText().c_str());
LLCurrencyUIManager::Impl* self = (LLCurrencyUIManager::Impl*)data;
self->currencyKey(value);
currencyKey(caller->getValue().asInteger());
}
void LLCurrencyUIManager::Impl::prepare()
@@ -352,8 +348,7 @@ void LLCurrencyUIManager::Impl::prepare()
if (lindenAmount)
{
lindenAmount->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
lindenAmount->setKeystrokeCallback(onCurrencyKey);
lindenAmount->setCallbackUserData(this);
lindenAmount->setKeystrokeCallback(boost::bind(&LLCurrencyUIManager::Impl::onCurrencyKey,this,_1));
}
}

View File

@@ -56,25 +56,25 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy
switch(var_type)
{
case VAR_TYPE_F32:
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, *((F32*)var), -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, *((F32*)var), -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider1->setPrecision(3);
addChild(mSlider1);
mSlider2 = NULL;
mSlider3 = NULL;
break;
case VAR_TYPE_S32:
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,100,190,80), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, (F32)*((S32*)var), -255.f, 255.f, 1.f, LLStringUtil::null);
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,100,190,80), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, (F32)*((S32*)var), -255.f, 255.f, 1.f, LLStringUtil::null);
mSlider1->setPrecision(0);
addChild(mSlider1);
mSlider2 = NULL;
mSlider3 = NULL;
break;
case VAR_TYPE_VEC3:
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), std::string("x: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, ((LLVector3*)var)->mV[VX], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), std::string("x: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VX], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider1->setPrecision(3);
mSlider2 = new LLSliderCtrl(std::string("slider 2"), LLRect(20,100,190,80), std::string("y: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, ((LLVector3*)var)->mV[VY], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider2 = new LLSliderCtrl(std::string("slider 2"), LLRect(20,100,190,80), std::string("y: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VY], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider2->setPrecision(3);
mSlider3 = new LLSliderCtrl(std::string("slider 3"), LLRect(20,70,190,50), std::string("z: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, ((LLVector3*)var)->mV[VZ], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider3 = new LLSliderCtrl(std::string("slider 3"), LLRect(20,70,190,50), std::string("z: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VZ], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider3->setPrecision(3);
addChild(mSlider1);
addChild(mSlider2);
@@ -85,7 +85,7 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy
break;
}
mAnimateButton = new LLButton(std::string("Animate"), LLRect(20, 45, 180, 25), LLStringUtil::null, onAnimateClicked, this);
mAnimateButton = new LLButton(std::string("Animate"), LLRect(20, 45, 180, 25), LLStringUtil::null, boost::bind(&LLDebugVarMessageBox::onAnimateClicked, this));
addChild(mAnimateButton);
mText = new LLTextBox(std::string("value"), LLRect(20,20,190,0));
@@ -113,7 +113,6 @@ void LLDebugVarMessageBox::show(const std::string& title, F32 *var, F32 max_valu
box->mSlider1->setValue(*var);
}
box->mSlider1->setCommitCallback(boost::bind(&LLDebugVarMessageBox::slider_changed,_1,box));
box->mSlider1->setCallbackUserData(box);
#endif
}
@@ -200,11 +199,10 @@ void LLDebugVarMessageBox::slider_changed(LLUICtrl* ctrl, void* user_data)
}
}
void LLDebugVarMessageBox::onAnimateClicked(void* user_data)
void LLDebugVarMessageBox::onAnimateClicked()
{
LLDebugVarMessageBox* msg_boxp = (LLDebugVarMessageBox*)user_data;
msg_boxp->mAnimate = !msg_boxp->mAnimate;
msg_boxp->mAnimateButton->setToggleState(msg_boxp->mAnimate);
mAnimate = !mAnimate;
mAnimateButton->setToggleState(mAnimate);
}
void LLDebugVarMessageBox::onClose(bool app_quitting)

View File

@@ -67,7 +67,7 @@ protected:
static LLDebugVarMessageBox* show(const std::string& title, EDebugVarType var_type, void *var);
static void slider_changed(LLUICtrl* ctrl, void* user_data);
static void onAnimateClicked(void* user_data);
void onAnimateClicked();
public:
static void show(const std::string& title, F32 *var, F32 max_value = 100.f, F32 increment = 0.1f);

View File

@@ -265,10 +265,9 @@ BOOL LLFloaterAnimPreview::postBuild()
mPlayButton = getChild<LLButton>( "play_btn");
if (!mPlayButton)
{
mPlayButton = new LLButton(std::string("play_btn"), LLRect(0,0,0,0));
mPlayButton = new LLButton("play_btn");
}
mPlayButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPlay,this));
mPlayButton->setImages(std::string("button_anim_play.tga"),
std::string("button_anim_play_selected.tga"));
@@ -280,10 +279,9 @@ BOOL LLFloaterAnimPreview::postBuild()
mStopButton = getChild<LLButton>( "stop_btn");
if (!mStopButton)
{
mStopButton = new LLButton(std::string("stop_btn"), LLRect(0,0,0,0));
mStopButton = new LLButton("stop_btn");
}
mStopButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnStop, this));
mStopButton->setImages(std::string("button_anim_stop.tga"),
std::string("button_anim_stop_selected.tga"));
@@ -748,16 +746,15 @@ void LLFloaterAnimPreview::onMouseCaptureLost()
//-----------------------------------------------------------------------------
// onBtnPlay()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnPlay(void* user_data)
void LLFloaterAnimPreview::onBtnPlay()
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
if (!getEnabled())
return;
if (previewp->mMotionID.notNull())
if (mMotionID.notNull())
{
LLVOAvatar* avatarp;
if (previewp->mInWorld)
if (mInWorld)
{
if (!gAgentAvatarp)
{
@@ -767,27 +764,27 @@ void LLFloaterAnimPreview::onBtnPlay(void* user_data)
}
else
{
if (!previewp->mAnimPreview)
if (!mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
avatarp = mAnimPreview->getDummyAvatar();
}
if(!avatarp->isMotionActive(previewp->mMotionID))
if(!avatarp->isMotionActive(mMotionID))
{
previewp->resetMotion();
previewp->mPauseRequest = NULL;
resetMotion();
mPauseRequest = NULL;
}
else
{
if (avatarp->areAnimationsPaused())
{
previewp->mPauseRequest = NULL;
mPauseRequest = NULL;
}
else
{
previewp->mPauseRequest = avatarp->requestPause();
mPauseRequest = avatarp->requestPause();
}
}
}
@@ -796,16 +793,15 @@ void LLFloaterAnimPreview::onBtnPlay(void* user_data)
//-----------------------------------------------------------------------------
// onBtnStop()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnStop(void* user_data)
void LLFloaterAnimPreview::onBtnStop()
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
if (!getEnabled())
return;
if (previewp->mMotionID.notNull())
if (mMotionID.notNull())
{
LLVOAvatar* avatarp;
if (previewp->mInWorld)
if (mInWorld)
{
if (!gAgentAvatarp)
{
@@ -815,14 +811,14 @@ void LLFloaterAnimPreview::onBtnStop(void* user_data)
}
else
{
if (!previewp->mAnimPreview)
if (!mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
avatarp = mAnimPreview->getDummyAvatar();
}
previewp->resetMotion();
previewp->mPauseRequest = avatarp->requestPause();
resetMotion();
mPauseRequest = avatarp->requestPause();
}
}

View File

@@ -90,8 +90,8 @@ public:
void refresh();
static void onBtnPlay(void*);
static void onBtnStop(void*);
void onBtnPlay();
void onBtnStop();
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
static void onSliderMove(LLUICtrl*, void*);
static void onCommitBaseAnim(LLUICtrl*, void*);

View File

@@ -92,8 +92,8 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker() :
BOOL LLFloaterAvatarPicker::postBuild()
{
childSetKeystrokeCallback("Edit", &LLFloaterAvatarPicker::editKeystroke, (void*)this);
childSetKeystrokeCallback("EditUUID", &LLFloaterAvatarPicker::editKeystroke, (void*)this);
getChild<LLLineEditor>("Edit")->setKeystrokeCallback(boost::bind(&LLFloaterAvatarPicker::editKeystroke,this,_1));
getChild<LLLineEditor>("EditUUID")->setKeystrokeCallback(boost::bind(&LLFloaterAvatarPicker::editKeystroke, this,_1));
childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
getChildView("Find")->setEnabled(FALSE);
@@ -716,14 +716,12 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD&
search_results->setFocus(TRUE);
}
//static
void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data)
void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller)
{
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)user_data;
if(caller->getName() == "Edit")
self->getChildView("Find")->setEnabled(caller->getText().size() >= 3);
getChildView("Find")->setEnabled(caller->getText().size() >= 3);
else
self->childSetEnabled("Select", caller->getValue().asUUID().notNull());
childSetEnabled("Select", caller->getValue().asUUID().notNull());
}
// virtual

View File

@@ -65,7 +65,7 @@ public:
void openFriendsTab();
private:
static void editKeystroke(class LLLineEditor* caller, void* user_data);
void editKeystroke(class LLLineEditor* caller);
void onBtnFind();
void onBtnSelect();

View File

@@ -41,7 +41,6 @@
#include "llfloaterbuy.h"
#include "llagent.h" // for agent id
#include "llalertdialog.h"
#include "llinventorymodel.h" // for gInventory
#include "llinventorydefines.h"
#include "llinventoryicon.h"

View File

@@ -44,7 +44,7 @@
LLFloaterEditUI* LLFloaterEditUI::sInstance = NULL;
void LLFloaterEditUI::navigateHierarchyButtonPressed(void* data)
void LLFloaterEditUI::navigateHierarchyButtonPressed(S32 i)
{
LLView* view = LLView::sEditingUIView;
if( !view ) return;
@@ -62,7 +62,7 @@ void LLFloaterEditUI::navigateHierarchyButtonPressed(void* data)
for(idx = 0,itor = parentChildren->begin();itor!=parentChildren->end();itor++,idx++){
if((*itor)==view)break;
}
switch((intptr_t)data)
switch(i)
{
case 0 ://up
view = view->getParent();
@@ -142,10 +142,7 @@ LLFloaterEditUI::LLFloaterEditUI()
LLStringUtil::null,
NULL,
254,
onCommitLabel,
NULL,
NULL,
this);
boost::bind(&LLFloaterEditUI::onCommitLabel,_1));
addChild(line);
mLabelLine = line;
@@ -154,8 +151,7 @@ LLFloaterEditUI::LLFloaterEditUI()
spin = new LLSpinCtrl(std::string("height_spin"), LLRect(x, y+20, x+100, y),
std::string("Height:"), LLFontGL::getFontSansSerifSmall(),
onCommitHeight,
this,
boost::bind(&LLFloaterEditUI::onCommitHeight,_1),
0.f,
2.f,
1000.f,
@@ -168,8 +164,7 @@ LLFloaterEditUI::LLFloaterEditUI()
spin = new LLSpinCtrl(std::string("width_spin"), LLRect(x, y+20, x+100, y),
std::string("Width:"), LLFontGL::getFontSansSerifSmall(),
onCommitWidth,
this,
boost::bind(&LLFloaterEditUI::onCommitHeight,_1),
0.f,
2.f,
1000.f,
@@ -190,28 +185,22 @@ LLFloaterEditUI::LLFloaterEditUI()
y -= VPAD + 20;
x += 40;
button = new LLButton(std::string("up"),LLRect(x, y+16, x+32, y));
button = new LLButton(std::string("up"),LLRect(x, y+16, x+32, y), std::string(), boost::bind(LLFloaterEditUI::navigateHierarchyButtonPressed,0));
addChild(button);
x -= 40;
y -= VPAD + 20;
button = new LLButton(std::string("<<"),LLRect(x, y+16, x+32, y));
button = new LLButton(std::string("<<"),LLRect(x, y+16, x+32, y), std::string(), boost::bind(LLFloaterEditUI::navigateHierarchyButtonPressed,2));
addChild(button);
x += 40;
button = new LLButton(std::string("rfrsh"),LLRect(x, y+16, x+32, y));
button = new LLButton(std::string("rfrsh"),LLRect(x, y+16, x+32, y), std::string(), boost::bind(LLFloaterEditUI::navigateHierarchyButtonPressed,4));
addChild(button);
x += 40;
button = new LLButton(std::string(">>"),LLRect(x, y+16, x+32, y));
button = new LLButton(std::string(">>"),LLRect(x, y+16, x+32, y), std::string(), boost::bind(LLFloaterEditUI::navigateHierarchyButtonPressed,3));
addChild(button);
x -= 40;
y -= VPAD + 20;
button = new LLButton(std::string("dn"),LLRect(x, y+16, x+32, y));
button = new LLButton(std::string("dn"),LLRect(x, y+16, x+32, y), std::string(), boost::bind(LLFloaterEditUI::navigateHierarchyButtonPressed,1));
addChild(button);
childSetAction("up",navigateHierarchyButtonPressed,(void*)0);
childSetAction("dn",navigateHierarchyButtonPressed,(void*)1);
childSetAction("<<",navigateHierarchyButtonPressed,(void*)2);
childSetAction(">>",navigateHierarchyButtonPressed,(void*)3);
childSetAction("rfrsh",navigateHierarchyButtonPressed,(void*)4);
sInstance = this;
}
@@ -380,7 +369,7 @@ BOOL LLFloaterEditUI::processKeystroke(KEY key, MASK mask)
}
// static
void LLFloaterEditUI::onCommitLabel(LLUICtrl* ctrl, void* data)
void LLFloaterEditUI::onCommitLabel(LLUICtrl* ctrl)
{
LLView* view = LLView::sEditingUIView;
if (!view) return;
@@ -396,7 +385,7 @@ void LLFloaterEditUI::onCommitLabel(LLUICtrl* ctrl, void* data)
}
// static
void LLFloaterEditUI::onCommitHeight(LLUICtrl* ctrl, void* data)
void LLFloaterEditUI::onCommitHeight(LLUICtrl* ctrl)
{
LLView* view = LLView::sEditingUIView;
if (!view) return;
@@ -410,7 +399,7 @@ void LLFloaterEditUI::onCommitHeight(LLUICtrl* ctrl, void* data)
}
// static
void LLFloaterEditUI::onCommitWidth(LLUICtrl* ctrl, void* data)
void LLFloaterEditUI::onCommitWidth(LLUICtrl* ctrl)
{
LLView* view = LLView::sEditingUIView;
if (!view) return;

View File

@@ -51,14 +51,14 @@ public:
void refreshView(LLView* view);
void refreshButton(LLView* view);
static void navigateHierarchyButtonPressed(void* data);
static void navigateHierarchyButtonPressed(S32 i);
static void show(void* unused = NULL);
static BOOL processKeystroke(KEY key, MASK mask);
static void onCommitLabel(LLUICtrl* ctrl, void* data);
static void onCommitHeight(LLUICtrl* ctrl, void* data);
static void onCommitWidth(LLUICtrl* ctrl, void* data);
static void onCommitLabel(LLUICtrl* ctrl);
static void onCommitHeight(LLUICtrl* ctrl);
static void onCommitWidth(LLUICtrl* ctrl);
protected:
LLView* mLastView;

View File

@@ -49,6 +49,7 @@
#include "llfloateravatarpicker.h"
#include "llviewerwindow.h"
#include "llbutton.h"
#include "llfiltereditor.h"
#include "llfloateravatarinfo.h"
#include "llinventorymodel.h"
#include "llnamelistctrl.h"
@@ -353,14 +354,9 @@ void LLPanelFriends::filterContacts(const std::string& search_name)
mLastContactSearch = search_name;
}
//static
void LLPanelFriends::onContactSearchEdit(const std::string& search_string, void* user_data)
void LLPanelFriends::onContactFilterEdit(const std::string& search_string)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
if (panelp)
{
panelp->filterContacts(search_string);
}
filterContacts(search_string);
}
/*void LLPanelFriends::onChangeContactGroup(LLUICtrl* ctrl, void* user_data)
@@ -387,10 +383,10 @@ BOOL LLPanelFriends::postBuild()
// <dogmode>
// Contact search and group system.
// 09/05/2010 - Charley Levenque
LLSearchEditor* contact = getChild<LLSearchEditor>("buddy_search_lineedit");
LLFilterEditor* contact = getChild<LLFilterEditor>("buddy_search_lineedit");
if (contact)
{
contact->setSearchCallback(&onContactSearchEdit, this);
contact->setCommitCallback(boost::bind(&LLPanelFriends::onContactFilterEdit, this, _2));
}
getChild<LLTextBox>("s_num")->setValue("0");

View File

@@ -133,7 +133,7 @@ private:
static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
static void onPickAvatar(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names );
static void onContactSearchEdit(const std::string& search_string, void* user_data);
void onContactFilterEdit(const std::string& search_string);
static void onClickIM(void* user_data);
static void onClickAssign(void* user_data);
static void onClickExpand(void* user_data);

View File

@@ -40,7 +40,6 @@
#include "message.h"
#include "llagent.h"
#include "llalertdialog.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
@@ -448,9 +447,10 @@ LLPanelRegionTools::LLPanelRegionTools(const std::string& title)
BOOL LLPanelRegionTools::postBuild()
{
getChild<LLUICtrl>("region name")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetKeystrokeCallback("region name", onChangeSimName, this);
childSetPrevalidate("region name", &LLLineEditor::prevalidatePrintableNotPipe);
LLLineEditor* region_name = getChild<LLLineEditor>("region name");
region_name->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
region_name->setKeystrokeCallback(boost::bind(&LLPanelRegionTools::onChangeSimName, this));
region_name->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLUICtrl>("check prelude")->setCommitCallback(boost::bind(&LLPanelRegionTools:: onChangePrelude, this));
getChild<LLUICtrl>("check fixed sun")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
@@ -470,36 +470,42 @@ BOOL LLPanelRegionTools::postBuild()
childSetAction("Revert Terrain", boost::bind(&LLPanelRegionTools::onRevertTerrain, this));
childSetAction("Swap Terrain", boost::bind(&LLPanelRegionTools::onSwapTerrain, this));
getChild<LLUICtrl>("estate")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetPrevalidate("estate", &LLLineEditor::prevalidatePositiveS32);
LLLineEditor* estate = getChild<LLLineEditor>("estate name");
estate->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
estate->setPrevalidate(&LLLineEditor::prevalidatePositiveS32);
getChild<LLUICtrl>("parentestate")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetPrevalidate("parentestate", &LLLineEditor::prevalidatePositiveS32);
childDisable("parentestate");
LLLineEditor* parentestate = getChild<LLLineEditor>("parentestate");
parentestate->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
parentestate->setPrevalidate(&LLLineEditor::prevalidatePositiveS32);
parentestate->setEnabled(false);
getChild<LLUICtrl>("gridposx")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetPrevalidate("gridposx", &LLLineEditor::prevalidatePositiveS32);
childDisable("gridposx");
LLLineEditor* gridposx = getChild<LLLineEditor>("gridposx");
gridposx->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
gridposx->setPrevalidate(&LLLineEditor::prevalidatePositiveS32);
gridposx->setEnabled(false);
getChild<LLUICtrl>("gridposy")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetPrevalidate("gridposy", &LLLineEditor::prevalidatePositiveS32);
childDisable("gridposy");
LLLineEditor* gridposy = getChild<LLLineEditor>("gridposy");
gridposy->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
gridposy->setPrevalidate(&LLLineEditor::prevalidatePositiveS32);
gridposy->setEnabled(false);
getChild<LLUICtrl>("redirectx")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetPrevalidate("redirectx", &LLLineEditor::prevalidatePositiveS32);
LLLineEditor* redirectx = getChild<LLLineEditor>("redirectx");
redirectx->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
redirectx->setPrevalidate(&LLLineEditor::prevalidatePositiveS32);
getChild<LLUICtrl>("redirecty")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetPrevalidate("redirecty", &LLLineEditor::prevalidatePositiveS32);
LLLineEditor* redirecty = getChild<LLLineEditor>("redirecty");
redirecty->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
redirecty->setPrevalidate(&LLLineEditor::prevalidatePositiveS32);
getChild<LLUICtrl>("billable factor")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
getChild<LLUICtrl>("land cost")->setCommitCallback(boost::bind(&LLPanelRegionTools::onChangeAnything, this));
childSetAction("Refresh", boost::bind(&LLPanelRegionTools::onRefresh, this));
childSetAction("Apply", boost::bind(&LLPanelRegionTools::onApplyChanges, this));
getChild<LLButton>("Refresh")->setClickedCallback(boost::bind(&LLPanelRegionTools::onRefresh, this));
getChild<LLButton>("Apply")->setClickedCallback(boost::bind(&LLPanelRegionTools::onApplyChanges, this));
childSetAction("Select Region", boost::bind(&LLPanelRegionTools::onSelectRegion, this));
childSetAction("Autosave now", boost::bind(onSaveState, this));
getChild<LLButton>("Select Region")->setClickedCallback(boost::bind(&LLPanelRegionTools::onSelectRegion, this));
getChild<LLButton>("Autosave now")->setClickedCallback(boost::bind(&LLPanelRegionTools::onSaveState,(void*)NULL));
return TRUE;
}
@@ -586,7 +592,8 @@ void LLPanelRegionTools::enableAllWidgets()
getChildView("Autosave now")->setEnabled(TRUE);
}
void LLPanelRegionTools::onSaveState(void* userdata)
//static
void LLPanelRegionTools::onSaveState(void*)
{
if (gAgent.isGodlike())
{
@@ -820,13 +827,11 @@ void LLPanelRegionTools::onChangePrelude()
onChangeAnything();
}
// static
void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata )
void LLPanelRegionTools::onChangeSimName()
{
if (userdata && gAgent.isGodlike())
if ( gAgent.isGodlike())
{
LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata;
region_tools->getChildView("Apply")->setEnabled(TRUE);
getChildView("Apply")->setEnabled(TRUE);
}
}

View File

@@ -135,8 +135,8 @@ public:
/*virtual*/ void refresh();
static void onSaveState(void* userdata);
static void onChangeSimName(LLLineEditor* caller, void* userdata);
static void onSaveState(void*);
void onChangeSimName();
void onChangeAnything();
void onChangePrelude();

View File

@@ -114,6 +114,10 @@ LLFloaterGroupInfo::LLFloaterGroupInfo(const std::string& name, const LLRect &re
: LLFloater(name, rect, title),
mGroupID( group_id )
{
llinfos << name << " : " << title << llendl;
llinfos << rect << llendl;
llinfos << getRect() << llendl;
llinfos << getLocalRect() << llendl;
// Construct the filename of the group panel xml definition file.
mPanelGroupp = new LLPanelGroup("panel_group.xml",
"PanelGroup",

View File

@@ -51,7 +51,6 @@
#include "llfloatergroupinfo.h"
#include "llfloaterdirectory.h"
#include "llfocusmgr.h"
#include "llalertdialog.h"
#include "llselectmgr.h"
#include "llscrolllistctrl.h"
#include "llnotificationsutil.h"

View File

@@ -37,7 +37,6 @@
// Viewer libs
#include "llviewercontrol.h"
#include "llmediactrl.h"
#include "llalertdialog.h"
// Linden libs
#include "llnotificationsutil.h"

View File

@@ -721,6 +721,8 @@ BOOL LLImagePreviewAvatar::render()
mNeedsUpdate = FALSE;
LLVOAvatar* avatarp = mDummyAvatar;
gGL.pushUIMatrix();
gGL.loadUIIdentity();
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.pushMatrix();
@@ -785,6 +787,7 @@ BOOL LLImagePreviewAvatar::render()
}
}
gGL.popUIMatrix();
gGL.color4f(1,1,1,1);
return TRUE;
}

View File

@@ -1129,11 +1129,10 @@ BOOL LLPanelLandObjects::postBuild()
mCleanOtherObjectsTime = getChild<LLLineEditor>("clean other time");
mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(&LLPanelLandObjects::onLostFocus, _1, this));
mCleanOtherObjectsTime->setCommitCallback(onCommitClean);
mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this);
mCleanOtherObjectsTime->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32);
childSetUserData("clean other time", this);
mBtnRefresh = getChild<LLButton>("Refresh List");
mBtnRefresh->setClickedCallback(onClickRefresh, this);

View File

@@ -37,16 +37,18 @@
#include "llagent.h"
#include "llagentui.h"
#include "llcheckboxctrl.h"
#include "llviewerparcelmgr.h"
#include "llfiltereditor.h"
#include "llfolderview.h"
#include "llfoldervieweventlistener.h"
#include "llinventory.h"
#include "llinventoryfunctions.h"
#include "llinventorypanel.h"
#include "llviewerinventory.h"
#include "llparcel.h"
#include "llpermissions.h"
#include "llsaleinfo.h"
#include "llparcel.h"
#include "llviewerinventory.h"
#include "llviewerparcelmgr.h"
#include "llnotificationsutil.h"
#include "llviewerwindow.h" // alertXml
@@ -67,21 +69,26 @@ LLFloaterLandmark::LLFloaterLandmark(const LLSD& data)
mResolutionLabel(NULL),
mIsDirty( FALSE ),
mActive( TRUE ),
mSearchEdit(NULL),
mContextConeOpacity(0.f)
mFilterEdit(NULL),
mContextConeOpacity(0.f),
mInventoryPanel(NULL),
mSavedFolderState(NULL),
mNoCopyLandmarkSelected( FALSE )
{
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_landmark_ctrl.xml");
}
BOOL LLFloaterLandmark::postBuild()
{
mTentativeLabel = getChild<LLTextBox>("Multiple");
mResolutionLabel = getChild<LLTextBox>("unknown");
childSetCommitCallback("show_folders_check", onShowFolders, this);
childSetVisible("show_folders_check", FALSE);
LLUICtrl* show_folders_check = getChild<LLUICtrl>("show_folders_check");
show_folders_check->setCommitCallback(boost::bind(&LLFloaterLandmark::onShowFolders,this, _1));
show_folders_check->setVisible(FALSE);
mSearchEdit = getChild<LLSearchEditor>("inventory search editor");
mSearchEdit->setSearchCallback(onSearchEdit, this);
mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
mFilterEdit->setCommitCallback(boost::bind(&LLFloaterLandmark::onFilterEdit, this, _2));
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
@@ -93,7 +100,7 @@ LLFloaterLandmark::LLFloaterLandmark(const LLSD& data)
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterLandmark::onSelectionChange, _1, _2, (void*)this));
mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterLandmark::onSelectionChange, this, _1, _2));
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setAllowMultiSelect(FALSE);
@@ -110,17 +117,19 @@ LLFloaterLandmark::LLFloaterLandmark(const LLSD& data)
mSavedFolderState = new LLSaveFolderState();
mNoCopyLandmarkSelected = FALSE;
childSetAction("Close", LLFloaterLandmark::onBtnClose,this);
childSetAction("New", LLFloaterLandmark::onBtnNew,this);
childSetAction("NewFolder", LLFloaterLandmark::onBtnNewFolder,this);
childSetAction("Edit", LLFloaterLandmark::onBtnEdit,this);
childSetAction("Rename", LLFloaterLandmark::onBtnRename,this);
childSetAction("Delete", LLFloaterLandmark::onBtnDelete,this);
getChild<LLButton>("Close")->setClickedCallback(boost::bind(&LLFloaterLandmark::onBtnClose,this));
getChild<LLButton>("New")->setClickedCallback(boost::bind(&LLFloaterLandmark::onBtnNew,this));
getChild<LLButton>("NewFolder")->setClickedCallback(boost::bind(&LLFloaterLandmark::onBtnNewFolder,this));
getChild<LLButton>("Edit")->setClickedCallback(boost::bind(&LLFloaterLandmark::onBtnEdit,this));
getChild<LLButton>("Rename")->setClickedCallback(boost::bind(&LLFloaterLandmark::onBtnRename,this));
getChild<LLButton>("Delete")->setClickedCallback(boost::bind(&LLFloaterLandmark::onBtnDelete,this));
setCanMinimize(FALSE);
mSavedFolderState->setApply(FALSE);
return true;
}
LLFloaterLandmark::~LLFloaterLandmark()
@@ -185,9 +194,9 @@ BOOL LLFloaterLandmark::handleKeyHere(KEY key, MASK mask)
{
LLFolderView* root_folder = mInventoryPanel->getRootFolder();
if (root_folder && mSearchEdit)
if (root_folder && mFilterEdit)
{
if (mSearchEdit->hasFocus() &&
if (mFilterEdit->hasFocus() &&
(key == KEY_RETURN || key == KEY_DOWN) &&
mask == MASK_NONE)
{
@@ -209,7 +218,7 @@ BOOL LLFloaterLandmark::handleKeyHere(KEY key, MASK mask)
if (root_folder->hasFocus() && key == KEY_UP)
{
mSearchEdit->focusFirstItem(TRUE);
mFilterEdit->focusFirstItem(TRUE);
}
}
@@ -261,27 +270,23 @@ const LLUUID& LLFloaterLandmark::findItemID(const LLUUID& asset_id, BOOL copyabl
return LLUUID::null;
}
// static
void LLFloaterLandmark::onBtnClose(void* userdata)
void LLFloaterLandmark::onBtnClose()
{
LLFloaterLandmark* self = (LLFloaterLandmark*) userdata;
self->mIsDirty = FALSE;
self->close();
mIsDirty = FALSE;
close();
}
// static
void LLFloaterLandmark::onBtnEdit(void* userdata)
void LLFloaterLandmark::onBtnEdit()
{
LLFloaterLandmark* self = (LLFloaterLandmark*) userdata;
// There isn't one, so make a new preview
LLViewerInventoryItem* itemp = gInventory.getItem(self->mImageAssetID);
LLViewerInventoryItem* itemp = gInventory.getItem(mImageAssetID);
if(itemp)
{
open_landmark(itemp, itemp->getName(), TRUE);
}
}
// static
void LLFloaterLandmark::onBtnNew(void* userdata)
void LLFloaterLandmark::onBtnNew()
{
LLViewerRegion* agent_region = gAgent.getRegion();
if(!agent_region)
@@ -316,17 +321,15 @@ void LLFloaterLandmark::onBtnNew(void* userdata)
NOT_WEARABLE, PERM_ALL,
NULL);
}
// static
void LLFloaterLandmark::onBtnNewFolder(void* userdata)
void LLFloaterLandmark::onBtnNewFolder()
{
}
// static
void LLFloaterLandmark::onBtnDelete(void* userdata)
{
LLFloaterLandmark* self = (LLFloaterLandmark*)userdata;
LLViewerInventoryItem* item = gInventory.getItem(self->mImageAssetID);
void LLFloaterLandmark::onBtnDelete()
{
LLViewerInventoryItem* item = gInventory.getItem(mImageAssetID);
if(item)
{
// Move the item to the trash
@@ -360,82 +363,75 @@ void LLFloaterLandmark::onBtnDelete(void* userdata)
}
// static
void LLFloaterLandmark::onBtnRename(void* userdata)
void LLFloaterLandmark::onBtnRename()
{
}
// static
void LLFloaterLandmark::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
void LLFloaterLandmark::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
{
LLFloaterLandmark* self = (LLFloaterLandmark*)data;
if (items.size())
{
LLFolderViewItem* first_item = items.front();
LLInventoryItem* itemp = gInventory.getItem(first_item->getListener()->getUUID());
self->mNoCopyLandmarkSelected = FALSE;
mNoCopyLandmarkSelected = FALSE;
if (itemp)
{
if (!itemp->getPermissions().allowCopyBy(gAgent.getID()))
{
self->mNoCopyLandmarkSelected = TRUE;
mNoCopyLandmarkSelected = TRUE;
}
self->mImageAssetID = itemp->getUUID();
self->mIsDirty = TRUE;
mImageAssetID = itemp->getUUID();
mIsDirty = TRUE;
}
}
}
// static
void LLFloaterLandmark::onShowFolders(LLUICtrl* ctrl, void *user_data)
void LLFloaterLandmark::onShowFolders(LLUICtrl* ctrl)
{
LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl;
LLFloaterLandmark* picker = (LLFloaterLandmark*)user_data;
if (check_box->get())
{
picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
}
else
{
picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NO_FOLDERS);
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NO_FOLDERS);
}
}
void LLFloaterLandmark::onSearchEdit(const std::string& search_string, void* user_data )
void LLFloaterLandmark::onFilterEdit(const LLSD& value )
{
LLFloaterLandmark* picker = (LLFloaterLandmark*)user_data;
std::string upper_case_search_string = search_string;
std::string upper_case_search_string = value.asString();
LLStringUtil::toUpper(upper_case_search_string);
if (upper_case_search_string.empty())
{
if (picker->mInventoryPanel->getFilterSubString().empty())
if (mInventoryPanel->getFilterSubString().empty())
{
// current filter and new filter empty, do nothing
return;
}
picker->mSavedFolderState->setApply(TRUE);
picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(*picker->mSavedFolderState);
mSavedFolderState->setApply(TRUE);
mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
// add folder with current item to list of previously opened folders
LLOpenFoldersWithSelection opener;
picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
picker->mInventoryPanel->getRootFolder()->scrollToShowSelection();
mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
mInventoryPanel->getRootFolder()->scrollToShowSelection();
}
else if (picker->mInventoryPanel->getFilterSubString().empty())
else if (mInventoryPanel->getFilterSubString().empty())
{
// first letter in search term, save existing folder open state
if (!picker->mInventoryPanel->getRootFolder()->isFilterModified())
if (!mInventoryPanel->getRootFolder()->isFilterModified())
{
picker->mSavedFolderState->setApply(FALSE);
picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(*picker->mSavedFolderState);
mSavedFolderState->setApply(FALSE);
mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
}
}
picker->mInventoryPanel->setFilterSubString(upper_case_search_string);
mInventoryPanel->setFilterSubString(upper_case_search_string);
}

View File

@@ -47,6 +47,7 @@ class LLSearchEditor;
class LLInventoryPanel;
class LLSaveFolderState;
class LLViewerTexture;
class LLFilterEditor;
// used for setting drag & drop callbacks.
typedef BOOL (*drag_n_drop_callback)(LLUICtrl*, LLInventoryItem*, void*);
@@ -61,6 +62,8 @@ public:
LLFloaterLandmark(const LLSD& data);
virtual ~LLFloaterLandmark();
BOOL postBuild();
// LLView overrides
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
@@ -78,15 +81,15 @@ public:
BOOL isDirty() const { return mIsDirty; }
void setActive( BOOL active );
static void onBtnClose( void* userdata );
static void onBtnNew( void* userdata );
static void onBtnEdit( void* userdata );
static void onBtnDelete( void* userdata );
static void onBtnNewFolder( void* userdata );
static void onBtnRename( void* userdata );
static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data);
static void onShowFolders(LLUICtrl* ctrl, void* userdata);
static void onSearchEdit(const std::string& search_string, void* user_data );
void onBtnClose();
void onBtnNew();
void onBtnEdit();
void onBtnDelete();
void onBtnNewFolder();
void onBtnRename();
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
void onShowFolders(LLUICtrl* ctrl);
void onFilterEdit(const LLSD& value);
protected:
LLPointer<LLViewerTexture> mLandmarkp;
@@ -104,7 +107,7 @@ protected:
BOOL mIsDirty;
BOOL mActive;
LLSearchEditor* mSearchEdit;
LLFilterEditor* mFilterEdit;
LLInventoryPanel* mInventoryPanel;
PermissionMask mImmediateFilterPermMask;
PermissionMask mNonImmediateFilterPermMask;

View File

@@ -45,7 +45,6 @@
#include "lltextbox.h"
#include "llagent.h" // for agent id
#include "llalertdialog.h"
#include "llfloaterinventory.h"
#include "llinventorybridge.h"
#include "llinventorymodel.h"

View File

@@ -107,15 +107,11 @@ LLPermissionsView::LLPermissionsView(const LLRect &rect) : LLView(std::string("p
void LLPermissionsView::clearPermissionsData()
{
deleteAllChildren();
std::for_each(mPermData.begin(), mPermData.end(), DeletePairedPointer());
mPermData.clear();
}
void LLPermissionsView::addPermissionsData(const std::string& object_name, const LLUUID& object_id, U32 permissions_flags)
{
// grow to make room for new element
LLPermissionsData* perm_datap = new LLPermissionsData(object_id, permissions_flags);
reshape(getRect().getWidth(), getRect().getHeight() + LINE + VPAD + BTN_HEIGHT + VPAD);
S32 y = getRect().getHeight() - LINE - VPAD;
LLRect label_rect(HPAD, y + LINE, getRect().getWidth(), y);
@@ -126,39 +122,33 @@ void LLPermissionsView::addPermissionsData(const std::string& object_name, const
y -= LINE + VPAD;
LLRect btn_rect(HPAD, y + BTN_HEIGHT, 120, y);
LLButton* button = new LLButton(std::string("Revoke permissions"), btn_rect, LLStringUtil::null, revokePermissions, (void*)perm_datap);
LLButton* button = new LLButton(std::string("Revoke permissions"), btn_rect, LLStringUtil::null, std::bind(&LLPermissionsView::revokePermissions, object_id, permissions_flags));
button->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM);
addChild(button);
btn_rect.set(HPAD + 120 + HPAD, y + BTN_HEIGHT, HPAD + 120 + HPAD + 120, y);
button = new LLButton(std::string("Find in world"), btn_rect, LLStringUtil::null, findObject, (void*)perm_datap);
/*btn_rect.set(HPAD + 120 + HPAD, y + BTN_HEIGHT, HPAD + 120 + HPAD + 120, y);
button = new LLButton(std::string("Find in world"), btn_rect, LLStringUtil::null, std::bind(&LLPermissionsView::findObject, object_id, permissions_flags));
button->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM);
addChild(button);
mPermData.insert(std::make_pair(object_id, perm_datap));
addChild(button);*/
}
void LLPermissionsView::revokePermissions(void *userdata)
void LLPermissionsView::revokePermissions(const LLUUID& object_id, U32 permission_flags)
{
LLPermissionsData* perm_data = (LLPermissionsData*)userdata;
if (perm_data)
LLViewerObject* objectp = gObjectList.findObject(object_id);
if (objectp)
{
LLViewerObject* objectp = gObjectList.findObject(perm_data->mObjectID);
if (objectp)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RevokePermissions);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ObjectID, perm_data->mObjectID);
msg->addU32Fast(_PREHASH_ObjectPermissions, perm_data->mPermFlags);
msg->sendReliable(objectp->getRegion()->getHost());
}
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RevokePermissions);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ObjectID, object_id);
msg->addU32Fast(_PREHASH_ObjectPermissions, permission_flags);
msg->sendReliable(objectp->getRegion()->getHost());
}
}
void LLPermissionsView::findObject(void *userdata)
/*void LLPermissionsView::findObject(const LLUUID& object_id, U32 permission_flags)
{
}
}*/

View File

@@ -64,15 +64,6 @@ protected:
static LLFloaterPermissionsMgr* sInstance;
};
class LLPermissionsData
{
public:
LLPermissionsData(const LLUUID& object_id, U32 permission_flags) : mObjectID(object_id), mPermFlags(permission_flags) {};
LLUUID mObjectID;
U32 mPermFlags;
};
class LLPermissionsView : public LLView
{
public:
@@ -83,11 +74,8 @@ public:
void clearPermissionsData();
void addPermissionsData(const std::string& object_name, const LLUUID& object_id, U32 permissions_flags);
static void revokePermissions(void *userdata);
static void findObject(void *userdata);
protected:
std::map<LLUUID, LLPermissionsData*> mPermData;
static void revokePermissions(const LLUUID& object_id, U32 permission_flags);
//static void findObject(const LLUUID& object_id, U32 permission_flags);
};

View File

@@ -32,7 +32,6 @@
*/
#include "llviewerprecompiledheaders.h"
#include "llalertdialog.h"
#include "llcheckboxctrl.h"
#include "llfloaterperms.h"
#include "llnotificationsutil.h"

View File

@@ -80,7 +80,8 @@
class LLPropertiesObserver : public LLInventoryObserver
{
public:
LLPropertiesObserver()
LLPropertiesObserver(LLFloaterProperties* floater)
: mFloater(floater)
{
gInventory.addObserver(this);
}
@@ -89,6 +90,8 @@ public:
gInventory.removeObserver(this);
}
virtual void changed(U32 mask);
private:
LLFloaterProperties* mFloater;
};
void LLPropertiesObserver::changed(U32 mask)
@@ -96,7 +99,7 @@ void LLPropertiesObserver::changed(U32 mask)
// if there's a change we're interested in.
if((mask & (LLInventoryObserver::LABEL | LLInventoryObserver::INTERNAL | LLInventoryObserver::REMOVE)) != 0)
{
LLFloaterProperties::dirtyAll();
mFloater->dirty();
}
}
@@ -106,25 +109,10 @@ void LLPropertiesObserver::changed(U32 mask)
/// Class LLFloaterProperties
///----------------------------------------------------------------------------
// static
LLFloaterProperties::instance_map LLFloaterProperties::sInstances;
LLPropertiesObserver* LLFloaterProperties::sPropertiesObserver = NULL;
S32 LLFloaterProperties::sPropertiesObserverCount = 0;
// static
LLFloaterProperties* LLFloaterProperties::find(const LLUUID& item_id,
const LLUUID& object_id)
//static
LLFloaterProperties* LLFloaterProperties::find(const LLUUID& item_id, const LLUUID &object_id)
{
// for simplicity's sake, we key the properties window with a
// single uuid. However, the items are keyed by item and object
// (obj == null -> agent inventory). So, we xor the two ids, and
// use that as a lookup key
instance_map::iterator it = sInstances.find(item_id ^ object_id);
if(it != sInstances.end())
{
return (*it).second;
}
return NULL;
return getInstance(item_id ^ object_id);
}
// static
@@ -147,84 +135,68 @@ LLFloaterProperties* LLFloaterProperties::show(const LLUUID& item_id,
return instance;
}
void LLFloaterProperties::dirtyAll()
{
// ...this is more clear. Possibly more correct, because the
// refresh method may delete the object.
for(instance_map::iterator it = sInstances.begin(); it!=sInstances.end(); )
{
(*it++).second->dirty();
}
}
// Default constructor
LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_id, const LLUUID& object_id) :
LLFloater(name, rect, title),
LLFloater(name, rect, title), LLInstanceTracker<LLFloaterProperties,LLUUID>(object_id ^ item_id),
mItemID(item_id),
mObjectID(object_id),
mDirty(TRUE)
{
mPropertiesObserver = new LLPropertiesObserver(this);
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml");
if (!sPropertiesObserver)
{
sPropertiesObserver = new LLPropertiesObserver;
}
sPropertiesObserverCount++;
childSetTextArg("TextPrice", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
// add the object to the static structure
LLUUID key = mItemID ^ mObjectID;
sInstances.insert(instance_map::value_type(key, this));
// build the UI
// item name & description
childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidatePrintableNotPipe);
childSetCommitCallback("LabelItemName",onCommitName,this);
childSetPrevalidate("LabelItemDesc",&LLLineEditor::prevalidatePrintableNotPipe);
childSetCommitCallback("LabelItemDesc", onCommitDescription, this);
// Creator information
childSetAction("BtnCreator",onClickCreator,this);
// owner information
childSetAction("BtnOwner",onClickOwner,this);
// acquired date
// owner permissions
// Permissions debug text
// group permissions
childSetCommitCallback("CheckGroupCopy",&onCommitPermissions, this);
childSetCommitCallback("CheckGroupMod",&onCommitPermissions, this);
childSetCommitCallback("CheckGroupMove",&onCommitPermissions, this);
// everyone permissions
childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this);
childSetCommitCallback("CheckEveryoneMove",&onCommitPermissions, this);
// next owner permissions
childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this);
childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this);
childSetCommitCallback("CheckNextOwnerTransfer",&onCommitPermissions, this);
// Mark for sale or not, and sale info
childSetCommitCallback("CheckPurchase",&onCommitSaleInfo, this);
childSetCommitCallback("RadioSaleType",&onCommitSaleType, this);
// "Price" label for edit
childSetCommitCallback("EditPrice",&onCommitSaleInfo, this);
// The UI has been built, now fill in all the values
refresh();
}
// Destroys the object
LLFloaterProperties::~LLFloaterProperties()
{
// clean up the static data.
instance_map::iterator it = sInstances.find(mItemID ^ mObjectID);
if(it != sInstances.end())
{
sInstances.erase(it);
}
sPropertiesObserverCount--;
if (!sPropertiesObserverCount)
{
delete sPropertiesObserver;
sPropertiesObserver = NULL;
}
delete mPropertiesObserver;
mPropertiesObserver = NULL;
}
// virtual
BOOL LLFloaterProperties::postBuild()
{
childSetTextArg("TextPrice", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
// build the UI
// item name & description
getChild<LLLineEditor>("LabelItemName")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitName,this));
getChild<LLLineEditor>("LabelItemDesc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitDescription,this));
// Creator information
getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickCreator,this));
// owner information
getChild<LLUICtrl>("BtnOwner")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickOwner,this));
// acquired date
// owner permissions
// Permissions debug text
// group permissions
getChild<LLUICtrl>("CheckGroupCopy")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
getChild<LLUICtrl>("CheckGroupMod")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
getChild<LLUICtrl>("CheckGroupMove")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
// everyone permissions
getChild<LLUICtrl>("CheckEveryoneCopy")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
getChild<LLUICtrl>("CheckEveryoneMove")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
// next owner permissions
getChild<LLUICtrl>("CheckNextOwnerModify")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
getChild<LLUICtrl>("CheckNextOwnerCopy")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
// Mark for sale or not, and sale info
getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
getChild<LLUICtrl>("RadioSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this));
// "Price" label for edit
getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
// The UI has been built, now fill in all the values
refresh();
return TRUE;
}
// virtual
void LLFloaterProperties::onOpen()
{
refresh();
}
void LLFloaterProperties::refresh()
@@ -261,11 +233,11 @@ void LLFloaterProperties::refresh()
"CheckNextOwnerTransfer",
"CheckPurchase",
"RadioSaleType",
"EditPrice"
"Edit Cost"
};
for(size_t t=0; t<LL_ARRAY_SIZE(enableNames); ++t)
{
childSetEnabled(enableNames[t],false);
getChildView(enableNames[t])->setEnabled(false);
}
const char* hideNames[]={
"BaseMaskDebug",
@@ -276,7 +248,7 @@ void LLFloaterProperties::refresh()
};
for(size_t t=0; t<LL_ARRAY_SIZE(hideNames); ++t)
{
childSetVisible(hideNames[t],false);
getChildView(hideNames[t])->setVisible(false);
}
}
}
@@ -301,14 +273,16 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
// do not enable the UI for incomplete items.
LLViewerInventoryItem* i = (LLViewerInventoryItem*)item;
BOOL is_complete = i->isComplete();
BOOL is_complete = i->isFinished();
const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(i->getInventoryType());
const BOOL is_calling_card = (i->getInventoryType() == LLInventoryType::IT_CALLINGCARD);
const LLPermissions& perm = item->getPermissions();
BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_MANIPULATE);
BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_SET_SALE);
BOOL is_link = i->getIsLinkType();
const BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_MANIPULATE);
const BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_SET_SALE) &&
!cannot_restrict_permissions;
const BOOL is_link = i->getIsLinkType();
// You need permission to modify the object to modify an inventory
// item in it.
@@ -324,16 +298,16 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
// ITEM NAME & DESC //
//////////////////////
BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm,
GP_OBJECT_MANIPULATE)
&& is_obj_modify && is_complete;
GP_OBJECT_MANIPULATE)
&& is_obj_modify && is_complete;
childSetEnabled("LabelItemNameTitle",TRUE);
childSetEnabled("LabelItemName",is_modifiable);
childSetText("LabelItemName",item->getName());
childSetEnabled("LabelItemDescTitle",TRUE);
childSetEnabled("LabelItemDesc",is_modifiable);
childSetVisible("IconLocked",!is_modifiable);
childSetText("LabelItemDesc",item->getDescription());
getChildView("LabelItemNameTitle")->setEnabled(TRUE);
getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards
getChild<LLUICtrl>("LabelItemName")->setValue(item->getName());
getChildView("LabelItemDescTitle")->setEnabled(TRUE);
getChildView("LabelItemDesc")->setEnabled(is_modifiable);
getChildView("IconLocked")->setVisible(!is_modifiable);
getChild<LLUICtrl>("LabelItemDesc")->setValue(item->getDescription());
//////////////////
// CREATOR NAME //
@@ -345,17 +319,17 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
{
std::string name;
gCacheName->getFullName(item->getCreatorUUID(), name);
childSetEnabled("BtnCreator",TRUE);
childSetEnabled("LabelCreatorTitle",TRUE);
childSetEnabled("LabelCreatorName",TRUE);
childSetText("LabelCreatorName",name);
getChildView("BtnCreator")->setEnabled(TRUE);
getChildView("LabelCreatorTitle")->setEnabled(TRUE);
getChildView("LabelCreatorName")->setEnabled(TRUE);
getChild<LLUICtrl>("LabelCreatorName")->setValue(name);
}
else
{
childSetEnabled("BtnCreator",FALSE);
childSetEnabled("LabelCreatorTitle",FALSE);
childSetEnabled("LabelCreatorName",FALSE);
childSetText("LabelCreatorName",getString("unknown"));
getChildView("BtnCreator")->setEnabled(FALSE);
getChildView("LabelCreatorTitle")->setEnabled(FALSE);
getChildView("LabelCreatorName")->setEnabled(FALSE);
getChild<LLUICtrl>("LabelCreatorName")->setValue(getString("unknown"));
}
////////////////
@@ -378,20 +352,20 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
}
// [/RLVa:KB]
}
//childSetEnabled("BtnOwner",TRUE);
getChildView("BtnOwner")->setEnabled(TRUE);
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e
childSetEnabled("BtnOwner", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [/RLVa:KB]
childSetEnabled("LabelOwnerTitle",TRUE);
childSetEnabled("LabelOwnerName",TRUE);
childSetText("LabelOwnerName",name);
getChildView("LabelOwnerTitle")->setEnabled(TRUE);
getChildView("LabelOwnerName")->setEnabled(TRUE);
getChild<LLUICtrl>("LabelOwnerName")->setValue(name);
}
else
{
childSetEnabled("BtnOwner",FALSE);
childSetEnabled("LabelOwnerTitle",FALSE);
childSetEnabled("LabelOwnerName",FALSE);
childSetText("LabelOwnerName",getString("public"));
getChildView("BtnOwner")->setEnabled(FALSE);
getChildView("LabelOwnerTitle")->setEnabled(FALSE);
getChildView("LabelOwnerName")->setEnabled(FALSE);
getChild<LLUICtrl>("LabelOwnerName")->setValue(getString("public"));
}
//////////////////
@@ -402,13 +376,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
time_t time_utc = item->getCreationDate();
if (0 == time_utc)
{
childSetText("LabelAcquiredDate",getString("unknown"));
getChild<LLUICtrl>("LabelAcquiredDate")->setValue(getString("unknown"));
}
else
{
std::string timestr;
timeToFormattedString(time_utc, gSavedSettings.getString("TimestampFormat"), timestr);
childSetText("LabelAcquiredDate", timestr);
std::string timeStr;
timeToFormattedString(time_utc, gSavedSettings.getString("TimestampFormat"), timeStr);
getChild<LLUICtrl>("LabelAcquiredDate")->setValue(timeStr);
}
///////////////////////
@@ -416,11 +390,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
///////////////////////
if(can_agent_manipulate)
{
childSetText("OwnerLabel",getString("you_can"));
getChild<LLUICtrl>("OwnerLabel")->setValue(getString("you_can"));
}
else
{
childSetText("OwnerLabel",getString("owner_can"));
getChild<LLUICtrl>("OwnerLabel")->setValue(getString("owner_can"));
}
U32 base_mask = perm.getMaskBase();
@@ -429,13 +403,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
U32 everyone_mask = perm.getMaskEveryone();
U32 next_owner_mask = perm.getMaskNextOwner();
childSetEnabled("OwnerLabel",TRUE);
childSetEnabled("CheckOwnerModify",FALSE);
childSetValue("CheckOwnerModify",LLSD((BOOL)(owner_mask & PERM_MODIFY)));
childSetEnabled("CheckOwnerCopy",FALSE);
childSetValue("CheckOwnerCopy",LLSD((BOOL)(owner_mask & PERM_COPY)));
childSetEnabled("CheckOwnerTransfer",FALSE);
childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER)));
getChildView("OwnerLabel")->setEnabled(TRUE);
getChildView("CheckOwnerModify")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckOwnerModify")->setValue(LLSD((BOOL)(owner_mask & PERM_MODIFY)));
getChildView("CheckOwnerCopy")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckOwnerCopy")->setValue(LLSD((BOOL)(owner_mask & PERM_COPY)));
getChildView("CheckOwnerTransfer")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckOwnerTransfer")->setValue(LLSD((BOOL)(owner_mask & PERM_TRANSFER)));
///////////////////////
// DEBUG PERMISSIONS //
@@ -459,39 +433,39 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
perm_string = "B: ";
perm_string += mask_to_string(base_mask);
childSetText("BaseMaskDebug",perm_string);
childSetVisible("BaseMaskDebug",TRUE);
getChild<LLUICtrl>("BaseMaskDebug")->setValue(perm_string);
getChildView("BaseMaskDebug")->setVisible(TRUE);
perm_string = "O: ";
perm_string += mask_to_string(owner_mask);
childSetText("OwnerMaskDebug",perm_string);
childSetVisible("OwnerMaskDebug",TRUE);
getChild<LLUICtrl>("OwnerMaskDebug")->setValue(perm_string);
getChildView("OwnerMaskDebug")->setVisible(TRUE);
perm_string = "G";
perm_string += overwrite_group ? "*: " : ": ";
perm_string += mask_to_string(group_mask);
childSetText("GroupMaskDebug",perm_string);
childSetVisible("GroupMaskDebug",TRUE);
getChild<LLUICtrl>("GroupMaskDebug")->setValue(perm_string);
getChildView("GroupMaskDebug")->setVisible(TRUE);
perm_string = "E";
perm_string += overwrite_everyone ? "*: " : ": ";
perm_string += mask_to_string(everyone_mask);
childSetText("EveryoneMaskDebug",perm_string);
childSetVisible("EveryoneMaskDebug",TRUE);
getChild<LLUICtrl>("EveryoneMaskDebug")->setValue(perm_string);
getChildView("EveryoneMaskDebug")->setVisible(TRUE);
perm_string = "N";
perm_string += slam_perm ? "*: " : ": ";
perm_string += mask_to_string(next_owner_mask);
childSetText("NextMaskDebug",perm_string);
childSetVisible("NextMaskDebug",TRUE);
getChild<LLUICtrl>("NextMaskDebug")->setValue(perm_string);
getChildView("NextMaskDebug")->setVisible(TRUE);
}
else
{
childSetVisible("BaseMaskDebug",FALSE);
childSetVisible("OwnerMaskDebug",FALSE);
childSetVisible("GroupMaskDebug",FALSE);
childSetVisible("EveryoneMaskDebug",FALSE);
childSetVisible("NextMaskDebug",FALSE);
getChildView("BaseMaskDebug")->setVisible(FALSE);
getChildView("OwnerMaskDebug")->setVisible(FALSE);
getChildView("GroupMaskDebug")->setVisible(FALSE);
getChildView("EveryoneMaskDebug")->setVisible(FALSE);
getChildView("NextMaskDebug")->setVisible(FALSE);
}
/////////////
@@ -501,23 +475,23 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
// Check for ability to change values.
if (!is_link && is_obj_modify && can_agent_manipulate)
{
childSetEnabled("GroupLabel", true);
childSetEnabled("CheckGroupCopy", (owner_mask & (PERM_TRANSFER|PERM_COPY)) == (PERM_TRANSFER|PERM_COPY));
childSetEnabled("CheckGroupMod", owner_mask & PERM_MODIFY);
childSetEnabled("CheckGroupMove", true);
childSetEnabled("EveryoneLabel", true);
childSetEnabled("CheckEveryoneCopy", (owner_mask & (PERM_TRANSFER|PERM_COPY)) == (PERM_TRANSFER|PERM_COPY));
childSetEnabled("CheckEveryoneMove",true);
getChild<LLUICtrl>("GroupLabel")->setEnabled(TRUE);
getChild<LLUICtrl>("CheckGroupCopy")->setEnabled((owner_mask & (PERM_TRANSFER|PERM_COPY)) == (PERM_TRANSFER|PERM_COPY));
getChild<LLUICtrl>("CheckGroupMod")->setEnabled(owner_mask & PERM_MODIFY);
getChild<LLUICtrl>("CheckGroupMove")->setEnabled(TRUE);
getChild<LLUICtrl>("EveryoneLabel")->setEnabled(TRUE);
getChild<LLUICtrl>("CheckEveryoneCopy")->setEnabled((owner_mask & (PERM_TRANSFER|PERM_COPY)) == (PERM_TRANSFER|PERM_COPY));
getChild<LLUICtrl>("CheckEveryoneMove")->setEnabled(TRUE);
}
else
{
childSetEnabled("GroupLabel", false);
childSetEnabled("CheckGroupCopy", false);
childSetEnabled("CheckGroupMod", false);
childSetEnabled("CheckGroupMove", false);
childSetEnabled("EveryoneLabel", false);
childSetEnabled("CheckEveryoneCopy",false);
childSetEnabled("CheckEveryoneMove",false);
getChild<LLUICtrl>("GroupLabel")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckGroupCopy")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckGroupMod")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckGroupMove")->setEnabled(FALSE);
getChild<LLUICtrl>("EveryoneLabel")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckEveryoneCopy")->setEnabled(FALSE);
getChild<LLUICtrl>("CheckEveryoneMove")->setEnabled(FALSE);
}
// Set values.
@@ -525,12 +499,12 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
BOOL is_group_modify = (group_mask & PERM_MODIFY) ? TRUE : FALSE;
BOOL is_group_move = (group_mask & PERM_MOVE) ? TRUE : FALSE;
childSetValue("CheckGroupCopy", is_group_copy);
childSetValue("CheckGroupMod", is_group_modify);
childSetValue("CheckGroupMove", is_group_move);
getChild<LLUICtrl>("CheckGroupCopy")->setValue(LLSD((BOOL)is_group_copy));
getChild<LLUICtrl>("CheckGroupMod")->setValue(LLSD((BOOL)is_group_modify));
getChild<LLUICtrl>("CheckGroupMove")->setValue(LLSD((BOOL)is_group_move));
childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY)));
childSetValue("CheckEveryoneMove",LLSD((BOOL)(everyone_mask & PERM_MOVE)));
getChild<LLUICtrl>("CheckEveryoneCopy")->setValue(LLSD((BOOL)(everyone_mask & PERM_COPY)));
getChild<LLUICtrl>("CheckEveryoneMove")->setValue(LLSD((BOOL)(everyone_mask & PERM_MOVE)));
///////////////
// SALE INFO //
@@ -542,38 +516,39 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
if (is_obj_modify && can_agent_sell
&& gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE))
{
childSetEnabled("SaleLabel",is_complete);
childSetEnabled("CheckPurchase",is_complete);
getChildView("SaleLabel")->setEnabled(is_complete);
getChildView("CheckPurchase")->setEnabled(is_complete);
childSetEnabled("NextOwnerLabel",TRUE);
childSetEnabled("CheckNextOwnerModify",base_mask & PERM_MODIFY);
childSetEnabled("CheckNextOwnerCopy",base_mask & PERM_COPY);
childSetEnabled("CheckNextOwnerTransfer",next_owner_mask & PERM_COPY);
getChildView("NextOwnerLabel")->setEnabled(TRUE);
getChildView("CheckNextOwnerModify")->setEnabled((base_mask & PERM_MODIFY) && !cannot_restrict_permissions);
getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions);
getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions);
childSetEnabled("RadioSaleType",is_complete && is_for_sale);
childSetEnabled("TextPrice",is_complete && is_for_sale);
childSetEnabled("EditPrice",is_complete && is_for_sale);
getChildView("RadioSaleType")->setEnabled(is_complete && is_for_sale);
getChildView("TextPrice")->setEnabled(is_complete && is_for_sale);
getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale);
}
else
{
childSetEnabled("SaleLabel",FALSE);
childSetEnabled("CheckPurchase",FALSE);
getChildView("SaleLabel")->setEnabled(FALSE);
getChildView("CheckPurchase")->setEnabled(FALSE);
childSetEnabled("NextOwnerLabel",FALSE);
childSetEnabled("CheckNextOwnerModify",FALSE);
childSetEnabled("CheckNextOwnerCopy",FALSE);
childSetEnabled("CheckNextOwnerTransfer",FALSE);
getChildView("NextOwnerLabel")->setEnabled(FALSE);
getChildView("CheckNextOwnerModify")->setEnabled(FALSE);
getChildView("CheckNextOwnerCopy")->setEnabled(FALSE);
getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE);
childSetEnabled("RadioSaleType",FALSE);
childSetEnabled("TextPrice",FALSE);
childSetEnabled("EditPrice",FALSE);
getChildView("RadioSaleType")->setEnabled(FALSE);
getChildView("TextPrice")->setEnabled(FALSE);
getChildView("Edit Cost")->setEnabled(FALSE);
}
// Set values.
childSetValue("CheckPurchase", is_for_sale);
childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY)));
childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY)));
childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER)));
getChild<LLUICtrl>("CheckPurchase")->setValue(is_for_sale);
getChildView("Edit Cost")->setEnabled(is_for_sale);
getChild<LLUICtrl>("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY)));
getChild<LLUICtrl>("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY)));
getChild<LLUICtrl>("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER)));
LLRadioGroup* radioSaleType = getChild<LLRadioGroup>("RadioSaleType");
if (is_for_sale)
@@ -581,21 +556,18 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
S32 numerical_price;
numerical_price = sale_info.getSalePrice();
childSetText("EditPrice",llformat("%d",numerical_price));
getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",numerical_price));
}
else
{
radioSaleType->setSelectedIndex(-1);
childSetText("EditPrice",llformat("%d",0));
getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0));
}
}
// static
void LLFloaterProperties::onClickCreator(void* data)
void LLFloaterProperties::onClickCreator()
{
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self) return;
LLInventoryItem* item = self->findItem();
LLInventoryItem* item = findItem();
if(!item) return;
if(!item->getCreatorUUID().isNull())
{
@@ -604,11 +576,9 @@ void LLFloaterProperties::onClickCreator(void* data)
}
// static
void LLFloaterProperties::onClickOwner(void* data)
void LLFloaterProperties::onClickOwner()
{
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self) return;
LLInventoryItem* item = self->findItem();
LLInventoryItem* item = findItem();
if(!item) return;
if(item->getPermissions().isGroupOwned())
{
@@ -627,20 +597,15 @@ void LLFloaterProperties::onClickOwner(void* data)
}
// static
void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
void LLFloaterProperties::onCommitName()
{
//llinfos << "LLFloaterProperties::onCommitName()" << llendl;
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self)
{
return;
}
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item)
{
return;
}
LLLineEditor* labelItemName = self->getChild<LLLineEditor>("LabelItemName");
LLLineEditor* labelItemName = getChild<LLLineEditor>("LabelItemName");
if(labelItemName&&
(item->getName() != labelItemName->getText()) &&
@@ -648,7 +613,7 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->rename(labelItemName->getText());
if(self->mObjectID.isNull())
if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
@@ -656,7 +621,7 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
}
else
{
LLViewerObject* object = gObjectList.findObject(self->mObjectID);
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
@@ -668,16 +633,13 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
}
}
// static
void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
void LLFloaterProperties::onCommitDescription()
{
//llinfos << "LLFloaterProperties::onCommitDescription()" << llendl;
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self) return;
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
LLLineEditor* labelItemDesc = self->getChild<LLLineEditor>("LabelItemDesc");
LLLineEditor* labelItemDesc = getChild<LLLineEditor>("LabelItemDesc");
if(!labelItemDesc)
{
return;
@@ -688,7 +650,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setDescription(labelItemDesc->getText());
if(self->mObjectID.isNull())
if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
@@ -696,7 +658,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
}
else
{
LLViewerObject* object = gObjectList.findObject(self->mObjectID);
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
@@ -709,68 +671,66 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
}
// static
void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
void LLFloaterProperties::onCommitPermissions()
{
//llinfos << "LLFloaterProperties::onCommitPermissions()" << llendl;
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self) return;
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
LLPermissions perm(item->getPermissions());
LLCheckBoxCtrl* CheckGroupCopy = self->getChild<LLCheckBoxCtrl>("CheckGroupCopy");
LLCheckBoxCtrl* CheckGroupCopy = getChild<LLCheckBoxCtrl>("CheckGroupCopy");
if(CheckGroupCopy)
{
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
CheckGroupCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckGroupMod = self->getChild<LLCheckBoxCtrl>("CheckGroupMod");
LLCheckBoxCtrl* CheckGroupMod = getChild<LLCheckBoxCtrl>("CheckGroupMod");
if(CheckGroupMod)
{
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
CheckGroupMod->get(), PERM_MODIFY);
}
LLCheckBoxCtrl* CheckGroupMove = self->getChild<LLCheckBoxCtrl>("CheckGroupMove");
LLCheckBoxCtrl* CheckGroupMove = getChild<LLCheckBoxCtrl>("CheckGroupMove");
if(CheckGroupMove)
{
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
CheckGroupMove->get(), PERM_MOVE);
}
LLCheckBoxCtrl* CheckEveryoneMove = self->getChild<LLCheckBoxCtrl>("CheckEveryoneMove");
LLCheckBoxCtrl* CheckEveryoneMove = getChild<LLCheckBoxCtrl>("CheckEveryoneMove");
if(CheckEveryoneMove)
{
perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
CheckEveryoneMove->get(), PERM_MOVE);
}
LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
LLCheckBoxCtrl* CheckEveryoneCopy = getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
if(CheckEveryoneCopy)
{
perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
CheckEveryoneCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
LLCheckBoxCtrl* CheckNextOwnerModify = getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
if(CheckNextOwnerModify)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerModify->get(), PERM_MODIFY);
}
LLCheckBoxCtrl* CheckNextOwnerCopy = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy");
LLCheckBoxCtrl* CheckNextOwnerCopy = getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy");
if(CheckNextOwnerCopy)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckNextOwnerTransfer = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer");
LLCheckBoxCtrl* CheckNextOwnerTransfer = getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer");
if(CheckNextOwnerTransfer)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerTransfer->get(), PERM_TRANSFER);
}
if(perm != item->getPermissions()
&& item->isComplete())
&& item->isFinished())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setPermissions(perm);
@@ -799,7 +759,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
}
new_item->setFlags(flags);
if(self->mObjectID.isNull())
if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
@@ -807,7 +767,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
}
else
{
LLViewerObject* object = gObjectList.findObject(self->mObjectID);
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
@@ -820,26 +780,22 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
else
{
// need to make sure we don't just follow the click
self->refresh();
refresh();
}
}
// static
void LLFloaterProperties::onCommitSaleInfo(LLUICtrl* ctrl, void* data)
void LLFloaterProperties::onCommitSaleInfo()
{
//llinfos << "LLFloaterProperties::onCommitSaleInfo()" << llendl;
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self) return;
self->updateSaleInfo();
updateSaleInfo();
}
// static
void LLFloaterProperties::onCommitSaleType(LLUICtrl* ctrl, void* data)
void LLFloaterProperties::onCommitSaleType()
{
//llinfos << "LLFloaterProperties::onCommitSaleType()" << llendl;
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self) return;
self->updateSaleInfo();
updateSaleInfo();
}
void LLFloaterProperties::updateSaleInfo()
@@ -849,10 +805,10 @@ void LLFloaterProperties::updateSaleInfo()
LLSaleInfo sale_info(item->getSaleInfo());
if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE))
{
childSetValue("CheckPurchase",LLSD((BOOL)FALSE));
getChild<LLUICtrl>("CheckPurchase")->setValue(LLSD((BOOL)FALSE));
}
if((BOOL)childGetValue("CheckPurchase"))
if((BOOL)getChild<LLUICtrl>("CheckPurchase")->getValue())
{
// turn on sale info
LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY;
@@ -884,13 +840,11 @@ void LLFloaterProperties::updateSaleInfo()
sale_type = LLSaleInfo::FS_ORIGINAL;
}
LLLineEditor* EditPrice = getChild<LLLineEditor>("EditPrice");
S32 price = -1;
if(EditPrice)
{
price = atoi(EditPrice->getText().c_str());
}
price = getChild<LLUICtrl>("Edit Cost")->getValue().asInteger();;
// Invalid data - turn off the sale
if (price < 0)
{
@@ -906,7 +860,7 @@ void LLFloaterProperties::updateSaleInfo()
sale_info.setSaleType(LLSaleInfo::FS_NOT);
}
if(sale_info != item->getSaleInfo()
&& item->isComplete())
&& item->isFinished())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
@@ -965,16 +919,25 @@ LLInventoryItem* LLFloaterProperties::findItem() const
return item;
}
//static
void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_id)
{
LLFloaterProperties* floaterp = find(item_id, object_id);
LLFloaterProperties* floaterp = getInstance(item_id ^ object_id);
if (floaterp)
{
floaterp->close();
}
}
//static
void LLFloaterProperties::dirtyAll()
{
for(instance_iter it = beginInstances();it!=endInstances();++it)
{
it->dirty();
}
}
///----------------------------------------------------------------------------
/// LLMultiProperties
///----------------------------------------------------------------------------

View File

@@ -36,6 +36,8 @@
#include <map>
#include "llmultifloater.h"
#include "lliconctrl.h"
#include "llinstancetracker.h"
#include "lluuid.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFloaterProperties
@@ -50,7 +52,7 @@ class LLTextBox;
class LLPropertiesObserver;
class LLFloaterProperties : public LLFloater
class LLFloaterProperties : public LLFloater, LLInstanceTracker<LLFloaterProperties, LLUUID>
{
public:
static LLFloaterProperties* find(const LLUUID& item_id,
@@ -62,21 +64,23 @@ public:
static void closeByID(const LLUUID& item_id, const LLUUID& object_id);
LLFloaterProperties(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_id, const LLUUID& object_id);
virtual ~LLFloaterProperties();
/*virtual*/ ~LLFloaterProperties();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen();
// do everything necessary
void dirty() { mDirty = TRUE; }
void refresh();
protected:
// ui callbacks
static void onClickCreator(void* data);
static void onClickOwner(void* data);
static void onCommitName(LLUICtrl* ctrl, void* data);
static void onCommitDescription(LLUICtrl* ctrl, void* data);
static void onCommitPermissions(LLUICtrl* ctrl, void* data);
static void onCommitSaleInfo(LLUICtrl* ctrl, void* data);
static void onCommitSaleType(LLUICtrl* ctrl, void* data);
void onClickCreator();
void onClickOwner();
void onCommitName();
void onCommitDescription();
void onCommitPermissions();
void onCommitSaleInfo();
void onCommitSaleType();
void updateSaleInfo();
LLInventoryItem* findItem() const;
@@ -95,10 +99,7 @@ protected:
BOOL mDirty;
typedef std::map<LLUUID, LLFloaterProperties*, lluuid_less> instance_map;
static instance_map sInstances;
static LLPropertiesObserver* sPropertiesObserver;
static S32 sPropertiesObserverCount;
LLPropertiesObserver* mPropertiesObserver;
};
class LLMultiProperties : public LLMultiFloater

View File

@@ -49,7 +49,6 @@
#include "llradiogroup.h"
#include "llagent.h"
#include "llalertdialog.h"
#include "llappviewer.h"
#include "llavatarnamecache.h"
#include "llfloateravatarpicker.h"

View File

@@ -184,7 +184,7 @@ BOOL LLFloaterSellLandUI::postBuild()
{
childSetCommitCallback("sell_to", onChangeValue, this);
childSetCommitCallback("price", onChangeValue, this);
childSetPrevalidate("price", LLLineEditor::prevalidateNonNegativeS32);
getChild<LLLineEditor>("price")->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
childSetCommitCallback("sell_objects", onChangeValue, this);
childSetAction("sell_to_select_agent", doSelectAgent, this);
childSetAction("cancel_btn", doCancel, this);

View File

@@ -37,6 +37,7 @@
#include "llcolorswatch.h"
//#include "llfirstuse.h"
#include "llfloater.h"
#include "llfiltereditor.h"
#include "llscrolllistctrl.h"
#include "llspinctrl.h"
#include "lltexteditor.h"
@@ -107,7 +108,7 @@ BOOL LLFloaterSettingsDebug::postBuild()
getChild<LLUICtrl>("boolean_combo")->setCommitCallback(boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this));
getChild<LLUICtrl>("copy_btn")->setCommitCallback(boost::bind(&LLFloaterSettingsDebug::onCopyToClipboard, this));
getChild<LLUICtrl>("default_btn")->setCommitCallback(boost::bind(&LLFloaterSettingsDebug::onClickDefault, this));
getChild<LLSearchEditor>("search_settings_input")->setSearchCallback(onUpdateFilter, this);
getChild<LLFilterEditor>("search_settings_input")->setCommitCallback(boost::bind(&LLFloaterSettingsDebug::onUpdateFilter, this, _2));
mComment = getChild<LLTextEditor>("comment_text");
return TRUE;
}
@@ -532,9 +533,9 @@ void LLFloaterSettingsDebug::updateControl()
}
void LLFloaterSettingsDebug::onUpdateFilter(const std::string& searchTerm, void*)
void LLFloaterSettingsDebug::onUpdateFilter(const LLSD& value)
{
LLFloaterSettingsDebug::getInstance()->updateFilter(searchTerm);
updateFilter(value.asString());
}
void LLFloaterSettingsDebug::updateFilter(std::string searchTerm)

View File

@@ -53,7 +53,7 @@ public:
void updateControl();
// updates control filter to display in the controls list on keystroke
static void onUpdateFilter(const std::string& searchTerm, void*);
void onUpdateFilter(const LLSD& value);
void updateFilter(std::string searchTerm);
void onSettingSelect();

View File

@@ -62,15 +62,15 @@ public:
LLFloaterTestImpl();
private:
static void onClickButton(void*);
static void onClickText(void*);
static void onClickTab(void*, bool);
static void onCommitCheck(LLUICtrl*, void*);
static void onCommitCombo(LLUICtrl*, void*);
static void onCommitLine(LLUICtrl*, void*);
static void onKeyLine(LLLineEditor*, void*);
static void onFocusLostLine(LLFocusableElement*, void*);
static void onChangeRadioGroup(LLUICtrl*, void*);
static void onClickButton();
static void onClickText();
static void onClickTab();
static void onCommitCheck();
static void onCommitCombo(LLUICtrl* ctrl, const LLSD& value);
static void onCommitLine();
static void onKeyLine();
static void onFocusLostLine();
static void onChangeRadioGroup();
LLButton* mBtnSimple;
LLButton* mBtnUnicode;
@@ -118,7 +118,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
btn = new LLButton(std::string("can't click"),
LLRect(LEFT+150, y, LEFT+150+100, y-LINE),
LLStringUtil::null,
onClickButton, this);
boost::bind(&LLFloaterTestImpl::onClickButton));
btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
btn->setFont(LLFontGL::getFontSansSerifSmall());
addChild(btn);
@@ -128,7 +128,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
50, // max_width
LLFontGL::getFontSansSerifSmall(),
TRUE); // mouse_opaque
text->setClickedCallback(onClickText);
text->setClickedCallback(boost::bind(&onClickText));
text->setRect(LLRect(LEFT, y, RIGHT, y-LINE));
addChild(text);
@@ -137,7 +137,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
btn = new LLButton(std::string("can click"),
LLRect(LEFT+150, y, LEFT+150+100, y-LINE),
LLStringUtil::null,
onClickButton, this);
boost::bind(&LLFloaterTestImpl::onClickButton));
btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
btn->setFont(LLFontGL::getFontSansSerifSmall());
addChild(btn);
@@ -160,7 +160,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
addChild(tab);
mTab = tab;
tab->setCommitCallback(boost::bind(&LLFloaterTestImpl::onClickTab,_1,_2));
tab->setCommitCallback(boost::bind(&LLFloaterTestImpl::onClickTab));
//-----------------------------------------------------------------------
// First tab container panel
@@ -194,7 +194,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
std::string("tool_zoom.tga"),
std::string("tool_zoom_active.tga"),
LLStringUtil::null,
onClickButton, this,
boost::bind(&LLFloaterTestImpl::onClickButton),
LLFontGL::getFontSansSerifSmall());
btn->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
panel->addChild(btn);
@@ -205,7 +205,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
LLRect(LEFT, y, LEFT+150, y-LLCHECKBOXCTRL_HEIGHT),
std::string("Simple Checkbox"),
LLFontGL::getFontSansSerifSmall(),
onCommitCheck, this,
boost::bind(&LLFloaterTestImpl::onCommitCheck),
TRUE, // initial_value
FALSE, // radio_style
std::string("UIFloaterTestBool")); // control_which
@@ -217,7 +217,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
LLRect(LEFT, y, LEFT+150, y-LLCHECKBOXCTRL_HEIGHT),
std::string("TODO: Unicode Checkbox"),
LLFontGL::getFontSansSerifSmall(),
onCommitCheck, this,
boost::bind(&LLFloaterTestImpl::onCommitCheck),
TRUE, // initial_value
FALSE, // radio_style
LLStringUtil::null); // control_which
@@ -229,7 +229,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
combo = new LLComboBox(std::string("combo"),
LLRect(LEFT, y, LEFT+100, y-LLCOMBOBOX_HEIGHT),
std::string("Combobox Label"),
onCommitCombo, this);
boost::bind(&LLFloaterTestImpl::onCommitCombo, _1,_2) );
combo->add(std::string("first item"));
combo->add(std::string("second item"));
combo->add(std::string("should go to the top"), ADD_TOP);
@@ -253,10 +253,9 @@ LLFloaterTestImpl::LLFloaterTestImpl()
std::string("test some unicode text here"),
LLFontGL::getFontSansSerif(),
200, // max_length_bytes
onCommitLine,
onKeyLine,
onFocusLostLine,
this);
boost::bind(&LLFloaterTestImpl::onCommitLine),
boost::bind(&LLFloaterTestImpl::onKeyLine),
boost::bind(&LLFloaterTestImpl::onFocusLostLine));
line->setHandleEditKeysDirectly(true);
panel->addChild(line);
@@ -266,7 +265,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
std::string("radio_group"),
LLRect(LEFT, y, LEFT+200, y - 50),
0, // initial_index
onChangeRadioGroup, this,
boost::bind(&LLFloaterTestImpl::onChangeRadioGroup),
TRUE); // border
panel->addChild(group);
@@ -292,7 +291,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
btn = new LLButton(std::string("Simple Button"),
LLRect(LEFT, y, LEFT+100, y - 20),
LLStringUtil::null,
onClickButton, this);
boost::bind(&LLFloaterTestImpl::onClickButton));
btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT);
panel->addChild(btn);
mBtnSimple = btn;
@@ -305,58 +304,56 @@ LLFloaterTestImpl::LLFloaterTestImpl()
}
// static
void LLFloaterTestImpl::onClickButton(void*)
void LLFloaterTestImpl::onClickButton()
{
llinfos << "button clicked" << llendl;
}
// static
void LLFloaterTestImpl::onClickText(void*)
void LLFloaterTestImpl::onClickText()
{
llinfos << "text clicked" << llendl;
}
// static
void LLFloaterTestImpl::onClickTab(void*, bool)
void LLFloaterTestImpl::onClickTab()
{
llinfos << "click tab" << llendl;
}
// static
void LLFloaterTestImpl::onCommitCheck(LLUICtrl*, void*)
void LLFloaterTestImpl::onCommitCheck()
{
llinfos << "commit check" << llendl;
}
// static
void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, void*)
void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, const LLSD& value)
{
LLComboBox* combo = (LLComboBox*)ctrl;
std::string name = combo->getSimple();
LLSD value = combo->getValue();
llinfos << "commit combo name " << name << " value " << value.asString() << llendl;
llinfos << "commit combo name " << combo->getSimple() << " value " << value.asString() << llendl;
}
// static
void LLFloaterTestImpl::onCommitLine(LLUICtrl*, void*)
void LLFloaterTestImpl::onCommitLine()
{
llinfos << "commit line editor" << llendl;
}
// static
void LLFloaterTestImpl::onKeyLine(LLLineEditor*, void*)
void LLFloaterTestImpl::onKeyLine()
{
llinfos << "keystroke line editor" << llendl;
}
// static
void LLFloaterTestImpl::onFocusLostLine(LLFocusableElement*, void*)
void LLFloaterTestImpl::onFocusLostLine()
{
llinfos << "focus lost line editor" << llendl;
}
// static
void LLFloaterTestImpl::onChangeRadioGroup(LLUICtrl*, void*)
void LLFloaterTestImpl::onChangeRadioGroup()
{
llinfos << "change radio group" << llendl;
}

View File

@@ -62,6 +62,7 @@
#include "llpreviewlandmark.h"
#include "llregionhandle.h"
#include "llscrolllistctrl.h"
#include "llsearcheditor.h"
#include "lltextbox.h"
#include "lltracker.h"
#include "lltrans.h"
@@ -211,23 +212,22 @@ BOOL LLFloaterWorldMap::postBuild()
LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo");
avatar_combo->selectFirstItem();
avatar_combo->setPrearrangeCallback( onAvatarComboPrearrange );
avatar_combo->setTextEntryCallback( onComboTextEntry );
avatar_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboPrearrange,this) );
avatar_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry,this) );
mListFriendCombo = dynamic_cast<LLCtrlListInterface *>(avatar_combo);
LLLineEditor *location_editor = getChild<LLLineEditor>("location");
LLSearchEditor *location_editor = getChild<LLSearchEditor>("location");
location_editor->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1));
location_editor->setKeystrokeCallback( onSearchTextEntry );
location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this));
LLScrollListCtrl* search_results = getChild<LLScrollListCtrl>("search_results");
search_results->setDoubleClickCallback(boost::bind(&LLFloaterWorldMap::onClickTeleportBtn,this));
mListSearchResults = dynamic_cast<LLCtrlListInterface *>(search_results);
LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo");
landmark_combo->selectFirstItem();
landmark_combo->setPrearrangeCallback( onLandmarkComboPrearrange );
landmark_combo->setTextEntryCallback( onComboTextEntry );
landmark_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onLandmarkComboPrearrange, this) );
landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) );
mListLandmarkCombo = dynamic_cast<LLCtrlListInterface *>(landmark_combo);
avatar_combo->setCommitCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboCommit,this) );
@@ -1082,22 +1082,20 @@ void LLFloaterWorldMap::onGoHome()
}
// static
void LLFloaterWorldMap::onLandmarkComboPrearrange( LLUICtrl* ctrl, void* userdata )
void LLFloaterWorldMap::onLandmarkComboPrearrange( )
{
LLFloaterWorldMap* self = gFloaterWorldMap;
if( !self || self->mIsClosing )
if( mIsClosing )
{
return;
}
LLCtrlListInterface *list = self->childGetListInterface("landmark combo");
LLCtrlListInterface *list = mListLandmarkCombo;
if (!list) return;
LLUUID current_choice = list->getCurrentID();
gFloaterWorldMap->buildLandmarkIDLists();
buildLandmarkIDLists();
if( current_choice.isNull() || !list->setCurrentByID( current_choice ) )
{
LLTracker::stopTracking(NULL);
@@ -1105,7 +1103,7 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( LLUICtrl* ctrl, void* userdat
}
void LLFloaterWorldMap::onComboTextEntry( LLLineEditor* ctrl, void* userdata )
void LLFloaterWorldMap::onComboTextEntry()
{
// Reset the tracking whenever we start typing into any of the search fields,
// so that hitting <enter> does an auto-complete versus teleporting us to the
@@ -1113,11 +1111,10 @@ void LLFloaterWorldMap::onComboTextEntry( LLLineEditor* ctrl, void* userdata )
LLTracker::stopTracking(NULL);
}
// static
void LLFloaterWorldMap::onSearchTextEntry( LLLineEditor* ctrl, void* userdata )
void LLFloaterWorldMap::onSearchTextEntry( )
{
onComboTextEntry(ctrl, userdata);
gFloaterWorldMap->updateSearchEnabled();
onComboTextEntry();
updateSearchEnabled();
}
// static
@@ -1168,26 +1165,25 @@ void LLFloaterWorldMap::onLandmarkComboCommit()
}
// static
void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata )
void LLFloaterWorldMap::onAvatarComboPrearrange( )
{
LLFloaterWorldMap* self = gFloaterWorldMap;
if( !self || self->mIsClosing )
if( mIsClosing )
{
return;
}
LLCtrlListInterface *list = self->childGetListInterface("friend combo");
LLCtrlListInterface *list = mListFriendCombo;
if (!list) return;
LLUUID current_choice;
if( LLAvatarTracker::instance().haveTrackingInfo() )
{
current_choice = LLAvatarTracker::instance().getAvatarID();
}
self->buildAvatarIDList();
buildAvatarIDList();
if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
{
LLTracker::stopTracking(NULL);

View File

@@ -116,14 +116,14 @@ public:
protected:
void onGoHome();
static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
void onLandmarkComboPrearrange();
void onLandmarkComboCommit();
static void onAvatarComboPrearrange( LLUICtrl* ctrl, void* data );
void onAvatarComboPrearrange();
void onAvatarComboCommit();
static void onComboTextEntry( LLLineEditor* ctrl, void* data );
static void onSearchTextEntry( LLLineEditor* ctrl, void* data );
void onComboTextEntry( );
void onSearchTextEntry( );
void onClearBtn();
void onClickTeleportBtn();

View File

@@ -235,10 +235,9 @@ LLFolderView::LLFolderView( const std::string& name,
mRenamer = new LLLineEditor(std::string("ren"), getRect(), LLStringUtil::null, getLabelFontForStyle(LLFontGL::NORMAL),
DB_INV_ITEM_NAME_STR_LEN,
&LLFolderView::commitRename,
boost::bind(&LLFolderView::commitRename,this),
NULL,
NULL,
this,
&LLLineEditor::prevalidatePrintableNotPipe);
//mRenamer->setWriteableBgColor(LLColor4::white);
// Escape is handled by reverting the rename, not commiting it (default behavior)
@@ -897,13 +896,9 @@ BOOL LLFolderView::startDrag(LLToolDragAndDrop::ESource source)
return can_drag;
}
void LLFolderView::commitRename( LLUICtrl* renamer, void* user_data )
void LLFolderView::commitRename( )
{
LLFolderView* root = reinterpret_cast<LLFolderView*>(user_data);
if( root )
{
root->finishRenamingItem();
}
finishRenamingItem();
}
void LLFolderView::draw()

View File

@@ -260,7 +260,7 @@ private:
protected:
LLScrollableContainerView* mScrollContainer; // NULL if this is not a child of a scroll container.
static void commitRename( LLUICtrl* renamer, void* user_data );
void commitRename( );
void onRenamerLost();
void finishRenamingItem( void );

View File

@@ -93,7 +93,7 @@ LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon,
S32 creation_date,
LLFolderView* root,
LLFolderViewEventListener* listener ) :
LLUICtrl( name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL, FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT),
LLUICtrl( name, LLRect(0, 0, 0, 0), TRUE, NULL, FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT),
mLabelWidth(0),
mLabelWidthDirty(false),
mParentFolder( NULL ),

View File

@@ -54,24 +54,11 @@
#include "hippogridmanager.h"
#include <boost/lexical_cast.hpp>
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLGiveMoneyInfo
//
// A small class used to track callback information
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
struct LLGiveMoneyInfo
{
LLFloaterPay* mFloater;
S32 mAmount;
LLGiveMoneyInfo(LLFloaterPay* floater, S32 amount) :
mFloater(floater), mAmount(amount){}
};
///----------------------------------------------------------------------------
/// Class LLFloaterPay
///----------------------------------------------------------------------------
@@ -88,13 +75,19 @@ LLFloaterPay::LLFloaterPay(const std::string& name,
LLFloater(name, std::string("FloaterPayRectB"), LLStringUtil::null, RESIZE_NO,
DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, DRAG_ON_TOP,
MINIMIZE_NO, CLOSE_YES),
mCallbackData(),
mCallback(callback),
mObjectNameText(NULL),
mTargetUUID(uuid),
mTargetIsObject(target_is_object),
mTargetIsGroup(FALSE)
mTargetIsGroup(FALSE),
mDefaultValue(0)
{
mQuickPayInfo[0] = PAY_BUTTON_DEFAULT_0;
mQuickPayInfo[1] = PAY_BUTTON_DEFAULT_1;
mQuickPayInfo[2] = PAY_BUTTON_DEFAULT_2;
mQuickPayInfo[3] = PAY_BUTTON_DEFAULT_3;
BOOST_STATIC_ASSERT(MAX_PAY_BUTTONS == 4);
if (target_is_object)
{
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_pay_object.xml");
@@ -105,55 +98,14 @@ LLFloaterPay::LLFloaterPay(const std::string& name,
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_pay.xml");
}
S32 i =0;
for(U32 i = 0; i < MAX_PAY_BUTTONS; ++i)
{
mQuickPayButton[i] = getChild<LLButton>("fastpay " + boost::lexical_cast<std::string>(mQuickPayInfo[i]));
mQuickPayButton[i]->setClickedCallback(boost::bind(&LLFloaterPay::onGive,this,std::ref(mQuickPayInfo[i])));
mQuickPayButton[i]->setVisible(FALSE);
mQuickPayButton[i]->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
}
LLGiveMoneyInfo* info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0);
mCallbackData.push_back(info);
childSetAction("fastpay 1",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 1", FALSE);
childSetLabelArg("fastpay 1", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
mQuickPayButton[i] = getChild<LLButton>("fastpay 1");
mQuickPayInfo[i] = info;
++i;
info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1);
mCallbackData.push_back(info);
childSetAction("fastpay 5",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 5", FALSE);
childSetLabelArg("fastpay 5", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
mQuickPayButton[i] = getChild<LLButton>("fastpay 5");
mQuickPayInfo[i] = info;
++i;
info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2);
mCallbackData.push_back(info);
childSetAction("fastpay 10",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 10", FALSE);
childSetLabelArg("fastpay 10", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
mQuickPayButton[i] = getChild<LLButton>("fastpay 10");
mQuickPayInfo[i] = info;
++i;
info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3);
mCallbackData.push_back(info);
childSetAction("fastpay 20",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 20", FALSE);
childSetLabelArg("fastpay 20", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
mQuickPayButton[i] = getChild<LLButton>("fastpay 20");
mQuickPayInfo[i] = info;
++i;
childSetVisible("amount text", FALSE);
std::string last_amount;
@@ -162,21 +114,20 @@ LLFloaterPay::LLFloaterPay(const std::string& name,
last_amount = llformat("%d", sLastAmount);
}
childSetVisible("amount", FALSE);
childSetKeystrokeCallback("amount", &LLFloaterPay::onKeystroke, this);
childSetText("amount", last_amount);
childSetPrevalidate("amount", LLLineEditor::prevalidateNonNegativeS32);
LLLineEditor* amount = getChild<LLLineEditor>("amount");
amount->setVisible(false);
amount->setKeystrokeCallback(boost::bind(&LLFloaterPay::onKeystroke, this, _1));
amount->setText(last_amount);
amount->setPrevalidate(&LLLineEditor::prevalidateNonNegativeS32);
info = new LLGiveMoneyInfo(this, 0);
mCallbackData.push_back(info);
childSetAction("pay btn",&LLFloaterPay::onGive,info);
setDefaultBtn("pay btn");
childSetVisible("pay btn", FALSE);
childSetEnabled("pay btn", (sLastAmount > 0));
LLButton* pay_btn = getChild<LLButton>("pay btn");
pay_btn->setClickedCallback(boost::bind(&LLFloaterPay::onGive,this,std::ref(mDefaultValue)));
setDefaultBtn(pay_btn);
pay_btn->setVisible(false);
pay_btn->setEnabled(sLastAmount > 0);
childSetAction("cancel btn",&LLFloaterPay::onCancel,this);
getChild<LLButton>("cancel btn")->setClickedCallback(boost::bind(&LLFloaterPay::onCancel,this));
center();
open(); /*Flawfinder: ignore*/
@@ -185,7 +136,6 @@ LLFloaterPay::LLFloaterPay(const std::string& name,
// Destroys the object
LLFloaterPay::~LLFloaterPay()
{
std::for_each(mCallbackData.begin(), mCallbackData.end(), DeletePointer());
}
// static
@@ -250,7 +200,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata)
self->mQuickPayButton[i]->setLabelSelected(button_str);
self->mQuickPayButton[i]->setLabelUnselected(button_str);
self->mQuickPayButton[i]->setVisible(TRUE);
self->mQuickPayInfo[i]->mAmount = pay_button;
self->mQuickPayInfo[i] = pay_button;
self->childSetVisible("fastpay text",TRUE);
if ( pay_button > max_pay_amount )
@@ -411,37 +361,22 @@ void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id,
childSetTextArg("payee_name", "[NAME]", full_name);
}
// static
void LLFloaterPay::onCancel(void* data)
void LLFloaterPay::onCancel()
{
LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data);
if(self)
{
self->close();
}
close();
}
// static
void LLFloaterPay::onKeystroke(LLLineEditor*, void* data)
void LLFloaterPay::onKeystroke(LLLineEditor* caller)
{
LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data);
if(self)
{
// enable the Pay button when amount is non-empty and positive, disable otherwise
std::string amtstr = self->childGetText("amount");
self->childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0);
}
// enable the Pay button when amount is non-empty and positive, disable otherwise
std::string amtstr = caller->getValue().asString();
childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0);
}
// static
void LLFloaterPay::onGive(void* data)
void LLFloaterPay::onGive(const S32& amount)
{
LLGiveMoneyInfo* info = reinterpret_cast<LLGiveMoneyInfo*>(data);
if(info && info->mFloater)
{
info->mFloater->give(info->mAmount);
info->mFloater->close();
}
give(amount);
close();
}
void LLFloaterPay::give(S32 amount)

View File

@@ -46,7 +46,6 @@ class LLLineEditor;
class LLTextBox;
class LLButton;
class LLObjectSelection;
struct LLGiveMoneyInfo;
typedef void (*money_callback)(const LLUUID&, LLViewerRegion*,S32,BOOL,S32,const std::string&);
@@ -72,16 +71,15 @@ public:
BOOL is_group);
private:
static void onCancel(void* data);
static void onKeystroke(LLLineEditor* editor, void* data);
static void onGive(void* data);
void onCancel();
void onKeystroke(LLLineEditor* caller);
void onGive(const S32& amount);
void give(S32 amount);
static void processPayPriceReply(LLMessageSystem* msg, void **userdata);
void onCacheOwnerName( const LLUUID& owner_id, const std::string& full_name, bool is_group);
void finishPayUI(const LLUUID& target_id, BOOL is_group);
protected:
std::vector<LLGiveMoneyInfo*> mCallbackData;
money_callback mCallback;
LLTextBox* mObjectNameText;
LLUUID mTargetUUID;
@@ -90,7 +88,8 @@ protected:
BOOL mHaveName;
LLButton* mQuickPayButton[MAX_PAY_BUTTONS];
LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS];
S32 mQuickPayInfo[MAX_PAY_BUTTONS];
S32 mDefaultValue;
LLSafeHandle<LLObjectSelection> mObjectSelection;

View File

@@ -66,7 +66,7 @@
#pragma warning(pop) // Restore all warnings to the previous state
#endif
const U32 MAX_CACHED_GROUPS = 10;
const U32 MAX_CACHED_GROUPS = 20;
//
// LLRoleActionSet
@@ -236,8 +236,15 @@ LLGroupMgrGroupData::LLGroupMgrGroupData(const LLUUID& id) :
mRoleDataComplete(FALSE),
mRoleMemberDataComplete(FALSE),
mGroupPropertiesDataComplete(FALSE),
mPendingRoleMemberRequest(FALSE)
mPendingRoleMemberRequest(FALSE),
mAccessTime(0.0f)
{
mMemberVersion.generate();
}
void LLGroupMgrGroupData::setAccessed()
{
mAccessTime = (F32)LLFrameTimer::getTotalSeconds();
}
BOOL LLGroupMgrGroupData::getRoleData(const LLUUID& role_id, LLRoleData& role_data)
@@ -419,6 +426,7 @@ void LLGroupMgrGroupData::removeMemberData()
}
mMembers.clear();
mMemberDataComplete = FALSE;
mMemberVersion.generate();
}
void LLGroupMgrGroupData::removeRoleData()
@@ -947,7 +955,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
LLUUID request_id;
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mMemberRequestID != request_id))
{
llwarns << "processGroupMembersReply: Received incorrect (stale?) group or request id" << llendl;
@@ -1017,6 +1025,8 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
}
}
group_datap->mMemberVersion.generate();
if (group_datap->mMembers.size() == (U32)group_datap->mMemberCount)
{
group_datap->mMemberDataComplete = TRUE;
@@ -1118,7 +1128,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
LLUUID request_id;
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mRoleDataRequestID != request_id))
{
llwarns << "processGroupPropertiesReply: Received incorrect (stale?) group or request id" << llendl;
@@ -1207,7 +1217,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
U32 total_pairs;
msg->getU32(_PREHASH_AgentData, "TotalPairs", total_pairs);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mRoleMembersRequestID != request_id))
{
llwarns << "processGroupRoleMembersReply: Received incorrect (stale?) group or request id" << llendl;
@@ -1311,7 +1321,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
LLUUID request_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_RequestID, request_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mTitlesRequestID != request_id))
{
llwarns << "processGroupTitlesReply: Received incorrect (stale?) group" << llendl;
@@ -1443,7 +1453,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data)
LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id)
{
LLGroupMgrGroupData* group_datap;
LLGroupMgrGroupData* group_datap = NULL;
group_map_t::iterator existing_group = LLGroupMgr::getInstance()->mGroups.find(id);
if (existing_group == LLGroupMgr::getInstance()->mGroups.end())
@@ -1456,6 +1466,11 @@ LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id)
group_datap = existing_group->second;
}
if (group_datap)
{
group_datap->setAccessed();
}
return group_datap;
}
@@ -1496,25 +1511,41 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc)
void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap)
{
if (mGroups.size() > MAX_CACHED_GROUPS)
while (mGroups.size() >= MAX_CACHED_GROUPS)
{
// get rid of groups that aren't observed
for (group_map_t::iterator gi = mGroups.begin(); gi != mGroups.end() && mGroups.size() > MAX_CACHED_GROUPS / 2; )
// LRU: Remove the oldest un-observed group from cache until group size is small enough
F32 oldest_access = LLFrameTimer::getTotalSeconds();
group_map_t::iterator oldest_gi = mGroups.end();
for (group_map_t::iterator gi = mGroups.begin(); gi != mGroups.end(); ++gi )
{
observer_multimap_t::iterator oi = mObservers.find(gi->first);
if (oi == mObservers.end())
{
// not observed
LLGroupMgrGroupData* unobserved_groupp = gi->second;
delete unobserved_groupp;
mGroups.erase(gi++);
}
else
{
++gi;
if (gi->second
&& (gi->second->getAccessTime() < oldest_access))
{
oldest_access = gi->second->getAccessTime();
oldest_gi = gi;
}
}
}
if (oldest_gi != mGroups.end())
{
delete oldest_gi->second;
mGroups.erase(oldest_gi);
}
else
{
// All groups must be currently open, none to remove.
// Just add the new group anyway, but get out of this loop as it
// will never drop below max_cached_groups.
break;
}
}
mGroups[group_datap->getID()] = group_datap;
}
@@ -1886,6 +1917,8 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
{
gAgent.sendReliableMessage();
}
group_datap->mMemberVersion.generate();
}
@@ -2047,8 +2080,10 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
group_datap->mMembers[member_id] = data;
}
group_datap->mMemberVersion.generate();
// Technically, we have this data, but to prevent completely overhauling
// this entire system (it would be nice, but I don't have the time),
// this entire system (it would be nice, but I don't have the time),
// I'm going to be dumb and just call services I most likely don't need
// with the thought being that the system might need it to be done.
//

View File

@@ -86,7 +86,7 @@ public:
BOOL isInRole(const LLUUID& role_id) { return (mRolesList.find(role_id) != mRolesList.end()); }
protected:
private:
LLUUID mID;
S32 mContribution;
U64 mAgentPowers;
@@ -233,6 +233,10 @@ public:
BOOL isRoleMemberDataComplete() { return mRoleMemberDataComplete; }
BOOL isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; }
F32 getAccessTime() const { return mAccessTime; }
void setAccessed();
const LLUUID& getMemberVersion() const { return mMemberVersion; }
public:
typedef std::map<LLUUID,LLGroupMemberData*> member_list_t;
typedef std::map<LLUUID,LLGroupRoleData*> role_list_t;
@@ -279,6 +283,10 @@ private:
BOOL mGroupPropertiesDataComplete;
BOOL mPendingRoleMemberRequest;
F32 mAccessTime;
// Generate a new ID every time mMembers
LLUUID mMemberVersion;
};
struct LLRoleAction

View File

@@ -250,8 +250,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
std::string("notify_next.png"),
std::string("notify_next.png"),
LLStringUtil::null,
onClickNext,
this,
boost::bind(&LLGroupNotifyBox::onClickNext, this),
LLFontGL::getFontSansSerif());
btn->setToolTip(LLTrans::getString("next"));
btn->setScaleImage(TRUE);
@@ -268,7 +267,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
btn_width,
BTN_HEIGHT);
btn = new LLButton(LLTrans::getString("ok"), btn_rect, LLStringUtil::null, onClickOk, this);
btn = new LLButton(LLTrans::getString("ok"), btn_rect, LLStringUtil::null, boost::bind(&LLGroupNotifyBox::onClickOk,this));
addChild(btn, -1);
setDefaultBtn(btn);
@@ -280,7 +279,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
wide_btn_width,
BTN_HEIGHT);
btn = new LLButton(LLTrans::getString("GroupNotifyGroupNotices"), btn_rect, LLStringUtil::null, onClickGroupInfo, this);
btn = new LLButton(LLTrans::getString("GroupNotifyGroupNotices"), btn_rect, LLStringUtil::null, boost::bind(&LLGroupNotifyBox::onClickGroupInfo,this));
btn->setToolTip(LLTrans::getString("GroupNotifyViewPastNotices"));
addChild(btn, -1);
@@ -302,7 +301,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
{
btn_lbl = LLTrans::getString("GroupNotifySaveAttachment");
}
mSaveInventoryBtn = new LLButton(btn_lbl, btn_rect, LLStringUtil::null, onClickSaveInventory, this);
mSaveInventoryBtn = new LLButton(btn_lbl, btn_rect, LLStringUtil::null, boost::bind(&LLGroupNotifyBox::onClickSaveInventory,this));
mSaveInventoryBtn->setVisible(mHasInventory);
addChild(mSaveInventoryBtn);
}
@@ -453,41 +452,29 @@ LLRect LLGroupNotifyBox::getGroupNotifyRect()
}
// static
void LLGroupNotifyBox::onClickOk(void* data)
void LLGroupNotifyBox::onClickOk()
{
LLGroupNotifyBox* self = (LLGroupNotifyBox*)data;
if (self) self->close();
close();
}
void LLGroupNotifyBox::onClickGroupInfo(void* data)
void LLGroupNotifyBox::onClickGroupInfo()
{
LLGroupNotifyBox* self = (LLGroupNotifyBox*)data;
if (self)
{
LLFloaterGroupInfo::showFromUUID(self->mGroupID, "notices_tab");
}
LLFloaterGroupInfo::showFromUUID(mGroupID, "notices_tab");
//Leave notice open until explicitly closed
}
void LLGroupNotifyBox::onClickSaveInventory(void* data)
void LLGroupNotifyBox::onClickSaveInventory()
{
LLGroupNotifyBox* self = (LLGroupNotifyBox*)data;
mInventoryOffer->forceResponse(IOR_ACCEPT);
self->mInventoryOffer->forceResponse(IOR_ACCEPT);
self->mInventoryOffer = NULL;
self->mHasInventory = FALSE;
mInventoryOffer = NULL;
mHasInventory = FALSE;
// Each item can only be received once, so disable the button.
self->mSaveInventoryBtn->setEnabled(FALSE);
mSaveInventoryBtn->setEnabled(FALSE);
}
// static
void LLGroupNotifyBox::onClickNext(void* data)
void LLGroupNotifyBox::onClickNext()
{
LLGroupNotifyBox* self = (LLGroupNotifyBox*)data;
self->moveToBack();
moveToBack();
}

View File

@@ -89,12 +89,12 @@ protected:
static LLRect getGroupNotifyRect();
// internal handler for button being clicked
static void onClickOk(void* data);
static void onClickGroupInfo(void* data);
static void onClickSaveInventory(void* data);
void onClickOk();
void onClickGroupInfo();
void onClickSaveInventory();
// for "next" button
static void onClickNext(void* data);
void onClickNext();
private:
// Are we sliding onscreen?

View File

@@ -1349,12 +1349,12 @@ BOOL LLFloaterIMPanel::postBuild()
mInputEditor = getChild<LLLineEditor>("chat_editor");
mInputEditor->setFocusReceivedCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusReceived, this) );
mFocusLostSignal = mInputEditor->setFocusLostCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusLost, this) );
mInputEditor->setKeystrokeCallback( onInputEditorKeystroke );
mInputEditor->setCommitCallback( onCommitChat );
mInputEditor->setCallbackUserData(this);
mInputEditor->setKeystrokeCallback( boost::bind(&LLFloaterIMPanel::onInputEditorKeystroke, this, _1) );
mInputEditor->setCommitCallback( boost::bind(&LLFloaterIMPanel::onSendMsg,this) );
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
mInputEditor->setReplaceNewlinesWithSpaces( FALSE );
mInputEditor->setPassDelete( TRUE );
if (LLButton* btn = findChild<LLButton>("profile_callee_btn"))
{
@@ -1371,7 +1371,7 @@ BOOL LLFloaterIMPanel::postBuild()
childSetAction("start_call_btn", onClickStartCall, this);
childSetAction("end_call_btn", onClickEndCall, this);
childSetAction("send_btn", onClickSend, this);
getChild<LLButton>("send_btn")->setCommitCallback(boost::bind(&LLFloaterIMPanel::onSendMsg,this));
if (LLButton* btn = findChild<LLButton>("toggle_active_speakers_btn"))
btn->setCommitCallback(boost::bind(&LLFloaterIMPanel::onClickToggleActiveSpeakers, this, _2));
@@ -1755,7 +1755,7 @@ BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask )
BOOL handled = FALSE;
if( KEY_RETURN == key && mask == MASK_NONE)
{
sendMsg();
onSendMsg();
handled = TRUE;
// Close talk panels on hitting return
@@ -1960,25 +1960,11 @@ void LLFloaterIMPanel::onClickEndCall(void* userdata)
self->getVoiceChannel()->deactivate();
}
// static
void LLFloaterIMPanel::onClickSend(void* userdata)
{
LLFloaterIMPanel* self = (LLFloaterIMPanel*)userdata;
self->sendMsg();
}
void LLFloaterIMPanel::onClickToggleActiveSpeakers(const LLSD& value)
{
childSetVisible("active_speakers_panel", !value);
}
// static
void LLFloaterIMPanel::onCommitChat(LLUICtrl* caller, void* userdata)
{
LLFloaterIMPanel* self= (LLFloaterIMPanel*) userdata;
self->sendMsg();
}
void LLFloaterIMPanel::onInputEditorFocusReceived()
{
mHistoryEditor->setCursorAndScrollToEnd();
@@ -1989,19 +1975,17 @@ void LLFloaterIMPanel::onInputEditorFocusLost()
setTyping(FALSE);
}
// static
void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller, void* userdata)
void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller)
{
LLFloaterIMPanel* self = (LLFloaterIMPanel*)userdata;
std::string text = self->mInputEditor->getText();
std::string text = caller->getText();
if (!text.empty())
{
self->setTyping(TRUE);
setTyping(TRUE);
}
else
{
// Deleting all text counts as stopping typing.
self->setTyping(FALSE);
setTyping(FALSE);
}
}
@@ -2109,7 +2093,7 @@ void deliver_message(const std::string& utf8_text,
}
}
void LLFloaterIMPanel::sendMsg()
void LLFloaterIMPanel::onSendMsg()
{
if (!gAgent.isGodlike()
&& (mDialog == IM_NOTHING_SPECIAL)

View File

@@ -233,8 +233,7 @@ public:
void onInputEditorFocusReceived();
void onInputEditorFocusLost();
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
static void onCommitChat(LLUICtrl* caller, void* userdata);
void onInputEditorKeystroke(LLLineEditor* caller);
static void onTabClick( void* userdata );
void onClickProfile();
@@ -245,7 +244,6 @@ public:
static void onClickClose( void* userdata );
static void onClickStartCall( void* userdata );
static void onClickEndCall( void* userdata );
static void onClickSend( void* userdata );
void onClickToggleActiveSpeakers(const LLSD& value);
static void* createSpeakersPanel(void* data);
@@ -294,7 +292,7 @@ private:
void init(const std::string& session_label);
// Called by UI methods.
void sendMsg();
void onSendMsg();
// for adding agents via the UI. Return TRUE if possible, do it if
BOOL dropCallingCard(LLInventoryItem* item, BOOL drop);

View File

@@ -61,7 +61,6 @@ class LLScrollableContainerView;
class LLTextBox;
class LLIconCtrl;
class LLSaveFolderState;
class LLSearchEditor;
class LLInvPanelComplObserver;
class LLInventoryPanel : public LLPanel

View File

@@ -63,7 +63,7 @@ const S32 MAX_TEXTURE_DIMENSION = 2048;
static LLRegisterWidget<LLMediaCtrl> r("web_browser");
LLMediaCtrl::LLMediaCtrl( const std::string& name, const LLRect& rect ) :
LLUICtrl( name, rect, FALSE, NULL, NULL),
LLUICtrl( name, rect, FALSE),
LLInstanceTracker<LLMediaCtrl, LLUUID>(LLUUID::generateNewID()),
mTextureDepthBytes( 4 ),
mWebBrowserImage( 0 ),
@@ -718,17 +718,20 @@ void LLMediaCtrl::draw()
}
if(draw_media)
{
gGL.pushMatrix();
gGL.pushUIMatrix();
{
if (mIgnoreUIScale)
/*if (mIgnoreUIScale)
{
gGL.pushUIMatrix();
gGL.loadUIIdentity();
gGL.pushMatrix();
gGL.loadIdentity();
// font system stores true screen origin, need to scale this by UI scale factor
// to get render origin for this view (with unit scale)
gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::getScaleFactor().mV[VX]),
floorf(LLFontGL::sCurOrigin.mY * LLUI::getScaleFactor().mV[VY]),
LLFontGL::sCurDepth);
}
}*/
// scale texture to fit the space using texture coords
gGL.getTexUnit(0)->bind(media_texture);
@@ -776,13 +779,13 @@ void LLMediaCtrl::draw()
x_offset = (r.getWidth() - width) / 2;
y_offset = (r.getHeight() - height) / 2;
if (mIgnoreUIScale)
/*if (mIgnoreUIScale)
{
x_offset = llround((F32)x_offset * LLUI::getScaleFactor().mV[VX]);
y_offset = llround((F32)y_offset * LLUI::getScaleFactor().mV[VY]);
width = llround((F32)width * LLUI::getScaleFactor().mV[VX]);
height = llround((F32)height * LLUI::getScaleFactor().mV[VY]);
}
}*/
// draw the browser
gGL.setSceneBlendType(LLRender::BT_REPLACE);
@@ -819,8 +822,13 @@ void LLMediaCtrl::draw()
}
gGL.end();
gGL.setSceneBlendType(LLRender::BT_ALPHA);
/*if (mIgnoreUIScale)
{
gGL.popUIMatrix();
gGL.popMatrix();
}*/
}
gGL.popMatrix();
gGL.popUIMatrix();
}
// highlight if keyboard focus here. (TODO: this needs some work)
if ( mBorder && mBorder->getVisible() )
@@ -1370,9 +1378,9 @@ LLView* LLMediaCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
web_browser->setCaretColor( colorU.mV[0], colorU.mV[1], colorU.mV[2] );
}
BOOL ignore_ui_scale = web_browser->getIgnoreUIScale();
node->getAttributeBOOL("ignore_ui_scale", ignore_ui_scale);
web_browser->setIgnoreUIScale((bool)ignore_ui_scale);
//BOOL ignore_ui_scale = web_browser->getIgnoreUIScale();
//node->getAttributeBOOL("ignore_ui_scale", ignore_ui_scale);
//web_browser->setIgnoreUIScale((bool)ignore_ui_scale);
web_browser->initFromXML(node, parent);

View File

@@ -52,21 +52,11 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect,
const LLUUID& name_id,
BOOL is_group,
const LLFontGL* glfont,
S32 max_text_length,
void (*commit_callback)(LLUICtrl* caller, void* user_data),
void (*keystroke_callback)(LLLineEditor* caller, void* user_data),
void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data),
void* userdata,
LLLinePrevalidateFunc prevalidate_func)
S32 max_text_length)
: LLLineEditor(name, rect,
std::string("(retrieving)"),
glfont,
max_text_length,
commit_callback,
keystroke_callback,
focus_lost_callback,
userdata,
prevalidate_func),
max_text_length),
mNameID(name_id)
{
LLNameEditor::sInstances.insert(this);
@@ -153,14 +143,11 @@ LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
LLFontGL* font = LLView::selectFont(node);
LLUICtrlCallback commit_callback = NULL;
LLNameEditor* line_editor = new LLNameEditor(name,
rect,
LLUUID::null, FALSE,
font,
max_text_length,
commit_callback);
max_text_length);
std::string label;
if(node->getAttributeString("label", label))

View File

@@ -50,12 +50,7 @@ public:
const LLUUID& name_id = LLUUID::null,
BOOL is_group = FALSE,
const LLFontGL* glfont = NULL,
S32 max_text_length = 254,
void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL,
void (*keystroke_callback)(LLLineEditor* caller, void* user_data) = NULL,
void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data) = NULL,
void* userdata = NULL,
LLLinePrevalidateFunc prevalidate_func = NULL);
S32 max_text_length = 254);
// By default, follows top and left and is mouse-opaque.
// If no text, text = name.
// If no font, uses default system font.

View File

@@ -50,14 +50,12 @@ std::set<LLNameListCtrl*> LLNameListCtrl::sInstances;
LLNameListCtrl::LLNameListCtrl(const std::string& name,
const LLRect& rect,
LLUICtrlCallback cb,
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,
: LLScrollListCtrl(name, rect, NULL, allow_multiple_selection,
draw_border,draw_heading),
mNameColumnIndex(name_column_index),
mAllowCallingCardDrop(FALSE),
@@ -339,12 +337,8 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
S32 name_column_index = 0;
node->getAttributeS32("name_column_index", name_column_index);
LLUICtrlCallback callback = NULL;
LLNameListCtrl* name_list = new LLNameListCtrl(name,
rect,
callback,
NULL,
multi_select,
draw_border,
draw_heading,

View File

@@ -52,8 +52,6 @@ public:
LLNameListCtrl(const std::string& name,
const LLRect& rect,
LLUICtrlCallback callback,
void* userdata,
BOOL allow_multiple_selection,
BOOL draw_border = TRUE,
bool draw_heading = false,

View File

@@ -208,6 +208,19 @@ void LLNetMap::draw()
F32 rotation = 0;
gGL.pushMatrix();
gGL.pushUIMatrix();
LLVector3 offset = gGL.getUITranslation();
LLVector3 scale = gGL.getUIScale();
gGL.loadIdentity();
gGL.loadUIIdentity();
gGL.scalef(scale.mV[0], scale.mV[1], scale.mV[2]);
gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]);
// Prepare a scissor region
{
LLGLEnable scissor(GL_SCISSOR_TEST);
@@ -512,6 +525,9 @@ void LLNetMap::draw()
}
}
gGL.popMatrix();
gGL.popUIMatrix();
// Rotation of 0 means that North is up
setDirectionPos( getChild<LLTextBox>("e_label"), rotation);
setDirectionPos( getChild<LLTextBox>("n_label"), rotation + F_PI_BY_TWO);

View File

@@ -48,7 +48,6 @@
#include "lluiconstants.h"
#include "llui.h"
#include "llxmlnode.h"
#include "llalertdialog.h"
#include "llviewercontrol.h"
#include "llviewerdisplay.h"
#include "llviewertexturelist.h"
@@ -323,8 +322,7 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification,
std::string("notify_next.png"),
std::string("notify_next.png"),
LLStringUtil::null,
onClickNext,
this,
boost::bind(&LLNotifyBox::onClickNext,this),
sFont);
btn->setScaleImage(TRUE);
btn->setToolTip(LLTrans::getString("next"));
@@ -398,7 +396,6 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification,
// virtual
LLNotifyBox::~LLNotifyBox()
{
std::for_each(mBtnCallbackData.begin(), mBtnCallbackData.end(), DeletePointer());
}
// virtual
@@ -435,14 +432,7 @@ LLButton* LLNotifyBox::addButton(const std::string& name, const std::string& lab
btn_width - 2*ignore_pad,
btn_height);
InstanceAndS32* userdata = new InstanceAndS32;
userdata->mSelf = this;
userdata->mButtonName = is_option ? name : "";
mBtnCallbackData.push_back(userdata);
btn = new LLButton(name, btn_rect, "", onClickButton, userdata);
btn = new LLButton(name, btn_rect, "", boost::bind(&LLNotifyBox::onClickButton, this, is_option ? name : ""));
btn->setLabel(label);
btn->setFont(font);
@@ -794,36 +784,29 @@ LLRect LLNotifyBox::getNotifyTipRect(const std::string &utf8message)
}
// static
void LLNotifyBox::onClickButton(void* data)
void LLNotifyBox::onClickButton(const std::string name)
{
InstanceAndS32* self_and_button = (InstanceAndS32*)data;
LLNotifyBox* self = self_and_button->mSelf;
std::string button_name = self_and_button->mButtonName;
LLSD response = self->mNotification->getResponseTemplate();
if (!self->mAddedDefaultBtn && !button_name.empty())
LLSD response = mNotification->getResponseTemplate();
if (!mAddedDefaultBtn && !name.empty())
{
response[button_name] = true;
response[name] = true;
}
if (self->mUserInputBox)
if (mUserInputBox)
{
response[self->mUserInputBox->getName()] = self->mUserInputBox->getValue();
response[mUserInputBox->getName()] = mUserInputBox->getValue();
}
self->mNotification->respond(response);
mNotification->respond(response);
}
// static
void LLNotifyBox::onClickNext(void* data)
void LLNotifyBox::onClickNext()
{
LLNotifyBox* self = static_cast<LLNotifyBox*>(data);
self->moveToBack(true);
moveToBack(true);
}
LLNotifyBoxView::LLNotifyBoxView(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows)
: LLUICtrl(name,rect,mouse_opaque,NULL,NULL,follows)
: LLUICtrl(name,rect,mouse_opaque,NULL,follows)
{
}

View File

@@ -90,10 +90,10 @@ protected:
static LLRect getNotifyTipRect(const std::string &message);
// internal handler for button being clicked
static void onClickButton(void* data);
void onClickButton(const std::string name);
// for "next" button
static void onClickNext(void* data);
void onClickNext();
//static LLNotifyBox* findExistingNotify(LLPointer<LLNotifyBoxTemplate> notify_template, const LLString::format_map_t& args);
@@ -130,8 +130,6 @@ protected:
LLNotifyBox* mSelf;
std::string mButtonName;
};
std::vector<InstanceAndS32*> mBtnCallbackData;
static S32 sNotifyBoxCount;
static const LLFontGL* sFont;
static const LLFontGL* sFontSmall;

View File

@@ -591,13 +591,14 @@ BOOL LLPanelAvatarNotes::postBuild(void)
BOOL LLPanelAvatarWeb::postBuild(void)
{
childSetKeystrokeCallback("url_edit", onURLKeystroke, this);
childSetCommitCallback("load", onCommitLoad, this);
LLLineEditor* url_edit = getChild<LLLineEditor>("url_edit");
url_edit->setKeystrokeCallback(boost::bind(&LLPanelAvatarWeb::onURLKeystroke,this,_1));
url_edit->setCommitCallback(boost::bind(&LLPanelAvatarWeb::onCommitURL,this,_2));
getChild<LLLineEditor>("load")->setCommitCallback(boost::bind(&LLPanelAvatarWeb::onCommitLoad,this,_2));
childSetAction("web_profile_help",onClickWebProfileHelp,this);
childSetCommitCallback("url_edit",onCommitURL,this);
childSetControlName("auto_load","AutoLoadWebProfiles");
mWebBrowser = getChild<LLMediaCtrl>("profile_html");
@@ -747,14 +748,9 @@ void LLPanelAvatarWeb::setWebURL(std::string url)
}
// static
void LLPanelAvatarWeb::onCommitURL(LLUICtrl* ctrl, void* data)
void LLPanelAvatarWeb::onCommitURL(const LLSD& value)
{
LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data;
if (!self) return;
self->load( self->childGetText("url_edit") );
load(value.asString());
}
// static
@@ -778,31 +774,20 @@ void LLPanelAvatarWeb::load(std::string url)
}
}
//static
void LLPanelAvatarWeb::onURLKeystroke(LLLineEditor* editor, void* data)
void LLPanelAvatarWeb::onURLKeystroke(LLLineEditor* editor)
{
LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data;
if (!self) return;
LLSD::String url = editor->getText();
self->childSetEnabled("load", url.length() > 0);
childSetEnabled("load", url.length() > 0);
return;
}
// static
void LLPanelAvatarWeb::onCommitLoad(LLUICtrl* ctrl, void* data)
void LLPanelAvatarWeb::onCommitLoad(const LLSD& value)
{
LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data;
if (!self) return;
LLSD::String valstr = ctrl->getValue().asString();
LLSD::String urlstr = self->childGetText("url_edit");
LLSD::String valstr = value.asString();
LLSD::String urlstr = childGetText("url_edit");
if (valstr == "") // load url string into browser panel
{
self->load(urlstr);
load(urlstr);
}
else if (valstr == "open") // open in user's external browser
{
@@ -813,9 +798,9 @@ void LLPanelAvatarWeb::onCommitLoad(LLUICtrl* ctrl, void* data)
}
else if (valstr == "home") // reload profile owner's home page
{
if (!self->mHome.empty())
if (!mHome.empty())
{
self->load(self->mHome);
load(mHome);
}
}
}

View File

@@ -162,9 +162,9 @@ public:
void setWebURL(std::string url);
void load(std::string url);
static void onURLKeystroke(LLLineEditor* editor, void* data);
static void onCommitLoad(LLUICtrl* ctrl, void* data);
static void onCommitURL(LLUICtrl* ctrl, void* data);
void onURLKeystroke(LLLineEditor* editor);
void onCommitLoad(const LLSD& value);
void onCommitURL(const LLSD& value);
static void onClickWebProfileHelp(void *);
// inherited from LLViewerMediaObserver

View File

@@ -46,7 +46,6 @@
#include "message.h"
#include "llagent.h"
#include "llalertdialog.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llclassifiedflags.h"

View File

@@ -104,7 +104,7 @@ LLPanelDebug::LLPanelDebug(const std::string& name, const LLRect& rect)
TRUE,
TRUE,
FALSE,
NULL, NULL,
NULL,
(F32)gSavedSettings.getS32("DropShadowFloater"),
0.f, 10.f, 1.0f,
std::string("DropShadowFloater"));
@@ -122,7 +122,7 @@ LLPanelDebug::LLPanelDebug(const std::string& name, const LLRect& rect)
TRUE,
TRUE,
FALSE,
NULL, NULL,
NULL,
(F32)gSavedSettings.getS32("DropShadowButton"),
0.f, 10.f, 1.0f,
std::string("DropShadowButton"));
@@ -135,7 +135,7 @@ LLPanelDebug::LLPanelDebug(const std::string& name, const LLRect& rect)
LLRect(LEFT, cur_y, RIGHT, cur_y - 20),
std::string("Left Click Shows Menu Unless Interactive"),
font,
NULL, NULL,
NULL,
gSavedSettings.getBOOL("LeftClickShowMenu"));
check->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
addChild(check);

View File

@@ -108,17 +108,19 @@ LLPanelDirBrowser::LLPanelDirBrowser(const std::string& name, LLFloaterDirectory
BOOL LLPanelDirBrowser::postBuild()
{
if (LLUICtrl* ctrl = findChild<LLUICtrl>("results"))
ctrl->setCommitCallback(onCommitList, this);
{
ctrl->setCommitCallback(boost::bind(&LLPanelDirBrowser::onCommitList,this));
}
if (LLButton* btn = findChild<LLButton>("< Prev"))
{
childSetAction("< Prev", onClickPrev, this);
btn->setClickedCallback(boost::bind(&LLPanelDirBrowser::prevPage,this));
btn->setVisible(false);
}
if (LLButton* btn = findChild<LLButton>("Next >"))
{
childSetAction("Next >", onClickNext, this);
btn->setClickedCallback(boost::bind(&LLPanelDirBrowser::nextPage,this));
btn->setVisible(false);
}
@@ -154,7 +156,7 @@ void LLPanelDirBrowser::draw()
childSetFocus("results", TRUE);
}
// Request specific data from the server
onCommitList(NULL, this);
onCommitList();
}
}
mDidAutoSelect = TRUE;
@@ -233,21 +235,6 @@ void LLPanelDirBrowser::updateResultCount()
}
}
// static
void LLPanelDirBrowser::onClickPrev(void* data)
{
LLPanelDirBrowser* self = (LLPanelDirBrowser*)data;
self->prevPage();
}
// static
void LLPanelDirBrowser::onClickNext(void* data)
{
LLPanelDirBrowser* self = (LLPanelDirBrowser*)data;
self->nextPage();
}
// static
std::string LLPanelDirBrowser::filterShortWords( const std::string source_string,
int shortest_word_length,
@@ -339,7 +326,7 @@ void LLPanelDirBrowser::selectByUUID(const LLUUID& id)
// Don't bother looking for this in the draw loop.
mWantSelectID.setNull();
// Make sure UI updates.
onCommitList(NULL, this);
onCommitList();
}
else
{
@@ -385,18 +372,15 @@ void LLPanelDirBrowser::getSelectedInfo(LLUUID* id, S32 *type)
*type = mResultsContents[id_str]["type"];
}
// static
void LLPanelDirBrowser::onCommitList(LLUICtrl* ctrl, void* data)
void LLPanelDirBrowser::onCommitList()
{
LLPanelDirBrowser* self = (LLPanelDirBrowser*)data;
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results");
if (!list) return;
// Start with everyone invisible
if (self->mFloaterDirectory)
if (mFloaterDirectory)
{
self->mFloaterDirectory->hideAllDetailPanels();
mFloaterDirectory->hideAllDetailPanels();
}
if (FALSE == list->getCanSelect())
@@ -404,28 +388,28 @@ void LLPanelDirBrowser::onCommitList(LLUICtrl* ctrl, void* data)
return;
}
std::string id_str = self->childGetValue("results").asString();
std::string id_str = childGetValue("results").asString();
if (id_str.empty())
{
return;
}
LLSD item_id = list->getCurrentID();
S32 type = self->mResultsContents[id_str]["type"];
S32 type = mResultsContents[id_str]["type"];
if (type == EVENT_CODE)
{
// all but events use the UUID above
item_id = self->mResultsContents[id_str]["event_id"];
item_id = mResultsContents[id_str]["event_id"];
}
//std::string name = self->mResultsContents[id_str]["name"].asString();
self->showDetailPanel(type, item_id);
showDetailPanel(type, item_id);
if (type == FOR_SALE_CODE)
{
std::string land_type = self->mResultsContents[id_str]["landtype"].asString();
if (self->mFloaterDirectory && self->mFloaterDirectory->mPanelPlaceSmallp)
std::string land_type = mResultsContents[id_str]["landtype"].asString();
if (mFloaterDirectory && mFloaterDirectory->mPanelPlaceSmallp)
{
self->mFloaterDirectory->mPanelPlaceSmallp->setLandTypeString(land_type);
mFloaterDirectory->mPanelPlaceSmallp->setLandTypeString(land_type);
}
}
}
@@ -1247,15 +1231,11 @@ void LLPanelDirBrowser::setupNewSearch()
}
// static
// called from calssifieds, events, groups, land, people, and places
void LLPanelDirBrowser::onClickSearchCore(void* userdata)
void LLPanelDirBrowser::onClickSearchCore()
{
LLPanelDirBrowser* self = (LLPanelDirBrowser*)userdata;
if (!self) return;
self->resetSearchStart();
self->performQuery();
resetSearchStart();
performQuery();
LLFloaterDirectory::sOldSearchCount++;
}
@@ -1282,18 +1262,17 @@ void LLPanelDirBrowser::sendDirFindQuery(
}
void LLPanelDirBrowser::onKeystrokeName(LLLineEditor* line, void* data)
void LLPanelDirBrowser::onKeystrokeName(LLLineEditor* line)
{
LLPanelDirBrowser *self = (LLPanelDirBrowser*)data;
if (line->getLength() >= (S32)self->mMinSearchChars)
if (line->getLength() >= (S32)mMinSearchChars)
{
self->setDefaultBtn( "Search" );
self->childEnable("Search");
setDefaultBtn( "Search" );
childEnable("Search");
}
else
{
self->setDefaultBtn();
self->childDisable("Search");
setDefaultBtn();
childDisable("Search");
}
}
@@ -1302,7 +1281,7 @@ void LLPanelDirBrowser::handleVisibilityChange(BOOL new_visibility)
{
if (new_visibility)
{
onCommitList(NULL, this);
onCommitList();
}
LLPanel::handleVisibilityChange(new_visibility);
}

View File

@@ -87,7 +87,8 @@ public:
// default handler for clicking the search button resets the
// next/prev state and performs the query.
// Expects a pointer to an LLPanelDirBrowser object.
static void onClickSearchCore(void* userdata);
void onClickSearchCore();
void onKeystrokeName(LLLineEditor* line);
// query_start indicates the first result row to
// return, usually 0 or 100 or 200 because the searches
@@ -103,11 +104,7 @@ public:
void showEvent(const U32 event_id);
// Prev/Next page buttons
static void onClickNext(void* data);
static void onClickPrev(void* data);
static void onCommitList(LLUICtrl* ctrl, void* data);
void onCommitList();
static void processDirPeopleReply(LLMessageSystem* msg, void**);
static void processDirPlacesReply(LLMessageSystem* msg, void**);
@@ -120,15 +117,12 @@ public:
// Logic to control maturity checkboxes in Classified/Events/Places/'Land for Sale' tabs.
void updateMaturityCheckbox();
protected:
void updateResultCount();
void addClassified(LLCtrlListInterface *list, const LLUUID& classified_id, const std::string& name, const U32 creation_date, const S32 price_for_listing);
LLSD createLandSale(const LLUUID& parcel_id, BOOL is_auction, BOOL is_for_sale, const std::string& name, S32 *type);
static void onKeystrokeName(LLLineEditor* line, void* data);
// If this is a search for a panel like "people_panel" (and not the "all" panel)
// optionally show the "Next" button. Return the actual number of
// rows to display.

View File

@@ -106,15 +106,15 @@ BOOL LLPanelDirClassified::postBuild()
}
// 0 or 3+ character searches allowed, exciting
childSetKeystrokeCallback("name", onKeystrokeNameClassified, this);
childSetAction("Search", onClickSearchCore, this);
childSetAction("Browse", onClickSearchCore, this);
getChild<LLLineEditor>("name")->setKeystrokeCallback(boost::bind(&LLPanelDirClassified::onKeystrokeNameClassified,this,_1));
getChild<LLButton>("Search")->setClickedCallback(boost::bind(&LLPanelDirBrowser::onClickSearchCore,this));
getChild<LLButton>("Browse")->setClickedCallback(boost::bind(&LLPanelDirBrowser::onClickSearchCore,this));
setDefaultBtn( "Browse" );
childSetAction("Place an Ad...", onClickCreateNewClassified, this);
getChild<LLButton>("Place an Ad...")->setClickedCallback(boost::bind(&LLPanelDirClassified::onClickCreateNewClassified,this));
childSetAction("Delete", onClickDelete, this);
getChild<LLButton>("Delete")->setClickedCallback(boost::bind(&LLPanelDirClassified::onClickDelete,this));
childDisable("Delete");
childHide("Delete");
@@ -149,25 +149,21 @@ void LLPanelDirClassified::refresh()
updateMaturityCheckbox();
}
//Open Profile to Classifieds tab
void LLPanelDirClassified::onClickCreateNewClassified(void *userdata)
void LLPanelDirClassified::onClickCreateNewClassified()
{
LLFloaterAvatarInfo::showFromObject(gAgent.getID(), "Classified");
}
// static
void LLPanelDirClassified::onClickDelete(void *userdata)
void LLPanelDirClassified::onClickDelete()
{
LLPanelDirClassified *self = (LLPanelDirClassified *)userdata;
LLUUID classified_id;
S32 type;
self->getSelectedInfo(&classified_id, &type);
getSelectedInfo(&classified_id, &type);
// Clear out the list. Deleting a classified will cause a refresh to be
// sent.
self->setupNewSearch();
setupNewSearch();
LLMessageSystem* msg = gMessageSystem;
@@ -177,7 +173,7 @@ void LLPanelDirClassified::onClickDelete(void *userdata)
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ClassifiedID, classified_id);
msg->addUUIDFast(_PREHASH_QueryID, self->mSearchID);
msg->addUUIDFast(_PREHASH_QueryID, mSearchID);
gAgent.sendReliableMessage();
}
@@ -222,34 +218,32 @@ void LLPanelDirClassified::performQuery()
gAgent.sendReliableMessage();
}
void LLPanelDirClassified::onKeystrokeNameClassified(LLLineEditor* line, void* data)
void LLPanelDirClassified::onKeystrokeNameClassified(LLLineEditor* line)
{
LLPanelDirClassified *self = (LLPanelDirClassified*)data;
S32 len = line->getLength();
if (len == 0
|| len >= 3)
{
// no text searches are cheap, as are longer searches
self->setDefaultBtn( "Search" );
self->childEnable("Search");
setDefaultBtn( "Search" );
childEnable("Search");
}
else
{
self->setDefaultBtn();
self->childDisable("Search");
setDefaultBtn();
childDisable("Search");
}
// Change the Browse to Search or vice versa
if (len > 0)
{
self->childSetVisible("Search", TRUE);
self->childSetVisible("Browse", FALSE);
childSetVisible("Search", TRUE);
childSetVisible("Browse", FALSE);
}
else
{
self->setDefaultBtn( "Browse" );
self->childSetVisible("Search", FALSE);
self->childSetVisible("Browse", TRUE);
setDefaultBtn( "Browse" );
childSetVisible("Search", FALSE);
childSetVisible("Browse", TRUE);
}
}

View File

@@ -59,15 +59,15 @@ public:
protected:
//static void onClickNewClassified(void* data);
static void onClickDelete(void* data);
void onClickDelete();
// onClickNext and onClickPrev are special case searches
static void onClickSearch(void *userdata);
void onClickSearch();
static void onKeystrokeNameClassified(LLLineEditor* line, void* data);
void onKeystrokeNameClassified(LLLineEditor* line);
//
static void onClickCreateNewClassified(void* data);
void onClickCreateNewClassified();
protected:
};

View File

@@ -68,21 +68,21 @@ BOOL LLPanelDirEvents::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetCommitCallback("date_mode", onDateModeCallback, this);
getChild<LLUICtrl>("date_mode")->setCommitCallback(boost::bind(&LLPanelDirEvents::onDateModeCallback,this));
childSetAction("<<", onBackBtn, this);
childSetAction(">>", onForwardBtn, this);
getChild<LLButton>("<<")->setClickedCallback(boost::bind(&LLPanelDirEvents::onBackBtn,this));
getChild<LLButton>(">>")->setClickedCallback(boost::bind(&LLPanelDirEvents::onForwardBtn,this));
childSetAction("Today", onClickToday, this);
getChild<LLButton>("Today")->setClickedCallback(boost::bind(&LLPanelDirEvents::onClickToday,this));
childSetAction("Search", LLPanelDirBrowser::onClickSearchCore, this);
getChild<LLButton>("Search")->setClickedCallback(boost::bind(&LLPanelDirEvents::onClickSearchCore,this));
setDefaultBtn("Search");
childSetAction("Delete", onClickDelete, this);
getChild<LLButton>("Delete")->setClickedCallback(boost::bind(&LLPanelDirEvents::onClickDelete,this));
childDisable("Delete");
childHide("Delete");
onDateModeCallback(NULL, this);
onDateModeCallback();
mCurrentSortColumn = "time";
@@ -246,63 +246,48 @@ void LLPanelDirEvents::performQueryOrDelete(U32 event_id)
}
}
// static
void LLPanelDirEvents::onDateModeCallback(LLUICtrl* ctrl, void *data)
void LLPanelDirEvents::onDateModeCallback()
{
LLPanelDirEvents* self = (LLPanelDirEvents*)data;
if (self->childGetValue("date_mode").asString() == "date")
if (childGetValue("date_mode").asString() == "date")
{
self->childEnable("Today");
self->childEnable(">>");
self->childEnable("<<");
childEnable("Today");
childEnable(">>");
childEnable("<<");
}
else
{
self->childDisable("Today");
self->childDisable(">>");
self->childDisable("<<");
childDisable("Today");
childDisable(">>");
childDisable("<<");
}
}
// static
void LLPanelDirEvents::onClickToday(void *userdata)
void LLPanelDirEvents::onClickToday()
{
LLPanelDirEvents *self = (LLPanelDirEvents *)userdata;
self->resetSearchStart();
self->setDay(0);
self->performQuery();
resetSearchStart();
setDay(0);
performQuery();
}
// static
void LLPanelDirEvents::onBackBtn(void* data)
void LLPanelDirEvents::onBackBtn()
{
LLPanelDirEvents* self = (LLPanelDirEvents*)data;
self->resetSearchStart();
self->setDay(self->mDay - 1);
self->performQuery();
resetSearchStart();
setDay(mDay - 1);
performQuery();
}
// static
void LLPanelDirEvents::onForwardBtn(void* data)
void LLPanelDirEvents::onForwardBtn()
{
LLPanelDirEvents* self = (LLPanelDirEvents*)data;
self->resetSearchStart();
self->setDay(self->mDay + 1);
self->performQuery();
resetSearchStart();
setDay(mDay + 1);
performQuery();
}
// static
void LLPanelDirEvents::onClickDelete(void *userdata)
void LLPanelDirEvents::onClickDelete()
{
LLPanelDirEvents *self = (LLPanelDirEvents *)userdata;
if (!self) return;
U32 event_id;
event_id = self->getSelectedEventID();
event_id = getSelectedEventID();
if (!event_id) return;
self->performQueryOrDelete(event_id);
performQueryOrDelete(event_id);
}

View File

@@ -57,12 +57,12 @@ public:
void setDay(S32 day);
protected:
static void onDateModeCallback(LLUICtrl* ctrl, void *data);
static void onBackBtn(void* data);
static void onForwardBtn(void* data);
static void onClickToday(void *userdata);
static void onClickSearch(void *data);
static void onClickDelete(void *data);
void onDateModeCallback();
void onBackBtn();
void onForwardBtn();
void onClickToday();
void onClickSearch();
void onClickDelete();
protected:
BOOL mDoneQuery;

View File

@@ -107,17 +107,17 @@ BOOL LLPanelDirFind::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetAction("back_btn", onClickBack, this);
getChild<LLButton>("back_btn")->setCommitCallback(boost::bind(&LLPanelDirFind::onClickBack,this));
if (hasChild("home_btn"))
childSetAction("home_btn", onClickHome, this);
childSetAction("forward_btn", onClickForward, this);
childSetAction("reload_btn", onClickRefresh, this);
getChild<LLButton>("home_btn")->setCommitCallback(boost::bind(&LLPanelDirFind::onClickHome,this));
getChild<LLButton>("forward_btn")->setCommitCallback(boost::bind(&LLPanelDirFind::onClickForward,this));
getChild<LLButton>("reload_btn")->setCommitCallback(boost::bind(&LLPanelDirFind::onClickRefresh,this));
if (hasChild("search_editor"))
childSetCommitCallback("search_editor", onCommitSearch, this);
getChild<LLButton>("search_editor")->setCommitCallback(boost::bind(&LLPanelDirFind::onClickSearch,this));
if (hasChild("search_btn"))
childSetAction("search_btn", onClickSearch, this);
getChild<LLButton>("search_btn")->setCommitCallback(boost::bind(&LLPanelDirFind::onClickSearch,this));
if (hasChild("?"))
childSetAction("?", onClickHelp, this);
getChild<LLButton>("?")->setCommitCallback(boost::bind(&LLPanelDirFind::onClickHelp,this));
// showcase doesn't have maturity flags -- it's all PG
if (hasChild("incmature"))
@@ -450,65 +450,47 @@ const std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_matur
return url;
}
// static
void LLPanelDirFind::onClickBack( void* data )
void LLPanelDirFind::onClickBack()
{
LLPanelDirFind* self = ( LLPanelDirFind* )data;
if ( self->mWebBrowser )
if ( mWebBrowser )
{
self->mWebBrowser->navigateBack();
mWebBrowser->navigateBack();
}
}
// static
void LLPanelDirFind::onClickHelp( void* data )
void LLPanelDirFind::onClickHelp()
{
LLNotificationsUtil::add("ClickSearchHelpAll");
}
// static
void LLPanelDirFind::onClickForward( void* data )
void LLPanelDirFind::onClickForward()
{
LLPanelDirFind* self = ( LLPanelDirFind* )data;
if ( self->mWebBrowser )
if ( mWebBrowser )
{
self->mWebBrowser->navigateForward();
mWebBrowser->navigateForward();
}
}
// static
void LLPanelDirFind::onClickHome( void* data )
void LLPanelDirFind::onClickHome()
{
LLPanelDirFind* self = ( LLPanelDirFind* )data;
if ( self->mWebBrowser )
if ( mWebBrowser )
{
self->mWebBrowser->navigateHome();
mWebBrowser->navigateHome();
}
}
// static
void LLPanelDirFind::onClickRefresh( void* data )
void LLPanelDirFind::onClickRefresh()
{
LLPanelDirFind* self = ( LLPanelDirFind* )data;
if ( self->mWebBrowser )
if ( mWebBrowser )
{
self->mWebBrowser->navigateTo(self->mWebBrowser->getCurrentNavUrl());
mWebBrowser->navigateTo(mWebBrowser->getCurrentNavUrl());
}
}
// static
void LLPanelDirFind::onCommitSearch(LLUICtrl*, void* data)
void LLPanelDirFind::onClickSearch()
{
onClickSearch(data);
}
// static
void LLPanelDirFind::onClickSearch(void* data)
{
LLPanelDirFind* self = ( LLPanelDirFind* )data;
std::string search_text = self->childGetText("search_editor");
self->search(search_text);
std::string search_text = childGetText("search_editor");
search(search_text);
LLFloaterDirectory::sNewSearchCount++;
}
@@ -573,9 +555,9 @@ BOOL LLPanelDirFindAllOld::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetKeystrokeCallback("name", &LLPanelDirBrowser::onKeystrokeName, this);
getChild<LLLineEditor>("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName,this,_1));
childSetAction("Search", onClickSearch, this);
getChild<LLButton>("Search")->setCommitCallback(boost::bind(&LLPanelDirFindAllOld::onClickSearch,this));
childDisable("Search");
setDefaultBtn( "Search" );
@@ -597,33 +579,23 @@ void LLPanelDirFindAllOld::draw()
LLPanelDirBrowser::draw();
}
// static
void LLPanelDirFindAllOld::onCommitScope(LLUICtrl* ctrl, void* data)
void LLPanelDirFindAllOld::onClickSearch()
{
LLPanelDirFindAllOld* self = (LLPanelDirFindAllOld*)data;
self->setFocus(TRUE);
}
// static
void LLPanelDirFindAllOld::onClickSearch(void *userdata)
{
LLPanelDirFindAllOld *self = (LLPanelDirFindAllOld *)userdata;
if (self->childGetValue("name").asString().length() < self->mMinSearchChars)
if (childGetValue("name").asString().length() < mMinSearchChars)
{
return;
};
BOOL inc_pg = self->childGetValue("incpg").asBoolean();
BOOL inc_mature = self->childGetValue("incmature").asBoolean();
BOOL inc_adult = self->childGetValue("incadult").asBoolean();
BOOL inc_pg = childGetValue("incpg").asBoolean();
BOOL inc_mature = childGetValue("incmature").asBoolean();
BOOL inc_adult = childGetValue("incadult").asBoolean();
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotificationsUtil::add("NoContentToSearch");
return;
}
self->setupNewSearch();
setupNewSearch();
// Figure out scope
U32 scope = 0x0;
@@ -644,7 +616,7 @@ void LLPanelDirFindAllOld::onClickSearch(void *userdata)
scope |= DFQ_INC_ADULT;
}
if (self->hasChild("filter_gaming") && self->childGetValue("filter_gaming").asBoolean())
if (hasChild("filter_gaming") && childGetValue("filter_gaming").asBoolean())
{
scope |= DFQ_FILTER_GAMING;
}
@@ -652,7 +624,7 @@ void LLPanelDirFindAllOld::onClickSearch(void *userdata)
// send the message
LLMessageSystem *msg = gMessageSystem;
S32 start_row = 0;
sendDirFindQuery(msg, self->mSearchID, self->childGetValue("name").asString(), scope, start_row);
sendDirFindQuery(msg, mSearchID, childGetValue("name").asString(), scope, start_row);
// Also look up classified ads. JC 12/2005
BOOL filter_auto_renew = FALSE;
@@ -662,8 +634,8 @@ void LLPanelDirFindAllOld::onClickSearch(void *userdata)
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("QueryData");
msg->addUUID("QueryID", self->mSearchID);
msg->addString("QueryText", self->childGetValue("name").asString());
msg->addUUID("QueryID", mSearchID);
msg->addString("QueryText", childGetValue("name").asString());
msg->addU32("QueryFlags", classified_flags);
msg->addU32("Category", 0); // all categories
msg->addS32("QueryStart", 0);
@@ -689,8 +661,8 @@ void LLPanelDirFindAllOld::onClickSearch(void *userdata)
msg->addUUID("AgentID", gAgent.getID() );
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("QueryData");
msg->addUUID("QueryID", self->mSearchID );
msg->addString("QueryText", self->childGetValue("name").asString());
msg->addUUID("QueryID", mSearchID );
msg->addString("QueryText", childGetValue("name").asString());
msg->addU32("QueryFlags", query_flags );
msg->addS32("QueryStart", 0 ); // Always get the first 100 when using find ALL
msg->addS8("Category", LLParcel::C_ANY);

View File

@@ -65,13 +65,12 @@ public:
const std::string getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) const;
private:
static void onClickBack( void* data );
static void onClickForward( void* data );
static void onClickHome( void* data );
static void onClickRefresh( void* data );
static void onClickSearch( void* data );
static void onCommitSearch(LLUICtrl*, void* data);
static void onClickHelp( void* data );
void onClickBack();
void onClickForward();
void onClickHome();
void onClickRefresh();
void onClickSearch();
void onClickHelp();
// inherited from LLViewerMediaObserver
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
@@ -100,9 +99,7 @@ public:
/*virtual*/ void draw();
static void onClickSearch(void *userdata);
static void onCommitScope(LLUICtrl* ctrl, void* data);
static void onKeystrokeName(LLLineEditor* line, void* data);
void onClickSearch();
};
#endif

View File

@@ -55,9 +55,9 @@ BOOL LLPanelDirGroups::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetKeystrokeCallback("name", &LLPanelDirBrowser::onKeystrokeName, this);
getChild<LLLineEditor>("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName,this,_1));
childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this);
getChild<LLButton>("Search")->setClickedCallback(boost::bind(&LLPanelDirBrowser::onClickSearchCore,this));
childDisable("Search");
setDefaultBtn( "Search" );

View File

@@ -90,17 +90,17 @@ BOOL LLPanelDirLand::postBuild()
childDisable("incadult");
}
childSetCommitCallback("pricecheck", onCommitPrice, this);
childSetCommitCallback("areacheck", onCommitArea, this);
getChild<LLUICtrl>("pricecheck")->setCommitCallback(boost::bind(&LLPanelDirLand::onCommitPrice,this,_2));
getChild<LLUICtrl>("areacheck")->setCommitCallback(boost::bind(&LLPanelDirLand::onCommitArea, this,_2));
childSetValue("priceedit", gStatusBar->getBalance());
childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice"));
childSetPrevalidate("priceedit", LLLineEditor::prevalidateNonNegativeS32);
getChild<LLLineEditor>("priceedit")->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea"));
childSetPrevalidate("areaedit", LLLineEditor::prevalidateNonNegativeS32);
getChild<LLLineEditor>("areaedit")->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
childSetAction("Search", onClickSearchCore, this);
getChild<LLButton>("Search")->setClickedCallback(boost::bind(&LLPanelDirBrowser::onClickSearchCore,this));
setDefaultBtn("Search");
childSetTextArg("pricecheck_symbol", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
@@ -111,7 +111,7 @@ BOOL LLPanelDirLand::postBuild()
LLScrollListCtrl* results = getChild<LLScrollListCtrl>("results");
if (results)
{
results->setSortChangedCallback(boost::bind(&LLPanelDirLand::onClickSort,this));
results->setSortChangedCallback(boost::bind(&LLPanelDirLand::performQuery,this));
results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending);
LLStringUtil::format_map_t args;
@@ -143,31 +143,14 @@ void LLPanelDirLand::draw()
LLPanelDirBrowser::draw();
}
void LLPanelDirLand::onClickSort(void* data)
void LLPanelDirLand::onCommitPrice(const LLSD& value)
{
LLPanelDirLand* self = (LLPanelDirLand*)data;
if (!self) return;
self->performQuery();
childSetEnabled("priceedit", value.asBoolean());
}
// static
void LLPanelDirLand::onCommitPrice(LLUICtrl* ctrl, void* data)
void LLPanelDirLand::onCommitArea(const LLSD& value)
{
LLPanelDirLand* self = (LLPanelDirLand*)data;
LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
if (!self || !check) return;
self->childSetEnabled("priceedit", check->get());
}
// static
void LLPanelDirLand::onCommitArea(LLUICtrl* ctrl, void* data)
{
LLPanelDirLand* self = (LLPanelDirLand*)data;
LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
if (!self || !check) return;
self->childSetEnabled("areaedit", check->get());
childSetEnabled("areaedit", value.asBoolean());
}
void LLPanelDirLand::performQuery()

View File

@@ -50,9 +50,8 @@ public:
void performQuery();
protected:
static void onClickSort(void* data);
static void onCommitPrice(LLUICtrl* ctrl, void* data);
static void onCommitArea(LLUICtrl* ctrl, void* data);
void onCommitPrice(const LLSD& value);
void onCommitArea(const LLSD& value);
};

View File

@@ -52,9 +52,9 @@ BOOL LLPanelDirPeople::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetKeystrokeCallback("name", &LLPanelDirBrowser::onKeystrokeName, this);
getChild<LLLineEditor>("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName,this,_1));
childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this);
getChild<LLButton>("Search")->setClickedCallback(boost::bind(&LLPanelDirBrowser::onClickSearchCore,this));
childDisable("Search");
setDefaultBtn( "Search" );

View File

@@ -45,9 +45,6 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void performQuery();
static void onClickSearch(void *userdata);
static void onKeystrokeName(LLLineEditor* line, void* data);
};
#endif

View File

@@ -76,9 +76,9 @@ BOOL LLPanelDirPlaces::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetKeystrokeCallback("name", &LLPanelDirBrowser::onKeystrokeName, this);
getChild<LLLineEditor>("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName,this,_1));
childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this);
getChild<LLButton>("Search")->setClickedCallback(boost::bind(&LLPanelDirBrowser::onClickSearchCore,this));
childDisable("Search");
mCurrentSortColumn = "dwell";

View File

@@ -38,7 +38,7 @@
struct LLOfferInfo;
const S32 UPDATE_MEMBERS_PER_FRAME = 500;
const F32 UPDATE_MEMBERS_SECONDS_PER_FRAME = 0.005; // 5ms
// Forward declares
class LLPanelGroupTab;

View File

@@ -568,7 +568,7 @@ void LLPanelGroupGeneral::cancel()
// invoked from callbackConfirmMature
bool LLPanelGroupGeneral::confirmMatureApply(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
// 0 == Yes
// 1 == No
// 2 == Cancel
@@ -593,7 +593,7 @@ bool LLPanelGroupGeneral::confirmMatureApply(const LLSD& notification, const LLS
// static
bool LLPanelGroupGeneral::createGroupCallback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch(option)
{
case 0:
@@ -684,6 +684,11 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
mComboActiveTitle->resetDirty();
}
// After role member data was changed in Roles->Members
// need to update role titles. See STORM-918.
if (gc == GC_ROLE_MEMBER_DATA)
LLGroupMgr::getInstance()->sendGroupTitlesRequest(mGroupID);
// If this was just a titles update, we are done.
if (gc == GC_TITLES) return;
@@ -867,71 +872,45 @@ void LLPanelGroupGeneral::updateMembers()
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!mListVisibleMembers || !gdatap
|| !gdatap->isMemberDataComplete())
if (!mListVisibleMembers
|| !gdatap
|| !gdatap->isMemberDataComplete()
|| gdatap->mMembers.empty())
{
return;
}
static LLTimer all_timer;
static LLTimer sd_timer;
static LLTimer element_timer;
LLTimer update_time;
update_time.setTimerExpirySec(UPDATE_MEMBERS_SECONDS_PER_FRAME);
all_timer.reset();
S32 i = 0;
LLAvatarName av_name;
for( ; mMemberProgress != gdatap->mMembers.end() && i<UPDATE_MEMBERS_PER_FRAME;
++mMemberProgress, ++i)
for( ; mMemberProgress != gdatap->mMembers.end() && !update_time.hasExpired();
++mMemberProgress)
{
lldebugs << "Adding " << mMemberProgress->first << ", " << mMemberProgress->second->getTitle() << llendl;
LLGroupMemberData* member = mMemberProgress->second;
if (!member)
{
continue;
}
// Owners show up in bold.
std::string style = "NORMAL";
if ( member->isOwner() )
if (LLAvatarNameCache::get(mMemberProgress->first, &av_name))
{
style = "BOLD";
addMember(mMemberProgress->second);
}
else
{
// If name is not cached, onNameCache() should be called when it is cached and add this member to list.
LLAvatarNameCache::get(mMemberProgress->first,
boost::bind(&LLPanelGroupGeneral::onNameCache,
this, gdatap->getMemberVersion(), member, _2));
}
sd_timer.reset();
LLSD row;
row["id"] = member->getID();
row["columns"][0]["column"] = "name";
row["columns"][0]["font-style"] = style;
// value is filled in by name list control
row["columns"][1]["column"] = "title";
row["columns"][1]["value"] = member->getTitle();
row["columns"][1]["font-style"] = style;
row["columns"][2]["column"] = "online";
row["columns"][2]["value"] = member->getOnlineStatus();
row["columns"][2]["font-style"] = style;
sSDTime += sd_timer.getElapsedTimeF32();
element_timer.reset();
mListVisibleMembers->addNameItem(row);
sElementTime += element_timer.getElapsedTimeF32();
}
sAllTime += all_timer.getElapsedTimeF32();
lldebugs << "Updated " << i << " of " << UPDATE_MEMBERS_PER_FRAME << "members in the list." << llendl;
if (mMemberProgress == gdatap->mMembers.end())
{
lldebugs << " member list completed." << llendl;
mListVisibleMembers->setEnabled(TRUE);
lldebugs << "All Time: " << sAllTime << llendl;
lldebugs << "SD Time: " << sSDTime << llendl;
lldebugs << "Element Time: " << sElementTime << llendl;
}
else
{
@@ -940,6 +919,48 @@ void LLPanelGroupGeneral::updateMembers()
}
}
void LLPanelGroupGeneral::addMember(LLGroupMemberData* member)
{
// Owners show up in bold.
std::string style = "NORMAL";
if ( member->isOwner() )
{
style = "BOLD";
}
LLSD row;
row["id"] = member->getID();
row["columns"][0]["column"] = "name";
row["columns"][0]["font-style"] = style;
row["columns"][0]["font"] = "SANSSERIF_SMALL";
row["columns"][1]["column"] = "title";
row["columns"][1]["value"] = member->getTitle();
row["columns"][1]["font-style"] = style;
row["columns"][1]["font"] = "SANSSERIF_SMALL";
row["columns"][2]["column"] = "online";
row["columns"][2]["value"] = member->getOnlineStatus();
row["columns"][2]["font-style"] = style;
row["columns"][1]["font"] = "SANSSERIF_SMALL";
mListVisibleMembers->addNameItemRow(row);
}
void LLPanelGroupGeneral::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name)
{
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap
|| !gdatap->isMemberDataComplete()
|| gdatap->getMemberVersion() != update_id)
{
// Stale data
return;
}
addMember(member);
}
void LLPanelGroupGeneral::updateChanged()
{
// List all the controls we want to check for changes...

View File

@@ -34,6 +34,7 @@
#define LL_LLPANELGROUPGENERAL_H
#include "llpanelgroup.h"
#include "llavatarnamecache.h"
class LLLineEditor;
class LLTextBox;
@@ -45,6 +46,7 @@ class LLCheckBoxCtrl;
class LLComboBox;
class LLNameBox;
class LLSpinCtrl;
class LLGroupMemberData;
class LLPanelGroupGeneral : public LLPanelGroupTab
{
@@ -66,6 +68,7 @@ public:
virtual void draw();
void onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name);
private:
void onFocusEdit();
void onCommitAny();
@@ -76,6 +79,7 @@ private:
static void onClickInfo(void* userdata);
static void onReceiveNotices(LLUICtrl* ctrl, void* data);
static void openProfile(void* data);
void addMember(LLGroupMemberData* member);
static bool joinDlgCB(const LLSD& notification, const LLSD& response);

View File

@@ -47,8 +47,10 @@
#include "llscrolllistctrl.h"
#include "lltextbox.h"
#include "lltabcontainer.h"
#include "lltexteditor.h"
#include "lltrans.h"
#include "lltransactiontypes.h"
#include "lltrans.h"
#include "lluictrlfactory.h"
#include "llstatusbar.h"
@@ -57,7 +59,50 @@
#include "hippogridmanager.h"
////////////////////////////////////////////////////////////////////////////
//*************************************************
//** LLGroupMoneyTabEventHandler::impl Functions **
//*************************************************
class LLGroupMoneyTabEventHandlerImpl
{
public:
LLGroupMoneyTabEventHandlerImpl(LLButton* earlier_buttonp,
LLButton* later_buttonp,
LLTextEditor* text_editorp,
LLPanel* tabpanelp,
const std::string& loading_text,
const LLUUID& group_id,
S32 interval_length_days,
S32 max_interval_days);
~LLGroupMoneyTabEventHandlerImpl();
bool getCanClickLater();
bool getCanClickEarlier();
void updateButtons();
const LLUUID& getGroupID() const { return mGroupID;}
//member variables
public:
LLUUID mPanelID;
LLUUID mGroupID;
LLPanel* mTabPanelp;
int mIntervalLength;
int mMaxInterval;
int mCurrentInterval;
LLTextEditor* mTextEditorp;
LLButton* mEarlierButtonp;
LLButton* mLaterButtonp;
std::string mLoadingText;
};
class LLGroupMoneyTabEventHandler
{
@@ -84,11 +129,12 @@ public:
static void clickLaterCallback(void* data);
void clickTabCallback(const LLSD &param);
static LLMap<LLUUID, LLGroupMoneyTabEventHandler*> sInstanceIDs;
static std::map<LLPanel*, LLGroupMoneyTabEventHandler*> sTabsToHandlers;
protected:
class impl;
impl* mImplementationp;
LLGroupMoneyTabEventHandlerImpl* mImplementationp;
};
class LLGroupMoneyDetailsTabEventHandler : public LLGroupMoneyTabEventHandler
@@ -157,8 +203,8 @@ public:
virtual void processGroupLand(LLMessageSystem* msg);
static void mapCallback(void* data);
static void contributionCommitCallback(LLUICtrl* ctrl, void* userdata);
static void contributionKeystrokeCallback(LLLineEditor* caller, void* userdata);
void contributionCommitCallback(const LLSD& value);
void contributionKeystrokeCallback(LLLineEditor* caller);
//member variables
public:
@@ -177,7 +223,6 @@ public:
LLScrollListCtrl* mGroupParcelsp;
LLUUID mGroupID;
LLUUID mTransID;
bool mBeenActivated;
@@ -186,14 +231,14 @@ public:
std::string mCantViewParcelsText;
std::string mCantViewAccountsText;
std::string mEmptyParcelsText;
};
// *******************************************
// ** LLPanelGroupLandMoney::impl Functions **
// *******************************************
LLPanelGroupLandMoney::impl::impl(LLPanelGroupLandMoney& panel, const LLUUID& group_id)
: mPanel(panel),
mGroupID(group_id)
: mPanel(panel)
{
mTransID = LLUUID::null;
@@ -226,7 +271,7 @@ void LLPanelGroupLandMoney::impl::requestGroupLandInfo()
mTransID.generate();
mGroupParcelsp->deleteAllItems();
send_places_query(mGroupID, mTransID, "", query_flags, LLParcel::C_ANY, "");
send_places_query(mPanel.mGroupID, mTransID, "", query_flags, LLParcel::C_ANY, "");
}
void LLPanelGroupLandMoney::impl::onMapButton()
@@ -273,7 +318,7 @@ bool LLPanelGroupLandMoney::impl::applyContribution()
new_contribution <= sqm_avail )
{
// update group info and server
if(!gAgent.setGroupContribution(mGroupID, new_contribution))
if(!gAgent.setGroupContribution(mPanel.mGroupID, new_contribution))
{
// should never happen...
llwarns << "Unable to set contribution." << llendl;
@@ -300,7 +345,7 @@ int LLPanelGroupLandMoney::impl::getStoredContribution()
LLGroupData group_data;
group_data.mContribution = 0;
gAgent.getGroupData(mGroupID, group_data);
gAgent.getGroupData(mPanel.mGroupID, group_data);
return group_data.mContribution;
}
@@ -318,7 +363,7 @@ void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib)
void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max)
{
mPanel.childSetTextArg("your_contribution_max_value", "[AMOUNT]", llformat("%d", max));
mPanel.getChild<LLUICtrl>("your_contribution_max_value")->setTextArg("[AMOUNT]", llformat("%d", max));
}
//static
@@ -329,34 +374,25 @@ void LLPanelGroupLandMoney::impl::mapCallback(void* data)
if ( selfp ) selfp->onMapButton();
}
void LLPanelGroupLandMoney::impl::contributionCommitCallback(LLUICtrl* ctrl,
void* userdata)
void LLPanelGroupLandMoney::impl::contributionCommitCallback(const LLSD& value)
{
LLPanelGroupLandMoney* tabp = (LLPanelGroupLandMoney*) userdata;
LLLineEditor* editorp = (LLLineEditor*) ctrl;
int your_contribution = 0;
int new_contribution = 0;
if ( tabp && editorp )
{
impl* self = tabp->mImplementationp;
int your_contribution = 0;
int new_contribution = 0;
new_contribution= value.asInteger();
your_contribution = getStoredContribution();
new_contribution= atoi(editorp->getText().c_str());
your_contribution = self->getStoredContribution();
//reset their junk data to be "good" data to us
setYourContributionTextField(new_contribution);
//reset their junk data to be "good" data to us
self->setYourContributionTextField(new_contribution);
//check to see if they're contribution text has changed
self->mNeedsApply = new_contribution != your_contribution;
tabp->notifyObservers();
}
//check to see if they're contribution text has changed
mNeedsApply = new_contribution != your_contribution;
mPanel.notifyObservers();
}
void LLPanelGroupLandMoney::impl::contributionKeystrokeCallback(LLLineEditor* caller,
void* userdata)
void LLPanelGroupLandMoney::impl::contributionKeystrokeCallback(LLLineEditor* caller)
{
impl::contributionCommitCallback(caller, userdata);
contributionCommitCallback(caller->getValue());
}
//static
@@ -380,14 +416,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
S32 total_contribution;
msg->getS32("QueryData", "ActualArea", total_contribution, 0);
mPanel.childSetTextArg("total_contributed_land_value", "[AREA]", llformat("%d", total_contribution));
mPanel.getChild<LLUICtrl>("total_contributed_land_value")->setTextArg("[AREA]", llformat("%d", total_contribution));
S32 committed;
msg->getS32("QueryData", "BillableArea", committed, 0);
mPanel.childSetTextArg("total_land_in_use_value", "[AREA]", llformat("%d", committed));
mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed));
S32 available = total_contribution - committed;
mPanel.childSetTextArg("land_available_value", "[AREA]", llformat("%d", available));
mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available));
if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
{
@@ -399,13 +435,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
if ( trans_id != mTransID ) return;
// This power was removed to make group roles simpler
//if ( !gAgent.hasPowerInGroup(mGroupID, GP_LAND_VIEW_OWNED) ) return;
if (!gAgent.isInGroup(mGroupID)) return;
//we updated more than just the available area special block
if ( count > 1)
{
mMapButtonp->setEnabled(TRUE);
}
if (!gAgent.isInGroup(mPanel.mGroupID)) return;
mGroupParcelsp->setCommentText(mEmptyParcelsText);
std::string name;
std::string desc;
@@ -558,6 +589,7 @@ void LLPanelGroupLandMoney::activate()
mImplementationp->setYourMaxContributionTextBox(max_avail);
}
mImplementationp->mMapButtonp->setEnabled(false);
update(GC_ALL);
}
@@ -639,9 +671,8 @@ BOOL LLPanelGroupLandMoney::postBuild()
{
LLLineEditor* editor = mImplementationp->mYourContributionEditorp;
editor->setCommitCallback(mImplementationp->contributionCommitCallback);
editor->setKeystrokeCallback(mImplementationp->contributionKeystrokeCallback);
editor->setCallbackUserData(this);
editor->setCommitCallback(boost::bind(&LLPanelGroupLandMoney::impl::contributionCommitCallback, mImplementationp, _2));
editor->setKeystrokeCallback(boost::bind(&LLPanelGroupLandMoney::impl::contributionKeystrokeCallback, mImplementationp, _1));
}
mImplementationp->mMapButtonp = getChild<LLButton>("map_button");
@@ -649,6 +680,12 @@ BOOL LLPanelGroupLandMoney::postBuild()
mImplementationp->mGroupParcelsp =
getChild<LLScrollListCtrl>("group_parcel_list");
if ( mImplementationp->mGroupParcelsp )
{
mImplementationp->mGroupParcelsp->setCommitCallback(boost::bind(&LLPanelGroupLandMoney::onLandSelectionChanged, this));
mImplementationp->mGroupParcelsp->setCommitOnSelectionChange(true);
}
mImplementationp->mCantViewParcelsText = getString("cant_view_group_land_text");
mImplementationp->mCantViewAccountsText = getString("cant_view_group_accounting_text");
@@ -771,6 +808,11 @@ BOOL LLPanelGroupLandMoney::postBuild()
return LLPanelGroupTab::postBuild();
}
void LLPanelGroupLandMoney::onLandSelectionChanged()
{
mImplementationp->mMapButtonp->setEnabled( mImplementationp->mGroupParcelsp->getItemCount() > 0 );
}
BOOL LLPanelGroupLandMoney::isVisibleByAgent(LLAgent* agentp)
{
return mAllowEdit && agentp->isInGroup(mGroupID);
@@ -794,47 +836,7 @@ void LLPanelGroupLandMoney::processPlacesReply(LLMessageSystem* msg, void**)
selfp->mImplementationp->processGroupLand(msg);
}
// *************************************************
// ** LLGroupMoneyTabEventHandler::impl Functions **
// *************************************************
class LLGroupMoneyTabEventHandler::impl
{
public:
impl(LLButton* earlier_buttonp,
LLButton* later_buttonp,
LLTextEditor* text_editorp,
LLPanel* tabpanelp,
const std::string& loading_text,
const LLUUID& group_id,
S32 interval_length_days,
S32 max_interval_days);
~impl();
bool getCanClickLater();
bool getCanClickEarlier();
void updateButtons();
//member variables
public:
LLUUID mGroupID;
LLUUID mPanelID;
LLPanel* mTabPanelp;
int mIntervalLength;
int mMaxInterval;
int mCurrentInterval;
LLTextEditor* mTextEditorp;
LLButton* mEarlierButtonp;
LLButton* mLaterButtonp;
std::string mLoadingText;
};
LLGroupMoneyTabEventHandler::impl::impl(LLButton* earlier_buttonp,
LLGroupMoneyTabEventHandlerImpl::LLGroupMoneyTabEventHandlerImpl(LLButton* earlier_buttonp,
LLButton* later_buttonp,
LLTextEditor* text_editorp,
LLPanel* tabpanelp,
@@ -858,21 +860,21 @@ LLGroupMoneyTabEventHandler::impl::impl(LLButton* earlier_buttonp,
mLoadingText = loading_text;
}
LLGroupMoneyTabEventHandler::impl::~impl()
LLGroupMoneyTabEventHandlerImpl::~LLGroupMoneyTabEventHandlerImpl()
{
}
bool LLGroupMoneyTabEventHandler::impl::getCanClickEarlier()
bool LLGroupMoneyTabEventHandlerImpl::getCanClickEarlier()
{
return (mCurrentInterval < mMaxInterval);
}
bool LLGroupMoneyTabEventHandler::impl::getCanClickLater()
bool LLGroupMoneyTabEventHandlerImpl::getCanClickLater()
{
return ( mCurrentInterval > 0 );
}
void LLGroupMoneyTabEventHandler::impl::updateButtons()
void LLGroupMoneyTabEventHandlerImpl::updateButtons()
{
if ( mEarlierButtonp )
{
@@ -901,7 +903,7 @@ LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_butto
S32 interval_length_days,
S32 max_interval_days)
{
mImplementationp = new impl(earlier_buttonp,
mImplementationp = new LLGroupMoneyTabEventHandlerImpl(earlier_buttonp,
later_buttonp,
text_editorp,
panelp,
@@ -924,7 +926,7 @@ LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_butto
if ( tab_containerp && panelp )
{
tab_containerp->setCommitCallback(boost::bind(&LLGroupMoneyTabEventHandler::clickTabCallback, this, _2));
tab_containerp->setCommitCallback(boost::bind(&LLGroupMoneyTabEventHandler::onClickTab, this));
}
sInstanceIDs.addData(mImplementationp->mPanelID, this);
@@ -996,14 +998,8 @@ void LLGroupMoneyTabEventHandler::clickLaterCallback(void* data)
if ( selfp ) selfp->onClickLater();
}
void LLGroupMoneyTabEventHandler::clickTabCallback(const LLSD& param)
{
if(param.asString() == "group_money_details_tab")
onClickTab();
}
// **************************************************
// ** LLGroupMoneyDetailsTabEventHandler Functions **
//**************************************************
//** LLGroupMoneyDetailsTabEventHandler Functions **
// **************************************************
LLGroupMoneyDetailsTabEventHandler::LLGroupMoneyDetailsTabEventHandler(LLButton* earlier_buttonp,
@@ -1035,7 +1031,7 @@ void LLGroupMoneyDetailsTabEventHandler::requestData(LLMessageSystem* msg)
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->addUUIDFast(_PREHASH_GroupID, mImplementationp->mGroupID );
msg->addUUIDFast(_PREHASH_GroupID, mImplementationp->getGroupID() );
msg->nextBlockFast(_PREHASH_MoneyData);
msg->addUUIDFast(_PREHASH_RequestID, mImplementationp->mPanelID );
msg->addS32Fast(_PREHASH_IntervalDays, mImplementationp->mIntervalLength );
@@ -1056,7 +1052,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
{
LLUUID group_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->mGroupID != group_id)
if (mImplementationp->getGroupID() != group_id)
{
llwarns << "Group Account details not for this group!" << llendl;
return;
@@ -1172,7 +1168,7 @@ void LLGroupMoneySalesTabEventHandler::requestData(LLMessageSystem* msg)
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->addUUIDFast(_PREHASH_GroupID, mImplementationp->mGroupID );
msg->addUUIDFast(_PREHASH_GroupID, mImplementationp->getGroupID() );
msg->nextBlockFast(_PREHASH_MoneyData);
msg->addUUIDFast(_PREHASH_RequestID, mImplementationp->mPanelID );
msg->addS32Fast(_PREHASH_IntervalDays, mImplementationp->mIntervalLength );
@@ -1193,7 +1189,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
{
LLUUID group_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->mGroupID != group_id)
if (mImplementationp->getGroupID() != group_id)
{
llwarns << "Group Account Transactions not for this group!" << llendl;
return;
@@ -1346,7 +1342,7 @@ void LLGroupMoneyPlanningTabEventHandler::requestData(LLMessageSystem* msg)
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->addUUIDFast(_PREHASH_GroupID, mImplementationp->mGroupID );
msg->addUUIDFast(_PREHASH_GroupID, mImplementationp->getGroupID() );
msg->nextBlockFast(_PREHASH_MoneyData);
msg->addUUIDFast(_PREHASH_RequestID, mImplementationp->mPanelID );
msg->addS32Fast(_PREHASH_IntervalDays, mImplementationp->mIntervalLength);
@@ -1367,7 +1363,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
{
LLUUID group_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->mGroupID != group_id)
if (mImplementationp->getGroupID() != group_id)
{
llwarns << "Group Account Summary received not for this group!" << llendl;
return;

View File

@@ -37,10 +37,6 @@
#include "llmap.h"
#include "lluuid.h"
#include "llbutton.h"
#include "lltexteditor.h"
#include "llpanel.h"
class LLPanelGroupLandMoney : public LLPanelGroupTab
{
public:
@@ -64,6 +60,8 @@ public:
static void processGroupAccountDetailsReply(LLMessageSystem* msg, void** data);
static void processGroupAccountTransactionsReply(LLMessageSystem* msg, void** data);
static void processGroupAccountSummaryReply(LLMessageSystem* msg, void** data);
virtual void onLandSelectionChanged();
protected:
class impl;

View File

@@ -35,12 +35,15 @@
#include "llcheckboxctrl.h"
#include "llagent.h"
#include "llavatarnamecache.h"
#include "llbutton.h"
#include "llfiltereditor.h"
#include "llfloateravatarinfo.h"
#include "llfloatergroupinvite.h"
#include "lliconctrl.h"
#include "lllineeditor.h"
#include "llnamelistctrl.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llpanelgrouproles.h"
#include "llscrolllistctrl.h"
@@ -117,15 +120,13 @@ LLPanelGroupRoles::LLPanelGroupRoles(const std::string& name, const LLUUID& grou
mCurrentTab(NULL),
mRequestedTab( NULL ),
mSubTabContainer( NULL ),
mFirstUse( TRUE ),
mIgnoreTransition( FALSE )
mFirstUse( TRUE )
{
}
LLPanelGroupRoles::~LLPanelGroupRoles()
{
int i;
for (i = 0; i < mSubTabContainer->getTabCount(); ++i)
for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i)
{
LLPanelGroupSubTab* subtabp = (LLPanelGroupSubTab*) mSubTabContainer->getPanelByIndex(i);
@@ -142,20 +143,25 @@ BOOL LLPanelGroupRoles::postBuild()
if (!mSubTabContainer) return FALSE;
// Hook up each sub-tabs callback and widgets.
S32 i;
for (i = 0; i < mSubTabContainer->getTabCount(); ++i)
for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i)
{
LLPanelGroupSubTab* subtabp = (LLPanelGroupSubTab*) mSubTabContainer->getPanelByIndex(i);
LLPanel* panel = mSubTabContainer->getPanelByIndex(i);
LLPanelGroupSubTab* subtabp = dynamic_cast<LLPanelGroupSubTab*>(panel);
if (!subtabp)
{
llwarns << "Invalid subtab panel: " << panel->getName() << llendl;
return FALSE;
}
// Hand the subtab a pointer to this LLPanelGroupRoles, so that it can
// look around for the widgets it is interested in.
if (!subtabp->postBuildSubTab(this)) return FALSE;
if (!subtabp->postBuildSubTab(this))
return FALSE;
subtabp->addObserver(this);
}
// Add click callbacks to all the tabs.
mSubTabContainer->setCommitCallback(boost::bind(&LLPanelGroupRoles::handleClickSubTab,this));
// Add click callbacks to tab switching.
mSubTabContainer->setValidateBeforeCommit(boost::bind(&LLPanelGroupRoles::handleSubTabSwitch, this, _1));
// Set the current tab to whatever is currently being shown.
mCurrentTab = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel();
@@ -197,30 +203,17 @@ BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp)
}
void LLPanelGroupRoles::handleClickSubTab()
bool LLPanelGroupRoles::handleSubTabSwitch(const LLSD& data)
{
// If we are already handling a transition,
// ignore this.
if (mIgnoreTransition)
std::string panel_name = data.asString();
if(mRequestedTab != NULL)//we already have tab change request
{
return;
return false;
}
mRequestedTab = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel();
mRequestedTab = static_cast<LLPanelGroupTab*>(mSubTabContainer->getPanelByName(panel_name));
// Make sure they aren't just clicking the same tab...
if (mRequestedTab == mCurrentTab)
{
return;
}
// Try to switch from the current panel to the panel the user selected.
attemptTransition();
}
BOOL LLPanelGroupRoles::attemptTransition()
{
// Check if the current tab needs to be applied.
std::string mesg;
if (mCurrentTab && mCurrentTab->needsApply(mesg))
{
@@ -236,26 +229,14 @@ BOOL LLPanelGroupRoles::attemptTransition()
LLNotificationsUtil::add("PanelGroupApply", args, LLSD(),
boost::bind(&LLPanelGroupRoles::handleNotifyCallback, this, _1, _2));
mHasModal = TRUE;
// We need to reselect the current tab, since it isn't finished.
if (mSubTabContainer)
{
mIgnoreTransition = TRUE;
mSubTabContainer->selectTabPanel( mCurrentTab );
mIgnoreTransition = FALSE;
}
// Returning FALSE will block a close action from finishing until
// we get a response back from the user.
return FALSE;
}
else
{
// The current panel didn't have anything it needed to apply.
if (mRequestedTab)
{
transitionToTab();
}
return TRUE;
return false;
}
transitionToTab();
return true;
}
void LLPanelGroupRoles::transitionToTab()
@@ -272,13 +253,15 @@ void LLPanelGroupRoles::transitionToTab()
// This is now the current tab;
mCurrentTab = mRequestedTab;
mCurrentTab->activate();
mRequestedTab = 0;
}
}
bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
mHasModal = FALSE;
LLPanelGroupTab* transition_tab = mRequestedTab;
switch (option)
{
case 0: // "Apply Changes"
@@ -298,26 +281,20 @@ bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLS
// Skip switching tabs.
break;
}
// This panel's info successfully applied.
// Switch to the next panel.
// No break! Continue into 'Ignore Changes' which just switches tabs.
mIgnoreTransition = TRUE;
mSubTabContainer->selectTabPanel( mRequestedTab );
mIgnoreTransition = FALSE;
transitionToTab();
mSubTabContainer->selectTabPanel( transition_tab );
break;
}
case 1: // "Ignore Changes"
// Switch to the requested panel without applying changes
cancel();
mIgnoreTransition = TRUE;
mSubTabContainer->selectTabPanel( mRequestedTab );
mIgnoreTransition = FALSE;
transitionToTab();
mSubTabContainer->selectTabPanel( transition_tab );
break;
case 2: // "Cancel"
default:
mRequestedTab = NULL;
// Do nothing. The user is canceling the action.
break;
}
@@ -470,9 +447,8 @@ LLPanelGroupSubTab::LLPanelGroupSubTab(const std::string& name, const LLUUID& gr
: LLPanelGroupTab(name, group_id),
mHeader(NULL),
mFooter(NULL),
mSearchLineEditor(NULL),
mSearchButton(NULL),
mShowAllButton(NULL)
mActivated(false),
mSearchEditor(NULL)
{
}
@@ -480,121 +456,47 @@ LLPanelGroupSubTab::~LLPanelGroupSubTab()
{
}
BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root)
{
// Get icons for later use.
mActionIcons.clear();
if (hasString("power_folder_icon"))
{
mActionIcons["folder"] = getString("power_folder_icon");
}
if (hasString("power_all_have_icon"))
{
mActionIcons["full"] = getString("power_all_have_icon");
}
if (hasString("power_partial_icon"))
{
mActionIcons["partial"] = getString("power_partial_icon");
}
return TRUE;
}
BOOL LLPanelGroupSubTab::postBuild()
{
// Hook up the search widgets.
bool recurse = true;
mSearchLineEditor = getChild<LLLineEditor>("search_text", recurse);
mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse);
if (!mSearchLineEditor) return FALSE;
mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke);
mSearchLineEditor->setCallbackUserData(this);
if (!mSearchEditor)
return FALSE;
mSearchButton = getChild<LLButton>("search_button", recurse);
if (!mSearchButton) return FALSE;
mSearchButton->setClickedCallback(boost::bind(&LLPanelGroupSubTab::onClickSearch,this));
mSearchButton->setEnabled(FALSE);
mShowAllButton = getChild<LLButton>("show_all_button", recurse);
if (!mShowAllButton) return FALSE;
mShowAllButton->setClickedCallback(boost::bind(&LLPanelGroupSubTab::onClickShowAll,this));
mShowAllButton->setEnabled(FALSE);
// Get icons for later use.
mActionIcons.clear();
bool no_recurse = false;
LLIconCtrl* icon = getChild<LLIconCtrl>("power_folder_icon",no_recurse);
if (icon && !icon->getImageName().empty())
{
mActionIcons["folder"] = icon->getImageName();
removeChild(icon);
delete icon;
}
icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse, false);
if (icon && !icon->getImageName().empty())
{
mActionIcons["full"] = icon->getImageName();
removeChild(icon);
delete icon;
}
icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse, false);
if (icon && !icon->getImageName().empty())
{
mActionIcons["partial"] = icon->getImageName();
removeChild(icon);
delete icon;
}
mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2));
return LLPanelGroupTab::postBuild();
}
// static
void LLPanelGroupSubTab::onSearchKeystroke(LLLineEditor* caller, void* user_data)
{
LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data);
self->handleSearchKeystroke(caller);
}
void LLPanelGroupSubTab::handleSearchKeystroke(LLLineEditor* caller)
{
if (caller->getText().size())
{
setDefaultBtn( mSearchButton );
mSearchButton->setEnabled(TRUE);
}
else
{
setDefaultBtn( NULL );
mSearchButton->setEnabled(FALSE);
}
}
// static
void LLPanelGroupSubTab::onClickSearch(void* user_data)
{
LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data);
self->handleClickSearch();
}
void LLPanelGroupSubTab::handleClickSearch()
{
lldebugs << "LLPanelGroupSubTab::handleClickSearch()" << llendl;
if (0 == mSearchLineEditor->getText().size())
{
// No search text. (This shouldn't happen... the search button should have been disabled).
llwarns << "handleClickSearch with no search text!" << llendl;
mSearchButton->setEnabled(FALSE);
return;
}
setSearchFilter( mSearchLineEditor->getText() );
mShowAllButton->setEnabled(TRUE);
}
// static
void LLPanelGroupSubTab::onClickShowAll(void* user_data)
{
LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data);
self->handleClickShowAll();
}
void LLPanelGroupSubTab::handleClickShowAll()
{
lldebugs << "LLPanelGroupSubTab::handleClickShowAll()" << llendl;
setSearchFilter( LLStringUtil::null );
mShowAllButton->setEnabled(FALSE);
}
void LLPanelGroupSubTab::setSearchFilter(const std::string& filter)
{
lldebugs << "LLPanelGroupSubTab::setSearchFilter() ==> '" << filter << "'" << llendl;
if(mSearchFilter == filter)
return;
mSearchFilter = filter;
LLStringUtil::toLower(mSearchFilter);
update(GC_ALL);
@@ -875,6 +777,8 @@ LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab()
BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
{
LLPanelGroupSubTab::postBuildSubTab(root);
// Upcast parent so we can ask it for sibling controls.
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
@@ -1174,7 +1078,8 @@ void LLPanelGroupMembersSubTab::handleEjectMembers()
for (itor = selection.begin() ;
itor != selection.end(); ++itor)
{
selected_members.push_back((*itor)->getUUID());
LLUUID member_id = (*itor)->getUUID();
selected_members.push_back( member_id );
}
mMembersList->deleteSelectedItems();
@@ -1298,15 +1203,19 @@ void LLPanelGroupMembersSubTab::handleMemberDoubleClick()
LLScrollListItem* selected = mMembersList->getFirstSelected();
if (selected)
{
LLFloaterAvatarInfo::showFromDirectory( selected->getUUID() );
LLUUID member_id = selected->getUUID();
LLFloaterAvatarInfo::showFromDirectory( member_id );
}
}
void LLPanelGroupMembersSubTab::activate()
{
LLPanelGroupSubTab::activate();
update(GC_ALL);
if(!mActivated)
{
update(GC_ALL);
mActivated = true;
}
}
void LLPanelGroupMembersSubTab::deactivate()
@@ -1382,7 +1291,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg)
bool LLPanelGroupMembersSubTab::addOwnerCB(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
mHasModal = FALSE;
if (0 == option)
@@ -1468,13 +1377,20 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
return GP_NO_POWERS;
}
LLGroupMemberData* member_data = gdatap->mMembers[agent_id];
if ( !member_data )
LLGroupMgrGroupData::member_list_t::iterator iter = gdatap->mMembers.find(agent_id);
if ( iter == gdatap->mMembers.end() )
{
llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- No member data for member with UUID " << agent_id << llendl;
return GP_NO_POWERS;
}
LLGroupMemberData* member_data = (*iter).second;
if (!member_data)
{
llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- Null member data for member with UUID " << agent_id << llendl;
return GP_NO_POWERS;
}
//see if there are unsaved role changes for this agent
role_change_data_map_t* role_change_datap = NULL;
member_role_changes_map_t::iterator member = mMemberRoleChangeData.find(agent_id);
@@ -1581,9 +1497,6 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc)
return;
}
// Rebuild the members list.
mMembersList->deleteAllItems();
// Wait for both all data to be retrieved before displaying anything.
if ( gdatap->isMemberDataComplete()
&& gdatap->isRoleDataComplete()
@@ -1619,6 +1532,50 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc)
}
}
void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
{
if (!data) return;
LLUIString donated = getString("donation_area");
donated.setArg("[AREA]", llformat("%d", data->getContribution()));
LLSD row;
row["id"] = data->getID();
row["columns"][0]["column"] = "name";
row["columns"][0]["font"] = "SANSSERIF_SMALL";
row["columns"][1]["column"] = "donated";
row["columns"][1]["value"] = donated.getString();
row["columns"][2]["column"] = "online";
row["columns"][2]["value"] = data->getOnlineStatus();
row["columns"][2]["font"] = "SANSSERIF_SMALL";
mMembersList->addNameItemRow(row);
mHasMatch = TRUE;
}
void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name)
{
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap
|| gdatap->getMemberVersion() != update_id
|| !member)
{
return;
}
// trying to avoid unnecessary hash lookups
if (matchesSearchFilter(av_name.getLegacyName()))
{
addMemberToList(member);
if(!mMembersList->getEnabled())
{
mMembersList->setEnabled(TRUE);
}
}
}
void LLPanelGroupMembersSubTab::updateMembers()
{
mPendingMemberUpdate = FALSE;
@@ -1640,48 +1597,38 @@ void LLPanelGroupMembersSubTab::updateMembers()
{
return;
}
//cleanup list only for first iretation
if(mMemberProgress == gdatap->mMembers.begin())
{
mMembersList->deleteAllItems();
}
LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
S32 i = 0;
for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME;
++mMemberProgress, ++i)
LLTimer update_time;
update_time.setTimerExpirySec(UPDATE_MEMBERS_SECONDS_PER_FRAME);
for( ; mMemberProgress != end && !update_time.hasExpired(); ++mMemberProgress)
{
if (!mMemberProgress->second)
continue;
// Do filtering on name if it is already in the cache.
bool add_member = true;
std::string fullname;
if (gCacheName->getFullName(mMemberProgress->first, fullname))
// Do filtering on name if it is already in the cache.
LLAvatarName av_name;
if (LLAvatarNameCache::get(mMemberProgress->first, &av_name))
{
if ( !matchesSearchFilter(fullname) )
if (matchesSearchFilter(av_name.getLegacyName()))
{
add_member = false;
addMemberToList(mMemberProgress->second);
}
}
if (add_member)
else
{
// Build the donated tier string.
std::ostringstream donated;
donated << mMemberProgress->second->getContribution() << " sq. m.";
LLSD row;
row["id"] = (*mMemberProgress).first;
row["columns"][0]["column"] = "name";
// value is filled in by name list control
row["columns"][1]["column"] = "donated";
row["columns"][1]["value"] = donated.str();
row["columns"][2]["column"] = "online";
row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus();
row["columns"][2]["font"] = "SANSSERIF_SMALL";
mMembersList->addNameItem(row);
mHasMatch = TRUE;
// If name is not cached, onNameCache() should be called when it is cached and add this member to list.
LLAvatarNameCache::get(mMemberProgress->first, boost::bind(&LLPanelGroupMembersSubTab::onNameCache,
this, gdatap->getMemberVersion(), mMemberProgress->second, _2));
}
}
@@ -1720,7 +1667,17 @@ void* LLPanelGroupRolesSubTab::createTab(void* data)
}
LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab(const std::string& name, const LLUUID& group_id)
: LLPanelGroupSubTab(name, group_id), mHasRoleChange(FALSE)
: LLPanelGroupSubTab(name, group_id),
mRolesList(NULL),
mAssignedMembersList(NULL),
mAllowedActionsList(NULL),
mRoleName(NULL),
mRoleTitle(NULL),
mRoleDescription(NULL),
mMemberVisibleCheck(NULL),
mDeleteRoleButton(NULL),
mCreateRoleButton(NULL),
mHasRoleChange(FALSE)
{
}
@@ -1730,6 +1687,8 @@ LLPanelGroupRolesSubTab::~LLPanelGroupRolesSubTab()
BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
{
LLPanelGroupSubTab::postBuildSubTab(root);
// Upcast parent so we can ask it for sibling controls.
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
@@ -1775,27 +1734,20 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
}
mRolesList->setCommitOnSelectionChange(TRUE);
mRolesList->setCallbackUserData(this);
mRolesList->setCommitCallback(onRoleSelect);
mRolesList->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::onRoleSelect,_1,this));
mMemberVisibleCheck->setCallbackUserData(this);
mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange);
mMemberVisibleCheck->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::onMemberVisibilityChange,_1,this));
mAllowedActionsList->setCommitOnSelectionChange(TRUE);
mAllowedActionsList->setCallbackUserData(this);
mRoleName->setCommitOnFocusLost(TRUE);
mRoleName->setCallbackUserData(this);
mRoleName->setKeystrokeCallback(onPropertiesKey);
mRoleName->setKeystrokeCallback(boost::bind(&LLPanelGroupRolesSubTab::onPropertiesKey,_1,this));
mRoleTitle->setCommitOnFocusLost(TRUE);
mRoleTitle->setCallbackUserData(this);
mRoleTitle->setKeystrokeCallback(onPropertiesKey);
mRoleTitle->setKeystrokeCallback(boost::bind(&LLPanelGroupRolesSubTab::onPropertiesKey,_1,this));
mRoleDescription->setCommitOnFocusLost(TRUE);
mRoleDescription->setCallbackUserData(this);
mRoleDescription->setCommitCallback(onDescriptionCommit);
mRoleDescription->setFocusReceivedCallback(boost::bind(&LLPanelGroupRolesSubTab::onDescriptionFocus, this));
mRoleDescription->setKeystrokeCallback(boost::bind(&LLPanelGroupRolesSubTab::onDescriptionKeyStroke, this, _1));
setFooterEnabled(FALSE);
@@ -1840,7 +1792,8 @@ bool LLPanelGroupRolesSubTab::apply(std::string& mesg)
{
lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl;
saveRoleChanges();
saveRoleChanges(true);
LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID);
notifyObservers();
@@ -2019,7 +1972,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect()
return;
}
saveRoleChanges();
saveRoleChanges(false);
// Check if there is anything selected.
LLScrollListItem* item = mRolesList->getFirstSelected();
@@ -2201,7 +2154,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force)
{
warning = "AssignDangerousAbilityWarning";
}
LLNotifications::instance().add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
LLNotificationsUtil::add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
}
else
{
@@ -2229,7 +2182,7 @@ bool LLPanelGroupRolesSubTab::addActionCB(const LLSD& notification, const LLSD&
mHasModal = FALSE;
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{
// User clicked "Yes"
@@ -2251,7 +2204,7 @@ void LLPanelGroupRolesSubTab::onPropertiesKey(LLLineEditor* ctrl, void* user_dat
self->notifyObservers();
}
void LLPanelGroupRolesSubTab::onDescriptionFocus()
void LLPanelGroupRolesSubTab::onDescriptionKeyStroke(LLTextEditor* caller)
{
mHasRoleChange = TRUE;
notifyObservers();
@@ -2382,7 +2335,7 @@ void LLPanelGroupRolesSubTab::handleDeleteRole()
notifyObservers();
}
void LLPanelGroupRolesSubTab::saveRoleChanges()
void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role)
{
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
@@ -2397,13 +2350,23 @@ void LLPanelGroupRolesSubTab::saveRoleChanges()
rd.mRoleDescription = mRoleDescription->getText();
rd.mRoleTitle = mRoleTitle->getText();
S32 role_members_count = 0;
if (mSelectedRole.isNull())
{
role_members_count = gdatap->mMemberCount;
}
else if(LLGroupRoleData* grd = get_ptr_in_map(gdatap->mRoles, mSelectedRole))
{
role_members_count = grd->getTotalMembersInRole();
}
gdatap->setRoleData(mSelectedRole,rd);
mRolesList->deleteSingleItem(mRolesList->getItemIndex(mSelectedRole));
LLSD row = createRoleItem(mSelectedRole,rd.mRoleName,rd.mRoleTitle,0);
LLSD row = createRoleItem(mSelectedRole,rd.mRoleName,rd.mRoleTitle,role_members_count);
LLScrollListItem* item = mRolesList->addElement(row, ADD_BOTTOM, this);
item->setSelected(TRUE);
item->setSelected(select_saved_role);
mHasRoleChange = FALSE;
}
@@ -2430,6 +2393,8 @@ LLPanelGroupActionsSubTab::~LLPanelGroupActionsSubTab()
BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
{
LLPanelGroupSubTab::postBuildSubTab(root);
// Upcast parent so we can ask it for sibling controls.
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
@@ -2446,13 +2411,9 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return FALSE;
mActionList->setCallbackUserData(this);
mActionList->setCommitOnSelectionChange(TRUE);
mActionList->setCommitCallback(boost::bind(&LLPanelGroupActionsSubTab::handleActionSelect, this));
mActionMembers->setCallbackUserData(this);
mActionRoles->setCallbackUserData(this);
update(GC_ALL);
return TRUE;
@@ -2463,10 +2424,8 @@ void LLPanelGroupActionsSubTab::activate()
LLPanelGroupSubTab::activate();
lldebugs << "LLPanelGroupActionsSubTab::activate()" << llendl;
mActionList->deselectAllItems();
mActionMembers->deleteAllItems();
mActionRoles->deleteAllItems();
mActionDescription->clear();
update(GC_ALL);
}
void LLPanelGroupActionsSubTab::deactivate()

View File

@@ -34,7 +34,9 @@
#define LL_LLPANELGROUPROLES_H
#include "llpanelgroup.h"
#include "llavatarnamecache.h"
class LLFilterEditor;
class LLNameListCtrl;
class LLPanelGroupSubTab;
class LLPanelGroupMembersSubTab;
@@ -42,6 +44,8 @@ class LLPanelGroupRolesSubTab;
class LLPanelGroupActionsSubTab;
class LLScrollListCtrl;
class LLScrollListItem;
class LLTextEditor;
class LLGroupMemberData;
// Forward declare for friend usage.
//virtual BOOL LLPanelGroupSubTab::postBuildSubTab(LLView*);
@@ -64,7 +68,7 @@ public:
virtual BOOL isVisibleByAgent(LLAgent* agentp);
static void* createTab(void* data);
void handleClickSubTab();
bool handleSubTabSwitch(const LLSD& data);
// Checks if the current tab needs to be applied, and tries to switch to the requested tab.
BOOL attemptTransition();
@@ -109,15 +113,7 @@ public:
virtual BOOL postBuild();
// This allows sub-tabs to collect child widgets from a higher level in the view hierarchy.
virtual BOOL postBuildSubTab(LLView* root) { return TRUE; }
static void onSearchKeystroke(LLLineEditor* caller, void* user_data);
void handleSearchKeystroke(LLLineEditor* caller);
static void onClickSearch(void*);
void handleClickSearch();
static void onClickShowAll(void*);
void handleClickShowAll();
virtual BOOL postBuildSubTab(LLView* root);
virtual void setSearchFilter( const std::string& filter );
@@ -126,6 +122,9 @@ public:
// Helper functions
bool matchesActionSearchFilter(std::string action);
void setFooterEnabled(BOOL enable);
protected:
void buildActionsList(LLScrollListCtrl* ctrl,
U64 allowed_by_some,
U64 allowed_by_all,
@@ -142,19 +141,18 @@ public:
BOOL filter,
BOOL is_owner_role);
void setFooterEnabled(BOOL enable);
protected:
LLPanel* mHeader;
LLPanel* mFooter;
LLLineEditor* mSearchLineEditor;
LLButton* mSearchButton;
LLButton* mShowAllButton;
LLFilterEditor* mSearchEditor;
std::string mSearchFilter;
icon_map_t mActionIcons;
bool mActivated;
void setOthersVisible(BOOL b);
};
@@ -197,6 +195,9 @@ public:
virtual void draw();
void addMemberToList(LLGroupMemberData* data);
void onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name);
protected:
typedef std::map<LLUUID, LLRoleMemberChangeType> role_change_data_map_t;
typedef std::map<LLUUID, role_change_data_map_t*> member_role_changes_map_t;
@@ -249,8 +250,9 @@ public:
static void onPropertiesKey(LLLineEditor*, void*);
void onDescriptionKeyStroke(LLTextEditor* caller);
static void onDescriptionCommit(LLUICtrl*, void*);
void onDescriptionFocus();
static void onMemberVisibilityChange(LLUICtrl*, void*);
void handleMemberVisibilityChange(bool value);
@@ -261,7 +263,7 @@ public:
static void onDeleteRole(void*);
void handleDeleteRole();
void saveRoleChanges();
void saveRoleChanges(bool select_saved_role);
protected:
void handleActionCheck(LLUICtrl* ctrl, bool force);
LLSD createRoleItem(const LLUUID& role_id, std::string name, std::string title, S32 members);

View File

@@ -227,11 +227,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
// instance management
if (LLPanelLogin::sInstance)
{
llwarns << "Duplicate instance of login view deleted" << llendl;
delete LLPanelLogin::sInstance;
LL_WARNS("AppInit") << "Duplicate instance of login view deleted" << LL_ENDL;
// Don't leave bad pointer in gFocusMgr
gFocusMgr.setDefaultKeyboardFocus(NULL);
delete LLPanelLogin::sInstance;
}
LLPanelLogin::sInstance = this;
@@ -259,17 +259,17 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
name_combo->setSuppressAutoComplete(true);
childSetCommitCallback("remember_name_check", onNameCheckChanged);
childSetCommitCallback("password_edit", mungePassword);
childSetKeystrokeCallback("password_edit", onPassKey, this);
childSetUserData("password_edit", this);
LLLineEditor* password_edit(getChild<LLLineEditor>("password_edit"));
password_edit->setKeystrokeCallback(onPassKey);
// STEAM-14: When user presses Enter with this field in focus, initiate login
password_edit->setCommitCallback(mungePassword, this);
password_edit->setDrawAsterixes(TRUE);
// change z sort of clickable text to be behind buttons
sendChildToBack(getChildView("channel_text"));
sendChildToBack(getChildView("forgot_password_text"));
LLLineEditor* edit = getChild<LLLineEditor>("password_edit");
if (edit) edit->setDrawAsterixes(TRUE);
//OGPX : This keeps the uris in a history file
//OGPX TODO: should this be inside an OGP only check?
LLComboBox* regioncombo = getChild<LLComboBox>("regionuri_edit");
@@ -347,14 +347,14 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
channel_text->setTextArg("[CHANNEL]", channel); // though not displayed
channel_text->setTextArg("[VERSION]", version);
channel_text->setClickedCallback(onClickVersion);
channel_text->setCallbackUserData(this);
channel_text->setClickedCallback(boost::bind(&LLPanelLogin::onClickVersion,(void*)NULL));
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(onClickForgotPassword);
forgot_password_text->setClickedCallback(boost::bind(&onClickForgotPassword));
LLTextBox* create_new_account_text = getChild<LLTextBox>("create_new_account_text");
create_new_account_text->setClickedCallback(onClickNewAccount);
create_new_account_text->setClickedCallback(boost::bind(&onClickNewAccount));
#endif
// get the web browser control
@@ -371,16 +371,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
// make links open in external browser
web_browser->setOpenInExternalBrowser( true );
// force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through)
LLRect htmlRect = getRect();
#if USE_VIEWER_AUTH
htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight());
#else
htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 );
#endif
web_browser->setRect( htmlRect );
web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE );
reshape( getRect().getWidth(), getRect().getHeight(), 1 );
reshapeBrowser();
updateGridCombo();
@@ -455,6 +446,26 @@ void LLPanelLogin::mungePassword(LLUICtrl* caller, void* user_data)
}
}
// force the size to be correct (XML doesn't seem to be sufficient to do this)
// (with some padding so the other login screen doesn't show through)
void LLPanelLogin::reshapeBrowser()
{
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
LLRect rect = gViewerWindow->getWindowRectScaled();
LLRect html_rect;
html_rect.setCenterAndSize(
#if USE_VIEWER_AUTH
rect.getCenterX() - 2, rect.getCenterY(),
rect.getWidth() + 6, rect.getHeight());
#else
rect.getCenterX() - 2, rect.getCenterY() + 40,
rect.getWidth() + 6, rect.getHeight() - 78 );
#endif
web_browser->setRect( html_rect );
web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE );
reshape( rect.getWidth(), rect.getHeight(), 1 );
}
LLPanelLogin::~LLPanelLogin()
{
LLPanelLogin::sInstance = NULL;
@@ -603,33 +614,37 @@ void LLPanelLogin::giveFocus()
if( sInstance )
{
// Grab focus and move cursor to first blank input field
std::string first = sInstance->getChild<LLComboBox>("name_combo")->getTextEntry();
std::string pass = sInstance->childGetText("password_edit");
std::string username = sInstance->getChild<LLUICtrl>("username_combo")->getValue().asString();
std::string pass = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString();
BOOL have_first = !first.empty();
BOOL have_username = !username.empty();
BOOL have_pass = !pass.empty();
if (!have_first)
LLLineEditor* edit = NULL;
LLUICtrl* combo = NULL;
if (have_username)
{
// User doesn't have a name, so start there.
LLComboBox* combo = sInstance->getChild<LLComboBox>("name_combo");
combo->setFocusText(TRUE);
}
else if (!have_pass)
{
LLLineEditor* edit = NULL;
if(have_pass)
combo = sInstance->getChild<LLButton>("connect_btn");
else
// User saved his name but not his password. Move
// focus to password field.
edit = sInstance->getChild<LLLineEditor>("password_edit");
edit->setFocus(TRUE);
edit->selectAll();
}
else
{
// else, we have both name and password.
// We get here waiting for the login to happen.
LLButton* connect_btn = sInstance->getChild<LLButton>("connect_btn");
connect_btn->setFocus(TRUE);
// User doesn't have a name, so start there.
combo = sInstance->getChild<LLComboBox>("username_combo");
}
if (edit)
{
edit->setFocus(TRUE);
edit->selectAll();
}
else if (combo)
{
combo->setFocus(TRUE);
}
}
#endif
@@ -827,13 +842,14 @@ void LLPanelLogin::close()
// static
void LLPanelLogin::setAlwaysRefresh(bool refresh)
{
if (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP) return;
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
if (web_browser)
if (sInstance && LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)
{
web_browser->setAlwaysRefresh(refresh);
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
if (web_browser)
{
web_browser->setAlwaysRefresh(refresh);
}
}
}
@@ -893,7 +909,7 @@ void LLPanelLogin::loadLoginPage()
if (!sInstance) return;
sInstance->updateGridCombo();
std::ostringstream oStr;
std::ostringstream login_uri;
std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
if (login_page.empty())
@@ -902,7 +918,7 @@ void LLPanelLogin::loadLoginPage()
return;
}
oStr << login_page;
login_uri << login_page;
// Use the right delimeter depending on how LLURI parses the URL
LLURI login_page_uri = LLURI(login_page);
@@ -914,20 +930,20 @@ void LLPanelLogin::loadLoginPage()
// Language
std::string language = LLUI::getLanguage();
oStr << first_query_delimiter<<"lang=" << language;
login_uri << first_query_delimiter<<"lang=" << language;
// First Login?
if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
{
oStr << "&firstlogin=TRUE";
login_uri << "&firstlogin=TRUE";
}
std::string version = llformat("%d.%d.%d (%d)",
gVersionMajor, gVersionMinor, gVersionPatch, gVersionBuild);
if(login_page.find("secondlife.com") == -1) {
oStr << "&channel=" << LLWeb::curlEscape(gVersionChannel);
oStr << "&version=" << LLWeb::curlEscape(version);
login_uri << "&channel=" << LLWeb::curlEscape(gVersionChannel);
login_uri << "&version=" << LLWeb::curlEscape(version);
}
// Grid
@@ -944,16 +960,16 @@ void LLPanelLogin::loadLoginPage()
i = tmp.rfind('/');
if (i != std::string::npos) {
tmp = tmp.substr(i+1);
oStr << "&grid=" << LLWeb::curlEscape(tmp);
login_uri << "&grid=" << LLWeb::curlEscape(tmp);
}
}
}
else if (gHippoGridManager->getConnectedGrid()->isOpenSimulator()){
oStr << "&grid=" << gHippoGridManager->getConnectedGrid()->getGridNick();
login_uri << "&grid=" << gHippoGridManager->getConnectedGrid()->getGridNick();
}
else if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_AURORA)
{
oStr << "&grid=" << LLWeb::curlEscape(LLViewerLogin::getInstance()->getGridLabel());
login_uri << "&grid=" << LLWeb::curlEscape(LLViewerLogin::getInstance()->getGridLabel());
}
@@ -1011,59 +1027,47 @@ void LLPanelLogin::loadLoginPage()
std::string curl_region = LLWeb::curlEscape(region);
oStr <<"firstname=" << firstname <<
login_uri <<"firstname=" << firstname <<
"&lastname=" << lastname << "&location=" << location << "&region=" << curl_region;
if (!password.empty())
{
oStr << "&password=" << password;
login_uri << "&password=" << password;
}
else if (!(password = load_password_from_disk()).empty())
{
oStr << "&password=$1$" << password;
login_uri << "&password=$1$" << password;
}
if (gAutoLogin)
{
oStr << "&auto_login=TRUE";
login_uri << "&auto_login=TRUE";
}
if (gSavedSettings.getBOOL("ShowStartLocation"))
{
oStr << "&show_start_location=TRUE";
login_uri << "&show_start_location=TRUE";
}
if (gSavedSettings.getBOOL("RememberPassword"))
{
oStr << "&remember_password=TRUE";
login_uri << "&remember_password=TRUE";
}
BOOL show_server = sInstance ? sInstance->mShowServerCombo : FALSE;
if (show_server || gSavedSettings.getBOOL("ForceShowGrid"))
{
oStr << "&show_grid=TRUE";
login_uri << "&show_grid=TRUE";
}
#endif
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
// navigate to the "real" page
web_browser->navigateTo( oStr.str(), "text/html" );
if (web_browser->getCurrentNavUrl() != login_uri.str())
{
LL_DEBUGS("AppInit") << "loading: " << login_uri << LL_ENDL;
web_browser->navigateTo( login_uri.str(), "text/html" );
}
}
void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
{
if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
{
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
if (web_browser)
{
// *HACK HACK HACK HACK!
/* Stuff a Tab key into the browser now so that the first field will
** get the focus! The embedded javascript on the page that properly
** sets the initial focus in a real web browser is not working inside
** the viewer, so this is an UGLY HACK WORKAROUND for now.
*/
// Commented out as it's not reliable
//web_browser->handleKey(KEY_TAB, MASK_NONE, false);
}
}
}
@@ -1141,7 +1145,7 @@ bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD&
// static
void LLPanelLogin::onClickNewAccount(void*)
void LLPanelLogin::onClickNewAccount()
{
const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterUrl();
if (!url.empty()) {
@@ -1191,7 +1195,7 @@ void LLPanelLogin::onClickVersion(void*)
}
//static
void LLPanelLogin::onClickForgotPassword(void*)
void LLPanelLogin::onClickForgotPassword()
{
if (sInstance )
{
@@ -1205,7 +1209,7 @@ void LLPanelLogin::onClickForgotPassword(void*)
}
// static
void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
void LLPanelLogin::onPassKey(LLLineEditor* caller)
{
if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE)
{

View File

@@ -103,15 +103,16 @@ public:
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
private:
void reshapeBrowser();
static void onClickConnect(void*);
static void onClickNewAccount(void*);
static void onClickNewAccount();
static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response);
static void onClickGrids(void*);
static void onSelectGrid(LLUICtrl *ctrl, void*);
static void onClickQuit(void*);
static void onClickVersion(void*);
static void onClickForgotPassword(void*);
static void onPassKey(LLLineEditor* caller, void* user_data);
static void onClickForgotPassword();
static void onPassKey(LLLineEditor* caller);
//static void onSelectServer(LLUICtrl*, void*);
//static void onServerComboLostFocus(LLFocusableElement*, void*);
static void onSelectLoginEntry(LLUICtrl*, void*);

View File

@@ -30,6 +30,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "lleconomy.h"
#include "llfiltereditor.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llinventorymodelbackgroundfetch.h"
@@ -198,10 +199,10 @@ BOOL LLInventoryView::postBuild()
}
mSearchEditor = getChild<LLSearchEditor>("inventory search editor");
if (mSearchEditor)
mFilterEditor = getChild<LLFilterEditor>("inventory search editor");
if (mFilterEditor)
{
mSearchEditor->setSearchCallback(onSearchEdit, this);
mFilterEditor->setCommitCallback(boost::bind(&LLInventoryView::onFilterEdit, this, _2));
}
mQuickFilterCombo = getChild<LLComboBox>("Quick Filter");
@@ -281,9 +282,9 @@ LLInventoryView::~LLInventoryView( void )
void LLInventoryView::startSearch()
{
// this forces focus to line editor portion of search editor
if (mSearchEditor)
if (mFilterEditor)
{
mSearchEditor->focusFirstItem(TRUE);
mFilterEditor->focusFirstItem(TRUE);
}
}
@@ -338,8 +339,8 @@ BOOL LLInventoryView::handleKeyHere(KEY key, MASK mask)
if (root_folder)
{
// first check for user accepting current search results
if (mSearchEditor
&& mSearchEditor->hasFocus()
if (mFilterEditor
&& mFilterEditor->hasFocus()
&& (key == KEY_RETURN
|| key == KEY_DOWN)
&& mask == MASK_NONE)
@@ -513,17 +514,13 @@ BOOL LLInventoryView::filtersVisible(void* user_data)
return self->getFinder() != NULL;
}
// static
void LLInventoryView::onClearSearch(void* user_data)
void LLInventoryView::onClearSearch()
{
LLInventoryView* self = (LLInventoryView*)user_data;
if(!self) return;
LLFloater *finder = self->getFinder();
if (self->mActivePanel)
LLFloater *finder = getFinder();
if (mActivePanel)
{
self->mActivePanel->setFilterSubString(LLStringUtil::null);
self->mActivePanel->setFilterTypes(0xffffffff);
mActivePanel->setFilterSubString(LLStringUtil::null);
mActivePanel->setFilterTypes(0xffffffffffffffffULL);
}
if (finder)
@@ -532,26 +529,24 @@ void LLInventoryView::onClearSearch(void* user_data)
}
// re-open folders that were initially open
if (self->mActivePanel)
if (mActivePanel)
{
self->mSavedFolderState->setApply(TRUE);
self->mActivePanel->getRootFolder()->applyFunctorRecursively(*self->mSavedFolderState);
mSavedFolderState->setApply(TRUE);
mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
LLOpenFoldersWithSelection opener;
self->mActivePanel->getRootFolder()->applyFunctorRecursively(opener);
self->mActivePanel->getRootFolder()->scrollToShowSelection();
mActivePanel->getRootFolder()->applyFunctorRecursively(opener);
mActivePanel->getRootFolder()->scrollToShowSelection();
}
//self->mFilterSubString = "";
}
//static
void LLInventoryView::onSearchEdit(const std::string& search_string, void* user_data )
void LLInventoryView::onFilterEdit(const std::string& search_string )
{
if (search_string == "")
{
onClearSearch(user_data);
onClearSearch();
}
LLInventoryView* self = (LLInventoryView*)user_data;
if (!self->mActivePanel)
if (!mActivePanel)
{
return;
}
@@ -562,21 +557,21 @@ void LLInventoryView::onSearchEdit(const std::string& search_string, void* user_
std::string filter_text = search_string;
std::string uppercase_search_string = filter_text;
LLStringUtil::toUpper(uppercase_search_string);
if (self->mActivePanel->getFilterSubString().empty() && uppercase_search_string.empty() /*self->mFilterSubString.empty()*/)
if (mActivePanel->getFilterSubString().empty() && uppercase_search_string.empty() /*self->mFilterSubString.empty()*/)
{
// current filter and new filter empty, do nothing
return;
}
// save current folder open state if no filter currently applied
if (!self->mActivePanel->getRootFolder()->isFilterModified())
if (!mActivePanel->getRootFolder()->isFilterModified())
{
self->mSavedFolderState->setApply(FALSE);
self->mActivePanel->getRootFolder()->applyFunctorRecursively(*self->mSavedFolderState);
mSavedFolderState->setApply(FALSE);
mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
}
// set new filter string
self->mActivePanel->setFilterSubString(uppercase_search_string/*self->mFilterSubString*/);
mActivePanel->setFilterSubString(uppercase_search_string/*self->mFilterSubString*/);
}
struct FilterEntry : public LLDictionaryEntry
@@ -726,11 +721,11 @@ void LLInventoryView::onResetAll(void* userdata)
{
return;
}
if (self->mActivePanel && self->mSearchEditor)
if (self->mActivePanel && self->mFilterEditor)
{
self->mSearchEditor->setText(LLStringUtil::null);
self->mFilterEditor->setText(LLStringUtil::null);
}
self->onSearchEdit("",userdata);
self->onFilterEdit("");
self->mActivePanel->closeAllFolders();
}
@@ -827,9 +822,9 @@ void LLInventoryView::changed(U32 mask)
void LLInventoryView::draw()
{
if (mActivePanel && mSearchEditor)
if (mActivePanel && mFilterEditor)
{
mSearchEditor->setText(mActivePanel->getFilterSubString());
mFilterEditor->setText(mActivePanel->getFilterSubString());
}
if (mActivePanel && mQuickFilterCombo)
@@ -989,55 +984,56 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
// update the ui elements
LLFloater::setTitle(mFilter->getName());
childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION));
childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD));
childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE));
childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE));
childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK));
childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD));
childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT));
childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL));
childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND));
childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE));
childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT));
childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS);
childSetValue("check_since_logoff", mFilter->isSinceLogoff());
getChild<LLUICtrl>("check_animation")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION));
getChild<LLUICtrl>("check_calling_card")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD));
getChild<LLUICtrl>("check_clothing")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE));
getChild<LLUICtrl>("check_gesture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE));
getChild<LLUICtrl>("check_landmark")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK));
getChild<LLUICtrl>("check_notecard")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD));
getChild<LLUICtrl>("check_object")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT));
getChild<LLUICtrl>("check_script")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LSL));
getChild<LLUICtrl>("check_sound")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND));
getChild<LLUICtrl>("check_texture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE));
getChild<LLUICtrl>("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT));
getChild<LLUICtrl>("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS);
getChild<LLUICtrl>("check_since_logoff")->setValue(mFilter->isSinceLogoff());
mSpinSinceHours->set((F32)(hours % 24));
mSpinSinceDays->set((F32)(hours / 24));
}
void LLFloaterInventoryFinder::draw()
{
U32 filter = 0xffffffff;
U64 filter = 0xffffffffffffffffULL;
BOOL filtered_by_all_types = TRUE;
if (!childGetValue("check_animation"))
if (!getChild<LLUICtrl>("check_animation")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_ANIMATION);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_calling_card"))
if (!getChild<LLUICtrl>("check_calling_card")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_clothing"))
if (!getChild<LLUICtrl>("check_clothing")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_WEARABLE);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_gesture"))
if (!getChild<LLUICtrl>("check_gesture")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_GESTURE);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_landmark"))
if (!getChild<LLUICtrl>("check_landmark")->getValue())
{
@@ -1045,38 +1041,39 @@ void LLFloaterInventoryFinder::draw()
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_notecard"))
if (!getChild<LLUICtrl>("check_notecard")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_NOTECARD);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_object"))
if (!getChild<LLUICtrl>("check_object")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_OBJECT);
filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_script"))
if (!getChild<LLUICtrl>("check_script")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_LSL);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_sound"))
if (!getChild<LLUICtrl>("check_sound")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SOUND);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_texture"))
if (!getChild<LLUICtrl>("check_texture")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_TEXTURE);
filtered_by_all_types = FALSE;
}
if (!childGetValue("check_snapshot"))
if (!getChild<LLUICtrl>("check_snapshot")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT);
filtered_by_all_types = FALSE;
@@ -1131,12 +1128,12 @@ void LLFloaterInventoryFinder::onClose(bool app_quitting)
BOOL LLFloaterInventoryFinder::getCheckShowEmpty()
{
return childGetValue("check_show_empty");
return getChild<LLUICtrl>("check_show_empty")->getValue();
}
BOOL LLFloaterInventoryFinder::getCheckSinceLogoff()
{
return childGetValue("check_since_logoff");
return getChild<LLUICtrl>("check_since_logoff")->getValue();
}
void LLFloaterInventoryFinder::onCloseBtn(void* user_data)
@@ -1151,17 +1148,17 @@ void LLFloaterInventoryFinder::selectAllTypes(void* user_data)
LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data;
if(!self) return;
self->childSetValue("check_animation", TRUE);
self->childSetValue("check_calling_card", TRUE);
self->childSetValue("check_clothing", TRUE);
self->childSetValue("check_gesture", TRUE);
self->childSetValue("check_landmark", TRUE);
self->childSetValue("check_notecard", TRUE);
self->childSetValue("check_object", TRUE);
self->childSetValue("check_script", TRUE);
self->childSetValue("check_sound", TRUE);
self->childSetValue("check_texture", TRUE);
self->childSetValue("check_snapshot", TRUE);
self->getChild<LLUICtrl>("check_animation")->setValue(TRUE);
self->getChild<LLUICtrl>("check_calling_card")->setValue(TRUE);
self->getChild<LLUICtrl>("check_clothing")->setValue(TRUE);
self->getChild<LLUICtrl>("check_gesture")->setValue(TRUE);
self->getChild<LLUICtrl>("check_landmark")->setValue(TRUE);
self->getChild<LLUICtrl>("check_notecard")->setValue(TRUE);
self->getChild<LLUICtrl>("check_object")->setValue(TRUE);
self->getChild<LLUICtrl>("check_script")->setValue(TRUE);
self->getChild<LLUICtrl>("check_sound")->setValue(TRUE);
self->getChild<LLUICtrl>("check_texture")->setValue(TRUE);
self->getChild<LLUICtrl>("check_snapshot")->setValue(TRUE);
}
//static
@@ -1170,15 +1167,15 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data)
LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data;
if(!self) return;
self->childSetValue("check_animation", FALSE);
self->childSetValue("check_calling_card", FALSE);
self->childSetValue("check_clothing", FALSE);
self->childSetValue("check_gesture", FALSE);
self->childSetValue("check_landmark", FALSE);
self->childSetValue("check_notecard", FALSE);
self->childSetValue("check_object", FALSE);
self->childSetValue("check_script", FALSE);
self->childSetValue("check_sound", FALSE);
self->childSetValue("check_texture", FALSE);
self->childSetValue("check_snapshot", FALSE);
self->getChild<LLUICtrl>("check_animation")->setValue(FALSE);
self->getChild<LLUICtrl>("check_calling_card")->setValue(FALSE);
self->getChild<LLUICtrl>("check_clothing")->setValue(FALSE);
self->getChild<LLUICtrl>("check_gesture")->setValue(FALSE);
self->getChild<LLUICtrl>("check_landmark")->setValue(FALSE);
self->getChild<LLUICtrl>("check_notecard")->setValue(FALSE);
self->getChild<LLUICtrl>("check_object")->setValue(FALSE);
self->getChild<LLUICtrl>("check_script")->setValue(FALSE);
self->getChild<LLUICtrl>("check_sound")->setValue(FALSE);
self->getChild<LLUICtrl>("check_texture")->setValue(FALSE);
self->getChild<LLUICtrl>("check_snapshot")->setValue(FALSE);
}

View File

@@ -42,7 +42,7 @@ class LLMenuButton;
class LLMenuGL;
class LLToggleableMenu;
class LLFloater;
class LLSearchEditor;
class LLFilterEditor;
class LLComboBox;
class LLFloaterInventoryFinder;
@@ -91,7 +91,7 @@ public:
const std::string& getFilterText() const { return mFilterText; }
void setSelectCallback(const LLFolderView::signal_t::slot_type& cb);
static void onSearchEdit(const std::string& search_string, void* user_data );
void onFilterEdit(const std::string& search_string);
//
// Misc functions
//
@@ -102,7 +102,7 @@ public:
void onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action);
static BOOL filtersVisible(void* user_data);
static void onClearSearch(void* user_data);
void onClearSearch();
static void onFoldersByName(void *user_data);
static BOOL checkFoldersByName(void *user_data);
@@ -161,7 +161,7 @@ protected:
protected:
LLFloaterInventoryFinder* getFinder();
LLSearchEditor* mSearchEditor;
LLFilterEditor* mFilterEditor;
LLComboBox* mQuickFilterCombo;
LLTabContainer* mFilterTabs;
LLHandle<LLFloater> mFinderHandle;

View File

@@ -90,9 +90,9 @@ LLPanelPermissions::LLPanelPermissions(const std::string& title) :
BOOL LLPanelPermissions::postBuild()
{
childSetCommitCallback("Object Name",LLPanelPermissions::onCommitName,this);
childSetPrevalidate("Object Name",LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("Object Name")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
childSetCommitCallback("Object Description",LLPanelPermissions::onCommitDesc,this);
childSetPrevalidate("Object Description",LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("Object Description")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
childSetAction("button owner profile",LLPanelPermissions::onClickOwner,this);
@@ -115,7 +115,7 @@ BOOL LLPanelPermissions::postBuild()
childSetCommitCallback("checkbox for sale",LLPanelPermissions::onCommitSaleInfo,this);
childSetCommitCallback("Edit Cost",LLPanelPermissions::onCommitSaleInfo,this);
childSetPrevalidate("Edit Cost",LLLineEditor::prevalidateNonNegativeS32);
getChild<LLLineEditor>("Edit Cost")->setPrevalidate(&LLLineEditor::prevalidateNonNegativeS32);
childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this);
@@ -124,17 +124,8 @@ BOOL LLPanelPermissions::postBuild()
childSetCommitCallback("checkbox next owner can transfer",LLPanelPermissions::onCommitNextOwnerTransfer,this);
childSetCommitCallback("clickaction",LLPanelPermissions::onCommitClickAction,this);
childSetCommitCallback("search_check",LLPanelPermissions::onCommitIncludeInSearch,this);
LLTextBox* group_rect_proxy = getChild<LLTextBox>("Group Name Proxy");
if(group_rect_proxy )
{
mLabelGroupName = new LLNameBox("Group Name", group_rect_proxy->getRect());
addChild(mLabelGroupName);
}
else
{
mLabelGroupName = NULL;
}
mLabelGroupName = getChild<LLNameBox>("Group Name Proxy");
return TRUE;
}
@@ -146,6 +137,99 @@ LLPanelPermissions::~LLPanelPermissions()
}
void LLPanelPermissions::disableAll()
{
getChildView("perm_modify")->setEnabled(FALSE);
getChild<LLUICtrl>("perm_modify")->setValue(LLStringUtil::null);
getChildView("pathfinding_attributes_value")->setEnabled(FALSE);
getChild<LLUICtrl>("pathfinding_attributes_value")->setValue(LLStringUtil::null);
getChildView("Creator:")->setEnabled(FALSE);
getChild<LLUICtrl>("Creator Name")->setValue(LLStringUtil::null);
getChildView("Creator Name")->setEnabled(FALSE);
getChildView("button creator profile")->setEnabled(FALSE);
getChildView("Owner:")->setEnabled(FALSE);
getChild<LLUICtrl>("Owner Name")->setValue(LLStringUtil::null);
getChildView("Owner Name")->setEnabled(FALSE);
getChildView("button owner profile")->setEnabled(FALSE);
getChildView("Last Owner:")->setEnabled(FALSE);
getChild<LLUICtrl>("Last Owner Name")->setValue(LLStringUtil::null);
getChildView("Last Owner Name")->setEnabled(FALSE);
getChildView("button last owner profile")->setEnabled(FALSE);
getChildView("Group:")->setEnabled(FALSE);
getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null);
getChildView("Group Name")->setEnabled(FALSE);
getChildView("button set group")->setEnabled(FALSE);
getChildView("button open group")->setEnabled(FALSE);
getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null);
getChildView("Object Name")->setEnabled(FALSE);
getChildView("Name:")->setEnabled(FALSE);
getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null);
getChildView("Group Name")->setEnabled(FALSE);
getChildView("Description:")->setEnabled(FALSE);
getChild<LLUICtrl>("Object Description")->setValue(LLStringUtil::null);
getChildView("Object Description")->setEnabled(FALSE);
getChildView("Permissions:")->setEnabled(FALSE);
getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE);
getChildView("checkbox share with group")->setEnabled(FALSE);
getChildView("button deed")->setEnabled(FALSE);
getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE);
getChildView("checkbox allow everyone move")->setEnabled(FALSE);
getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE);
getChildView("checkbox allow everyone copy")->setEnabled(FALSE);
//Next owner can:
getChildView("Next owner can:")->setEnabled(FALSE);
getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE);
getChildView("checkbox next owner can modify")->setEnabled(FALSE);
getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE);
getChildView("checkbox next owner can copy")->setEnabled(FALSE);
getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE);
getChildView("checkbox next owner can transfer")->setEnabled(FALSE);
//checkbox for sale
getChild<LLUICtrl>("checkbox for sale")->setValue(FALSE);
getChildView("checkbox for sale")->setEnabled(FALSE);
//checkbox include in search
getChild<LLUICtrl>("search_check")->setValue(FALSE);
getChildView("search_check")->setEnabled(FALSE);
LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type");
if(RadioSaleType)
{
RadioSaleType->setSelectedIndex(-1);
RadioSaleType->setEnabled(FALSE);
}
getChildView("Cost")->setEnabled(FALSE);
getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default"));
getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null);
getChildView("Edit Cost")->setEnabled(FALSE);
getChildView("label click action")->setEnabled(FALSE);
LLComboBox* combo_click_action = getChild<LLComboBox>("clickaction");
if (combo_click_action)
{
combo_click_action->setEnabled(FALSE);
combo_click_action->clear();
}
getChildView("B:")->setVisible( FALSE);
getChildView("O:")->setVisible( FALSE);
getChildView("G:")->setVisible( FALSE);
getChildView("E:")->setVisible( FALSE);
getChildView("N:")->setVisible( FALSE);
getChildView("F:")->setVisible( FALSE);
}
void LLPanelPermissions::refresh()
{
@@ -184,93 +268,7 @@ void LLPanelPermissions::refresh()
if(!nodep || !objectp)// || attachment_selected)
{
// ...nothing selected
childSetEnabled("perm_modify",false);
childSetText("perm_modify",LLStringUtil::null);
childSetEnabled("Creator:",false);
childSetText("Creator Name",LLStringUtil::null);
childSetEnabled("Creator Name",false);
childSetEnabled("button creator profile",false);
childSetEnabled("Owner:",false);
childSetText("Owner Name",LLStringUtil::null);
childSetEnabled("Owner Name",false);
childSetEnabled("button owner profile",false);
childSetEnabled("Last Owner:",false);
childSetText("Last Owner Name",LLStringUtil::null);
childSetEnabled("Last Owner Name",false);
childSetEnabled("button last owner profile",false);
childSetEnabled("Group:",false);
childSetText("Group Name",LLStringUtil::null);
childSetEnabled("Group Name",false);
childSetEnabled("button set group",false);
childSetEnabled("button open group",false);
childSetText("Object Name",LLStringUtil::null);
childSetEnabled("Object Name",false);
childSetEnabled("Name:",false);
childSetText("Group Name",LLStringUtil::null);
childSetEnabled("Group Name",false);
childSetEnabled("Description:",false);
childSetText("Object Description",LLStringUtil::null);
childSetEnabled("Object Description",false);
childSetEnabled("Permissions:",false);
childSetValue("checkbox share with group",FALSE);
childSetEnabled("checkbox share with group",false);
childSetEnabled("button deed",false);
childSetValue("checkbox allow everyone move",FALSE);
childSetEnabled("checkbox allow everyone move",false);
childSetValue("checkbox allow everyone copy",FALSE);
childSetEnabled("checkbox allow everyone copy",false);
//Next owner can:
childSetEnabled("Next owner can:",false);
childSetValue("checkbox next owner can modify",FALSE);
childSetEnabled("checkbox next owner can modify",false);
childSetValue("checkbox next owner can copy",FALSE);
childSetEnabled("checkbox next owner can copy",false);
childSetValue("checkbox next owner can transfer",FALSE);
childSetEnabled("checkbox next owner can transfer",false);
//checkbox for sale
childSetValue("checkbox for sale",FALSE);
childSetEnabled("checkbox for sale",false);
//checkbox include in search
childSetValue("search_check", FALSE);
childSetEnabled("search_check", false);
LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type");
if(RadioSaleType)
{
RadioSaleType->setSelectedIndex(-1);
RadioSaleType->setEnabled(FALSE);
}
childSetEnabled("Cost",false);
childSetText("Cost", getString("Cost Default", argsCurrency));
childSetText("Edit Cost",LLStringUtil::null);
childSetEnabled("Edit Cost",false);
childSetEnabled("label click action",false);
LLComboBox* ComboClickAction = getChild<LLComboBox>("clickaction");
if(ComboClickAction)
{
ComboClickAction->setEnabled(FALSE);
ComboClickAction->clear();
}
childSetVisible("B:",false);
childSetVisible("O:",false);
childSetVisible("G:",false);
childSetVisible("E:",false);
childSetVisible("N:",false);
childSetVisible("F:",false);
disableAll();
return;
}
@@ -308,8 +306,8 @@ void LLPanelPermissions::refresh()
{
++string_index;
}
childSetEnabled("perm_modify",true);
childSetText("perm_modify",MODIFY_INFO_STRINGS[string_index]);
getChildView("perm_modify")->setEnabled(TRUE);
getChild<LLUICtrl>("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]);
std::string pfAttrName;
@@ -339,19 +337,19 @@ void LLPanelPermissions::refresh()
getChildView("pathfinding_attributes_value")->setEnabled(TRUE);
getChild<LLUICtrl>("pathfinding_attributes_value")->setValue(LLTrans::getString(pfAttrName));
childSetEnabled("Permissions:",true);
getChildView("Permissions:")->setEnabled(TRUE);
// Update creator text field
childSetEnabled("Creator:",true);
getChildView("Creator:")->setEnabled(TRUE);
std::string creator_name;
bool creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name);
childSetText("Creator Name",creator_name);
childSetEnabled("Creator Name",TRUE);
childSetEnabled("button creator profile", creators_identical && mCreatorID.notNull() );
getChild<LLUICtrl>("Creator Name")->setValue(creator_name);
getChildView("Creator Name")->setEnabled(TRUE);
getChildView("button creator profile")->setEnabled(creators_identical && mCreatorID.notNull());
// Update owner text field
childSetEnabled("Owner:",true);
getChildView("Owner:")->setEnabled(TRUE);
std::string owner_name;
const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name);
@@ -395,21 +393,21 @@ void LLPanelPermissions::refresh()
}
// [/RLVa:KB]
childSetText("Owner Name",owner_name);
childSetEnabled("Owner Name",TRUE);
getChild<LLUICtrl>("Owner Name")->setValue(owner_name);
getChildView("Owner Name")->setEnabled(TRUE);
// childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned()));
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
childSetEnabled("button owner profile",
fRlvEnableOwner && owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned()));
// [/RLVa:KB]
childSetText("Last Owner Name",last_owner_name);
childSetEnabled("Last Owner Name",TRUE);
childSetEnabled("button last owner profile",owners_identical && mLastOwnerID.notNull());
getChild<LLUICtrl>("Last Owner Name")->setValue(last_owner_name);
getChildView("Last Owner Name")->setEnabled(TRUE);
getChildView("button last owner profile")->setEnabled(owners_identical && mLastOwnerID.notNull());
// update group text field
childSetEnabled("Group:",true);
childSetText("Group Name",LLStringUtil::null);
getChildView("Group:")->setEnabled(TRUE);
getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null);
LLUUID group_id;
BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id);
if (groups_identical)
@@ -425,31 +423,24 @@ void LLPanelPermissions::refresh()
if(mLabelGroupName)
{
mLabelGroupName->setNameID(LLUUID::null, TRUE);
mLabelGroupName->refresh(LLUUID::null, LLStringUtil::null, true);
mLabelGroupName->refresh(LLUUID::null, std::string(), true);
mLabelGroupName->setEnabled(FALSE);
}
}
childSetEnabled("button set group",root_selected && owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
childSetEnabled("button open group", group_id.notNull());
getChildView("button set group")->setEnabled(root_selected && owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
getChildView("button open group")->setEnabled(group_id.notNull());
// figure out the contents of the name, description, & category
BOOL edit_name_desc = FALSE;
if(is_one_object && objectp->permModify() && !objectp->isPermanentEnforced())
{
edit_name_desc = TRUE;
}
childSetEnabled("Name:",true);
getChildView("Name:")->setEnabled(TRUE);
LLLineEditor* LineEditorObjectName = getChild<LLLineEditor>("Object Name");
childSetEnabled("Description:",true);
LLLineEditor* LineEditorObjectDesc = getChild<LLLineEditor>("Object Description");
getChildView("Description:")->setEnabled(TRUE);
LLLineEditor* LineEditorObjectDesc = getChild<LLLineEditor>("Object Description");
if(is_one_object)
{
if(keyboard_focus_view != LineEditorObjectName)
{
childSetText("Object Name",nodep->mName);
getChild<LLUICtrl>("Object Name")->setValue(nodep->mName);
}
if(LineEditorObjectDesc)
@@ -462,19 +453,25 @@ void LLPanelPermissions::refresh()
}
else
{
childSetText("Object Name",LLStringUtil::null);
getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null);
LineEditorObjectDesc->setText(LLStringUtil::null);
}
// figure out the contents of the name, description, & category
BOOL edit_name_desc = FALSE;
if(is_one_object && objectp->permModify() && !objectp->isPermanentEnforced())
{
edit_name_desc = TRUE;
}
if(edit_name_desc)
{
childSetEnabled("Object Name",true);
childSetEnabled("Object Description",true);
getChildView("Object Name")->setEnabled(TRUE);
getChildView("Object Description")->setEnabled(TRUE);
}
else
{
childSetEnabled("Object Name",false);
childSetEnabled("Object Description",false);
getChildView("Object Name")->setEnabled(FALSE);
getChildView("Object Description")->setEnabled(FALSE);
}
S32 total_sale_price = 0;
@@ -494,11 +491,11 @@ void LLPanelPermissions::refresh()
const BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer();
const BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy();
if(!owners_identical)
if (!owners_identical)
{
childSetEnabled("Cost",false);
childSetText("Edit Cost",LLStringUtil::null);
childSetEnabled("Edit Cost",false);
getChildView("Cost")->setEnabled(FALSE);
getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null);
getChildView("Edit Cost")->setEnabled(FALSE);
}
// You own these objects.
else if(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE)))
@@ -506,63 +503,63 @@ void LLPanelPermissions::refresh()
// If there are multiple items for sale then set text to PRICE PER UNIT.
if (num_for_sale > 1)
{
childSetText("Cost",getString("Cost Per Unit", argsCurrency));
getChild<LLUICtrl>("Cost")->setValue(getString("Cost Per Unit"));
}
else
{
childSetText("Cost",getString("Cost Default", argsCurrency));
getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default"));
}
LLLineEditor *editPrice = getChild<LLLineEditor>("Edit Cost");
if(keyboard_focus_view != editPrice)
LLLineEditor *edit_price = getChild<LLLineEditor>("Edit Cost");
if(keyboard_focus_view != edit_price)
{
// If the sale price is mixed then set the cost to MIXED, otherwise
// set to the actual cost.
if (num_for_sale > 0 && is_for_sale_mixed)
{
childSetText("Edit Cost",getString("Sale Mixed"));
edit_price->setValue(getString("Sale Mixed"));
}
else if (num_for_sale > 0 && is_sale_price_mixed)
{
childSetText("Edit Cost",getString("Cost Mixed"));
edit_price->setValue(getString("Cost Mixed"));
}
else
{
childSetText("Edit Cost",llformat("%d",individual_sale_price));
edit_price->setValue(individual_sale_price);
}
}
// The edit fields are only enabled if you can sell this object
// and the sale price is not mixed.
bool enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : false;
childSetEnabled("Cost",enable_edit);
childSetEnabled("Edit Cost",enable_edit);
BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE;
getChildView("Cost")->setEnabled(enable_edit);
getChildView("Edit Cost")->setEnabled(enable_edit);
}
// Someone, not you, owns these objects.
else if(!public_owned)
{
childSetEnabled("Cost",false);
childSetEnabled("Edit Cost",false);
getChildView("Cost")->setEnabled(FALSE);
getChildView("Edit Cost")->setEnabled(FALSE);
// Don't show a price if none of the items are for sale.
if (num_for_sale)
childSetText("Edit Cost",llformat("%d",total_sale_price));
getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",total_sale_price));
else
childSetText("Edit Cost",LLStringUtil::null);
getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null);
// If multiple items are for sale, set text to TOTAL PRICE.
if (num_for_sale > 1)
childSetText("Cost", getString("Cost Total", argsCurrency));
getChild<LLUICtrl>("Cost")->setValue(getString("Cost Total", argsCurrency));
else
childSetText("Cost", getString("Cost Default", argsCurrency));
getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default", argsCurrency));
}
// This is a public object.
else
{
childSetEnabled("Cost",false);
childSetText("Cost", getString("Cost Default", argsCurrency));
getChildView("Cost")->setEnabled(FALSE);
getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default", argsCurrency));
childSetText("Edit Cost",LLStringUtil::null);
childSetEnabled("Edit Cost",false);
getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null);
getChildView("Edit Cost")->setEnabled(FALSE);
}
// Enable and disable the permissions checkboxes
@@ -605,11 +602,9 @@ void LLPanelPermissions::refresh()
if( gSavedSettings.getBOOL("DebugPermissions") )
{
childSetVisible("perm_modify", false);
std::string perm_string;
if (valid_base_perms)
{
perm_string = "B: ";
perm_string += mask_to_string(base_mask_on);
std::string perm_string = mask_to_string(base_mask_on);
if (U32 diff_mask = base_mask_on ^ owner_mask_on) // When different, show the user's potential permissions lowercase.
{
if (diff_mask & PERM_MOVE)
@@ -621,217 +616,209 @@ void LLPanelPermissions::refresh()
if (diff_mask & PERM_TRANSFER)
LLStringUtil::replaceChar(perm_string, 'T', 't');
}
childSetText("B:",perm_string);
childSetVisible("B:",true);
getChild<LLUICtrl>("B:")->setValue("B: " + perm_string);
getChildView("B:")->setVisible( TRUE);
perm_string = "O: ";
perm_string += mask_to_string(owner_mask_on);
childSetText("O:",perm_string);
childSetVisible("O:",true);
getChild<LLUICtrl>("O:")->setValue("O: " + mask_to_string(owner_mask_on));
getChildView("O:")->setVisible( TRUE);
perm_string = "G: ";
perm_string += mask_to_string(group_mask_on);
childSetText("G:",perm_string);
childSetVisible("G:",true);
getChild<LLUICtrl>("G:")->setValue("G: " + mask_to_string(group_mask_on));
getChildView("G:")->setVisible( TRUE);
perm_string = "E: ";
perm_string += mask_to_string(everyone_mask_on);
childSetText("E:",perm_string);
childSetVisible("E:",true);
getChild<LLUICtrl>("E:")->setValue("E: " + mask_to_string(everyone_mask_on));
getChildView("E:")->setVisible( TRUE);
perm_string = "N: ";
perm_string += mask_to_string(next_owner_mask_on);
childSetText("N:",perm_string);
childSetVisible("N:",true);
getChild<LLUICtrl>("N:")->setValue("N: " + mask_to_string(next_owner_mask_on));
getChildView("N:")->setVisible( TRUE);
}
perm_string = "F: ";
U32 flag_mask = 0x0;
if (objectp->permMove()) flag_mask |= PERM_MOVE;
if (objectp->permModify()) flag_mask |= PERM_MODIFY;
if (objectp->permCopy()) flag_mask |= PERM_COPY;
if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER;
perm_string += mask_to_string(flag_mask);
childSetText("F:",perm_string);
childSetVisible("F:",true);
if (objectp->permMove()) flag_mask |= PERM_MOVE;
if (objectp->permModify()) flag_mask |= PERM_MODIFY;
if (objectp->permCopy()) flag_mask |= PERM_COPY;
if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER;
getChild<LLUICtrl>("F:")->setValue("F:" + mask_to_string(flag_mask));
getChildView("F:")->setVisible( TRUE);
}
else
{
childSetVisible("perm_modify", true);
childSetVisible("B:",false);
childSetVisible("O:",false);
childSetVisible("G:",false);
childSetVisible("E:",false);
childSetVisible("N:",false);
childSetVisible("F:",false);
getChildView("B:")->setVisible( FALSE);
getChildView("O:")->setVisible( FALSE);
getChildView("G:")->setVisible( FALSE);
getChildView("E:")->setVisible( FALSE);
getChildView("N:")->setVisible( FALSE);
getChildView("F:")->setVisible( FALSE);
}
bool has_change_perm_ability = false;
bool has_change_sale_ability = false;
BOOL has_change_perm_ability = FALSE;
BOOL has_change_sale_ability = FALSE;
if(valid_base_perms && is_nonpermanent_enforced &&
if (valid_base_perms && is_nonpermanent_enforced &&
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE))))
{
has_change_perm_ability = true;
has_change_perm_ability = TRUE;
}
if(valid_base_perms && is_nonpermanent_enforced &&
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
if (valid_base_perms && is_nonpermanent_enforced &&
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
{
has_change_sale_ability = true;
has_change_sale_ability = TRUE;
}
if (!has_change_perm_ability && !has_change_sale_ability && !root_selected)
{
// ...must select root to choose permissions
childSetValue("perm_modify", getString("text modify warning"));
getChild<LLUICtrl>("perm_modify")->setValue(getString("text modify warning"));
}
if (has_change_perm_ability)
{
childSetEnabled("checkbox share with group",true);
childSetEnabled("checkbox allow everyone move",owner_mask_on & PERM_MOVE);
childSetEnabled("checkbox allow everyone copy",owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER);
getChildView("checkbox share with group")->setEnabled(TRUE);
getChildView("checkbox allow everyone move")->setEnabled(owner_mask_on & PERM_MOVE);
getChildView("checkbox allow everyone copy")->setEnabled(owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER);
}
else
{
childSetEnabled("checkbox share with group", FALSE);
childSetEnabled("checkbox allow everyone move", FALSE);
childSetEnabled("checkbox allow everyone copy", FALSE);
getChildView("checkbox share with group")->setEnabled(FALSE);
getChildView("checkbox allow everyone move")->setEnabled(FALSE);
getChildView("checkbox allow everyone copy")->setEnabled(FALSE);
}
if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER))
{
childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale));
getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale));
// Set the checkbox to tentative if the prices of each object selected
// are not the same.
childSetTentative("checkbox for sale", is_for_sale_mixed);
childSetEnabled("sale type",num_for_sale && can_transfer && !is_sale_price_mixed);
getChild<LLUICtrl>("checkbox for sale")->setTentative( is_for_sale_mixed);
getChildView("sale type")->setEnabled(num_for_sale && can_transfer && !is_sale_price_mixed);
childSetEnabled("Next owner can:", TRUE);
childSetEnabled("checkbox next owner can modify",base_mask_on & PERM_MODIFY);
childSetEnabled("checkbox next owner can copy",base_mask_on & PERM_COPY);
childSetEnabled("checkbox next owner can transfer",next_owner_mask_on & PERM_COPY);
getChildView("Next owner can:")->setEnabled(TRUE);
getChildView("checkbox next owner can modify")->setEnabled(base_mask_on & PERM_MODIFY);
getChildView("checkbox next owner can copy")->setEnabled(base_mask_on & PERM_COPY);
getChildView("checkbox next owner can transfer")->setEnabled(next_owner_mask_on & PERM_COPY);
}
else
{
childSetEnabled("checkbox for sale",FALSE);
childSetEnabled("sale type",FALSE);
getChildView("checkbox for sale")->setEnabled(FALSE);
getChildView("sale type")->setEnabled(FALSE);
childSetEnabled("Next owner can:",FALSE);
childSetEnabled("checkbox next owner can modify",FALSE);
childSetEnabled("checkbox next owner can copy",FALSE);
childSetEnabled("checkbox next owner can transfer",FALSE);
getChildView("Next owner can:")->setEnabled(FALSE);
getChildView("checkbox next owner can modify")->setEnabled(FALSE);
getChildView("checkbox next owner can copy")->setEnabled(FALSE);
getChildView("checkbox next owner can transfer")->setEnabled(FALSE);
}
if(valid_group_perms)
if (valid_group_perms)
{
if((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE))
if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE))
{
childSetValue("checkbox share with group",TRUE);
childSetTentative("checkbox share with group",FALSE);
childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer);
getChild<LLUICtrl>("checkbox share with group")->setValue(TRUE);
getChild<LLUICtrl>("checkbox share with group")->setTentative( FALSE);
getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer);
}
else if((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE))
else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE))
{
childSetValue("checkbox share with group",FALSE);
childSetTentative("checkbox share with group",false);
childSetEnabled("button deed",false);
getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE);
getChild<LLUICtrl>("checkbox share with group")->setTentative( FALSE);
getChildView("button deed")->setEnabled(FALSE);
}
else
{
childSetValue("checkbox share with group",TRUE);
childSetTentative("checkbox share with group",true);
childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer);
getChild<LLUICtrl>("checkbox share with group")->setValue(TRUE);
getChild<LLUICtrl>("checkbox share with group")->setTentative( TRUE);
getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer);
}
}
if(valid_everyone_perms)
if (valid_everyone_perms)
{
// Move
if(everyone_mask_on & PERM_MOVE)
if (everyone_mask_on & PERM_MOVE)
{
childSetValue("checkbox allow everyone move",TRUE);
childSetTentative("checkbox allow everyone move",false);
getChild<LLUICtrl>("checkbox allow everyone move")->setValue(TRUE);
getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( FALSE);
}
else if(everyone_mask_off & PERM_MOVE)
else if (everyone_mask_off & PERM_MOVE)
{
childSetValue("checkbox allow everyone move",FALSE);
childSetTentative("checkbox allow everyone move",false);
getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE);
getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( FALSE);
}
else
{
childSetValue("checkbox allow everyone move",TRUE);
childSetTentative("checkbox allow everyone move",true);
getChild<LLUICtrl>("checkbox allow everyone move")->setValue(TRUE);
getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( TRUE);
}
// Copy == everyone can't copy
if(everyone_mask_on & PERM_COPY)
if (everyone_mask_on & PERM_COPY)
{
childSetValue("checkbox allow everyone copy",TRUE);
childSetTentative("checkbox allow everyone copy",!can_copy || !can_transfer);
getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(TRUE);
getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( !can_copy || !can_transfer);
}
else if(everyone_mask_off & PERM_COPY)
else if (everyone_mask_off & PERM_COPY)
{
childSetValue("checkbox allow everyone copy",FALSE);
childSetTentative("checkbox allow everyone copy",false);
getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE);
getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( FALSE);
}
else
{
childSetValue("checkbox allow everyone copy",TRUE);
childSetTentative("checkbox allow everyone copy",true);
getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(TRUE);
getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( TRUE);
}
}
if(valid_next_perms)
if (valid_next_perms)
{
// Modify == next owner canot modify
if(next_owner_mask_on & PERM_MODIFY)
if (next_owner_mask_on & PERM_MODIFY)
{
childSetValue("checkbox next owner can modify",TRUE);
childSetTentative("checkbox next owner can modify",false);
getChild<LLUICtrl>("checkbox next owner can modify")->setValue(TRUE);
getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( FALSE);
}
else if(next_owner_mask_off & PERM_MODIFY)
else if (next_owner_mask_off & PERM_MODIFY)
{
childSetValue("checkbox next owner can modify",FALSE);
childSetTentative("checkbox next owner can modify",false);
getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE);
getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( FALSE);
}
else
{
childSetValue("checkbox next owner can modify",TRUE);
childSetTentative("checkbox next owner can modify",true);
getChild<LLUICtrl>("checkbox next owner can modify")->setValue(TRUE);
getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( TRUE);
}
// Copy == next owner cannot copy
if(next_owner_mask_on & PERM_COPY)
if (next_owner_mask_on & PERM_COPY)
{
childSetValue("checkbox next owner can copy",TRUE);
childSetTentative("checkbox next owner can copy",!can_copy);
getChild<LLUICtrl>("checkbox next owner can copy")->setValue(TRUE);
getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( !can_copy);
}
else if(next_owner_mask_off & PERM_COPY)
else if (next_owner_mask_off & PERM_COPY)
{
childSetValue("checkbox next owner can copy",FALSE);
childSetTentative("checkbox next owner can copy",FALSE);
getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE);
getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( FALSE);
}
else
{
childSetValue("checkbox next owner can copy",TRUE);
childSetTentative("checkbox next owner can copy",TRUE);
getChild<LLUICtrl>("checkbox next owner can copy")->setValue(TRUE);
getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( TRUE);
}
// Transfer == next owner cannot transfer
if(next_owner_mask_on & PERM_TRANSFER)
if (next_owner_mask_on & PERM_TRANSFER)
{
childSetValue("checkbox next owner can transfer",TRUE);
childSetTentative("checkbox next owner can transfer",!can_transfer);
getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(TRUE);
getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( !can_transfer);
}
else if(next_owner_mask_off & PERM_TRANSFER)
else if (next_owner_mask_off & PERM_TRANSFER)
{
childSetValue("checkbox next owner can transfer",FALSE);
childSetTentative("checkbox next owner can transfer",FALSE);
getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE);
getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( FALSE);
}
else
{
childSetValue("checkbox next owner can transfer",TRUE);
childSetTentative("checkbox next owner can transfer",TRUE);
getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(TRUE);
getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( TRUE);
}
}
@@ -856,37 +843,40 @@ void LLPanelPermissions::refresh()
}
}
childSetValue("checkbox for sale", num_for_sale != 0);
getChild<LLUICtrl>("checkbox for sale")->setValue((num_for_sale != 0));
// HACK: There are some old objects in world that are set for sale,
// but are no-transfer. We need to let users turn for-sale off, but only
// if for-sale is set.
bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY);
if (num_for_sale && has_change_sale_ability && cannot_actually_sell)
if (cannot_actually_sell)
{
childSetEnabled("checkbox for sale", true);
if (num_for_sale && has_change_sale_ability)
{
getChildView("checkbox for sale")->setEnabled(true);
}
}
// Check search status of objects
BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
bool include_in_search;
bool all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search);
childSetEnabled("search_check", has_change_sale_ability && all_volume);
childSetValue("search_check", include_in_search);
childSetTentative("search_check", ! all_include_in_search);
const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search);
getChildView("search_check")->setEnabled(has_change_sale_ability && all_volume);
getChild<LLUICtrl>("search_check")->setValue(include_in_search);
getChild<LLUICtrl>("search_check")->setTentative( !all_include_in_search);
// Click action (touch, sit, buy)
U8 click_action = 0;
if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action))
{
LLComboBox* ComboClickAction = getChild<LLComboBox>("clickaction");
if(ComboClickAction)
LLComboBox* combo_click_action = getChild<LLComboBox>("clickaction");
if(combo_click_action)
{
ComboClickAction->setCurrentByIndex((S32)click_action);
combo_click_action->setCurrentByIndex((S32)click_action);
}
}
childSetEnabled("label click action",is_perm_modify && is_nonpermanent_enforced && all_volume);
childSetEnabled("clickaction",is_perm_modify && is_nonpermanent_enforced && all_volume);
getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
}
@@ -952,15 +942,18 @@ void LLPanelPermissions::onClickGroup(void* data)
if(owners_identical && (owner_id == gAgent.getID()))
{
LLFloaterGroupPicker* fg;
fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID()));
fg->setSelectCallback( cbGroupID, data );
LLFloaterGroupPicker* fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID()));
if (parent_floater)
if (fg)
{
LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg);
fg->setOrigin(new_rect.mLeft, new_rect.mBottom);
parent_floater->addDependentFloater(fg);
fg->setSelectCallback( cbGroupID, data );
if (parent_floater)
{
LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg);
fg->setOrigin(new_rect.mLeft, new_rect.mBottom);
parent_floater->addDependentFloater(fg);
}
}
}
}
@@ -986,7 +979,7 @@ void LLPanelPermissions::cbGroupID(LLUUID group_id, void* userdata)
bool callback_deed_to_group(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{
LLUUID group_id;
@@ -1002,7 +995,7 @@ bool callback_deed_to_group(const LLSD& notification, const LLSD& response)
void LLPanelPermissions::onClickDeedToGroup(void* data)
{
LLNotifications::instance().add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group);
LLNotificationsUtil::add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group);
}
void LLPanelPermissions::onClickCopyObjKey(void* data)

View File

@@ -102,6 +102,9 @@ protected:
static void onCommitIncludeInSearch(LLUICtrl* ctrl, void*);
protected:
void disableAll();
private:
LLNameBox* mLabelGroupName; // group name
//LLTextBox* mBuyerLabel;

View File

@@ -97,7 +97,7 @@ BOOL LLPreviewAnim::postBuild()
childSetAction("Anim audition btn",auditionAnim,this);
childSetCommitCallback("desc", LLPreview::onText, this);
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
return LLPreview::postBuild();
}

View File

@@ -399,8 +399,7 @@ BOOL LLPreviewGesture::postBuild()
LLCheckBoxCtrl* check;
edit = getChild<LLLineEditor>("trigger_editor");
edit->setKeystrokeCallback(onKeystrokeCommit);
edit->setCallbackUserData(this);
edit->setKeystrokeCallback(boost::bind(&onKeystrokeCommit,_1,this));
edit->setCommitCallback(boost::bind(&LLPreviewGesture::onCommitSetDirty,this));
edit->setCommitOnFocusLost(TRUE);
edit->setIgnoreTab(TRUE);
@@ -412,8 +411,7 @@ BOOL LLPreviewGesture::postBuild()
edit = getChild<LLLineEditor>("replace_editor");
edit->setEnabled(FALSE);
edit->setKeystrokeCallback(onKeystrokeCommit);
edit->setCallbackUserData(this);
edit->setKeystrokeCallback(boost::bind(&onKeystrokeCommit,_1,this));
edit->setCommitCallback(boost::bind(&LLPreviewGesture::onCommitSetDirty,this));
edit->setCommitOnFocusLost(TRUE);
@@ -537,7 +535,7 @@ BOOL LLPreviewGesture::postBuild()
{
childSetCommitCallback("desc", LLPreview::onText, this);
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
}
return TRUE;

View File

@@ -144,7 +144,7 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,
childSetCommitCallback("desc", LLPreview::onText, this);
if (const LLInventoryItem* item = getItem())
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
}
setTitle(title);

View File

@@ -1299,7 +1299,7 @@ LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect,
childSetCommitCallback("desc", LLPreview::onText, this);
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
if (!getFloaterHost() && !getHost() && getAssetStatus() == PREVIEW_ASSET_UNLOADED)
{

View File

@@ -88,7 +88,7 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons
childSetCommitCallback("desc", LLPreview::onText, this);
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
// preload the sound
if(item && gAudiop)

View File

@@ -229,7 +229,7 @@ void LLPreviewTexture::init()
mCreatorKey = item->getCreatorUUID();
childSetCommitCallback("desc", LLPreview::onText, this);
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
childSetText("uuid", getItemID().asString());
childSetText("uploader", getItemCreatorName());
childSetText("uploadtime", getItemCreationDate());

View File

@@ -89,7 +89,7 @@ BOOL LLProgressView::postBuild()
getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle()));
getChild<LLTextBox>("message_text")->setClickedCallback(onClickMessage, this);
getChild<LLTextBox>("message_text")->setClickedCallback(boost::bind(&LLProgressView::onClickMessage, this));
sInstance = this;
return TRUE;

View File

@@ -165,28 +165,28 @@ void LLScrollingPanelParam::draw()
// Draw the hints over the "less" and "more" buttons.
if(mHintMin)
{
gGL.pushMatrix();
gGL.pushUIMatrix();
{
const LLRect& r = mHintMin->getRect();
F32 left = (F32)(r.mLeft + BTN_BORDER);
F32 bot = (F32)(r.mBottom + BTN_BORDER);
gGL.translatef(left, bot, 0.f);
gGL.translateUI(left, bot, 0.f);
mHintMin->draw();
}
gGL.popMatrix();
gGL.popUIMatrix();
}
if(mHintMax)
{
gGL.pushMatrix();
gGL.pushUIMatrix();
{
const LLRect& r = mHintMax->getRect();
F32 left = (F32)(r.mLeft + BTN_BORDER);
F32 bot = (F32)(r.mBottom + BTN_BORDER);
gGL.translatef(left, bot, 0.f);
gGL.translateUI(left, bot, 0.f);
mHintMax->draw();
}
gGL.popMatrix();
gGL.popUIMatrix();
}

Some files were not shown because too many files have changed in this diff Show More