aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewertexteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewertexteditor.cpp92
1 files changed, 16 insertions, 76 deletions
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp
index 826c411..6a8d53e 100644
--- a/linden/indra/newview/llviewertexteditor.cpp
+++ b/linden/indra/newview/llviewertexteditor.cpp
@@ -1219,7 +1219,7 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, BOOL saved)
1219 return TRUE; 1219 return TRUE;
1220 1220
1221 case LLAssetType::AT_LANDMARK: 1221 case LLAssetType::AT_LANDMARK:
1222 showLandmarkDialog( item ); 1222 openEmbeddedLandmark( item );
1223 return TRUE; 1223 return TRUE;
1224 1224
1225 case LLAssetType::AT_LSL_TEXT: 1225 case LLAssetType::AT_LSL_TEXT:
@@ -1273,35 +1273,28 @@ void LLViewerTextEditor::openEmbeddedSound( LLInventoryItem* item )
1273 showCopyToInvDialog( item ); 1273 showCopyToInvDialog( item );
1274} 1274}
1275 1275
1276/* 1276
1277void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item ) 1277void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item )
1278{ 1278{
1279 // See if we can bring an existing preview to the front 1279 open_landmark((LLViewerInventoryItem*)item, " preview landmark", FALSE, item->getUUID(), TRUE);
1280 if( !LLPreview::show( item->getUUID() ) ) 1280}
1281 { 1281
1282 // There isn't one, so make a new preview
1283 S32 left, top;
1284 gFloaterView->getNewFloaterPosition(&left, &top);
1285 LLRect rect = gSavedSettings.getRect("PreviewLandmarkRect");
1286 rect.translate( left - rect.mLeft, top - rect.mTop );
1287
1288 LLPreviewLandmark* preview = new LLPreviewLandmark(
1289 "preview landmark",
1290 rect,
1291 item->getName(),
1292 item->getUUID());
1293 preview->setAuxItem( item );
1294 preview->addCopyToInvButton();
1295 preview->open();
1296 }
1297}*/
1298 1282
1299void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, BOOL saved ) 1283void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, BOOL saved )
1300{ 1284{
1301 if (saved) 1285 if (saved)
1302 { 1286 {
1303 // Copy to inventory 1287 // Pop-up the notecard floater.
1304 copyInventory(item); 1288 // Note: Previously would copy to inventory and rely on autodisplay to view.
1289 // Now that autodisplay can be turned off, we need to make this case display always.
1290 // besides, there's no point adding to inventory -MG
1291 open_notecard(
1292 (LLViewerInventoryItem*)item,
1293 LLString("Embedded Note: ") + item->getName(), // title
1294 mObjectID,
1295 FALSE, // show_keep_discard
1296 LLUUID::null, // source_id
1297 TRUE); // take_focus
1305 } 1298 }
1306 else 1299 else
1307 { 1300 {
@@ -1324,59 +1317,6 @@ void LLViewerTextEditor::onNotecardDialog( S32 option, void* userdata )
1324} 1317}
1325 1318
1326 1319
1327void LLViewerTextEditor::showLandmarkDialog( LLInventoryItem* item )
1328{
1329 LLNotecardCopyInfo *info = new LLNotecardCopyInfo(this, item);
1330 gViewerWindow->alertXml("ConfirmLandmarkCopy",
1331 LLViewerTextEditor::onLandmarkDialog, (void*)info);
1332}
1333
1334// static
1335void LLViewerTextEditor::onLandmarkDialog( S32 option, void* userdata )
1336{
1337 LLNotecardCopyInfo *info = (LLNotecardCopyInfo *)userdata;
1338 if( option == 0 )
1339 {
1340 // Copy to inventory
1341 info->mTextEd->copyInventory(info->mItem);
1342 /*
1343 * XXXPAM
1344 *
1345 * Yes, this is broken. We don't show the map yet.
1346 *
1347 LLInventoryItem* orig_item = (LLInventoryItem*)userdata;
1348
1349 // Copy to inventory
1350 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem;
1351 cloneInventoryItemToViewer(orig_item, new_item);
1352 U32 flags = new_item->getFlags();
1353 flags &= ~LLInventoryItem::II_FLAGS_LANDMARK_VISITED;
1354 new_item->setFlags(flags);
1355 new_item->updateServer(TRUE);
1356 gInventory.updateItem(new_item);
1357 gInventory.notifyObservers();
1358
1359 LLInventoryView* view = LLInventoryView::getActiveInventory();
1360 if(view)
1361 {
1362 view->getPanel()->setSelection(new_item->getUUID(), TAKE_FOCUS_NO);
1363 }
1364
1365 if( (0 == option) && gFloaterWorldMap )
1366 {
1367 // Note: there's a minor race condition here.
1368 // If the user immediately tries to teleport to the landmark, the dataserver may
1369 // not yet know that the user has the landmark in his inventory and so may
1370 // disallow the teleport. However, the user will need to be pretty fast to make
1371 // this happen, and, if it does, they haven't lost anything. Once the dataserver
1372 // knows about the new item, the user will be able to teleport to it successfully.
1373 gFloaterWorldMap->trackLandmark(new_item->getUUID());
1374 LLFloaterWorldMap::show(NULL, TRUE);
1375 }*/
1376 }
1377 delete info;
1378}
1379
1380 1320
1381void LLViewerTextEditor::showCopyToInvDialog( LLInventoryItem* item ) 1321void LLViewerTextEditor::showCopyToInvDialog( LLInventoryItem* item )
1382{ 1322{