aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llpreview.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/newview/llpreview.cpp')
-rw-r--r--linden/indra/newview/llpreview.cpp36
1 files changed, 29 insertions, 7 deletions
diff --git a/linden/indra/newview/llpreview.cpp b/linden/indra/newview/llpreview.cpp
index c5dc414..534513f 100644
--- a/linden/indra/newview/llpreview.cpp
+++ b/linden/indra/newview/llpreview.cpp
@@ -52,6 +52,7 @@
52// Globals and statics 52// Globals and statics
53LLPreview::preview_multimap_t LLPreview::sPreviewsBySource; 53LLPreview::preview_multimap_t LLPreview::sPreviewsBySource;
54LLPreview::preview_map_t LLPreview::sInstances; 54LLPreview::preview_map_t LLPreview::sInstances;
55std::map<LLUUID, LLViewHandle> LLMultiPreview::sAutoOpenPreviewHandles;
55 56
56// Functions 57// Functions
57LLPreview::LLPreview(const std::string& name) : 58LLPreview::LLPreview(const std::string& name) :
@@ -219,11 +220,11 @@ void LLPreview::onCommit()
219 { 220 {
220 gSelectMgr->deselectAll(); 221 gSelectMgr->deselectAll();
221 gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); 222 gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE );
222 gSelectMgr->setObjectDescription( childGetText("desc") ); 223 gSelectMgr->selectionSetObjectDescription( childGetText("desc") );
223 224
224 if( has_sale_info ) 225 if( has_sale_info )
225 { 226 {
226 gSelectMgr->setObjectSaleInfo( sale_info ); 227 gSelectMgr->selectionSetObjectSaleInfo( sale_info );
227 } 228 }
228 229
229 gSelectMgr->deselectAll(); 230 gSelectMgr->deselectAll();
@@ -272,7 +273,7 @@ LLPreview* LLPreview::show( const LLUUID& item_uuid, BOOL take_focus )
272 // needs to be rehosted 273 // needs to be rehosted
273 LLFloater::getFloaterHost()->addFloater(instance, TRUE); 274 LLFloater::getFloaterHost()->addFloater(instance, TRUE);
274 } 275 }
275 instance->open(); 276 instance->open(); /*Flawfinder: ignore*/
276 if (take_focus) 277 if (take_focus)
277 { 278 {
278 instance->setFocus(TRUE); 279 instance->setFocus(TRUE);
@@ -382,14 +383,14 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask)
382 return LLFloater::handleHover(x,y,mask); 383 return LLFloater::handleHover(x,y,mask);
383} 384}
384 385
385void LLPreview::open() 386void LLPreview::open() /*Flawfinder: ignore*/
386{ 387{
387 LLMultiFloater* hostp = getHost(); 388 LLMultiFloater* hostp = getHost();
388 if (!sHostp && !hostp && getAssetStatus() == PREVIEW_ASSET_UNLOADED) 389 if (!sHostp && !hostp && getAssetStatus() == PREVIEW_ASSET_UNLOADED)
389 { 390 {
390 loadAsset(); 391 loadAsset();
391 } 392 }
392 LLFloater::open(); 393 LLFloater::open(); /*Flawfinder: ignore*/
393} 394}
394 395
395// virtual 396// virtual
@@ -491,11 +492,12 @@ LLPreview* LLPreview::getFirstPreviewForSource(const LLUUID& source_id)
491 492
492LLMultiPreview::LLMultiPreview(const LLRect& rect) : LLMultiFloater("Preview", rect) 493LLMultiPreview::LLMultiPreview(const LLRect& rect) : LLMultiFloater("Preview", rect)
493{ 494{
495 setCanResize(TRUE);
494} 496}
495 497
496void LLMultiPreview::open() 498void LLMultiPreview::open() /*Flawfinder: ignore*/
497{ 499{
498 LLMultiFloater::open(); 500 LLMultiFloater::open(); /*Flawfinder: ignore*/
499 LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel(); 501 LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel();
500 if (frontmost_preview && frontmost_preview->getAssetStatus() == LLPreview::PREVIEW_ASSET_UNLOADED) 502 if (frontmost_preview && frontmost_preview->getAssetStatus() == LLPreview::PREVIEW_ASSET_UNLOADED)
501 { 503 {
@@ -511,3 +513,23 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click)
511 opened_preview->loadAsset(); 513 opened_preview->loadAsset();
512 } 514 }
513} 515}
516
517//static
518LLMultiPreview* LLMultiPreview::getAutoOpenInstance(const LLUUID& id)
519{
520 handle_map_t::iterator found_it = sAutoOpenPreviewHandles.find(id);
521 if (found_it != sAutoOpenPreviewHandles.end())
522 {
523 return (LLMultiPreview*)gFloaterView->getFloaterByHandle(found_it->second);
524 }
525 return NULL;
526}
527
528//static
529void LLMultiPreview::setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& id)
530{
531 if (previewp)
532 {
533 sAutoOpenPreviewHandles[id] = previewp->getHandle();
534 }
535}