Annotation of /trunk/indra/newview/llpanelpick.cpp
Parent Directory
|
Revision Log
Revision 137 - (view) (download)
| 1 : | mjm | 135 | /** |
| 2 : | * @file llpanelpick.cpp | ||
| 3 : | * @brief LLPanelPick class implementation | ||
| 4 : | * | ||
| 5 : | * $LicenseInfo:firstyear=2004&license=viewergpl$ | ||
| 6 : | * | ||
| 7 : | mjm | 137 | * Copyright (c) 2004-2010, Linden Research, Inc. |
| 8 : | mjm | 135 | * |
| 9 : | * Second Life Viewer Source Code | ||
| 10 : | * The source code in this file ("Source Code") is provided by Linden Lab | ||
| 11 : | * to you under the terms of the GNU General Public License, version 2.0 | ||
| 12 : | * ("GPL"), unless you have obtained a separate licensing agreement | ||
| 13 : | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
| 14 : | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
| 15 : | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
| 16 : | * | ||
| 17 : | * There are special exceptions to the terms and conditions of the GPL as | ||
| 18 : | * it is applied to this Source Code. View the full text of the exception | ||
| 19 : | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
| 20 : | * online at | ||
| 21 : | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
| 22 : | * | ||
| 23 : | * By copying, modifying or distributing this software, you acknowledge | ||
| 24 : | * that you have read and understood your obligations described above, | ||
| 25 : | * and agree to abide by those obligations. | ||
| 26 : | * | ||
| 27 : | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
| 28 : | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
| 29 : | * COMPLETENESS OR PERFORMANCE. | ||
| 30 : | * $/LicenseInfo$ | ||
| 31 : | */ | ||
| 32 : | |||
| 33 : | // Display of a "Top Pick" used both for the global top picks in the | ||
| 34 : | // Find directory, and also for each individual user's picks in their | ||
| 35 : | // profile. | ||
| 36 : | |||
| 37 : | #include "llviewerprecompiledheaders.h" | ||
| 38 : | |||
| 39 : | #include "llpanelpick.h" | ||
| 40 : | |||
| 41 : | #include "lldir.h" | ||
| 42 : | #include "llparcel.h" | ||
| 43 : | #include "message.h" | ||
| 44 : | |||
| 45 : | #include "llagent.h" | ||
| 46 : | #include "llbutton.h" | ||
| 47 : | #include "llcheckboxctrl.h" | ||
| 48 : | #include "llviewercontrol.h" | ||
| 49 : | #include "lllineeditor.h" | ||
| 50 : | #include "lltabcontainervertical.h" | ||
| 51 : | #include "lltextbox.h" | ||
| 52 : | #include "llviewertexteditor.h" | ||
| 53 : | #include "lltexturectrl.h" | ||
| 54 : | #include "lluiconstants.h" | ||
| 55 : | #include "llviewergenericmessage.h" | ||
| 56 : | #include "lluictrlfactory.h" | ||
| 57 : | #include "llviewerparcelmgr.h" | ||
| 58 : | #include "llworldmap.h" | ||
| 59 : | #include "llfloaterworldmap.h" | ||
| 60 : | #include "llviewerregion.h" | ||
| 61 : | #include "llviewerwindow.h" | ||
| 62 : | |||
| 63 : | //static | ||
| 64 : | std::list<LLPanelPick*> LLPanelPick::sAllPanels; | ||
| 65 : | |||
| 66 : | LLPanelPick::LLPanelPick(BOOL top_pick) | ||
| 67 : | : LLPanel(std::string("Top Picks Panel")), | ||
| 68 : | mTopPick(top_pick), | ||
| 69 : | mPickID(), | ||
| 70 : | mCreatorID(), | ||
| 71 : | mParcelID(), | ||
| 72 : | mDataRequested(FALSE), | ||
| 73 : | mDataReceived(FALSE), | ||
| 74 : | mPosGlobal(), | ||
| 75 : | mSnapshotCtrl(NULL), | ||
| 76 : | mNameEditor(NULL), | ||
| 77 : | mDescEditor(NULL), | ||
| 78 : | mLocationEditor(NULL), | ||
| 79 : | mTeleportBtn(NULL), | ||
| 80 : | mMapBtn(NULL), | ||
| 81 : | //mLandmarkBtn(NULL), | ||
| 82 : | mSortOrderText(NULL), | ||
| 83 : | mSortOrderEditor(NULL), | ||
| 84 : | mEnabledCheck(NULL), | ||
| 85 : | mSetBtn(NULL) | ||
| 86 : | { | ||
| 87 : | sAllPanels.push_back(this); | ||
| 88 : | |||
| 89 : | std::string pick_def_file; | ||
| 90 : | if (top_pick) | ||
| 91 : | { | ||
| 92 : | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_top_pick.xml"); | ||
| 93 : | } | ||
| 94 : | else | ||
| 95 : | { | ||
| 96 : | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_pick.xml"); | ||
| 97 : | } | ||
| 98 : | } | ||
| 99 : | |||
| 100 : | |||
| 101 : | LLPanelPick::~LLPanelPick() | ||
| 102 : | { | ||
| 103 : | sAllPanels.remove(this); | ||
| 104 : | } | ||
| 105 : | |||
| 106 : | |||
| 107 : | void LLPanelPick::reset() | ||
| 108 : | { | ||
| 109 : | mPickID.setNull(); | ||
| 110 : | mCreatorID.setNull(); | ||
| 111 : | mParcelID.setNull(); | ||
| 112 : | |||
| 113 : | // Don't request data, this isn't valid | ||
| 114 : | mDataRequested = TRUE; | ||
| 115 : | mDataReceived = FALSE; | ||
| 116 : | |||
| 117 : | mPosGlobal.clearVec(); | ||
| 118 : | |||
| 119 : | clearCtrls(); | ||
| 120 : | } | ||
| 121 : | |||
| 122 : | |||
| 123 : | BOOL LLPanelPick::postBuild() | ||
| 124 : | { | ||
| 125 : | mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); | ||
| 126 : | mSnapshotCtrl->setCommitCallback(onCommitAny); | ||
| 127 : | mSnapshotCtrl->setCallbackUserData(this); | ||
| 128 : | |||
| 129 : | mNameEditor = getChild<LLLineEditor>("given_name_editor"); | ||
| 130 : | mNameEditor->setCommitOnFocusLost(TRUE); | ||
| 131 : | mNameEditor->setCommitCallback(onCommitAny); | ||
| 132 : | mNameEditor->setCallbackUserData(this); | ||
| 133 : | |||
| 134 : | mDescEditor = getChild<LLTextEditor>("desc_editor"); | ||
| 135 : | mDescEditor->setCommitOnFocusLost(TRUE); | ||
| 136 : | mDescEditor->setCommitCallback(onCommitAny); | ||
| 137 : | mDescEditor->setCallbackUserData(this); | ||
| 138 : | mDescEditor->setTabsToNextField(TRUE); | ||
| 139 : | |||
| 140 : | mLocationEditor = getChild<LLLineEditor>("location_editor"); | ||
| 141 : | |||
| 142 : | mSetBtn = getChild<LLButton>( "set_location_btn"); | ||
| 143 : | mSetBtn->setClickedCallback(onClickSet); | ||
| 144 : | mSetBtn->setCallbackUserData(this); | ||
| 145 : | |||
| 146 : | mTeleportBtn = getChild<LLButton>( "pick_teleport_btn"); | ||
| 147 : | mTeleportBtn->setClickedCallback(onClickTeleport); | ||
| 148 : | mTeleportBtn->setCallbackUserData(this); | ||
| 149 : | |||
| 150 : | mMapBtn = getChild<LLButton>( "pick_map_btn"); | ||
| 151 : | mMapBtn->setClickedCallback(onClickMap); | ||
| 152 : | mMapBtn->setCallbackUserData(this); | ||
| 153 : | |||
| 154 : | mSortOrderText = getChild<LLTextBox>("sort_order_text"); | ||
| 155 : | |||
| 156 : | mSortOrderEditor = getChild<LLLineEditor>("sort_order_editor"); | ||
| 157 : | mSortOrderEditor->setPrevalidate(LLLineEditor::prevalidateInt); | ||
| 158 : | mSortOrderEditor->setCommitOnFocusLost(TRUE); | ||
| 159 : | mSortOrderEditor->setCommitCallback(onCommitAny); | ||
| 160 : | mSortOrderEditor->setCallbackUserData(this); | ||
| 161 : | |||
| 162 : | mEnabledCheck = getChild<LLCheckBoxCtrl>( "enabled_check"); | ||
| 163 : | mEnabledCheck->setCommitCallback(onCommitAny); | ||
| 164 : | mEnabledCheck->setCallbackUserData(this); | ||
| 165 : | |||
| 166 : | return TRUE; | ||
| 167 : | } | ||
| 168 : | |||
| 169 : | |||
| 170 : | // Fill in some reasonable defaults for a new pick. | ||
| 171 : | void LLPanelPick::initNewPick() | ||
| 172 : | { | ||
| 173 : | //MK | ||
| 174 : | if (gRRenabled && gAgent.mRRInterface.mContainsShowloc) | ||
| 175 : | { | ||
| 176 : | return; | ||
| 177 : | } | ||
| 178 : | //mk | ||
| 179 : | mPickID.generate(); | ||
| 180 : | |||
| 181 : | mCreatorID = gAgent.getID(); | ||
| 182 : | |||
| 183 : | mPosGlobal = gAgent.getPositionGlobal(); | ||
| 184 : | |||
| 185 : | // Try to fill in the current parcel | ||
| 186 : | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); | ||
| 187 : | if (parcel) | ||
| 188 : | { | ||
| 189 : | mNameEditor->setText(parcel->getName()); | ||
| 190 : | mDescEditor->setText(parcel->getDesc()); | ||
| 191 : | mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); | ||
| 192 : | } | ||
| 193 : | |||
| 194 : | // Commit to the database, since we've got "new" values. | ||
| 195 : | sendPickInfoUpdate(); | ||
| 196 : | } | ||
| 197 : | |||
| 198 : | |||
| 199 : | void LLPanelPick::setPickID(const LLUUID& pick_id, const LLUUID& creator_id) | ||
| 200 : | { | ||
| 201 : | mPickID = pick_id; | ||
| 202 : | mCreatorID = creator_id; | ||
| 203 : | } | ||
| 204 : | |||
| 205 : | |||
| 206 : | // Schedules the panel to request data | ||
| 207 : | // from the server next time it is drawn. | ||
| 208 : | void LLPanelPick::markForServerRequest() | ||
| 209 : | { | ||
| 210 : | mDataRequested = FALSE; | ||
| 211 : | mDataReceived = FALSE; | ||
| 212 : | } | ||
| 213 : | |||
| 214 : | |||
| 215 : | std::string LLPanelPick::getPickName() | ||
| 216 : | { | ||
| 217 : | return mNameEditor->getText(); | ||
| 218 : | } | ||
| 219 : | |||
| 220 : | |||
| 221 : | void LLPanelPick::sendPickInfoRequest() | ||
| 222 : | { | ||
| 223 : | // Must ask for a pick based on the creator id because | ||
| 224 : | // the pick database is distributed to the inventory cluster. JC | ||
| 225 : | std::vector<std::string> strings; | ||
| 226 : | strings.push_back( mCreatorID.asString() ); | ||
| 227 : | strings.push_back( mPickID.asString() ); | ||
| 228 : | send_generic_message("pickinforequest", strings); | ||
| 229 : | |||
| 230 : | mDataRequested = TRUE; | ||
| 231 : | } | ||
| 232 : | |||
| 233 : | |||
| 234 : | void LLPanelPick::sendPickInfoUpdate() | ||
| 235 : | { | ||
| 236 : | // If we don't have a pick id yet, we'll need to generate one, | ||
| 237 : | // otherwise we'll keep overwriting pick_id 00000 in the database. | ||
| 238 : | if (mPickID.isNull()) | ||
| 239 : | { | ||
| 240 : | mPickID.generate(); | ||
| 241 : | } | ||
| 242 : | |||
| 243 : | LLMessageSystem* msg = gMessageSystem; | ||
| 244 : | |||
| 245 : | msg->newMessage("PickInfoUpdate"); | ||
| 246 : | msg->nextBlock("AgentData"); | ||
| 247 : | msg->addUUID("AgentID", gAgent.getID()); | ||
| 248 : | msg->addUUID("SessionID", gAgent.getSessionID()); | ||
| 249 : | msg->nextBlock("Data"); | ||
| 250 : | msg->addUUID("PickID", mPickID); | ||
| 251 : | msg->addUUID("CreatorID", mCreatorID); | ||
| 252 : | msg->addBOOL("TopPick", mTopPick); | ||
| 253 : | // fills in on simulator if null | ||
| 254 : | msg->addUUID("ParcelID", mParcelID); | ||
| 255 : | msg->addString("Name", mNameEditor->getText()); | ||
| 256 : | msg->addString("Desc", mDescEditor->getText()); | ||
| 257 : | msg->addUUID("SnapshotID", mSnapshotCtrl->getImageAssetID()); | ||
| 258 : | msg->addVector3d("PosGlobal", mPosGlobal); | ||
| 259 : | |||
| 260 : | // Only top picks have a sort order | ||
| 261 : | S32 sort_order; | ||
| 262 : | if (mTopPick) | ||
| 263 : | { | ||
| 264 : | sort_order = atoi(mSortOrderEditor->getText().c_str()); | ||
| 265 : | } | ||
| 266 : | else | ||
| 267 : | { | ||
| 268 : | sort_order = 0; | ||
| 269 : | } | ||
| 270 : | msg->addS32("SortOrder", sort_order); | ||
| 271 : | msg->addBOOL("Enabled", mEnabledCheck->get()); | ||
| 272 : | gAgent.sendReliableMessage(); | ||
| 273 : | } | ||
| 274 : | |||
| 275 : | |||
| 276 : | //static | ||
| 277 : | void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **) | ||
| 278 : | { | ||
| 279 : | // Extract the agent id and verify the message is for this | ||
| 280 : | // client. | ||
| 281 : | LLUUID agent_id; | ||
| 282 : | msg->getUUID("AgentData", "AgentID", agent_id ); | ||
| 283 : | if (agent_id != gAgent.getID()) | ||
| 284 : | { | ||
| 285 : | llwarns << "Agent ID mismatch in processPickInfoReply" | ||
| 286 : | << llendl; | ||
| 287 : | return; | ||
| 288 : | } | ||
| 289 : | |||
| 290 : | LLUUID pick_id; | ||
| 291 : | msg->getUUID("Data", "PickID", pick_id); | ||
| 292 : | |||
| 293 : | LLUUID creator_id; | ||
| 294 : | msg->getUUID("Data", "CreatorID", creator_id); | ||
| 295 : | |||
| 296 : | BOOL top_pick; | ||
| 297 : | msg->getBOOL("Data", "TopPick", top_pick); | ||
| 298 : | |||
| 299 : | LLUUID parcel_id; | ||
| 300 : | msg->getUUID("Data", "ParcelID", parcel_id); | ||
| 301 : | |||
| 302 : | std::string name; | ||
| 303 : | msg->getString("Data", "Name", name); | ||
| 304 : | |||
| 305 : | std::string desc; | ||
| 306 : | msg->getString("Data", "Desc", desc); | ||
| 307 : | |||
| 308 : | LLUUID snapshot_id; | ||
| 309 : | msg->getUUID("Data", "SnapshotID", snapshot_id); | ||
| 310 : | |||
| 311 : | // "Location text" is actually the owner name, the original | ||
| 312 : | // name that owner gave the parcel, and the location. | ||
| 313 : | std::string location_text; | ||
| 314 : | msg->getString("Data", "User", location_text); | ||
| 315 : | location_text.append(", "); | ||
| 316 : | |||
| 317 : | std::string original_name; | ||
| 318 : | msg->getString("Data", "OriginalName", original_name); | ||
| 319 : | if (!original_name.empty()) | ||
| 320 : | { | ||
| 321 : | location_text.append(original_name); | ||
| 322 : | location_text.append(", "); | ||
| 323 : | } | ||
| 324 : | |||
| 325 : | std::string sim_name; | ||
| 326 : | msg->getString("Data", "SimName", sim_name); | ||
| 327 : | location_text.append(sim_name); | ||
| 328 : | location_text.append(" "); | ||
| 329 : | |||
| 330 : | LLVector3d pos_global; | ||
| 331 : | msg->getVector3d("Data", "PosGlobal", pos_global); | ||
| 332 : | |||
| 333 : | S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; | ||
| 334 : | S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; | ||
| 335 : | S32 region_z = llround((F32)pos_global.mdV[VZ]); | ||
| 336 : | |||
| 337 : | location_text.append(llformat("(%d, %d, %d)", region_x, region_y, region_z)); | ||
| 338 : | |||
| 339 : | S32 sort_order; | ||
| 340 : | msg->getS32("Data", "SortOrder", sort_order); | ||
| 341 : | |||
| 342 : | BOOL enabled; | ||
| 343 : | msg->getBOOL("Data", "Enabled", enabled); | ||
| 344 : | |||
| 345 : | // Look up the panel to fill in | ||
| 346 : | for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) | ||
| 347 : | { | ||
| 348 : | LLPanelPick* self = *iter; | ||
| 349 : | // For top picks, must match pick id | ||
| 350 : | if (self->mPickID != pick_id) | ||
| 351 : | { | ||
| 352 : | continue; | ||
| 353 : | } | ||
| 354 : | |||
| 355 : | self->mDataReceived = TRUE; | ||
| 356 : | |||
| 357 : | // Found the panel, now fill in the information | ||
| 358 : | self->mPickID = pick_id; | ||
| 359 : | self->mCreatorID = creator_id; | ||
| 360 : | self->mParcelID = parcel_id; | ||
| 361 : | self->mSimName.assign(sim_name); | ||
| 362 : | self->mPosGlobal = pos_global; | ||
| 363 : | |||
| 364 : | // Update UI controls | ||
| 365 : | self->mNameEditor->setText(std::string(name)); | ||
| 366 : | self->mDescEditor->setText(std::string(desc)); | ||
| 367 : | self->mSnapshotCtrl->setImageAssetID(snapshot_id); | ||
| 368 : | self->mLocationEditor->setText(location_text); | ||
| 369 : | self->mEnabledCheck->set(enabled); | ||
| 370 : | |||
| 371 : | self->mSortOrderEditor->setText(llformat("%d", sort_order)); | ||
| 372 : | } | ||
| 373 : | } | ||
| 374 : | |||
| 375 : | void LLPanelPick::draw() | ||
| 376 : | { | ||
| 377 : | refresh(); | ||
| 378 : | |||
| 379 : | LLPanel::draw(); | ||
| 380 : | } | ||
| 381 : | |||
| 382 : | |||
| 383 : | void LLPanelPick::refresh() | ||
| 384 : | { | ||
| 385 : | if (!mDataRequested) | ||
| 386 : | { | ||
| 387 : | sendPickInfoRequest(); | ||
| 388 : | } | ||
| 389 : | |||
| 390 : | // Check for god mode | ||
| 391 : | BOOL godlike = gAgent.isGodlike(); | ||
| 392 : | BOOL is_self = (gAgent.getID() == mCreatorID); | ||
| 393 : | |||
| 394 : | // Set button visibility/enablement appropriately | ||
| 395 : | if (mTopPick) | ||
| 396 : | { | ||
| 397 : | mSnapshotCtrl->setEnabled(godlike); | ||
| 398 : | mNameEditor->setEnabled(godlike); | ||
| 399 : | mDescEditor->setEnabled(godlike); | ||
| 400 : | |||
| 401 : | mSortOrderText->setVisible(godlike); | ||
| 402 : | |||
| 403 : | mSortOrderEditor->setVisible(godlike); | ||
| 404 : | mSortOrderEditor->setEnabled(godlike); | ||
| 405 : | |||
| 406 : | mEnabledCheck->setVisible(godlike); | ||
| 407 : | mEnabledCheck->setEnabled(godlike); | ||
| 408 : | |||
| 409 : | mSetBtn->setVisible(godlike); | ||
| 410 : | mSetBtn->setEnabled(godlike); | ||
| 411 : | } | ||
| 412 : | else | ||
| 413 : | { | ||
| 414 : | mSnapshotCtrl->setEnabled(is_self); | ||
| 415 : | mNameEditor->setEnabled(is_self); | ||
| 416 : | mDescEditor->setEnabled(is_self); | ||
| 417 : | |||
| 418 : | mSortOrderText->setVisible(FALSE); | ||
| 419 : | |||
| 420 : | mSortOrderEditor->setVisible(FALSE); | ||
| 421 : | mSortOrderEditor->setEnabled(FALSE); | ||
| 422 : | |||
| 423 : | mEnabledCheck->setVisible(FALSE); | ||
| 424 : | mEnabledCheck->setEnabled(FALSE); | ||
| 425 : | |||
| 426 : | mSetBtn->setVisible(is_self); | ||
| 427 : | mSetBtn->setEnabled(is_self); | ||
| 428 : | } | ||
| 429 : | } | ||
| 430 : | |||
| 431 : | |||
| 432 : | // static | ||
| 433 : | void LLPanelPick::onClickTeleport(void* data) | ||
| 434 : | { | ||
| 435 : | LLPanelPick* self = (LLPanelPick*)data; | ||
| 436 : | |||
| 437 : | if (!self->mPosGlobal.isExactlyZero()) | ||
| 438 : | { | ||
| 439 : | gAgent.teleportViaLocation(self->mPosGlobal); | ||
| 440 : | gFloaterWorldMap->trackLocation(self->mPosGlobal); | ||
| 441 : | } | ||
| 442 : | } | ||
| 443 : | |||
| 444 : | |||
| 445 : | // static | ||
| 446 : | void LLPanelPick::onClickMap(void* data) | ||
| 447 : | { | ||
| 448 : | LLPanelPick* self = (LLPanelPick*)data; | ||
| 449 : | gFloaterWorldMap->trackLocation(self->mPosGlobal); | ||
| 450 : | LLFloaterWorldMap::show(NULL, TRUE); | ||
| 451 : | } | ||
| 452 : | |||
| 453 : | // static | ||
| 454 : | /* | ||
| 455 : | void LLPanelPick::onClickLandmark(void* data) | ||
| 456 : | { | ||
| 457 : | LLPanelPick* self = (LLPanelPick*)data; | ||
| 458 : | create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); | ||
| 459 : | } | ||
| 460 : | */ | ||
| 461 : | |||
| 462 : | // static | ||
| 463 : | void LLPanelPick::onClickSet(void* data) | ||
| 464 : | { | ||
| 465 : | //MK | ||
| 466 : | if (gRRenabled && gAgent.mRRInterface.mContainsShowloc) | ||
| 467 : | { | ||
| 468 : | // don't allow to set the location while under @showloc, or it appears on the window | ||
| 469 : | return; | ||
| 470 : | } | ||
| 471 : | //mk | ||
| 472 : | |||
| 473 : | LLPanelPick* self = (LLPanelPick*)data; | ||
| 474 : | |||
| 475 : | // Save location for later. | ||
| 476 : | self->mPosGlobal = gAgent.getPositionGlobal(); | ||
| 477 : | |||
| 478 : | std::string location_text; | ||
| 479 : | location_text.assign("(will update after save)"); | ||
| 480 : | location_text.append(", "); | ||
| 481 : | |||
| 482 : | S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; | ||
| 483 : | S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; | ||
| 484 : | S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]); | ||
| 485 : | |||
| 486 : | location_text.append(self->mSimName); | ||
| 487 : | location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); | ||
| 488 : | |||
| 489 : | // if sim name in pick is different from current sim name | ||
| 490 : | // make sure it's clear that all that's being changed | ||
| 491 : | // is the location and nothing else | ||
| 492 : | if ( gAgent.getRegion ()->getName () != self->mSimName ) | ||
| 493 : | { | ||
| 494 : | LLNotifications::instance().add("SetPickLocation"); | ||
| 495 : | }; | ||
| 496 : | |||
| 497 : | self->mLocationEditor->setText(location_text); | ||
| 498 : | |||
| 499 : | onCommitAny(NULL, data); | ||
| 500 : | } | ||
| 501 : | |||
| 502 : | |||
| 503 : | // static | ||
| 504 : | void LLPanelPick::onCommitAny(LLUICtrl* ctrl, void* data) | ||
| 505 : | { | ||
| 506 : | LLPanelPick* self = (LLPanelPick*)data; | ||
| 507 : | |||
| 508 : | // have we received up to date data for this pick? | ||
| 509 : | if (self->mDataReceived) | ||
| 510 : | { | ||
| 511 : | self->sendPickInfoUpdate(); | ||
| 512 : | |||
| 513 : | // Big hack - assume that top picks are always in a browser, | ||
| 514 : | // and non-top-picks are always in a tab container. | ||
| 515 : | /*if (self->mTopPick) | ||
| 516 : | { | ||
| 517 : | LLPanelDirPicks* panel = (LLPanelDirPicks*)self->getParent(); | ||
| 518 : | panel->renamePick(self->mPickID, self->mNameEditor->getText()); | ||
| 519 : | } | ||
| 520 : | else | ||
| 521 : | {*/ | ||
| 522 : | LLTabContainer* tab = (LLTabContainer*)self->getParent(); | ||
| 523 : | if (tab) | ||
| 524 : | { | ||
| 525 : | if(tab) tab->setCurrentTabName(self->mNameEditor->getText()); | ||
| 526 : | } | ||
| 527 : | //} | ||
| 528 : | } | ||
| 529 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

