diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 27d0111fc..0e6a4514c 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -759,8 +759,7 @@ void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl* LLUICtrl* child = getChild(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(id, true); - if (child) - { - child->setCallbackUserData(userdata); - } -} - void LLPanel::childSetColor(const std::string& id, const LLColor4& color) { LLUICtrl* child = getChild(id, true); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index d781dbae3..3080eb594 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -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); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index a5bbc9b90..3f198bbaf 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -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) diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 70f490dcc..528f413ed 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -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; diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index dd8d4e606..57f972799 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -620,5 +620,16 @@ Value /away + SinguCompleteNameProfiles + + Comment + Use the complete name "Display Name (legacy.name)" in profiles, instead of following the choice set by PhoenixNameSystem. + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 9802144ec..7d8de21ea 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -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); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 78984b3c5..b9eaa18e4 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -63,6 +63,7 @@ protected: bool mAnnounceSnapshots; bool mAnnounceStreamMetadata; bool mUnfocusedFloatersOpaque; + bool mCompleteNameProfiles; //Tags\Colors BOOL mAscentBroadcastTag; std::string mReportClientUUID; diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 6bfbad3bf..7f278fae9 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -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(); } diff --git a/indra/newview/lldroptarget.cpp b/indra/newview/lldroptarget.cpp index 610ce2068..c86e1f18c 100644 --- a/indra/newview/lldroptarget.cpp +++ b/indra/newview/lldroptarget.cpp @@ -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$ */ diff --git a/indra/newview/lldroptarget.h b/indra/newview/lldroptarget.h index 1a08484ce..e064c1b02 100644 --- a/indra/newview/lldroptarget.h +++ b/indra/newview/lldroptarget.h @@ -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$ */ diff --git a/indra/newview/llfloateravatarinfo.cpp b/indra/newview/llfloateravatarinfo.cpp index 4a6883ecf..fe13d15fd 100644 --- a/indra/newview/llfloateravatarinfo.cpp +++ b/indra/newview/llfloateravatarinfo.cpp @@ -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 diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index 552406479..cd3c85b5f 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -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; } diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index ec9bf09b0..fc358d79a 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -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(); diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h index 1a436b8bf..302428a3f 100644 --- a/indra/newview/llfloaternotificationsconsole.h +++ b/indra/newview/llfloaternotificationsconsole.h @@ -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 diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 524de0fb0..bd0f62603 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -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("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("dnname")->setText(name); } diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 2b4b7f8eb..de5f765cc 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -244,40 +244,37 @@ void LLPanelClassified::reset() BOOL LLPanelClassified::postBuild() { mSnapshotCtrl = getChild("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny); - mSnapshotCtrl->setCallbackUserData(this); + mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); mSnapshotSize = mSnapshotCtrl->getRect(); mNameEditor = getChild("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("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("location_editor"); mSetBtn = getChild( "set_location_btn"); - mSetBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickSet, this)); + mSetBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickSet, this)); mTeleportBtn = getChild( "classified_teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickTeleport, this)); + mTeleportBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickTeleport, this)); mMapBtn = getChild( "classified_map_btn"); - mMapBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickMap, this)); + mMapBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickMap, this)); if(mInFinder) { mProfileBtn = getChild( "classified_profile_btn"); - mProfileBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickProfile, this)); + mProfileBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickProfile, this)); } mCategoryCombo = getChild( "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( "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( "auto_renew_check"); - mAutoRenewCheck->setCommitCallback(onCommitAny); - mAutoRenewCheck->setCallbackUserData(this); + mAutoRenewCheck->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); } mUpdateBtn = getChild("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("set_price_btn")->setCommitCallback(boost::bind(&LLFloaterPriceForListing::buttonCore, this)); - childSetAction("cancel_btn", onClickCancel, this); + getChild("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() diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index a3bb42554..04432edfd 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -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 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; }; diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 619f89e84..ad8b2cd40 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -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("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("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(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 diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 55b5b70ad..e524a280b 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -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); diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index a69b4c76a..3deb47999 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -222,8 +222,7 @@ BOOL LLPanelGroupNotices::postBuild() mNoticesList = getChild("notice_list",recurse); mNoticesList->setCommitOnSelectionChange(TRUE); - mNoticesList->setCommitCallback(onSelectNotice); - mNoticesList->setCallbackUserData(this); + mNoticesList->setCommitCallback(boost::bind(&LLPanelGroupNotices::onSelectNotice, this)); mBtnNewMessage = getChild("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"); diff --git a/indra/newview/llpanelgroupnotices.h b/indra/newview/llpanelgroupnotices.h index 916032c1b..fdd878394 100644 --- a/indra/newview/llpanelgroupnotices.h +++ b/indra/newview/llpanelgroupnotices.h @@ -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 { diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index d341d3ce8..0b5acb543 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -198,7 +198,7 @@ BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) GP_MEMBER_EJECT | GP_MEMBER_OPTIONS ); */ - return mAllowEdit && agentp->isInGroup(mGroupID); + return agentp->isInGroup(mGroupID); } diff --git a/indra/newview/llpanelgroupvoting.cpp b/indra/newview/llpanelgroupvoting.cpp index 0eac7e5ec..2b03523b8 100644 --- a/indra/newview/llpanelgroupvoting.cpp +++ b/indra/newview/llpanelgroupvoting.cpp @@ -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() diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index f599fc915..674d9b65d 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -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::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("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny); - mSnapshotCtrl->setCallbackUserData(this); + mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this)); mNameEditor = getChild("given_name_editor"); - mNameEditor->setCommitOnFocusLost(TRUE); - mNameEditor->setCommitCallback(onCommitAny); - mNameEditor->setCallbackUserData(this); + mNameEditor->setCommitOnFocusLost(true); + mNameEditor->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this)); mDescEditor = getChild("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("location_editor"); - mSetBtn = getChild( "set_location_btn"); - mSetBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickSet,this)); + mSetBtn = getChild( "set_location_btn"); + mSetBtn->setCommitCallback(boost::bind(&LLPanelPick::onClickSet,this)); - mTeleportBtn = getChild( "pick_teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickTeleport,this)); + mOpenBtn = getChild("open_picture_btn"); + mOpenBtn->setCommitCallback(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, mSnapshotCtrl), boost::bind(&LLLineEditor::getText, mNameEditor))); - mMapBtn = getChild( "pick_map_btn"); - mMapBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickMap,this)); - - mSortOrderText = getChild("sort_order_text"); - - mSortOrderEditor = getChild("sort_order_editor"); - mSortOrderEditor->setPrevalidate(LLLineEditor::prevalidateInt); - mSortOrderEditor->setCommitOnFocusLost(TRUE); - mSortOrderEditor->setCommitCallback(onCommitAny); - mSortOrderEditor->setCallbackUserData(this); - - mEnabledCheck = getChild( "enabled_check"); - mEnabledCheck->setCommitCallback(onCommitAny); - mEnabledCheck->setCallbackUserData(this); + getChild("pick_teleport_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickTeleport,this)); + getChild("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(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(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()); - } - //} } } diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 84f41b8da..eb2d30a89 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -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 panel_list_t; static panel_list_t sAllPanels; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index d1fc130e9..950c84995 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -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("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] diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index ee56d7b5d..26b43e526 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -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) diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index d12b63997..29072ce93 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -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 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(); diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 0a364a90f..702b97ca1 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -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 ); diff --git a/indra/newview/skins/default/xui/en-us/floater_directory.xml b/indra/newview/skins/default/xui/en-us/floater_directory.xml index 78391be16..6817602b0 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory.xml @@ -703,7 +703,7 @@ To buy direct, visit the land and click on the place name in the title bar. width="430" /> - diff --git a/indra/newview/skins/default/xui/en-us/floater_directory2.xml b/indra/newview/skins/default/xui/en-us/floater_directory2.xml index 5a2cdf3c7..8f310183a 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory2.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory2.xml @@ -640,7 +640,7 @@ To buy direct, visit the land and click on the place name in the title bar. width="430" /> - diff --git a/indra/newview/skins/default/xui/en-us/floater_directory3.xml b/indra/newview/skins/default/xui/en-us/floater_directory3.xml index 57783a43f..75fb4cd87 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory3.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory3.xml @@ -762,7 +762,7 @@ To buy direct, visit the land and click on the place name in the title bar. width="430" /> - diff --git a/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml b/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml index b43b2718d..3d224ec9b 100644 --- a/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml +++ b/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml @@ -14,16 +14,9 @@ width="290" />