aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llpreview.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llpreview.cpp')
-rw-r--r--linden/indra/newview/llpreview.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/linden/indra/newview/llpreview.cpp b/linden/indra/newview/llpreview.cpp
index 0549b16..8827598 100644
--- a/linden/indra/newview/llpreview.cpp
+++ b/linden/indra/newview/llpreview.cpp
@@ -56,7 +56,7 @@
56// Globals and statics 56// Globals and statics
57LLPreview::preview_multimap_t LLPreview::sPreviewsBySource; 57LLPreview::preview_multimap_t LLPreview::sPreviewsBySource;
58LLPreview::preview_map_t LLPreview::sInstances; 58LLPreview::preview_map_t LLPreview::sInstances;
59std::map<LLUUID, LLViewHandle> LLMultiPreview::sAutoOpenPreviewHandles; 59std::map<LLUUID, LLHandle<LLFloater> > LLMultiPreview::sAutoOpenPreviewHandles;
60 60
61// Functions 61// Functions
62LLPreview::LLPreview(const std::string& name) : 62LLPreview::LLPreview(const std::string& name) :
@@ -72,7 +72,7 @@ LLPreview::LLPreview(const std::string& name) :
72 // don't add to instance list, since ItemID is null 72 // don't add to instance list, since ItemID is null
73 mAuxItem = new LLInventoryItem; // (LLPointer is auto-deleted) 73 mAuxItem = new LLInventoryItem; // (LLPointer is auto-deleted)
74 // don't necessarily steal focus on creation -- sometimes these guys pop up without user action 74 // don't necessarily steal focus on creation -- sometimes these guys pop up without user action
75 mAutoFocus = FALSE; 75 setAutoFocus(FALSE);
76 gInventory.addObserver(this); 76 gInventory.addObserver(this);
77} 77}
78 78
@@ -91,7 +91,7 @@ LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::str
91{ 91{
92 mAuxItem = new LLInventoryItem; 92 mAuxItem = new LLInventoryItem;
93 // don't necessarily steal focus on creation -- sometimes these guys pop up without user action 93 // don't necessarily steal focus on creation -- sometimes these guys pop up without user action
94 mAutoFocus = FALSE; 94 setAutoFocus(FALSE);
95 95
96 if (mItemUUID.notNull()) 96 if (mItemUUID.notNull())
97 { 97 {
@@ -114,7 +114,7 @@ LLPreview::~LLPreview()
114 preview_multimap_t::iterator found_it = sPreviewsBySource.find(mSourceID); 114 preview_multimap_t::iterator found_it = sPreviewsBySource.find(mSourceID);
115 for (; found_it != sPreviewsBySource.end(); ++found_it) 115 for (; found_it != sPreviewsBySource.end(); ++found_it)
116 { 116 {
117 if (found_it->second == mViewHandle) 117 if (found_it->second == getHandle())
118 { 118 {
119 sPreviewsBySource.erase(found_it); 119 sPreviewsBySource.erase(found_it);
120 break; 120 break;
@@ -152,7 +152,7 @@ void LLPreview::setSourceID(const LLUUID& source_id)
152 preview_multimap_t::iterator found_it = sPreviewsBySource.find(mSourceID); 152 preview_multimap_t::iterator found_it = sPreviewsBySource.find(mSourceID);
153 for (; found_it != sPreviewsBySource.end(); ++found_it) 153 for (; found_it != sPreviewsBySource.end(); ++found_it)
154 { 154 {
155 if (found_it->second == mViewHandle) 155 if (found_it->second == getHandle())
156 { 156 {
157 sPreviewsBySource.erase(found_it); 157 sPreviewsBySource.erase(found_it);
158 break; 158 break;
@@ -160,7 +160,7 @@ void LLPreview::setSourceID(const LLUUID& source_id)
160 } 160 }
161 } 161 }
162 mSourceID = source_id; 162 mSourceID = source_id;
163 sPreviewsBySource.insert(preview_multimap_t::value_type(mSourceID, mViewHandle)); 163 sPreviewsBySource.insert(preview_multimap_t::value_type(mSourceID, getHandle()));
164} 164}
165 165
166const LLViewerInventoryItem *LLPreview::getItem() const 166const LLViewerInventoryItem *LLPreview::getItem() const
@@ -427,8 +427,7 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask)
427 427
428void LLPreview::open() /*Flawfinder: ignore*/ 428void LLPreview::open() /*Flawfinder: ignore*/
429{ 429{
430 LLMultiFloater* hostp = getHost(); 430 if (!getFloaterHost() && !getHost() && getAssetStatus() == PREVIEW_ASSET_UNLOADED)
431 if (!sHostp && !hostp && getAssetStatus() == PREVIEW_ASSET_UNLOADED)
432 { 431 {
433 loadAsset(); 432 loadAsset();
434 } 433 }
@@ -468,6 +467,7 @@ void LLPreview::onBtnCopyToInv(void* userdata)
468 cb); 467 cb);
469 } 468 }
470 } 469 }
470 self->close();
471} 471}
472 472
473// static 473// static
@@ -523,14 +523,14 @@ LLPreview* LLPreview::getFirstPreviewForSource(const LLUUID& source_id)
523 if (found_it != sPreviewsBySource.end()) 523 if (found_it != sPreviewsBySource.end())
524 { 524 {
525 // just return first one 525 // just return first one
526 return (LLPreview*)LLFloater::getFloaterByHandle(found_it->second); 526 return (LLPreview*)found_it->second.get();
527 } 527 }
528 return NULL; 528 return NULL;
529} 529}
530 530
531void LLPreview::userSetShape(const LLRect& new_rect) 531void LLPreview::userSetShape(const LLRect& new_rect)
532{ 532{
533 if(new_rect.getWidth() != mRect.getWidth() || new_rect.getHeight() != mRect.getHeight()) 533 if(new_rect.getWidth() != getRect().getWidth() || new_rect.getHeight() != getRect().getHeight())
534 { 534 {
535 userResized(); 535 userResized();
536 } 536 }
@@ -559,7 +559,7 @@ void LLMultiPreview::open() /*Flawfinder: ignore*/
559 559
560void LLMultiPreview::userSetShape(const LLRect& new_rect) 560void LLMultiPreview::userSetShape(const LLRect& new_rect)
561{ 561{
562 if(new_rect.getWidth() != mRect.getWidth() || new_rect.getHeight() != mRect.getHeight()) 562 if(new_rect.getWidth() != getRect().getWidth() || new_rect.getHeight() != getRect().getHeight())
563 { 563 {
564 LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel(); 564 LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel();
565 if (frontmost_preview) frontmost_preview->userResized(); 565 if (frontmost_preview) frontmost_preview->userResized();
@@ -583,7 +583,7 @@ LLMultiPreview* LLMultiPreview::getAutoOpenInstance(const LLUUID& id)
583 handle_map_t::iterator found_it = sAutoOpenPreviewHandles.find(id); 583 handle_map_t::iterator found_it = sAutoOpenPreviewHandles.find(id);
584 if (found_it != sAutoOpenPreviewHandles.end()) 584 if (found_it != sAutoOpenPreviewHandles.end())
585 { 585 {
586 return (LLMultiPreview*)gFloaterView->getFloaterByHandle(found_it->second); 586 return (LLMultiPreview*)found_it->second.get();
587 } 587 }
588 return NULL; 588 return NULL;
589} 589}