Merge remote-tracking branch 'lirusaito/master'
This commit is contained in:
@@ -759,8 +759,7 @@ void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*
|
||||
LLUICtrl* child = getChild<LLUICtrl>(id, true);
|
||||
if (child)
|
||||
{
|
||||
child->setCommitCallback(cb);
|
||||
child->setCallbackUserData(userdata);
|
||||
child->setCommitCallback(cb, userdata);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -773,15 +772,6 @@ void LLPanel::childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childSetUserData(const std::string& id, void* userdata)
|
||||
{
|
||||
LLUICtrl* child = getChild<LLUICtrl>(id, true);
|
||||
if (child)
|
||||
{
|
||||
child->setCallbackUserData(userdata);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childSetColor(const std::string& id, const LLColor4& color)
|
||||
{
|
||||
LLUICtrl* child = getChild<LLUICtrl>(id, true);
|
||||
|
||||
@@ -172,7 +172,6 @@ public:
|
||||
|
||||
void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL );
|
||||
void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) );
|
||||
void childSetUserData(const std::string& id, void* userdata);
|
||||
|
||||
void childSetColor(const std::string& id, const LLColor4& color);
|
||||
void childSetAlpha(const std::string& id, F32 alpha);
|
||||
|
||||
@@ -3869,16 +3869,14 @@ LLScrollColumnHeader::LLScrollColumnHeader(const std::string& label, const LLRec
|
||||
mHasResizableElement(FALSE)
|
||||
{
|
||||
mListPosition = LLComboBox::ABOVE;
|
||||
setCommitCallback(onSelectSort);
|
||||
setCallbackUserData(this);
|
||||
setCommitCallback(boost::bind(&LLScrollColumnHeader::onSelectSort, this));
|
||||
mButton->setTabStop(FALSE);
|
||||
// require at least two frames between mouse down and mouse up event to capture intentional "hold" not just bad framerate
|
||||
mButton->setHeldDownDelay(LLUI::sConfigGroup->getF32("ColumnHeaderDropDownDelay"), 2);
|
||||
mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::onHeldDown, this));
|
||||
mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::showList, this));
|
||||
mButton->setClickedCallback(boost::bind(&LLScrollColumnHeader::onClick, this));
|
||||
mButton->setMouseDownCallback(boost::bind(&LLScrollColumnHeader::onMouseDown, this));
|
||||
|
||||
mButton->setCallbackUserData(this);
|
||||
mButton->setToolTip(label);
|
||||
|
||||
mAscendingText = std::string("[LOW]...[HIGH](Ascending)"); // *TODO: Translate
|
||||
@@ -4037,7 +4035,7 @@ BOOL LLScrollColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask)
|
||||
}
|
||||
else
|
||||
{
|
||||
onClick(this);
|
||||
onClick();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -4065,42 +4063,29 @@ void LLScrollColumnHeader::setImageOverlay(const std::string &image_name, LLFont
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onClick(void* user_data)
|
||||
void LLScrollColumnHeader::onClick()
|
||||
{
|
||||
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
|
||||
if (!headerp) return;
|
||||
if (!mColumn) return;
|
||||
|
||||
LLScrollListColumn* column = headerp->mColumn;
|
||||
if (!column) return;
|
||||
|
||||
if (headerp->mList->getVisible())
|
||||
if (mList->getVisible())
|
||||
{
|
||||
headerp->hideList();
|
||||
hideList();
|
||||
}
|
||||
|
||||
LLScrollListCtrl::onClickColumn(column);
|
||||
LLScrollListCtrl::onClickColumn(mColumn);
|
||||
|
||||
// propagate new sort order to sort order list
|
||||
headerp->mList->selectNthItem(column->mParentCtrl->getSortAscending() ? 0 : 1);
|
||||
mList->selectNthItem(mColumn->mParentCtrl->getSortAscending() ? 0 : 1);
|
||||
|
||||
headerp->mList->setFocus(TRUE);
|
||||
mList->setFocus(TRUE);
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onMouseDown(void* user_data)
|
||||
void LLScrollColumnHeader::onMouseDown()
|
||||
{
|
||||
// for now, do nothing but block the normal showList() behavior
|
||||
return;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onHeldDown(void* user_data)
|
||||
{
|
||||
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
|
||||
headerp->showList();
|
||||
}
|
||||
|
||||
void LLScrollColumnHeader::showList()
|
||||
{
|
||||
if (mShowSortOptions)
|
||||
@@ -4183,30 +4168,25 @@ void LLScrollColumnHeader::showList()
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onSelectSort(LLUICtrl* ctrl, void* user_data)
|
||||
void LLScrollColumnHeader::onSelectSort()
|
||||
{
|
||||
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
|
||||
if (!headerp) return;
|
||||
|
||||
LLScrollListColumn* column = headerp->mColumn;
|
||||
if (!column) return;
|
||||
LLScrollListCtrl *parent = column->mParentCtrl;
|
||||
if (!mColumn) return;
|
||||
LLScrollListCtrl* parent = mColumn->mParentCtrl;
|
||||
if (!parent) return;
|
||||
|
||||
if (headerp->getCurrentIndex() == 0)
|
||||
if (getCurrentIndex() == 0)
|
||||
{
|
||||
// ascending
|
||||
parent->sortByColumn(column->mSortingColumn, TRUE);
|
||||
parent->sortByColumn(mColumn->mSortingColumn, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// descending
|
||||
parent->sortByColumn(column->mSortingColumn, FALSE);
|
||||
parent->sortByColumn(mColumn->mSortingColumn, FALSE);
|
||||
}
|
||||
|
||||
// restore original column header
|
||||
headerp->setLabel(headerp->mOrigLabel);
|
||||
setLabel(mOrigLabel);
|
||||
}
|
||||
|
||||
LLView* LLScrollColumnHeader::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding)
|
||||
|
||||
@@ -241,10 +241,9 @@ public:
|
||||
void enableResizeBar(BOOL enable);
|
||||
std::string getLabel() { return mOrigLabel; }
|
||||
|
||||
static void onSelectSort(LLUICtrl* ctrl, void* user_data);
|
||||
static void onClick(void* user_data);
|
||||
static void onMouseDown(void* user_data);
|
||||
static void onHeldDown(void* user_data);
|
||||
void onSelectSort();
|
||||
void onClick();
|
||||
void onMouseDown();
|
||||
|
||||
private:
|
||||
LLScrollListColumn* mColumn;
|
||||
|
||||
@@ -620,5 +620,16 @@
|
||||
<key>Value</key>
|
||||
<string>/away</string>
|
||||
</map>
|
||||
<key>SinguCompleteNameProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Use the complete name "Display Name (legacy.name)" in profiles, instead of following the choice set by PhoenixNameSystem.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
||||
@@ -192,6 +192,7 @@ void LLPrefsAscentVan::refreshValues()
|
||||
mAnnounceSnapshots = gSavedSettings.getBOOL("AnnounceSnapshots");
|
||||
mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata");
|
||||
mUnfocusedFloatersOpaque = gSavedSettings.getBOOL("FloaterUnfocusedBackgroundOpaque");
|
||||
mCompleteNameProfiles = gSavedSettings.getBOOL("SinguCompleteNameProfiles");
|
||||
|
||||
//Tags\Colors ----------------------------------------------------------------------------
|
||||
mAscentBroadcastTag = gSavedSettings.getBOOL("AscentBroadcastTag");
|
||||
@@ -261,6 +262,7 @@ void LLPrefsAscentVan::cancel()
|
||||
gSavedSettings.setBOOL("AnnounceSnapshots", mAnnounceSnapshots);
|
||||
gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata);
|
||||
gSavedSettings.setBOOL("FloaterUnfocusedBackgroundOpaque", mUnfocusedFloatersOpaque);
|
||||
gSavedSettings.setBOOL("SinguCompleteNameProfiles", mCompleteNameProfiles);
|
||||
|
||||
//Tags\Colors ----------------------------------------------------------------------------
|
||||
gSavedSettings.setBOOL("AscentBroadcastTag", mAscentBroadcastTag);
|
||||
|
||||
@@ -63,6 +63,7 @@ protected:
|
||||
bool mAnnounceSnapshots;
|
||||
bool mAnnounceStreamMetadata;
|
||||
bool mUnfocusedFloatersOpaque;
|
||||
bool mCompleteNameProfiles;
|
||||
//Tags\Colors
|
||||
BOOL mAscentBroadcastTag;
|
||||
std::string mReportClientUUID;
|
||||
|
||||
@@ -339,7 +339,7 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa
|
||||
LLFloaterAvatarInfo* floater = LLFloaterAvatarInfo::getInstance(agent_id);
|
||||
if(!floater)
|
||||
{
|
||||
floater = new LLFloaterAvatarInfo(LLTrans::getString("Command_Profile_Label")+" "+av_name.getCompleteName(), agent_id);
|
||||
floater = new LLFloaterAvatarInfo(av_name.getCompleteName()+" - "+LLTrans::getString("Command_Profile_Label"), agent_id);
|
||||
floater->center();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,31 +9,27 @@
|
||||
* Altered to support a callback so it can return the item
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* Pulled into its own file for more widespread use
|
||||
* Rewritten by Liru Færs to act as its own ui element and use a control
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -9,31 +9,27 @@
|
||||
* Altered to support a callback so it can return the item
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* Pulled into its own file for more widespread use
|
||||
* Rewritten by Liru Færs to act as its own ui element and use a control
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLUUID &
|
||||
LLCallbackMap::map_t factory_map;
|
||||
factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this);
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_profile.xml", &factory_map);
|
||||
setTitle(name);
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
||||
@@ -390,7 +390,7 @@ void* LLFloaterDirectory::createGroupDetail(void* userdata)
|
||||
{
|
||||
LLFloaterDirectory *self = (LLFloaterDirectory*)userdata;
|
||||
self->mPanelGroupp = new LLPanelGroup(gAgent.getGroupID());
|
||||
self->mPanelGroupp->setAllowEdit(FALSE || gAgent.isGodlike()); // Gods can always edit panels
|
||||
self->mPanelGroupp->setAllowEdit(false); // Singu Note: This setting actually just tells the panel whether or not it is in search
|
||||
self->mPanelGroupp->setVisible(FALSE);
|
||||
return self->mPanelGroupp;
|
||||
}
|
||||
|
||||
@@ -263,8 +263,7 @@ BOOL LLFloaterNotification::postBuild()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
responses_combo->setCommitCallback(onCommitResponse);
|
||||
responses_combo->setCallbackUserData(this);
|
||||
responses_combo->setCommitCallback(boost::bind(&LLFloaterNotification::respond, this));
|
||||
|
||||
LLSD form_sd = form->asLLSD();
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ public:
|
||||
void onClose(bool app_quitting) { setVisible(FALSE); }
|
||||
|
||||
private:
|
||||
static void onCommitResponse(LLUICtrl* ctrl, void* data) { ((LLFloaterNotification*)data)->respond(); }
|
||||
LLNotification* mNote;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1214,7 +1214,7 @@ void LLPanelAvatarPicks::processProperties(void* data, EAvatarProcessorType type
|
||||
for(LLAvatarPicks::picks_list_t::iterator it = picks->picks_list.begin();
|
||||
it != picks->picks_list.end(); ++it)
|
||||
{
|
||||
LLPanelPick* panel_pick = new LLPanelPick(FALSE);
|
||||
LLPanelPick* panel_pick = new LLPanelPick();
|
||||
panel_pick->setPickID(it->first, mAvatarID);
|
||||
|
||||
// This will request data from the server when the pick is first
|
||||
@@ -1259,7 +1259,7 @@ void LLPanelAvatarPicks::onClickNew(void* data)
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data;
|
||||
LLPanelPick* panel_pick = new LLPanelPick(FALSE);
|
||||
LLPanelPick* panel_pick = new LLPanelPick();
|
||||
LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab");
|
||||
|
||||
panel_pick->initNewPick();
|
||||
@@ -1275,7 +1275,7 @@ void LLPanelAvatarPicks::onClickNew(void* data)
|
||||
void LLPanelAvatarPicks::onClickImport(void* data)
|
||||
{
|
||||
LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data;
|
||||
self->mPanelPick = new LLPanelPick(FALSE);
|
||||
self->mPanelPick = new LLPanelPick();
|
||||
self->mPanelPick->importNewPick(&LLPanelAvatarPicks::onClickImport_continued, data);
|
||||
}
|
||||
|
||||
@@ -1514,7 +1514,10 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status)
|
||||
void LLPanelAvatar::onAvatarNameResponse(const LLUUID& agent_id, const LLAvatarName& av_name)
|
||||
{
|
||||
std::string name;
|
||||
LLAvatarNameCache::getPNSName(av_name, name);
|
||||
if (gSavedSettings.getBOOL("SinguCompleteNameProfiles"))
|
||||
name = av_name.getCompleteName();
|
||||
else
|
||||
LLAvatarNameCache::getPNSName(av_name, name);
|
||||
getChild<LLLineEditor>("dnname")->setText(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -244,40 +244,37 @@ void LLPanelClassified::reset()
|
||||
BOOL LLPanelClassified::postBuild()
|
||||
{
|
||||
mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl");
|
||||
mSnapshotCtrl->setCommitCallback(onCommitAny);
|
||||
mSnapshotCtrl->setCallbackUserData(this);
|
||||
mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
mSnapshotSize = mSnapshotCtrl->getRect();
|
||||
|
||||
mNameEditor = getChild<LLLineEditor>("given_name_editor");
|
||||
mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN);
|
||||
mNameEditor->setCommitOnFocusLost(TRUE);
|
||||
mNameEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this));
|
||||
mNameEditor->setCommitCallback(onCommitAny);
|
||||
mNameEditor->setCallbackUserData(this);
|
||||
mNameEditor->setFocusReceivedCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
mNameEditor->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII );
|
||||
|
||||
mDescEditor = getChild<LLTextEditor>("desc_editor");
|
||||
mDescEditor->setCommitOnFocusLost(TRUE);
|
||||
mDescEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this));
|
||||
mDescEditor->setCommitCallback(onCommitAny);
|
||||
mDescEditor->setCallbackUserData(this);
|
||||
mDescEditor->setFocusReceivedCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
mDescEditor->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
mDescEditor->setTabsToNextField(TRUE);
|
||||
|
||||
mLocationEditor = getChild<LLLineEditor>("location_editor");
|
||||
|
||||
mSetBtn = getChild<LLButton>( "set_location_btn");
|
||||
mSetBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickSet, this));
|
||||
mSetBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickSet, this));
|
||||
|
||||
mTeleportBtn = getChild<LLButton>( "classified_teleport_btn");
|
||||
mTeleportBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickTeleport, this));
|
||||
mTeleportBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickTeleport, this));
|
||||
|
||||
mMapBtn = getChild<LLButton>( "classified_map_btn");
|
||||
mMapBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickMap, this));
|
||||
mMapBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickMap, this));
|
||||
|
||||
if(mInFinder)
|
||||
{
|
||||
mProfileBtn = getChild<LLButton>( "classified_profile_btn");
|
||||
mProfileBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickProfile, this));
|
||||
mProfileBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickProfile, this));
|
||||
}
|
||||
|
||||
mCategoryCombo = getChild<LLComboBox>( "classified_category_combo");
|
||||
@@ -289,13 +286,11 @@ BOOL LLPanelClassified::postBuild()
|
||||
mCategoryCombo->add(iter->second, (void *)((intptr_t)iter->first), ADD_BOTTOM);
|
||||
}
|
||||
mCategoryCombo->setCurrentByIndex(0);
|
||||
mCategoryCombo->setCommitCallback(onCommitAny);
|
||||
mCategoryCombo->setCallbackUserData(this);
|
||||
mCategoryCombo->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
|
||||
mMatureCombo = getChild<LLComboBox>( "classified_mature_check");
|
||||
mMatureCombo->setCurrentByIndex(0);
|
||||
mMatureCombo->setCommitCallback(onCommitAny);
|
||||
mMatureCombo->setCallbackUserData(this);
|
||||
mMatureCombo->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
if (gAgent.wantsPGOnly())
|
||||
{
|
||||
// Teens don't get to set mature flag. JC
|
||||
@@ -306,13 +301,11 @@ BOOL LLPanelClassified::postBuild()
|
||||
if (!mInFinder)
|
||||
{
|
||||
mAutoRenewCheck = getChild<LLCheckBoxCtrl>( "auto_renew_check");
|
||||
mAutoRenewCheck->setCommitCallback(onCommitAny);
|
||||
mAutoRenewCheck->setCallbackUserData(this);
|
||||
mAutoRenewCheck->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this));
|
||||
}
|
||||
|
||||
mUpdateBtn = getChild<LLButton>("classified_update_btn");
|
||||
mUpdateBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickUpdate, this));
|
||||
mUpdateBtn->setCallbackUserData(this);
|
||||
mUpdateBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickUpdate, this));
|
||||
|
||||
if (!mInFinder)
|
||||
{
|
||||
@@ -392,9 +385,6 @@ void LLPanelClassified::processProperties(void* data, EAvatarProcessorType type)
|
||||
mUpdateBtn->setLabel(getString("update_txt"));
|
||||
|
||||
resetDirty();
|
||||
|
||||
// I don't know if a second call is deliberate or a bad merge, so I'm leaving it here.
|
||||
resetDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -496,7 +486,7 @@ void LLPanelClassified::initNewClassified()
|
||||
mUpdateBtn->setLabel(getString("publish_txt"));
|
||||
|
||||
// simulate clicking the "location" button
|
||||
LLPanelClassified::onClickSet(this);
|
||||
onClickSet();
|
||||
}
|
||||
|
||||
|
||||
@@ -713,33 +703,28 @@ void LLPanelClassified::refresh()
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelClassified::onClickUpdate(void* data)
|
||||
void LLPanelClassified::onClickUpdate()
|
||||
{
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
|
||||
if(self == NULL) return;
|
||||
|
||||
// Disallow leading spaces, punctuation, etc. that screw up
|
||||
// sort order.
|
||||
if ( ! self->titleIsValid() )
|
||||
if (!titleIsValid())
|
||||
{
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
// If user has not set mature, do not allow publish
|
||||
if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE)
|
||||
if (mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE)
|
||||
{
|
||||
// Tell user about it
|
||||
LLNotificationsUtil::add("SetClassifiedMature",
|
||||
LLSD(),
|
||||
LLSD(),
|
||||
boost::bind(&LLPanelClassified::confirmMature, self, _1, _2));
|
||||
boost::bind(&LLPanelClassified::confirmMature, this, _1, _2));
|
||||
return;
|
||||
}
|
||||
|
||||
// Mature content flag is set, proceed
|
||||
self->gotMature();
|
||||
gotMature();
|
||||
}
|
||||
|
||||
// Callback from a dialog indicating response to mature notification
|
||||
@@ -781,38 +766,30 @@ void LLPanelClassified::gotMature()
|
||||
else
|
||||
{
|
||||
// Ask the user how much they want to pay
|
||||
LLFloaterPriceForListing::show( callbackGotPriceForListing, this );
|
||||
new LLFloaterPriceForListing(boost::bind(&LLPanelClassified::callbackGotPriceForListing, this, _1));
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, void* data)
|
||||
void LLPanelClassified::callbackGotPriceForListing(const std::string& text)
|
||||
{
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
|
||||
// Only do something if user hits publish
|
||||
if (option != 0) return;
|
||||
|
||||
S32 price_for_listing = strtol(text.c_str(), NULL, 10);
|
||||
if (price_for_listing < MINIMUM_PRICE_FOR_LISTING)
|
||||
{
|
||||
LLSD args;
|
||||
std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING);
|
||||
args["MIN_PRICE"] = price_text;
|
||||
|
||||
args["MIN_PRICE"] = llformat("%d", MINIMUM_PRICE_FOR_LISTING);
|
||||
LLNotificationsUtil::add("MinClassifiedPrice", args);
|
||||
return;
|
||||
}
|
||||
|
||||
// price is acceptable, put it in the dialog for later read by
|
||||
// update send
|
||||
self->mPriceForListing = price_for_listing;
|
||||
mPriceForListing = price_for_listing;
|
||||
|
||||
LLSD args;
|
||||
args["AMOUNT"] = llformat("%d", price_for_listing);
|
||||
args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
|
||||
LLNotificationsUtil::add("PublishClassified", args, LLSD(),
|
||||
boost::bind(&LLPanelClassified::confirmPublish, self, _1, _2));
|
||||
boost::bind(&LLPanelClassified::confirmPublish, this, _1, _2));
|
||||
}
|
||||
|
||||
void LLPanelClassified::resetDirty()
|
||||
@@ -862,51 +839,39 @@ bool LLPanelClassified::confirmPublish(const LLSD& notification, const LLSD& res
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLPanelClassified::onClickTeleport(void* data)
|
||||
void LLPanelClassified::onClickTeleport()
|
||||
{
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
|
||||
if (!self->mPosGlobal.isExactlyZero())
|
||||
if (!mPosGlobal.isExactlyZero())
|
||||
{
|
||||
gAgent.teleportViaLocation(self->mPosGlobal);
|
||||
gFloaterWorldMap->trackLocation(self->mPosGlobal);
|
||||
gAgent.teleportViaLocation(mPosGlobal);
|
||||
gFloaterWorldMap->trackLocation(mPosGlobal);
|
||||
|
||||
self->sendClassifiedClickMessage("teleport");
|
||||
sendClassifiedClickMessage("teleport");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLPanelClassified::onClickMap(void* data)
|
||||
void LLPanelClassified::onClickMap()
|
||||
{
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
gFloaterWorldMap->trackLocation(self->mPosGlobal);
|
||||
gFloaterWorldMap->trackLocation(mPosGlobal);
|
||||
LLFloaterWorldMap::show(true);
|
||||
|
||||
self->sendClassifiedClickMessage("map");
|
||||
sendClassifiedClickMessage("map");
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelClassified::onClickProfile(void* data)
|
||||
void LLPanelClassified::onClickProfile()
|
||||
{
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
LLAvatarActions::showProfile(self->mCreatorID);
|
||||
self->sendClassifiedClickMessage("profile");
|
||||
LLAvatarActions::showProfile(mCreatorID);
|
||||
sendClassifiedClickMessage("profile");
|
||||
}
|
||||
|
||||
// static
|
||||
/*
|
||||
void LLPanelClassified::onClickLandmark(void* data)
|
||||
void LLPanelClassified::onClickLandmark()
|
||||
{
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal);
|
||||
create_landmark(mNameEditor->getText(), "", mPosGlobal);
|
||||
}
|
||||
*/
|
||||
|
||||
// static
|
||||
void LLPanelClassified::onClickSet(void* data)
|
||||
void LLPanelClassified::onClickSet()
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
|
||||
@@ -914,10 +879,9 @@ void LLPanelClassified::onClickSet(void* data)
|
||||
return;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
|
||||
// Save location for later.
|
||||
self->mPosGlobal = gAgent.getPositionGlobal();
|
||||
mPosGlobal = gAgent.getPositionGlobal();
|
||||
|
||||
std::string location_text;
|
||||
std::string regionName = "(will update after publish)";
|
||||
@@ -929,22 +893,22 @@ void LLPanelClassified::onClickSet(void* data)
|
||||
location_text.assign(regionName);
|
||||
location_text.append(", ");
|
||||
|
||||
S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]);
|
||||
S32 region_x = llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)mPosGlobal.mdV[VZ]);
|
||||
|
||||
location_text.append(self->mSimName);
|
||||
location_text.append(mSimName);
|
||||
location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
|
||||
|
||||
self->mLocationEditor->setText(location_text);
|
||||
self->mLocationChanged = true;
|
||||
mLocationEditor->setText(location_text);
|
||||
mLocationChanged = true;
|
||||
|
||||
self->setDefaultAccessCombo();
|
||||
setDefaultAccessCombo();
|
||||
|
||||
// Set this to null so it updates on the next save.
|
||||
self->mParcelID.setNull();
|
||||
mParcelID.setNull();
|
||||
|
||||
onCommitAny(NULL, data);
|
||||
checkDirty();
|
||||
}
|
||||
|
||||
|
||||
@@ -963,23 +927,6 @@ BOOL LLPanelClassified::checkDirty()
|
||||
return mDirty;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelClassified::onCommitAny(LLUICtrl* ctrl, void* data)
|
||||
{
|
||||
LLPanelClassified* self = (LLPanelClassified*)data;
|
||||
if (self)
|
||||
{
|
||||
self->checkDirty();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelClassified::focusReceived(LLFocusableElement* ctrl, void* data)
|
||||
{
|
||||
// allow the data to be saved
|
||||
onCommitAny((LLUICtrl*)ctrl, data);
|
||||
}
|
||||
|
||||
|
||||
void LLPanelClassified::sendClassifiedClickMessage(const std::string& type)
|
||||
{
|
||||
@@ -1000,15 +947,22 @@ void LLPanelClassified::sendClassifiedClickMessage(const std::string& type)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLFloaterPriceForListing::LLFloaterPriceForListing()
|
||||
LLFloaterPriceForListing::LLFloaterPriceForListing(const signal_t::slot_type& cb)
|
||||
: LLFloater(std::string("PriceForListing")),
|
||||
mCallback(NULL),
|
||||
mUserData(NULL)
|
||||
{ }
|
||||
mSignal(new signal_t)
|
||||
{
|
||||
// Builds and adds to gFloaterView
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_price_for_listing.xml");
|
||||
center();
|
||||
|
||||
mSignal->connect(cb);
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLFloaterPriceForListing::~LLFloaterPriceForListing()
|
||||
{ }
|
||||
{
|
||||
delete mSignal;
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLFloaterPriceForListing::postBuild()
|
||||
@@ -1023,50 +977,18 @@ BOOL LLFloaterPriceForListing::postBuild()
|
||||
edit->setFocus(TRUE);
|
||||
}
|
||||
|
||||
childSetAction("set_price_btn", onClickSetPrice, this);
|
||||
getChild<LLUICtrl>("set_price_btn")->setCommitCallback(boost::bind(&LLFloaterPriceForListing::buttonCore, this));
|
||||
|
||||
childSetAction("cancel_btn", onClickCancel, this);
|
||||
getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloater::close, this, false));
|
||||
|
||||
setDefaultBtn("set_price_btn");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterPriceForListing::show( void (*callback)(S32, std::string, void*), void* userdata)
|
||||
void LLFloaterPriceForListing::buttonCore()
|
||||
{
|
||||
LLFloaterPriceForListing *self = new LLFloaterPriceForListing();
|
||||
|
||||
// Builds and adds to gFloaterView
|
||||
LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml");
|
||||
self->center();
|
||||
|
||||
self->mCallback = callback;
|
||||
self->mUserData = userdata;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterPriceForListing::onClickSetPrice(void* data)
|
||||
{
|
||||
buttonCore(0, data);
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterPriceForListing::onClickCancel(void* data)
|
||||
{
|
||||
buttonCore(1, data);
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterPriceForListing::buttonCore(S32 button, void* data)
|
||||
{
|
||||
LLFloaterPriceForListing* self = (LLFloaterPriceForListing*)data;
|
||||
|
||||
if (self->mCallback)
|
||||
{
|
||||
std::string text = self->childGetText("price_edit");
|
||||
self->mCallback(button, text, self->mUserData);
|
||||
self->close();
|
||||
}
|
||||
(*mSignal)(childGetText("price_edit"));
|
||||
close();
|
||||
}
|
||||
|
||||
void LLPanelClassified::setDefaultAccessCombo()
|
||||
|
||||
@@ -38,23 +38,19 @@
|
||||
#define LL_LLPANELCLASSIFIED_H
|
||||
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llpanel.h"
|
||||
#include "llclassifiedinfo.h"
|
||||
#include "v3dmath.h"
|
||||
#include "lluuid.h"
|
||||
#include "llfloater.h"
|
||||
//#include "llrect.h"
|
||||
|
||||
class LLButton;
|
||||
class LLCheckBoxCtrl;
|
||||
class LLComboBox;
|
||||
class LLIconCtrl;
|
||||
class LLLineEditor;
|
||||
class LLTextBox;
|
||||
class LLTextEditor;
|
||||
class LLTextureCtrl;
|
||||
class LLUICtrl;
|
||||
class LLMessageSystem;
|
||||
|
||||
class LLPanelClassified : public LLPanel, public LLAvatarPropertiesObserver
|
||||
{
|
||||
@@ -104,7 +100,7 @@ public:
|
||||
// Confirmation dialogs flow in this order
|
||||
bool confirmMature(const LLSD& notification, const LLSD& response);
|
||||
void gotMature();
|
||||
static void callbackGotPriceForListing(S32 option, std::string text, void* data);
|
||||
void callbackGotPriceForListing(const std::string& text);
|
||||
bool confirmPublish(const LLSD& notification, const LLSD& response);
|
||||
|
||||
void sendClassifiedClickMessage(const std::string& type);
|
||||
@@ -112,14 +108,11 @@ public:
|
||||
protected:
|
||||
bool saveCallback(const LLSD& notification, const LLSD& response);
|
||||
|
||||
static void onClickUpdate(void* data);
|
||||
static void onClickTeleport(void* data);
|
||||
static void onClickMap(void* data);
|
||||
static void onClickProfile(void* data);
|
||||
static void onClickSet(void* data);
|
||||
|
||||
static void focusReceived(LLFocusableElement* ctrl, void* data);
|
||||
static void onCommitAny(LLUICtrl* ctrl, void* data);
|
||||
void onClickUpdate();
|
||||
void onClickTeleport();
|
||||
void onClickMap();
|
||||
void onClickProfile();
|
||||
void onClickSet();
|
||||
|
||||
void setDefaultAccessCombo(); // Default AO and PG regions to proper classified access
|
||||
|
||||
@@ -183,20 +176,15 @@ class LLFloaterPriceForListing
|
||||
: public LLFloater
|
||||
{
|
||||
public:
|
||||
LLFloaterPriceForListing();
|
||||
typedef boost::signals2::signal<void(const std::string& value)> signal_t;
|
||||
LLFloaterPriceForListing(const signal_t::slot_type& cb);
|
||||
virtual ~LLFloaterPriceForListing();
|
||||
virtual BOOL postBuild();
|
||||
|
||||
static void show( void (*callback)(S32 option, std::string value, void* userdata), void* userdata );
|
||||
|
||||
private:
|
||||
static void onClickSetPrice(void*);
|
||||
static void onClickCancel(void*);
|
||||
static void buttonCore(S32 button, void* data);
|
||||
void buttonCore();
|
||||
|
||||
private:
|
||||
void (*mCallback)(S32 option, std::string, void*);
|
||||
void* mUserData;
|
||||
signal_t* mSignal;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -246,14 +246,13 @@ BOOL LLPanelGroup::postBuild()
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnCancel,this));
|
||||
button->setVisible(mAllowEdit);
|
||||
button->setEnabled(mAllowEdit); // Cancel should always be enabled for standalone group floater, this is expected behavior and may be used for simply closing
|
||||
}
|
||||
|
||||
button = getChild<LLButton>("btn_apply");
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnApply,this));
|
||||
button->setVisible(mAllowEdit);
|
||||
button->setEnabled(FALSE);
|
||||
|
||||
mApplyBtn = button;
|
||||
@@ -263,7 +262,6 @@ BOOL LLPanelGroup::postBuild()
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnRefresh,this));
|
||||
button->setVisible(mAllowEdit);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -286,11 +284,15 @@ void LLPanelGroup::tabChanged()
|
||||
{
|
||||
//some tab information has changed,....enable/disable the apply button
|
||||
//based on if they need an apply
|
||||
std::string str;
|
||||
const bool need = mCurrentTab->needsApply(str);
|
||||
if ( mApplyBtn )
|
||||
{
|
||||
std::string mesg;
|
||||
mApplyBtn->setEnabled(mCurrentTab->needsApply(mesg));
|
||||
mApplyBtn->setEnabled(need);
|
||||
}
|
||||
if (mAllowEdit) return; // Cancel should always be enabled for standalone group floater, this is expected behavior and may be used for simply closing
|
||||
if (LLUICtrl* ctrl = getChild<LLUICtrl>("btn_cancel"))
|
||||
ctrl->setEnabled(need);
|
||||
}
|
||||
|
||||
void LLPanelGroup::handleClickTab()
|
||||
@@ -477,7 +479,10 @@ void LLPanelGroup::onBtnOK(void* user_data)
|
||||
void LLPanelGroup::onBtnCancel(void* user_data)
|
||||
{
|
||||
LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data);
|
||||
self->close();
|
||||
if (self->mAllowEdit) // We're in a standalone floater
|
||||
self->close();
|
||||
else // We're in search, we can't close out, just refreshData to kill changes
|
||||
self->refreshData();
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -298,8 +298,7 @@ void LLPanelGroupGeneral::onCommitEnrollment()
|
||||
}
|
||||
|
||||
// Make sure the agent can change enrollment info.
|
||||
if (!gAgent.hasPowerInGroup(mGroupID,GP_MEMBER_OPTIONS)
|
||||
|| !mAllowEdit)
|
||||
if (!gAgent.hasPowerInGroup(mGroupID,GP_MEMBER_OPTIONS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -317,7 +316,7 @@ void LLPanelGroupGeneral::onCommitEnrollment()
|
||||
|
||||
void LLPanelGroupGeneral::onCommitTitle()
|
||||
{
|
||||
if (mGroupID.isNull() || !mAllowEdit) return;
|
||||
if (mGroupID.isNull()) return;
|
||||
LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID());
|
||||
update(GC_TITLES);
|
||||
mComboActiveTitle->resetDirty();
|
||||
@@ -564,7 +563,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
if (mComboActiveTitle)
|
||||
{
|
||||
mComboActiveTitle->setVisible(is_member);
|
||||
mComboActiveTitle->setEnabled(mAllowEdit);
|
||||
|
||||
if ( mActiveTitleLabel) mActiveTitleLabel->setVisible(is_member);
|
||||
|
||||
@@ -624,7 +622,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
if (mCtrlShowInGroupList)
|
||||
{
|
||||
mCtrlShowInGroupList->set(gdatap->mShowInList);
|
||||
mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident);
|
||||
mCtrlShowInGroupList->setEnabled(can_change_ident);
|
||||
mCtrlShowInGroupList->resetDirty();
|
||||
|
||||
}
|
||||
@@ -638,20 +636,20 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
{
|
||||
mComboMature->setCurrentByIndex(NON_MATURE_CONTENT);
|
||||
}
|
||||
mComboMature->setEnabled(mAllowEdit && can_change_ident);
|
||||
mComboMature->setEnabled(can_change_ident);
|
||||
mComboMature->setVisible( !gAgent.isTeen() );
|
||||
mComboMature->resetDirty();
|
||||
}
|
||||
if (mCtrlOpenEnrollment)
|
||||
{
|
||||
mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment);
|
||||
mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts);
|
||||
mCtrlOpenEnrollment->setEnabled(can_change_member_opts);
|
||||
mCtrlOpenEnrollment->resetDirty();
|
||||
}
|
||||
if (mCtrlEnrollmentFee)
|
||||
{
|
||||
mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0);
|
||||
mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts);
|
||||
mCtrlEnrollmentFee->setEnabled(can_change_member_opts);
|
||||
mCtrlEnrollmentFee->resetDirty();
|
||||
}
|
||||
|
||||
@@ -659,9 +657,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
{
|
||||
S32 fee = gdatap->mMembershipFee;
|
||||
mSpinEnrollmentFee->set((F32)fee);
|
||||
mSpinEnrollmentFee->setEnabled( mAllowEdit &&
|
||||
(fee > 0) &&
|
||||
can_change_member_opts);
|
||||
mSpinEnrollmentFee->setEnabled(fee && can_change_member_opts);
|
||||
mSpinEnrollmentFee->resetDirty();
|
||||
}
|
||||
if ( mBtnJoinGroup )
|
||||
@@ -693,7 +689,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
mCtrlReceiveNotices->setVisible(is_member);
|
||||
if (is_member)
|
||||
{
|
||||
mCtrlReceiveNotices->setEnabled(mAllowEdit);
|
||||
if(!mCtrlReceiveNotices->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc.
|
||||
{
|
||||
mCtrlReceiveNotices->set(agent_gdatap.mAcceptNotices);
|
||||
@@ -707,7 +702,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
mCtrlListGroup->setVisible(is_member);
|
||||
if (is_member)
|
||||
{
|
||||
mCtrlListGroup->setEnabled(mAllowEdit);
|
||||
if(!mCtrlListGroup->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc.
|
||||
{
|
||||
mCtrlListGroup->set(agent_gdatap.mListInProfile);
|
||||
@@ -721,7 +715,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
mCtrlReceiveChat->setVisible(is_member);
|
||||
if (is_member)
|
||||
{
|
||||
mCtrlReceiveChat->setEnabled(mAllowEdit);
|
||||
if(!mCtrlReceiveChat->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc.
|
||||
{
|
||||
mCtrlReceiveChat->set(!gIMMgr->getIgnoreGroup(mGroupID));
|
||||
@@ -730,8 +723,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
||||
}
|
||||
}
|
||||
|
||||
if (mInsignia) mInsignia->setEnabled(mAllowEdit && can_change_ident);
|
||||
if (mEditCharter) mEditCharter->setEnabled(mAllowEdit && can_change_ident);
|
||||
if (mInsignia) mInsignia->setEnabled(can_change_ident);
|
||||
if (mEditCharter) mEditCharter->setEnabled(can_change_ident);
|
||||
|
||||
if (mGroupName) mGroupName->setText(gdatap->mName);
|
||||
if (mGroupNameEditor) mGroupNameEditor->setVisible(FALSE);
|
||||
|
||||
@@ -222,8 +222,7 @@ BOOL LLPanelGroupNotices::postBuild()
|
||||
|
||||
mNoticesList = getChild<LLScrollListCtrl>("notice_list",recurse);
|
||||
mNoticesList->setCommitOnSelectionChange(TRUE);
|
||||
mNoticesList->setCommitCallback(onSelectNotice);
|
||||
mNoticesList->setCallbackUserData(this);
|
||||
mNoticesList->setCommitCallback(boost::bind(&LLPanelGroupNotices::onSelectNotice, this));
|
||||
|
||||
mBtnNewMessage = getChild<LLButton>("create_new_notice",recurse);
|
||||
mBtnNewMessage->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickNewMessage,this));
|
||||
@@ -494,14 +493,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
|
||||
mNoticesList->updateSort();
|
||||
}
|
||||
|
||||
void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data)
|
||||
void LLPanelGroupNotices::onSelectNotice()
|
||||
{
|
||||
LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
|
||||
|
||||
if(!self) return;
|
||||
LLScrollListItem* item = self->mNoticesList->getFirstSelected();
|
||||
LLScrollListItem* item = mNoticesList->getFirstSelected();
|
||||
if (!item) return;
|
||||
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessage("GroupNoticeRequest");
|
||||
msg->nextBlock("AgentData");
|
||||
|
||||
@@ -78,7 +78,7 @@ private:
|
||||
static void onClickRefreshNotices(void* data);
|
||||
|
||||
void processNotices(LLMessageSystem* msg);
|
||||
static void onSelectNotice(LLUICtrl* ctrl, void* data);
|
||||
void onSelectNotice();
|
||||
|
||||
enum ENoticeView
|
||||
{
|
||||
|
||||
@@ -198,7 +198,7 @@ BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp)
|
||||
GP_MEMBER_EJECT |
|
||||
GP_MEMBER_OPTIONS );
|
||||
*/
|
||||
return mAllowEdit && agentp->isInGroup(mGroupID);
|
||||
return agentp->isInGroup(mGroupID);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1491,7 +1491,7 @@ LLPanelGroupVoting::~LLPanelGroupVoting()
|
||||
BOOL LLPanelGroupVoting::isVisibleByAgent(LLAgent* agentp)
|
||||
{
|
||||
//if they are in the group, the panel is viewable
|
||||
return mAllowEdit && agentp->isInGroup(mGroupID);
|
||||
return agentp->isInGroup(mGroupID);
|
||||
}
|
||||
|
||||
BOOL LLPanelGroupVoting::postBuild()
|
||||
|
||||
@@ -30,82 +30,65 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
// Display of a "Top Pick" used both for the global top picks in the
|
||||
// Find directory, and also for each individual user's picks in their
|
||||
// profile.
|
||||
// Display of each individual user's picks in their profile.
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llpanelpick.h"
|
||||
|
||||
#include "lldir.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llparcel.h"
|
||||
#include "message.h"
|
||||
#include "lltexteditor.h"
|
||||
#include "lltexturectrl.h"
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llviewertexteditor.h"
|
||||
#include "lltexturectrl.h"
|
||||
#include "lluiconstants.h"
|
||||
#include "llviewergenericmessage.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llworldmap.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "llpreviewtexture.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llnotificationsutil.h"
|
||||
|
||||
// [RLVa:KB]
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
|
||||
//For pick import and export - RK
|
||||
#include "statemachine/aifilepicker.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "hippogridmanager.h"
|
||||
#include "llsdserialize.h"
|
||||
|
||||
void show_picture(const LLUUID& id, const std::string& name)
|
||||
{
|
||||
// Try to show and focus existing preview
|
||||
if (LLPreview::show(id)) return;
|
||||
// If there isn't one, make a new preview
|
||||
LLPreview* preview = new LLPreviewTexture("preview texture", gSavedSettings.getRect("PreviewTextureRect"), name, id);
|
||||
preview->setFocus(true);
|
||||
}
|
||||
|
||||
//static
|
||||
std::list<LLPanelPick*> LLPanelPick::sAllPanels;
|
||||
|
||||
LLPanelPick::LLPanelPick(BOOL top_pick)
|
||||
LLPanelPick::LLPanelPick()
|
||||
: LLPanel(std::string("Top Picks Panel")),
|
||||
mTopPick(top_pick),
|
||||
mPickID(),
|
||||
mCreatorID(),
|
||||
mParcelID(),
|
||||
mDataRequested(FALSE),
|
||||
mDataReceived(FALSE),
|
||||
mDataRequested(false),
|
||||
mDataReceived(false),
|
||||
mPosGlobal(),
|
||||
mSnapshotCtrl(NULL),
|
||||
mNameEditor(NULL),
|
||||
mDescEditor(NULL),
|
||||
mLocationEditor(NULL),
|
||||
mTeleportBtn(NULL),
|
||||
mMapBtn(NULL),
|
||||
//mLandmarkBtn(NULL),
|
||||
mSortOrderText(NULL),
|
||||
mSortOrderEditor(NULL),
|
||||
mEnabledCheck(NULL),
|
||||
mSetBtn(NULL),
|
||||
mOpenBtn(NULL),
|
||||
mImporting(0)
|
||||
{
|
||||
sAllPanels.push_back(this);
|
||||
|
||||
std::string pick_def_file;
|
||||
if (top_pick)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_top_pick.xml");
|
||||
}
|
||||
else
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_pick.xml");
|
||||
}
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_pick.xml");
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +113,8 @@ void LLPanelPick::reset()
|
||||
mParcelID.setNull();
|
||||
|
||||
// Don't request data, this isn't valid
|
||||
mDataRequested = TRUE;
|
||||
mDataReceived = FALSE;
|
||||
mDataRequested = true;
|
||||
mDataReceived = false;
|
||||
|
||||
mPosGlobal.clearVec();
|
||||
|
||||
@@ -142,83 +125,55 @@ void LLPanelPick::reset()
|
||||
BOOL LLPanelPick::postBuild()
|
||||
{
|
||||
mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl");
|
||||
mSnapshotCtrl->setCommitCallback(onCommitAny);
|
||||
mSnapshotCtrl->setCallbackUserData(this);
|
||||
mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this));
|
||||
|
||||
mNameEditor = getChild<LLLineEditor>("given_name_editor");
|
||||
mNameEditor->setCommitOnFocusLost(TRUE);
|
||||
mNameEditor->setCommitCallback(onCommitAny);
|
||||
mNameEditor->setCallbackUserData(this);
|
||||
mNameEditor->setCommitOnFocusLost(true);
|
||||
mNameEditor->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this));
|
||||
|
||||
mDescEditor = getChild<LLTextEditor>("desc_editor");
|
||||
mDescEditor->setCommitOnFocusLost(TRUE);
|
||||
mDescEditor->setCommitCallback(onCommitAny);
|
||||
mDescEditor->setCallbackUserData(this);
|
||||
mDescEditor->setTabsToNextField(TRUE);
|
||||
mDescEditor->setCommitOnFocusLost(true);
|
||||
mDescEditor->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this));
|
||||
mDescEditor->setTabsToNextField(true);
|
||||
|
||||
mLocationEditor = getChild<LLLineEditor>("location_editor");
|
||||
|
||||
mSetBtn = getChild<LLButton>( "set_location_btn");
|
||||
mSetBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickSet,this));
|
||||
mSetBtn = getChild<LLUICtrl>( "set_location_btn");
|
||||
mSetBtn->setCommitCallback(boost::bind(&LLPanelPick::onClickSet,this));
|
||||
|
||||
mTeleportBtn = getChild<LLButton>( "pick_teleport_btn");
|
||||
mTeleportBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickTeleport,this));
|
||||
mOpenBtn = getChild<LLUICtrl>("open_picture_btn");
|
||||
mOpenBtn->setCommitCallback(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, mSnapshotCtrl), boost::bind(&LLLineEditor::getText, mNameEditor)));
|
||||
|
||||
mMapBtn = getChild<LLButton>( "pick_map_btn");
|
||||
mMapBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickMap,this));
|
||||
|
||||
mSortOrderText = getChild<LLTextBox>("sort_order_text");
|
||||
|
||||
mSortOrderEditor = getChild<LLLineEditor>("sort_order_editor");
|
||||
mSortOrderEditor->setPrevalidate(LLLineEditor::prevalidateInt);
|
||||
mSortOrderEditor->setCommitOnFocusLost(TRUE);
|
||||
mSortOrderEditor->setCommitCallback(onCommitAny);
|
||||
mSortOrderEditor->setCallbackUserData(this);
|
||||
|
||||
mEnabledCheck = getChild<LLCheckBoxCtrl>( "enabled_check");
|
||||
mEnabledCheck->setCommitCallback(onCommitAny);
|
||||
mEnabledCheck->setCallbackUserData(this);
|
||||
getChild<LLUICtrl>("pick_teleport_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickTeleport,this));
|
||||
getChild<LLUICtrl>("pick_map_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickMap,this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLPanelPick::processProperties(void* data, EAvatarProcessorType type)
|
||||
{
|
||||
if(APT_PICK_INFO != type)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!data || APT_PICK_INFO != type) return;
|
||||
|
||||
LLPickData* pick_info = static_cast<LLPickData*>(data);
|
||||
//llassert_always(pick_info->creator_id != gAgent.getID());
|
||||
//llassert_always(mCreatorID != gAgent.getID());
|
||||
if(!pick_info
|
||||
|| pick_info->creator_id != mCreatorID
|
||||
|| pick_info->pick_id != mPickID)
|
||||
{
|
||||
if (pick_info->creator_id != mCreatorID || pick_info->pick_id != mPickID)
|
||||
return;
|
||||
}
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mCreatorID, this);
|
||||
|
||||
// "Location text" is actually the owner name, the original
|
||||
// name that owner gave the parcel, and the location.
|
||||
std::string location_text = pick_info->user_name + ", ";
|
||||
|
||||
if (!pick_info->original_name.empty())
|
||||
{
|
||||
location_text.append(pick_info->original_name);
|
||||
location_text.append(", ");
|
||||
location_text += pick_info->original_name + ", ";
|
||||
}
|
||||
|
||||
location_text.append(pick_info->sim_name);
|
||||
location_text.append(" ");
|
||||
location_text += pick_info->sim_name + " ";
|
||||
|
||||
//Fix for location text importing - RK
|
||||
for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
|
||||
{
|
||||
LLPanelPick* self = *iter;
|
||||
if(!self->mImporting) self->mLocationText = location_text;
|
||||
if (!self->mImporting) self->mLocationText = location_text;
|
||||
else location_text = self->mLocationText;
|
||||
self->mImporting = false;
|
||||
}
|
||||
@@ -226,10 +181,9 @@ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type)
|
||||
S32 region_x = llround((F32)pick_info->pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround((F32)pick_info->pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)pick_info->pos_global.mdV[VZ]);
|
||||
|
||||
location_text.append(llformat("(%d, %d, %d)", region_x, region_y, region_z));
|
||||
|
||||
mDataReceived = TRUE;
|
||||
mDataReceived = true;
|
||||
|
||||
// Found the panel, now fill in the information
|
||||
mPickID = pick_info->pick_id;
|
||||
@@ -243,24 +197,17 @@ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type)
|
||||
mDescEditor->setText(pick_info->desc);
|
||||
mSnapshotCtrl->setImageAssetID(pick_info->snapshot_id);
|
||||
mLocationEditor->setText(location_text);
|
||||
mEnabledCheck->set(pick_info->enabled);
|
||||
|
||||
mSortOrderEditor->setText(llformat("%d", pick_info->sort_order));
|
||||
|
||||
}
|
||||
|
||||
// Fill in some reasonable defaults for a new pick.
|
||||
void LLPanelPick::initNewPick()
|
||||
{
|
||||
mPickID.generate();
|
||||
|
||||
mCreatorID = gAgent.getID();
|
||||
|
||||
mCreatorID = gAgentID;
|
||||
mPosGlobal = gAgent.getPositionGlobal();
|
||||
|
||||
// Try to fill in the current parcel
|
||||
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if (parcel)
|
||||
if (LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel())
|
||||
{
|
||||
mNameEditor->setText(parcel->getName());
|
||||
mDescEditor->setText(parcel->getDesc());
|
||||
@@ -284,21 +231,14 @@ void LLPanelPick::importNewPick_continued(void (*callback)(void*, bool), void* d
|
||||
bool result = false;
|
||||
if (filepicker->hasFilename())
|
||||
{
|
||||
std::string file = filepicker->getFilename();
|
||||
|
||||
llifstream importer(file);
|
||||
llifstream importer(filepicker->getFilename());
|
||||
LLSD data;
|
||||
LLSDSerialize::fromXMLDocument(data, importer);
|
||||
|
||||
LLSD file_data = data["Data"];
|
||||
data = LLSD();
|
||||
|
||||
mPickID.generate();
|
||||
|
||||
mCreatorID = gAgent.getID();
|
||||
|
||||
mCreatorID = gAgentID;
|
||||
mPosGlobal = LLVector3d(file_data["globalPos"]);
|
||||
|
||||
mNameEditor->setText(file_data["name"].asString());
|
||||
mDescEditor->setText(file_data["desc"].asString());
|
||||
mSnapshotCtrl->setImageAssetID(file_data["snapshotID"].asUUID());
|
||||
@@ -325,10 +265,10 @@ void LLPanelPick::exportPick_continued(AIFilePicker* filepicker)
|
||||
if (!filepicker->hasFilename())
|
||||
return;
|
||||
|
||||
std::string destination = filepicker->getFilename();
|
||||
LLSD header;
|
||||
header["Version"] = 2;
|
||||
|
||||
LLSD datas;
|
||||
|
||||
datas["name"] = mNameEditor->getText();
|
||||
datas["desc"] = mDescEditor->getText();
|
||||
datas["parcelID"] = mParcelID;
|
||||
@@ -337,16 +277,12 @@ void LLPanelPick::exportPick_continued(AIFilePicker* filepicker)
|
||||
datas["locationText"] = mLocationText;
|
||||
|
||||
LLSD file;
|
||||
LLSD header;
|
||||
header["Version"] = 2;
|
||||
file["Header"] = header;
|
||||
std::string grid_uri = gHippoGridManager->getConnectedGrid()->getLoginUri();
|
||||
//LLStringUtil::toLower(uris[0]);
|
||||
file["Grid"] = grid_uri;
|
||||
file["Grid"] = gHippoGridManager->getConnectedGrid()->getLoginUri();
|
||||
file["Data"] = datas;
|
||||
|
||||
// Create a file stream and write to it
|
||||
llofstream export_file(destination);
|
||||
llofstream export_file(filepicker->getFilename());
|
||||
LLSDSerialize::toPrettyXML(file, export_file);
|
||||
// Open the file save dialog
|
||||
export_file.close();
|
||||
@@ -364,24 +300,17 @@ void LLPanelPick::setPickID(const LLUUID& pick_id, const LLUUID& creator_id)
|
||||
// from the server next time it is drawn.
|
||||
void LLPanelPick::markForServerRequest()
|
||||
{
|
||||
mDataRequested = FALSE;
|
||||
mDataReceived = FALSE;
|
||||
}
|
||||
|
||||
|
||||
std::string LLPanelPick::getPickName()
|
||||
{
|
||||
return mNameEditor->getText();
|
||||
mDataRequested = false;
|
||||
mDataReceived = false;
|
||||
}
|
||||
|
||||
|
||||
void LLPanelPick::sendPickInfoRequest()
|
||||
{
|
||||
//llassert_always(mCreatorID != gAgent.getID());
|
||||
LLAvatarPropertiesProcessor::getInstance()->addObserver(mCreatorID, this);
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(mCreatorID, mPickID);
|
||||
|
||||
mDataRequested = TRUE;
|
||||
mDataRequested = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -396,24 +325,18 @@ void LLPanelPick::sendPickInfoUpdate()
|
||||
mPickID.generate();
|
||||
}
|
||||
|
||||
pick_data.agent_id = gAgent.getID();
|
||||
pick_data.session_id = gAgent.getSessionID();
|
||||
pick_data.agent_id = gAgentID;
|
||||
pick_data.session_id = gAgentSessionID;
|
||||
pick_data.pick_id = mPickID;
|
||||
pick_data.creator_id = gAgent.getID();
|
||||
|
||||
//legacy var need to be deleted
|
||||
pick_data.top_pick = mTopPick;
|
||||
pick_data.creator_id = gAgentID;
|
||||
pick_data.top_pick = false; //legacy var need to be deleted
|
||||
pick_data.parcel_id = mParcelID;
|
||||
pick_data.name = mNameEditor->getText();
|
||||
pick_data.desc = mDescEditor->getText();
|
||||
pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID();
|
||||
pick_data.pos_global = mPosGlobal;
|
||||
if(mTopPick)
|
||||
pick_data.sort_order = atoi(mSortOrderEditor->getText().c_str());
|
||||
else
|
||||
pick_data.sort_order = 0;
|
||||
|
||||
pick_data.enabled = mEnabledCheck->get();
|
||||
pick_data.sort_order = 0;
|
||||
pick_data.enabled = true;
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendPickInfoUpdate(&pick_data);
|
||||
}
|
||||
@@ -421,106 +344,50 @@ void LLPanelPick::sendPickInfoUpdate()
|
||||
|
||||
|
||||
void LLPanelPick::draw()
|
||||
{
|
||||
refresh();
|
||||
|
||||
LLPanel::draw();
|
||||
}
|
||||
|
||||
|
||||
void LLPanelPick::refresh()
|
||||
{
|
||||
if (!mDataRequested)
|
||||
{
|
||||
sendPickInfoRequest();
|
||||
}
|
||||
|
||||
// Check for god mode
|
||||
BOOL godlike = gAgent.isGodlike();
|
||||
BOOL is_self = (gAgent.getID() == mCreatorID);
|
||||
|
||||
// Set button visibility/enablement appropriately
|
||||
if (mTopPick)
|
||||
{
|
||||
mSnapshotCtrl->setEnabled(godlike);
|
||||
mNameEditor->setEnabled(godlike);
|
||||
mDescEditor->setEnabled(godlike);
|
||||
|
||||
mSortOrderText->setVisible(godlike);
|
||||
|
||||
mSortOrderEditor->setVisible(godlike);
|
||||
mSortOrderEditor->setEnabled(godlike);
|
||||
|
||||
mEnabledCheck->setVisible(godlike);
|
||||
mEnabledCheck->setEnabled(godlike);
|
||||
|
||||
mSetBtn->setVisible(godlike);
|
||||
//mSetBtn->setEnabled(godlike);
|
||||
bool is_self = gAgentID == mCreatorID;
|
||||
mSnapshotCtrl->setEnabled(is_self);
|
||||
mNameEditor->setEnabled(is_self);
|
||||
mDescEditor->setEnabled(is_self);
|
||||
mSetBtn->setVisible(is_self);
|
||||
//mSetBtn->setEnabled(is_self);
|
||||
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
|
||||
mSetBtn->setEnabled(godlike && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) );
|
||||
// [/RLVa:KB]
|
||||
}
|
||||
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
mSnapshotCtrl->setEnabled(is_self);
|
||||
mNameEditor->setEnabled(is_self);
|
||||
mDescEditor->setEnabled(is_self);
|
||||
|
||||
mSortOrderText->setVisible(FALSE);
|
||||
|
||||
mSortOrderEditor->setVisible(FALSE);
|
||||
mSortOrderEditor->setEnabled(FALSE);
|
||||
|
||||
mEnabledCheck->setVisible(FALSE);
|
||||
mEnabledCheck->setEnabled(FALSE);
|
||||
|
||||
mSetBtn->setVisible(is_self);
|
||||
//mSetBtn->setEnabled(is_self);
|
||||
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
|
||||
mSetBtn->setEnabled(is_self && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) );
|
||||
mSetBtn->setEnabled(is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
|
||||
// [/RLVa]
|
||||
}
|
||||
mOpenBtn->setVisible(!is_self);
|
||||
|
||||
LLPanel::draw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// static
|
||||
void LLPanelPick::onClickTeleport(void* data)
|
||||
void LLPanelPick::onClickTeleport()
|
||||
{
|
||||
LLPanelPick* self = (LLPanelPick*)data;
|
||||
|
||||
if (!self->mPosGlobal.isExactlyZero())
|
||||
if (!mPosGlobal.isExactlyZero())
|
||||
{
|
||||
gAgent.teleportViaLocation(self->mPosGlobal);
|
||||
gFloaterWorldMap->trackLocation(self->mPosGlobal);
|
||||
gAgent.teleportViaLocation(mPosGlobal);
|
||||
gFloaterWorldMap->trackLocation(mPosGlobal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLPanelPick::onClickMap(void* data)
|
||||
void LLPanelPick::onClickMap()
|
||||
{
|
||||
LLPanelPick* self = (LLPanelPick*)data;
|
||||
gFloaterWorldMap->trackLocation(self->mPosGlobal);
|
||||
gFloaterWorldMap->trackLocation(mPosGlobal);
|
||||
LLFloaterWorldMap::show(true);
|
||||
}
|
||||
|
||||
// static
|
||||
/*
|
||||
void LLPanelPick::onClickLandmark(void* data)
|
||||
void LLPanelPick::onClickLandmark()
|
||||
{
|
||||
LLPanelPick* self = (LLPanelPick*)data;
|
||||
create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal);
|
||||
create_landmark(mNameEditor->getText(), "", mPosGlobal);
|
||||
}
|
||||
*/
|
||||
|
||||
// static
|
||||
void LLPanelPick::onClickSet(void* data)
|
||||
void LLPanelPick::onClickSet()
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
|
||||
@@ -528,63 +395,41 @@ void LLPanelPick::onClickSet(void* data)
|
||||
return;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
LLPanelPick* self = (LLPanelPick*)data;
|
||||
|
||||
// Save location for later.
|
||||
self->mPosGlobal = gAgent.getPositionGlobal();
|
||||
mPosGlobal = gAgent.getPositionGlobal();
|
||||
|
||||
std::string location_text;
|
||||
location_text.assign("(will update after save)");
|
||||
location_text.append(", ");
|
||||
std::string location_text("(will update after save), " + mSimName);
|
||||
|
||||
S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]);
|
||||
|
||||
location_text.append(self->mSimName);
|
||||
S32 region_x = llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)mPosGlobal.mdV[VZ]);
|
||||
location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
|
||||
|
||||
// if sim name in pick is different from current sim name
|
||||
// make sure it's clear that all that's being changed
|
||||
// is the location and nothing else
|
||||
if ( gAgent.getRegion ()->getName () != self->mSimName )
|
||||
if (gAgent.getRegion()->getName() != mSimName)
|
||||
{
|
||||
LLNotificationsUtil::add("SetPickLocation");
|
||||
};
|
||||
}
|
||||
|
||||
self->mLocationEditor->setText(location_text);
|
||||
mLocationEditor->setText(location_text);
|
||||
|
||||
onCommitAny(NULL, data);
|
||||
onCommitAny();
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLPanelPick::onCommitAny(LLUICtrl* ctrl, void* data)
|
||||
void LLPanelPick::onCommitAny()
|
||||
{
|
||||
LLPanelPick* self = (LLPanelPick*)data;
|
||||
|
||||
if(self->mCreatorID != gAgent.getID())
|
||||
return;
|
||||
if (mCreatorID != gAgentID) return;
|
||||
|
||||
// have we received up to date data for this pick?
|
||||
if (self->mDataReceived)
|
||||
if (mDataReceived)
|
||||
{
|
||||
self->sendPickInfoUpdate();
|
||||
|
||||
// Big hack - assume that top picks are always in a browser,
|
||||
// and non-top-picks are always in a tab container.
|
||||
/*if (self->mTopPick)
|
||||
sendPickInfoUpdate();
|
||||
if (LLTabContainer* tab = dynamic_cast<LLTabContainer*>(getParent()))
|
||||
{
|
||||
LLPanelDirPicks* panel = (LLPanelDirPicks*)self->getParent();
|
||||
panel->renamePick(self->mPickID, self->mNameEditor->getText());
|
||||
tab->setCurrentTabName(mNameEditor->getText());
|
||||
}
|
||||
else
|
||||
{*/
|
||||
LLTabContainer* tab = (LLTabContainer*)self->getParent();
|
||||
if (tab)
|
||||
{
|
||||
if(tab) tab->setCurrentTabName(self->mNameEditor->getText());
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,43 +30,30 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
// Display of a "Top Pick" used both for the global top picks in the
|
||||
// Find directory, and also for each individual user's picks in their
|
||||
// profile.
|
||||
// Display of each individual user's picks in their profile.
|
||||
|
||||
#ifndef LL_LLPANELPICK_H
|
||||
#define LL_LLPANELPICK_H
|
||||
|
||||
#include "llpanel.h"
|
||||
#include "v3dmath.h"
|
||||
#include "lluuid.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
|
||||
class LLButton;
|
||||
class LLCheckBoxCtrl;
|
||||
class LLIconCtrl;
|
||||
class LLLineEditor;
|
||||
class LLTextBox;
|
||||
class LLTextEditor;
|
||||
class LLTextureCtrl;
|
||||
class LLUICtrl;
|
||||
class LLMessageSystem;
|
||||
class AIFilePicker;
|
||||
|
||||
class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver
|
||||
{
|
||||
public:
|
||||
LLPanelPick(BOOL top_pick);
|
||||
LLPanelPick();
|
||||
/*virtual*/ ~LLPanelPick();
|
||||
|
||||
void reset();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void draw();
|
||||
|
||||
/*virtual*/ void refresh();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
// Setup a new pick, including creating an id, giving a sane
|
||||
@@ -87,7 +74,7 @@ public:
|
||||
// from the server next time it is drawn.
|
||||
void markForServerRequest();
|
||||
|
||||
std::string getPickName();
|
||||
const std::string& getPickName() const { return mNameEditor->getText(); }
|
||||
const LLUUID& getPickID() const { return mPickID; }
|
||||
const LLUUID& getPickCreatorID() const { return mCreatorID; }
|
||||
|
||||
@@ -95,26 +82,24 @@ public:
|
||||
void sendPickInfoUpdate();
|
||||
|
||||
protected:
|
||||
static void onClickTeleport(void* data);
|
||||
static void onClickMap(void* data);
|
||||
//static void onClickLandmark(void* data);
|
||||
static void onClickSet(void* data);
|
||||
void onClickTeleport();
|
||||
void onClickMap();
|
||||
//void onClickLandmark();
|
||||
void onClickSet();
|
||||
|
||||
static void onCommitAny(LLUICtrl* ctrl, void* data);
|
||||
void onCommitAny();
|
||||
|
||||
protected:
|
||||
//Pick import and export - RK
|
||||
BOOL mImporting;
|
||||
bool mImporting;
|
||||
std::string mLocationText;
|
||||
|
||||
BOOL mTopPick;
|
||||
LLUUID mPickID;
|
||||
LLUUID mCreatorID;
|
||||
LLUUID mParcelID;
|
||||
|
||||
// Data will be requested on first draw
|
||||
BOOL mDataRequested;
|
||||
BOOL mDataReceived;
|
||||
bool mDataRequested;
|
||||
bool mDataReceived;
|
||||
|
||||
std::string mSimName;
|
||||
LLVector3d mPosGlobal;
|
||||
@@ -124,13 +109,9 @@ protected:
|
||||
LLTextEditor* mDescEditor;
|
||||
LLLineEditor* mLocationEditor;
|
||||
|
||||
LLButton* mTeleportBtn;
|
||||
LLButton* mMapBtn;
|
||||
|
||||
LLTextBox* mSortOrderText;
|
||||
LLLineEditor* mSortOrderEditor;
|
||||
LLCheckBoxCtrl* mEnabledCheck;
|
||||
LLButton* mSetBtn;
|
||||
LLUICtrl* mTeleportBtn;
|
||||
LLUICtrl* mSetBtn;
|
||||
LLUICtrl* mOpenBtn;
|
||||
|
||||
typedef std::list<LLPanelPick*> panel_list_t;
|
||||
static panel_list_t sAllPanels;
|
||||
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
static void onBtnRemove( void* userdata );
|
||||
static void onBtnBrowser( void* userdata );
|
||||
|
||||
static void onLocalScrollCommit ( LLUICtrl* ctrl, void *userdata );
|
||||
void onLocalScrollCommit();
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
protected:
|
||||
@@ -483,8 +483,7 @@ BOOL LLFloaterTexturePicker::postBuild()
|
||||
childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this);
|
||||
|
||||
mLocalScrollCtrl = getChild<LLScrollListCtrl>("local_name_list");
|
||||
mLocalScrollCtrl->setCallbackUserData(this);
|
||||
mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit);
|
||||
mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this));
|
||||
LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl );
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
@@ -906,15 +905,14 @@ void LLFloaterTexturePicker::onBtnBrowser(void *userdata)
|
||||
FloaterLocalAssetBrowser::show(NULL);
|
||||
}
|
||||
|
||||
// static, reacts to user clicking a valid field in the local scroll list.
|
||||
void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl *ctrl, void *userdata)
|
||||
// reacts to user clicking a valid field in the local scroll list.
|
||||
void LLFloaterTexturePicker::onLocalScrollCommit()
|
||||
{
|
||||
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
|
||||
LLUUID id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel( LOCALLIST_COL_ID );
|
||||
LLUUID id(mLocalScrollCtrl->getSelectedItemLabel(LOCALLIST_COL_ID));
|
||||
|
||||
self->mOwner->setImageAssetID( id );
|
||||
if ( self->childGetValue("apply_immediate_check").asBoolean() )
|
||||
{ self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, id); } // calls an overridden function.
|
||||
mOwner->setImageAssetID(id);
|
||||
if (childGetValue("apply_immediate_check").asBoolean())
|
||||
mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, id); // calls an overridden function.
|
||||
}
|
||||
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
@@ -766,9 +766,9 @@ void LLViewerParcelMedia::filterMedia(LLParcel* parcel, U32 type)
|
||||
sDeniedMedia.erase(ip);
|
||||
dirty = true;
|
||||
}
|
||||
if (dirty)
|
||||
if (dirty && SLFloaterMediaFilter::findInstance())
|
||||
{
|
||||
SLFloaterMediaFilter::setDirty();
|
||||
SLFloaterMediaFilter::getInstance()->setDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ void callback_media_alert(const LLSD ¬ification, const LLSD &response, LLParc
|
||||
}
|
||||
|
||||
LLViewerParcelMedia::sMediaQueries.erase(domain);
|
||||
SLFloaterMediaFilter::setDirty();
|
||||
if (SLFloaterMediaFilter::findInstance()) SLFloaterMediaFilter::getInstance()->setDirty();
|
||||
}
|
||||
|
||||
void LLViewerParcelMedia::saveDomainFilterList()
|
||||
@@ -975,7 +975,7 @@ bool LLViewerParcelMedia::loadDomainFilterList()
|
||||
llifstream medialistFile(medialist_filename);
|
||||
LLSDSerialize::fromXML(sMediaFilterList, medialistFile);
|
||||
medialistFile.close();
|
||||
SLFloaterMediaFilter::setDirty();
|
||||
if (SLFloaterMediaFilter::findInstance()) SLFloaterMediaFilter::getInstance()->setDirty();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -991,7 +991,7 @@ void LLViewerParcelMedia::clearDomainFilterList()
|
||||
sDeniedMedia.clear();
|
||||
saveDomainFilterList();
|
||||
LLNotificationsUtil::add("MediaFiltersCleared");
|
||||
SLFloaterMediaFilter::setDirty();
|
||||
if (SLFloaterMediaFilter::findInstance()) SLFloaterMediaFilter::getInstance()->setDirty();
|
||||
}
|
||||
|
||||
std::string LLViewerParcelMedia::extractDomain(std::string url)
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief Text editor widget to let users enter a multi-line document.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -32,42 +31,39 @@
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfocusmgr.h"
|
||||
#include "llaudioengine.h"
|
||||
#include "llagent.h"
|
||||
#include "llinventory.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventorypanel.h"
|
||||
#include "llinventorybridge.h" // for landmark prefix string
|
||||
|
||||
#include "llviewertexteditor.h"
|
||||
|
||||
#include "llfloaterchat.h"
|
||||
#include "llagent.h"
|
||||
#include "llaudioengine.h"
|
||||
#include "llavataractions.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "llnotify.h"
|
||||
#include "llfocusmgr.h"
|
||||
#include "llinventorybridge.h" // for landmark prefix string
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llmemorystream.h"
|
||||
#include "llmenugl.h"
|
||||
#include "llnotecard.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpreview.h"
|
||||
#include "llpreviewtexture.h"
|
||||
#include "llpreviewnotecard.h"
|
||||
#include "llpreviewlandmark.h"
|
||||
#include "llscrollbar.h"
|
||||
#include "lltooldraganddrop.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewerassettype.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llnotecard.h"
|
||||
#include "llmemorystream.h"
|
||||
#include "llmenugl.h"
|
||||
#include "llviewerassettype.h"
|
||||
|
||||
#include "llappviewer.h" // for gPacificDaylightTime
|
||||
|
||||
// [RLVa:KB]
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
void open_landmark(LLViewerInventoryItem* inv_item, const std::string& title, BOOL show_keep_discard, const LLUUID& source_id, BOOL take_focus);
|
||||
extern BOOL gPacificDaylightTime;
|
||||
|
||||
static LLRegisterWidget<LLViewerTextEditor> r("text_editor");
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
@@ -113,7 +109,7 @@ public:
|
||||
// See if we can bring an existing preview to the front
|
||||
if(!LLPreview::show(item->getUUID(), true))
|
||||
{
|
||||
if(!gSavedSettings.getBOOL("ShowNewInventory"))
|
||||
if (gSavedSettings.getBOOL("ShowNewInventory")) // Singu Note: ShowNewInventory is true, not false, when they want a preview
|
||||
{
|
||||
// There isn't one, so make a new preview
|
||||
S32 left, top;
|
||||
@@ -1407,6 +1403,10 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, llwchar wc)
|
||||
openEmbeddedLandmark( item, wc );
|
||||
return TRUE;
|
||||
|
||||
case LLAssetType::AT_CALLINGCARD:
|
||||
openEmbeddedCallingcard( item, wc );
|
||||
return TRUE;
|
||||
|
||||
case LLAssetType::AT_LSL_TEXT:
|
||||
case LLAssetType::AT_CLOTHING:
|
||||
case LLAssetType::AT_OBJECT:
|
||||
@@ -1483,18 +1483,26 @@ void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, llwchar wc
|
||||
copyInventory(item, gInventoryCallbacks.registerCB(mInventoryCallback));
|
||||
}
|
||||
|
||||
void LLViewerTextEditor::openEmbeddedCallingcard( LLInventoryItem* item, llwchar wc )
|
||||
{
|
||||
if(item && !item->getCreatorUUID().isNull())
|
||||
{
|
||||
LLAvatarActions::showProfile(item->getCreatorUUID());
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerTextEditor::showUnsavedAlertDialog( LLInventoryItem* item )
|
||||
{
|
||||
LLSD payload;
|
||||
payload["item_id"] = item->getUUID();
|
||||
payload["notecard_id"] = mNotecardInventoryID;
|
||||
LLNotifications::instance().add( "ConfirmNotecardSave", LLSD(), payload, LLViewerTextEditor::onNotecardDialog);
|
||||
LLNotificationsUtil::add( "ConfirmNotecardSave", LLSD(), payload, LLViewerTextEditor::onNotecardDialog);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLViewerTextEditor::onNotecardDialog(const LLSD& notification, const LLSD& response )
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if( option == 0 )
|
||||
{
|
||||
// itemptr is deleted by LLPreview::save
|
||||
@@ -1512,13 +1520,13 @@ void LLViewerTextEditor::showCopyToInvDialog( LLInventoryItem* item, llwchar wc
|
||||
LLUUID item_id = item->getUUID();
|
||||
payload["item_id"] = item_id;
|
||||
payload["item_wc"] = LLSD::Integer(wc);
|
||||
LLNotifications::instance().add( "ConfirmItemCopy", LLSD(), payload,
|
||||
LLNotificationsUtil::add( "ConfirmItemCopy", LLSD(), payload,
|
||||
boost::bind(&LLViewerTextEditor::onCopyToInvDialog, this, _1, _2));
|
||||
}
|
||||
|
||||
bool LLViewerTextEditor::onCopyToInvDialog(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if( 0 == option )
|
||||
{
|
||||
LLUUID item_id = notification["payload"]["item_id"].asUUID();
|
||||
|
||||
@@ -117,6 +117,7 @@ private:
|
||||
void openEmbeddedSound( LLInventoryItem* item, llwchar wc );
|
||||
void openEmbeddedLandmark( LLInventoryItem* item, llwchar wc );
|
||||
void openEmbeddedNotecard( LLInventoryItem* item, llwchar wc);
|
||||
void openEmbeddedCallingcard( LLInventoryItem* item, llwchar wc);
|
||||
void showCopyToInvDialog( LLInventoryItem* item, llwchar wc );
|
||||
void showUnsavedAlertDialog( LLInventoryItem* item );
|
||||
|
||||
|
||||
@@ -703,7 +703,7 @@ To buy direct, visit the land and click on the place name in the title bar.
|
||||
width="430" />
|
||||
<panel bottom="-560" follows="right|top" height="470" left="340"
|
||||
name="event_details_panel" width="440" />
|
||||
<panel bottom="-580" follows="right|top" height="515" left="350"
|
||||
<panel bottom="-570" follows="right|top" height="515" left="350"
|
||||
name="group_details_panel_holder" width="430">
|
||||
<panel bottom="0" follows="right|top" height="470" left="0" name="group_details_panel"
|
||||
width="430" />
|
||||
|
||||
@@ -640,7 +640,7 @@ To buy direct, visit the land and click on the place name in the title bar.
|
||||
width="430" />
|
||||
<panel bottom="-560" follows="right|top" height="470" left="340"
|
||||
name="event_details_panel" width="440" />
|
||||
<panel bottom="-580" follows="right|top" height="515" left="350"
|
||||
<panel bottom="-570" follows="right|top" height="515" left="350"
|
||||
name="group_details_panel_holder" width="430">
|
||||
<panel bottom="0" follows="right|top" height="470" left="0" name="group_details_panel"
|
||||
width="430" />
|
||||
|
||||
@@ -762,7 +762,7 @@ To buy direct, visit the land and click on the place name in the title bar.
|
||||
width="430" />
|
||||
<panel bottom="-560" follows="right|top" height="470" left="340"
|
||||
name="event_details_panel" width="440" />
|
||||
<panel bottom="-580" follows="right|top" height="515" left="350"
|
||||
<panel bottom="-570" follows="right|top" height="515" left="350"
|
||||
name="group_details_panel_holder" width="430">
|
||||
<panel bottom="0" follows="right|top" height="470" left="0" name="group_details_panel"
|
||||
width="430" />
|
||||
|
||||
@@ -14,16 +14,9 @@
|
||||
width="290" />
|
||||
<button bottom_delta="-27" follows="left|top" height="20" label="Set Location"
|
||||
left="180" name="set_location_btn" width="120" />
|
||||
<button bottom_delta="0" follows="left|top" height="20" width="120" label="Open Picture" name="open_picture_btn"/>
|
||||
<button bottom_delta="0" follows="left|top" height="20" label="Teleport" left="10"
|
||||
name="pick_teleport_btn" width="70" />
|
||||
<button bottom_delta="0" follows="left|top" height="20" label="Show on Map" left="80"
|
||||
name="pick_map_btn" width="100" />
|
||||
<text bottom_delta="0" follows="left|top" height="20" left="290"
|
||||
name="sort_order_text" width="30">
|
||||
Sort:
|
||||
</text>
|
||||
<line_editor bottom_delta="5" follows="left|top" height="16" left="280"
|
||||
name="sort_order_editor" width="25" />
|
||||
<check_box bottom_delta="0" follows="left|top" height="20" label="Enabled" left="360"
|
||||
name="enabled_check" width="80" />
|
||||
</panel>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel border="false" bottom="5" follows="bottom|left" height="514" left="340"
|
||||
mouse_opaque="true" name="GroupInfoFinder" title="GroupInfoFinder"
|
||||
width="420">
|
||||
<text name="default_needs_apply_text">
|
||||
There are unapplied changes on the current tab.
|
||||
</text>
|
||||
<text name="want_apply_text">
|
||||
Do you want to apply these changes?
|
||||
</text>
|
||||
<tab_container border="false" bottom="0" follows="all" height="483" left="0"
|
||||
name="group_tab_container" tab_position="top" width="420">
|
||||
<panel filename="panel_group_general.xml" name="general_tab" />
|
||||
<panel filename="panel_group_roles.xml" name="roles_tab" />
|
||||
<panel filename="panel_group_notices.xml" name="notices_tab" />
|
||||
<panel filename="panel_group_voting.xml" name="voting_tab" />
|
||||
<panel filename="panel_group_land_money.xml" name="land_money_tab" />
|
||||
</tab_container>
|
||||
</panel>
|
||||
@@ -12,6 +12,7 @@
|
||||
<check_box bottom_delta="-20" control_name="AnnounceSnapshots" follows="top" height="16" label="Announce when someone takes a snapshot" tool_tip="Won't announce for people who hide the fact that they are taking a snapshot." name="announce_snapshots"/>
|
||||
<check_box bottom_delta="-20" control_name="AnnounceStreamMetadata" follows="top" height="16" label="Announce music stream's metadata in local chat when tuned in" tool_tip="When a new song comes on, a message will be displayed in local chat with available information about the track." name="announce_stream_metadata"/>
|
||||
<check_box bottom_delta="-20" control_name="FloaterUnfocusedBackgroundOpaque" follows="top" height="16" label="Make unfocused floaters opaque (requires refocusing each floater to take effect)" tool_tip="When a floater loses focus, it won't turn transparent with this enabled. This may conflict with some skins." name="unfocused_floaters_opaque"/>
|
||||
<check_box bottom_delta="-20" control_name="SinguCompleteNameProfiles" follows="top" height="16" label="Show complete names (display name and username) in profiles" tool_tip="Disregards the global name display settings, will not work if display names are switched off." name="complete_name_profiles"/>
|
||||
</panel>
|
||||
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Tags/Colors" name="TagsColors">
|
||||
<!-- Client tag options -->
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel border="false" bottom="20" follows="bottom|left" height="470" left="330"
|
||||
name="Pick" title="Pick" width="450">
|
||||
<texture_picker bottom="-315" follows="left|top" height="300" left="20" name="snapshot_ctrl"
|
||||
width="400" />
|
||||
<line_editor bottom_delta="-8" enabled="false" follows="left|top"
|
||||
font="SansSerif" height="20" left="20" name="given_name_editor"
|
||||
width="400" />
|
||||
<text_editor enabled="false" follows="left|top" font="SansSerif"
|
||||
height="90" left="20" max_length="1023" name="desc_editor"
|
||||
width="400" word_wrap="true" spell_check="true" />
|
||||
<line_editor enabled="false" follows="left|top" font="SansSerif"
|
||||
height="20" left="20" name="location_editor"
|
||||
width="400" />
|
||||
<button bottom_delta="0" follows="left|top" height="20" label="Set" left="380"
|
||||
name="set_location_btn" width="60" />
|
||||
<button bottom_delta="-30" follows="left|top" height="20" label="Teleport" left="20"
|
||||
name="pick_teleport_btn" width="80" />
|
||||
<button bottom_delta="0" follows="left|top" height="20" label="Show on Map" left="105"
|
||||
name="pick_map_btn" width="100" />
|
||||
<text bottom_delta="0" follows="left|top" height="20" left="290"
|
||||
name="sort_order_text" width="30">
|
||||
Sort:
|
||||
</text>
|
||||
<line_editor bottom_delta="5" follows="left|top" height="16" left="320"
|
||||
name="sort_order_editor" width="25" />
|
||||
<check_box bottom_delta="0" follows="left|top" height="20" label="Enabled" left="360"
|
||||
name="enabled_check" width="80" />
|
||||
</panel>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel name="GroupInfoFinder" title="Buscar Infor de Grupo">
|
||||
<text name="default_needs_apply_text">
|
||||
Hay cambios sin aplicar en esta pestaña.
|
||||
</text>
|
||||
<text name="want_apply_text">
|
||||
¿Deseas aplicar estos cambios?
|
||||
</text>
|
||||
<tab_container name="group_tab_container">
|
||||
<panel name="general_tab" />
|
||||
<panel name="roles_tab" />
|
||||
<panel name="notices_tab" />
|
||||
<panel name="voting_tab" />
|
||||
<panel name="land_money_tab" />
|
||||
</tab_container>
|
||||
</panel>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel name="Pick" title="Destacados">
|
||||
<button label="Definir" name="set_location_btn"/>
|
||||
<button label="Teleportar" name="pick_teleport_btn" width="85"/>
|
||||
<button label="Mostrar en el Mapa" name="pick_map_btn" left="115"/>
|
||||
<text name="sort_order_text">
|
||||
Ordenar:
|
||||
</text>
|
||||
<check_box label="Activado" name="enabled_check"/>
|
||||
</panel>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel name="GroupInfoFinder" title="Recherche d'infos sur le groupe">
|
||||
<text name="default_needs_apply_text">
|
||||
Certains changements n'ont pas été appliqués sur cet onglet.
|
||||
</text>
|
||||
<text name="want_apply_text">
|
||||
Voulez-vous enregistrer les modifications?
|
||||
</text>
|
||||
</panel>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel name="Pick" title="Choisir">
|
||||
<button label="Définir" name="set_location_btn" />
|
||||
<button label="Téléporter" name="pick_teleport_btn" />
|
||||
<button label="Voir sur la carte" name="pick_map_btn" />
|
||||
<text name="sort_order_text">
|
||||
Trier:
|
||||
</text>
|
||||
<check_box label="Activé" name="enabled_check" />
|
||||
</panel>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<panel name="GroupInfoFinder" title="Grupo">
|
||||
<text name="default_needs_apply_text">
|
||||
Existem mudanças não concluídas na aba atual
|
||||
</text>
|
||||
<text name="want_apply_text">
|
||||
Deseja aplicar as mudanças?
|
||||
</text>
|
||||
</panel>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<panel name="Pick" title="Pegar">
|
||||
<button label="Ajustar" name="set_location_btn"/>
|
||||
<button label="Teletransporte" name="pick_teleport_btn"/>
|
||||
<button label="Mostrar no Mapa" name="pick_map_btn"/>
|
||||
<text name="sort_order_text">
|
||||
Ordenar:
|
||||
</text>
|
||||
<check_box label="Ativo" name="enabled_check"/>
|
||||
</panel>
|
||||
@@ -33,18 +33,12 @@
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "lllineeditor.h"
|
||||
#include "slfloatermediafilter.h"
|
||||
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
#include "slfloatermediafilter.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerparcelmedia.h"
|
||||
|
||||
SLFloaterMediaFilter* SLFloaterMediaFilter::sInstance = NULL;
|
||||
bool SLFloaterMediaFilter::sIsWhitelist = false;
|
||||
bool SLFloaterMediaFilter::sShowIPs = false;
|
||||
|
||||
SLFloaterMediaFilter::SLFloaterMediaFilter(const LLSD& key) : LLFloater(std::string("media filter")), mIsDirty(false)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_media_filter.xml");
|
||||
@@ -52,7 +46,6 @@ SLFloaterMediaFilter::SLFloaterMediaFilter(const LLSD& key) : LLFloater(std::str
|
||||
|
||||
SLFloaterMediaFilter::~SLFloaterMediaFilter()
|
||||
{
|
||||
sInstance = NULL;
|
||||
}
|
||||
|
||||
BOOL SLFloaterMediaFilter::postBuild()
|
||||
@@ -62,15 +55,13 @@ BOOL SLFloaterMediaFilter::postBuild()
|
||||
|
||||
if (mWhitelistSLC && mBlacklistSLC)
|
||||
{
|
||||
childSetAction("clear_lists", onClearLists, this);
|
||||
childSetAction("show_ips", onShowIPs, this);
|
||||
childSetAction("add_whitelist", onWhitelistAdd, this);
|
||||
childSetAction("remove_whitelist", onWhitelistRemove, this);
|
||||
childSetAction("add_blacklist", onBlacklistAdd, this);
|
||||
childSetAction("remove_blacklist", onBlacklistRemove, this);
|
||||
childSetAction("commit_domain", onCommitDomain, this);
|
||||
childSetUserData("whitelist_list", this);
|
||||
childSetUserData("blacklist_list", this);
|
||||
getChild<LLUICtrl>("clear_lists")->setCommitCallback(boost::bind(LLViewerParcelMedia::clearDomainFilterList));
|
||||
getChild<LLUICtrl>("show_ips")->setCommitCallback(boost::bind(&SLFloaterMediaFilter::onShowIPs, this));
|
||||
getChild<LLUICtrl>("add_whitelist")->setCommitCallback(boost::bind(&SLFloaterMediaFilter::onWhitelistAdd, this));
|
||||
getChild<LLUICtrl>("remove_whitelist")->setCommitCallback(boost::bind(&SLFloaterMediaFilter::onWhitelistRemove, this));
|
||||
getChild<LLUICtrl>("add_blacklist")->setCommitCallback(boost::bind(&SLFloaterMediaFilter::onBlacklistAdd, this));
|
||||
getChild<LLUICtrl>("remove_blacklist")->setCommitCallback(boost::bind(&SLFloaterMediaFilter::onBlacklistRemove, this));
|
||||
getChild<LLUICtrl>("commit_domain")->setCommitCallback(boost::bind(&SLFloaterMediaFilter::onCommitDomain, this));
|
||||
mIsDirty = true;
|
||||
}
|
||||
|
||||
@@ -96,7 +87,7 @@ void SLFloaterMediaFilter::draw()
|
||||
for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++)
|
||||
{
|
||||
domain = LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString();
|
||||
if (sShowIPs)
|
||||
if (mShowIPs)
|
||||
{
|
||||
host.setHostByName(domain);
|
||||
ip = host.getIPString();
|
||||
@@ -137,7 +128,7 @@ void SLFloaterMediaFilter::draw()
|
||||
for (it = LLViewerParcelMedia::sAllowedMedia.begin(); it != LLViewerParcelMedia::sAllowedMedia.end(); it++)
|
||||
{
|
||||
domain = *it;
|
||||
if (sShowIPs)
|
||||
if (mShowIPs)
|
||||
{
|
||||
host.setHostByName(domain);
|
||||
ip = host.getIPString();
|
||||
@@ -156,7 +147,7 @@ void SLFloaterMediaFilter::draw()
|
||||
for (it = LLViewerParcelMedia::sDeniedMedia.begin(); it != LLViewerParcelMedia::sDeniedMedia.end(); it++)
|
||||
{
|
||||
domain = *it;
|
||||
if (sShowIPs)
|
||||
if (mShowIPs)
|
||||
{
|
||||
host.setHostByName(domain);
|
||||
ip = host.getIPString();
|
||||
@@ -191,7 +182,7 @@ void SLFloaterMediaFilter::draw()
|
||||
}
|
||||
|
||||
mIsDirty = false;
|
||||
sShowIPs = false;
|
||||
mShowIPs = false;
|
||||
}
|
||||
|
||||
LLFloater::draw();
|
||||
@@ -199,55 +190,38 @@ void SLFloaterMediaFilter::draw()
|
||||
|
||||
void SLFloaterMediaFilter::setDirty()
|
||||
{
|
||||
if (sInstance)
|
||||
{
|
||||
sInstance->mIsDirty = true;
|
||||
sInstance->draw();
|
||||
}
|
||||
mIsDirty = true;
|
||||
}
|
||||
|
||||
void SLFloaterMediaFilter::onClearLists(void* data)
|
||||
void SLFloaterMediaFilter::onShowIPs()
|
||||
{
|
||||
LLViewerParcelMedia::clearDomainFilterList();
|
||||
mShowIPs = true;
|
||||
mIsDirty = true;
|
||||
}
|
||||
|
||||
void SLFloaterMediaFilter::onShowIPs(void* data)
|
||||
void SLFloaterMediaFilter::onWhitelistAdd()
|
||||
{
|
||||
sShowIPs = true;
|
||||
setDirty();
|
||||
childDisable("clear_lists");
|
||||
childDisable("show_ips");
|
||||
childDisable("blacklist_list");
|
||||
childDisable("whitelist_list");
|
||||
childDisable("remove_whitelist");
|
||||
childDisable("add_whitelist");
|
||||
childDisable("remove_blacklist");
|
||||
childDisable("add_blacklist");
|
||||
childEnable("input_domain");
|
||||
childEnable("commit_domain");
|
||||
childSetText("add_text", std::string("Enter the domain/url to add to the white list:"));
|
||||
mIsWhitelist = true;
|
||||
}
|
||||
|
||||
void SLFloaterMediaFilter::onWhitelistAdd(void* data)
|
||||
void SLFloaterMediaFilter::onWhitelistRemove()
|
||||
{
|
||||
if (!sInstance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
sInstance->childDisable("clear_lists");
|
||||
sInstance->childDisable("show_ips");
|
||||
sInstance->childDisable("blacklist_list");
|
||||
sInstance->childDisable("whitelist_list");
|
||||
sInstance->childDisable("remove_whitelist");
|
||||
sInstance->childDisable("add_whitelist");
|
||||
sInstance->childDisable("remove_blacklist");
|
||||
sInstance->childDisable("add_blacklist");
|
||||
sInstance->childEnable("input_domain");
|
||||
sInstance->childEnable("commit_domain");
|
||||
sInstance->childSetText("add_text", std::string("Enter the domain/url to add to the white list:"));
|
||||
sIsWhitelist = true;
|
||||
}
|
||||
|
||||
void SLFloaterMediaFilter::onWhitelistRemove(void* data)
|
||||
{
|
||||
if (!sInstance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLScrollListItem* selected = sInstance->mWhitelistSLC->getFirstSelected();
|
||||
LLScrollListItem* selected = mWhitelistSLC->getFirstSelected();
|
||||
|
||||
if (selected)
|
||||
{
|
||||
std::string domain = sInstance->mWhitelistSLC->getSelectedItemLabel();
|
||||
std::string domain = mWhitelistSLC->getSelectedItemLabel();
|
||||
size_t pos = domain.find(' ');
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
@@ -265,7 +239,7 @@ void SLFloaterMediaFilter::onWhitelistRemove(void* data)
|
||||
}
|
||||
}
|
||||
|
||||
if (sInstance->childGetValue("match_ip") && domain.find('/') == std::string::npos)
|
||||
if (childGetValue("match_ip") && domain.find('/') == std::string::npos)
|
||||
{
|
||||
LLHost host;
|
||||
host.setHostByName(domain);
|
||||
@@ -291,37 +265,29 @@ void SLFloaterMediaFilter::onWhitelistRemove(void* data)
|
||||
}
|
||||
}
|
||||
|
||||
void SLFloaterMediaFilter::onBlacklistAdd(void* data)
|
||||
void SLFloaterMediaFilter::onBlacklistAdd()
|
||||
{
|
||||
if (!sInstance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
sInstance->childDisable("clear_lists");
|
||||
sInstance->childDisable("show_ips");
|
||||
sInstance->childDisable("blacklist_list");
|
||||
sInstance->childDisable("whitelist_list");
|
||||
sInstance->childDisable("remove_whitelist");
|
||||
sInstance->childDisable("add_whitelist");
|
||||
sInstance->childDisable("remove_blacklist");
|
||||
sInstance->childDisable("add_blacklist");
|
||||
sInstance->childEnable("input_domain");
|
||||
sInstance->childEnable("commit_domain");
|
||||
sInstance->childSetText("add_text", std::string("Enter the domain/url to add to the black list:"));
|
||||
sIsWhitelist = false;
|
||||
childDisable("clear_lists");
|
||||
childDisable("show_ips");
|
||||
childDisable("blacklist_list");
|
||||
childDisable("whitelist_list");
|
||||
childDisable("remove_whitelist");
|
||||
childDisable("add_whitelist");
|
||||
childDisable("remove_blacklist");
|
||||
childDisable("add_blacklist");
|
||||
childEnable("input_domain");
|
||||
childEnable("commit_domain");
|
||||
childSetText("add_text", std::string("Enter the domain/url to add to the black list:"));
|
||||
mIsWhitelist = false;
|
||||
}
|
||||
|
||||
void SLFloaterMediaFilter::onBlacklistRemove(void* data)
|
||||
void SLFloaterMediaFilter::onBlacklistRemove()
|
||||
{
|
||||
if (!sInstance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLScrollListItem* selected = sInstance->mBlacklistSLC->getFirstSelected();
|
||||
LLScrollListItem* selected = mBlacklistSLC->getFirstSelected();
|
||||
|
||||
if (selected)
|
||||
{
|
||||
std::string domain = sInstance->mBlacklistSLC->getSelectedItemLabel();
|
||||
std::string domain = mBlacklistSLC->getSelectedItemLabel();
|
||||
size_t pos = domain.find(' ');
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
@@ -339,7 +305,7 @@ void SLFloaterMediaFilter::onBlacklistRemove(void* data)
|
||||
}
|
||||
}
|
||||
|
||||
if (sInstance->childGetValue("match_ip") && domain.find('/') == std::string::npos)
|
||||
if (childGetValue("match_ip") && domain.find('/') == std::string::npos)
|
||||
{
|
||||
LLHost host;
|
||||
host.setHostByName(domain);
|
||||
@@ -365,18 +331,14 @@ void SLFloaterMediaFilter::onBlacklistRemove(void* data)
|
||||
}
|
||||
}
|
||||
|
||||
void SLFloaterMediaFilter::onCommitDomain(void* data)
|
||||
void SLFloaterMediaFilter::onCommitDomain()
|
||||
{
|
||||
if (!sInstance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::string domain = sInstance->childGetText("input_domain");
|
||||
std::string domain = childGetText("input_domain");
|
||||
domain = LLViewerParcelMedia::extractDomain(domain);
|
||||
LLHost host;
|
||||
host.setHostByName(domain);
|
||||
std::string ip = host.getIPString();
|
||||
bool match_ip = (sInstance->childGetValue("match_ip") && ip != domain && domain.find('/') == std::string::npos);
|
||||
bool match_ip = (childGetValue("match_ip") && ip != domain && domain.find('/') == std::string::npos);
|
||||
|
||||
if (!domain.empty())
|
||||
{
|
||||
@@ -403,7 +365,7 @@ void SLFloaterMediaFilter::onCommitDomain(void* data)
|
||||
}
|
||||
LLSD newmedia;
|
||||
newmedia["domain"] = domain;
|
||||
if (sIsWhitelist)
|
||||
if (mIsWhitelist)
|
||||
{
|
||||
newmedia["action"] = "allow";
|
||||
}
|
||||
@@ -420,17 +382,17 @@ void SLFloaterMediaFilter::onCommitDomain(void* data)
|
||||
LLViewerParcelMedia::saveDomainFilterList();
|
||||
}
|
||||
|
||||
sInstance->childEnable("clear_lists");
|
||||
sInstance->childEnable("show_ips");
|
||||
sInstance->childEnable("blacklist_list");
|
||||
sInstance->childEnable("whitelist_list");
|
||||
sInstance->childEnable("remove_whitelist");
|
||||
sInstance->childEnable("add_whitelist");
|
||||
sInstance->childEnable("remove_blacklist");
|
||||
sInstance->childEnable("add_blacklist");
|
||||
sInstance->childDisable("input_domain");
|
||||
sInstance->childDisable("commit_domain");
|
||||
sInstance->childSetText("add_text", std::string("New domain:"));
|
||||
sInstance->childSetText("input_domain", std::string(""));
|
||||
childEnable("clear_lists");
|
||||
childEnable("show_ips");
|
||||
childEnable("blacklist_list");
|
||||
childEnable("whitelist_list");
|
||||
childEnable("remove_whitelist");
|
||||
childEnable("add_whitelist");
|
||||
childEnable("remove_blacklist");
|
||||
childEnable("add_blacklist");
|
||||
childDisable("input_domain");
|
||||
childDisable("commit_domain");
|
||||
childSetText("add_text", std::string("New domain:"));
|
||||
childSetText("input_domain", std::string(""));
|
||||
setDirty();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLScrollListCtrl;
|
||||
class LLButton;
|
||||
|
||||
class SLFloaterMediaFilter : public LLFloater, public LLFloaterSingleton<SLFloaterMediaFilter>
|
||||
{
|
||||
@@ -48,24 +47,20 @@ public:
|
||||
virtual void draw();
|
||||
virtual ~SLFloaterMediaFilter();
|
||||
|
||||
static void setDirty();
|
||||
void setDirty();
|
||||
|
||||
static void onClearLists(void*);
|
||||
static void onShowIPs(void*);
|
||||
static void onWhitelistAdd(void*);
|
||||
static void onWhitelistRemove(void*);
|
||||
static void onBlacklistAdd(void*);
|
||||
static void onBlacklistRemove(void*);
|
||||
static void onCommitDomain(void*);
|
||||
void onShowIPs();
|
||||
void onWhitelistAdd();
|
||||
void onWhitelistRemove();
|
||||
void onBlacklistAdd();
|
||||
void onBlacklistRemove();
|
||||
void onCommitDomain();
|
||||
|
||||
private:
|
||||
static bool sIsWhitelist;
|
||||
static bool sShowIPs;
|
||||
bool mIsWhitelist;
|
||||
bool mShowIPs;
|
||||
LLScrollListCtrl* mWhitelistSLC;
|
||||
LLScrollListCtrl* mBlacklistSLC;
|
||||
bool mIsDirty;
|
||||
|
||||
static SLFloaterMediaFilter* sInstance;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user