From cce5dd64e09eb2f0da039c3e6c4c1ebd7b5aafeb Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 26 Jun 2011 04:59:02 -0400 Subject: STORM-1276 [MULTIPLE LANGS] Text truncation in Email Snapshot floater in Spanish localization --- indra/newview/llfloaterpostcard.cpp | 4 ++-- indra/newview/skins/default/xui/en/floater_postcard.xml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index dd0b1d999c..3bcbb987f7 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -137,9 +137,9 @@ void LLFloaterPostcard::draw() // first set the max extents of our preview rect.translate(-rect.mLeft, -rect.mBottom); - rect.mLeft += 280; + rect.mLeft += 320; rect.mRight -= 10; - rect.mTop -= 20; + rect.mTop -= 27; rect.mBottom = rect.mTop - 130; // then fix the aspect ratio diff --git a/indra/newview/skins/default/xui/en/floater_postcard.xml b/indra/newview/skins/default/xui/en/floater_postcard.xml index 8da35e9d7f..c756661ffc 100644 --- a/indra/newview/skins/default/xui/en/floater_postcard.xml +++ b/indra/newview/skins/default/xui/en/floater_postcard.xml @@ -7,11 +7,11 @@ height="380" layout="topleft" min_height="380" - min_width="450" + min_width="490" name="Postcard" help_topic="postcard" title="EMAIL SNAPSHOT" - width="450"> + width="490"> Postcard from [SECOND_LIFE]. @@ -40,7 +40,7 @@ follows="left|top" height="20" layout="topleft" - left_delta="108" + left_delta="148" name="to_form" top_delta="-4" width="150" /> @@ -59,7 +59,7 @@ follows="left|top" height="20" layout="topleft" - left_delta="108" + left_delta="148" name="from_form" top_delta="-4" width="150" /> @@ -78,7 +78,7 @@ follows="left|top" height="20" layout="topleft" - left_delta="108" + left_delta="148" max_length_bytes="100" name="name_form" top_delta="-4" @@ -99,7 +99,7 @@ height="20" label="Type your subject here." layout="topleft" - left_delta="108" + left_delta="148" max_length_bytes="100" name="subject_form" top_delta="-4" -- cgit v1.2.3 From f9cf9179122d06782f0c968ba84adc1e44dd1e21 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 11 Aug 2011 18:16:21 -0600 Subject: fix for SH-2194: viewer UI is visible on the login progress screen --- indra/newview/llstartup.cpp | 32 +++++++++++++++++++++----------- indra/newview/llviewertexture.cpp | 22 +++++++++++++++------- indra/newview/llviewertexture.h | 1 + 3 files changed, 37 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e4bf668275..9855326093 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2557,22 +2557,32 @@ void init_start_screen(S32 location_id) else if(!start_image_bmp->load(temp_str) ) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; - return; + gStartTexture = NULL; } + else + { + gStartImageWidth = start_image_bmp->getWidth(); + gStartImageHeight = start_image_bmp->getHeight(); - gStartImageWidth = start_image_bmp->getWidth(); - gStartImageHeight = start_image_bmp->getHeight(); + LLPointer raw = new LLImageRaw; + if (!start_image_bmp->decode(raw, 0.0f)) + { + LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; + gStartTexture = NULL; + } + else + { + raw->expandToPowerOfTwo(); + gStartTexture = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE) ; + } + } - LLPointer raw = new LLImageRaw; - if (!start_image_bmp->decode(raw, 0.0f)) + if(gStartTexture.isNull()) { - LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; - gStartTexture = NULL; - return; + gStartTexture = LLViewerTexture::sBlackImagep ; + gStartImageWidth = gStartTexture->getWidth() ; + gStartImageHeight = gStartTexture->getHeight() ; } - - raw->expandToPowerOfTwo(); - gStartTexture = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE) ; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5fcc57bc91..70509f9a9f 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -66,6 +66,7 @@ // statics LLPointer LLViewerTexture::sNullImagep = NULL; +LLPointer LLViewerTexture::sBlackImagep = NULL; LLPointer LLViewerFetchedTexture::sMissingAssetImagep = NULL; LLPointer LLViewerFetchedTexture::sWhiteImagep = NULL; LLPointer LLViewerFetchedTexture::sDefaultImagep = NULL; @@ -295,17 +296,23 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromHost(const void LLViewerTextureManager::init() { - LLPointer raw = new LLImageRaw(1,1,3); - raw->clear(0x77, 0x77, 0x77, 0xFF); - LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), TRUE) ; - -#if 1 - LLPointer imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT); - LLViewerFetchedTexture::sDefaultImagep = imagep; + { + LLPointer raw = new LLImageRaw(1,1,3); + raw->clear(0x77, 0x77, 0x77, 0xFF); + LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), TRUE) ; + } const S32 dim = 128; LLPointer image_raw = new LLImageRaw(dim,dim,3); U8* data = image_raw->getData(); + + memset(data, 0, dim * dim * 3) ; + LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE) ; + +#if 1 + LLPointer imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT); + LLViewerFetchedTexture::sDefaultImagep = imagep; + for (S32 i = 0; i sNullImagep; // Null texture for non-textured objects. + static LLPointer sBlackImagep; // Texture to show NOTHING (pure black) }; -- cgit v1.2.3 From b5f1ee387848e56cb2cd42195056ff5cd7baa01e Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 16 Aug 2011 17:00:12 -0600 Subject: fix for SH-2023: Brightness Bump maps don't load when shadows are enabled --- indra/newview/lldrawpoolbump.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 6f71c54f79..eb78e28306 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1078,6 +1078,7 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText { src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ; src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL ); + src_image->forceToSaveRawImage(0) ; } } } -- cgit v1.2.3 From dfcc0849495d40459bce60d4eb754128d6ea53db Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 17 Aug 2011 15:16:02 -0600 Subject: fix for SH-1142: HUD objects do not display bumpmaps when Lighting and Shadows are enabled. --- indra/newview/llspatialpartition.cpp | 9 +++++++++ indra/newview/llspatialpartition.h | 2 ++ indra/newview/llvovolume.cpp | 7 ++++--- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index e23b431457..fd17781a2e 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -523,6 +523,11 @@ void LLSpatialGroup::clearDrawMap() mDrawMap.clear(); } +BOOL LLSpatialGroup::isHUDGroup() +{ + return mSpatialPartition && mSpatialPartition->isHUDPartition() ; +} + BOOL LLSpatialGroup::isRecentlyVisible() const { return (LLDrawable::getCurrentFrame() - mVisible[LLViewerCamera::sCurCameraID]) < LLDrawable::getMinVisFrameRange() ; @@ -4155,6 +4160,10 @@ void LLSpatialGroup::drawObjectBox(LLColor4 col) drawBox(mObjectBounds[0], size); } +bool LLSpatialPartition::isHUDPartition() +{ + return mPartitionType == LLViewerRegion::PARTITION_HUD ; +} BOOL LLSpatialPartition::isVisible(const LLVector3& v) { diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 54d5d36f6e..11955540c6 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -282,6 +282,7 @@ public: LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part); + BOOL isHUDGroup() ; BOOL isDead() { return isState(DEAD); } BOOL isState(U32 state) const; BOOL isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state ? TRUE : FALSE; } @@ -470,6 +471,7 @@ public: S32 cull(LLCamera &camera, std::vector* results = NULL, BOOL for_select = FALSE); // Cull on arbitrary frustum BOOL isVisible(const LLVector3& v); + bool isHUDPartition() ; virtual LLSpatialBridge* asBridge() { return NULL; } virtual BOOL isBridge() { return asBridge() != NULL; } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index eb3ed3c379..528c7acbc8 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4490,6 +4490,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: std::sort(faces.begin(), faces.end(), LLFace::CompareDistanceGreater()); } + bool hud_group = group->isHUDGroup() ; std::vector::iterator face_iter = faces.begin(); LLSpatialGroup::buffer_map_t buffer_map; @@ -4760,7 +4761,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY); registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } - else if (LLPipeline::sRenderDeferred) + else if (LLPipeline::sRenderDeferred && !hud_group) { //deferred rendering if (te->getFullbright()) { //register in post deferred fullbright shiny pass @@ -4798,7 +4799,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: else if (fullbright || bake_sunlight) { //fullbright registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); - if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) + if (LLPipeline::sRenderDeferred && !hud_group && LLPipeline::sRenderBump && te->getBumpmap()) { //if this is the deferred render and a bump map is present, register in post deferred bump registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); } @@ -4824,7 +4825,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } //not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010 - if (!is_alpha && !LLPipeline::sRenderDeferred) + if (!is_alpha && (hud_group || !LLPipeline::sRenderDeferred)) { llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright); facep->setPoolType((fullbright) ? LLDrawPool::POOL_FULLBRIGHT : LLDrawPool::POOL_SIMPLE); -- cgit v1.2.3 From c3327eba03972fdda60a14cc0125bb70298fd3da Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 17 Aug 2011 15:33:18 -0600 Subject: fix for SH-1069: [REGRESSION] Sometimes bumpmaps load only partially --- indra/newview/lldrawpoolbump.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index eb78e28306..0742250b0b 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -155,6 +155,7 @@ void LLStandardBumpmap::addstandard() LLViewerTextureManager::getFetchedTexture(LLUUID(bump_image_id)); gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setBoostLevel(LLViewerTexture::BOOST_BUMP) ; gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, NULL, NULL ); + gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->forceToSaveRawImage(0) ; LLStandardBumpmap::sStandardBumpmapCount++; } -- cgit v1.2.3 From 24a0ec9286170bdcd7fd3989f223d4043c2a133d Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 18 Aug 2011 17:12:35 -0600 Subject: fix for SH-2315: crash at LLVOCacheEntry::~LLVOCacheEntry() line 138 --- indra/newview/llviewerregion.cpp | 1 + indra/newview/llvocache.cpp | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index db2dc531db..17f908d73f 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1193,6 +1193,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec eCacheUpdateResult result = CACHE_UPDATE_ADDED; if (mImpl->mCacheMap.size() > MAX_OBJECT_CACHE_ENTRIES) { + delete mImpl->mCacheMap.begin()->second ; mImpl->mCacheMap.erase(mImpl->mCacheMap.begin()); result = CACHE_UPDATE_REPLACED; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index f0b5b50feb..6d457434b5 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -621,16 +621,20 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca S32 num_entries; success = check_read(&apr_file, &num_entries, sizeof(S32)) ; - for (S32 i = 0; success && i < num_entries; i++) + if(success) { - LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file); - if (!entry->getLocalID()) + for (S32 i = 0; i < num_entries; i++) { - llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; - delete entry ; - success = false ; + LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file); + if (!entry->getLocalID()) + { + llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; + delete entry ; + success = false ; + break ; + } + cache_entry_map[entry->getLocalID()] = entry; } - cache_entry_map[entry->getLocalID()] = entry; } } } -- cgit v1.2.3 From 0f1dea30f827f920d2323d9450826f1a4baaa10b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 19 Aug 2011 13:48:44 +0300 Subject: STORM-1268 Settings for ignorable dialogs were reset during deferred auto-upgrade. Reason: In case of deferred upgrade (i.e. when you select "Later...") the defaults for notifications settings are not loaded, so when the viewer exits after launching the updater, it incorrectly re-saves notifications settings. Fix: Initialize settings earlier, so that viewer picks them up in update mode. --- indra/newview/llappviewer.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d12b971bde..7ad5e92f99 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -731,6 +731,23 @@ bool LLAppViewer::init() initThreads(); LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ; + // Initialize settings early so that the defaults for ignorable dialogs are + // picked up and then correctly re-saved after launching the updater (STORM-1268). + LLUI::settings_map_t settings_map; + settings_map["config"] = &gSavedSettings; + settings_map["ignores"] = &gWarningSettings; + settings_map["floater"] = &gSavedSettings; // *TODO: New settings file + settings_map["account"] = &gSavedPerAccountSettings; + + LLUI::initClass(settings_map, + LLUIImageList::getInstance(), + ui_audio_callback, + &LLUI::sGLScaleFactor); + LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ; + + LLNotifications::instance(); + LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; + writeSystemInfo(); // Initialize updater service (now that we have an io pump) @@ -772,19 +789,8 @@ bool LLAppViewer::init() { LLError::setPrintLocation(true); } - - // Widget construction depends on LLUI being initialized - LLUI::settings_map_t settings_map; - settings_map["config"] = &gSavedSettings; - settings_map["ignores"] = &gWarningSettings; - settings_map["floater"] = &gSavedSettings; // *TODO: New settings file - settings_map["account"] = &gSavedPerAccountSettings; - LLUI::initClass(settings_map, - LLUIImageList::getInstance(), - ui_audio_callback, - &LLUI::sGLScaleFactor); - + // Setup paths and LLTrans after LLUI::initClass has been called LLUI::setupPaths(); LLTransUtil::parseStrings("strings.xml", default_trans_args); -- cgit v1.2.3 From 51c837dda7661ad7b9d90d96e35117eacc7a113a Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 19 Aug 2011 19:53:44 +0300 Subject: STORM-1543 WIP Fixed dropping nventory offers in busy mode. When auto-discarding inventory offers we looked up missing Busy button (i.e. a button having index=3) in the inventory offer notification dialog template. Failure to find the button resulted in ignoring inventory offers. Fixed that by "auto-clicking" the existing Discard button. --- indra/newview/llviewermessage.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 321d02aaf1..8177446778 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1495,6 +1495,13 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& LLChat chat; std::string log_message; S32 button = LLNotificationsUtil::getSelectedOption(notification, response); + + // The offer notification has no Busy button, + // so if we're in busy mode, assume busy response (STORM-1543). + if (gAgent.getBusy()) + { + button = IOR_BUSY; + } LLInventoryObserver* opener = NULL; LLViewerInventoryCategory* catp = NULL; @@ -2667,7 +2674,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { // Until throttling is implemented, busy mode should reject inventory instead of silently // accepting it. SEE SL-39554 - info->forceResponse(IOR_BUSY); + info->forceResponse(IOR_DECLINE); } else { -- cgit v1.2.3 From 1ed945b5a08a40399ff63ed657c66416c3baf7cf Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 19 Aug 2011 19:58:00 +0300 Subject: STORM-1543 WIP Fixed auto-moving offered inventory items to trash. It turned out impossible to properly remove an inventory item from within LLDiscardAgentOffer::done(), because that would lead to nested LLInventoryModel::notifyObservers() calls. Fixed that by deferring removal until the next LLAppViewer::idle() iteration. Also elimiteed duplicated code. --- indra/newview/llappviewer.cpp | 48 +++++++++++++++++++++++++++++++++++++++ indra/newview/llappviewer.h | 2 ++ indra/newview/llviewermessage.cpp | 32 ++------------------------ 3 files changed, 52 insertions(+), 30 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d12b971bde..16c2b2d55a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -321,6 +321,47 @@ static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; +//-- LLDeferredTaskList ------------------------------------------------------ + +/** + * A list of deferred tasks. + * + * We sometimes need to defer execution of some code until the viewer gets idle, + * e.g. removing an inventory item from within notifyObservers() may not work out. + * + * Tasks added to this list will be executed in the next LLAppViewer::idle() iteration. + * All tasks are executed only once. + */ +class LLDeferredTaskList: + public LLSingleton, + private LLDestroyClass +{ + LOG_CLASS(LLDeferredTaskList); + friend class LLAppViewer; + friend class LLDestroyClass; + typedef boost::signals2::signal signal_t; + + void addTask(const signal_t::slot_type& cb) + { + mSignal.connect(cb); + } + + void run() + { + if (mSignal.empty()) return; + + mSignal(); + mSignal.disconnect_all_slots(); + } + + static void destroyClass() + { + instance().mSignal.disconnect_all_slots(); + } + + signal_t mSignal; +}; + //---------------------------------------------------------------------------- // List of entries from strings.xml to always replace @@ -3820,6 +3861,11 @@ bool LLAppViewer::initCache() } } +void LLAppViewer::addOnIdleCallback(const boost::function& cb) +{ + LLDeferredTaskList::instance().addTask(cb); +} + void LLAppViewer::purgeCache() { LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << LL_ENDL; @@ -4413,6 +4459,8 @@ void LLAppViewer::idle() gAudiop->idle(max_audio_decode_time); } } + + LLDeferredTaskList::instance().run(); // Handle shutdown process, for example, // wait for floaters to close, send quit message, diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 61ee6a7cf1..32115e0e7b 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -164,6 +164,8 @@ public: login_completed_signal_t mOnLoginCompleted; boost::signals2::connection setOnLoginCompletedCallback( const login_completed_signal_t::slot_type& cb ) { return mOnLoginCompleted.connect(cb); } + void addOnIdleCallback(const boost::function& cb); // add a callback to fire (once) when idle + void purgeCache(); // Clear the local cache. // mute/unmute the system's master audio diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 8177446778..2c783cd4b6 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1058,37 +1058,9 @@ public: virtual void done() { LL_DEBUGS("Messaging") << "LLDiscardAgentOffer::done()" << LL_ENDL; - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - bool notify = false; - if(trash_id.notNull() && mObjectID.notNull()) - { - LLInventoryModel::update_list_t update; - LLInventoryModel::LLCategoryUpdate old_folder(mFolderID, -1); - update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(trash_id, 1); - update.push_back(new_folder); - gInventory.accountForUpdate(update); - gInventory.moveObject(mObjectID, trash_id); - LLInventoryObject* obj = gInventory.getObject(mObjectID); - if(obj) - { - // no need to restamp since this is already a freshly - // stamped item. - obj->updateParentOnServer(FALSE); - notify = true; - } - } - else - { - LL_WARNS("Messaging") << "DiscardAgentOffer unable to find: " - << (trash_id.isNull() ? "trash " : "") - << (mObjectID.isNull() ? "object" : "") << LL_ENDL; - } + + LLAppViewer::instance()->addOnIdleCallback(boost::bind(&LLInventoryModel::removeItem, &gInventory, mObjectID)); gInventory.removeObserver(this); - if(notify) - { - gInventory.notifyObservers(); - } delete this; } protected: -- cgit v1.2.3 From e0b5ff5c5289f965c943dcba93f0b5d94d1ba1f9 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 19 Aug 2011 19:59:13 +0300 Subject: STORM-1543 WIP Minor cleanup. --- indra/newview/llviewermessage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2c783cd4b6..22966015c8 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1049,12 +1049,13 @@ void start_new_inventory_observer() class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver { LOG_CLASS(LLDiscardAgentOffer); + public: LLDiscardAgentOffer(const LLUUID& folder_id, const LLUUID& object_id) : LLInventoryFetchItemsObserver(object_id), mFolderID(folder_id), mObjectID(object_id) {} - virtual ~LLDiscardAgentOffer() {} + virtual void done() { LL_DEBUGS("Messaging") << "LLDiscardAgentOffer::done()" << LL_ENDL; @@ -1063,6 +1064,7 @@ public: gInventory.removeObserver(this); delete this; } + protected: LLUUID mFolderID; LLUUID mObjectID; -- cgit v1.2.3 From 5578c285d866488d06f99f5e72e3fb9291d37eca Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 22 Aug 2011 14:01:18 +0300 Subject: STORM-1543 WIP More cleanup and comments. --- indra/newview/llappviewer.cpp | 21 ++++++++------------- indra/newview/llviewermessage.cpp | 4 ++++ 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 16c2b2d55a..326b5fd629 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -332,13 +332,11 @@ const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; * Tasks added to this list will be executed in the next LLAppViewer::idle() iteration. * All tasks are executed only once. */ -class LLDeferredTaskList: - public LLSingleton, - private LLDestroyClass +class LLDeferredTaskList: public LLSingleton { LOG_CLASS(LLDeferredTaskList); + friend class LLAppViewer; - friend class LLDestroyClass; typedef boost::signals2::signal signal_t; void addTask(const signal_t::slot_type& cb) @@ -348,15 +346,11 @@ class LLDeferredTaskList: void run() { - if (mSignal.empty()) return; - - mSignal(); - mSignal.disconnect_all_slots(); - } - - static void destroyClass() - { - instance().mSignal.disconnect_all_slots(); + if (!mSignal.empty()) + { + mSignal(); + mSignal.disconnect_all_slots(); + } } signal_t mSignal; @@ -4460,6 +4454,7 @@ void LLAppViewer::idle() } } + // Execute deferred tasks. LLDeferredTaskList::instance().run(); // Handle shutdown process, for example, diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 22966015c8..793abb1c9d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1060,6 +1060,10 @@ public: { LL_DEBUGS("Messaging") << "LLDiscardAgentOffer::done()" << LL_ENDL; + // We're invoked from LLInventoryModel::notifyObservers(). + // If we now try to remove the inventory item, it will cause a nested + // notifyObservers() call, which won't work. + // So defer moving the item to trash until viewer gets idle (in a moment). LLAppViewer::instance()->addOnIdleCallback(boost::bind(&LLInventoryModel::removeItem, &gInventory, mObjectID)); gInventory.removeObserver(this); delete this; -- cgit v1.2.3 From e7fb4ef9541400b00fb570d5c385eafa7eb60c41 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 22 Aug 2011 14:23:34 +0300 Subject: STORM-1542 FIXED Changed search URL back from search-beta to search.sl.com. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7c01731282..7fb5c4d2dc 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3993,7 +3993,7 @@ Type String Value - http://search-beta.secondlife.com/viewer/[CATEGORY]/?q=[QUERY] + http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY] WebProfileURL -- cgit v1.2.3 From a0f3b2a9cc0022605b4da6705bc3dc9578977f48 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 22 Aug 2011 18:04:27 +0300 Subject: STORM-1566 FIXED Sidebar tabs didn't detach by drag-n-drop. The regression was introduced in the fix of EXP-856 (changeset 9e650f2750b5). --- indra/newview/llsidetray.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 651897a217..a7c4057846 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -496,7 +496,7 @@ public: LLSideTray* side_tray = LLSideTray::getInstance(); // Check if the tab we are dragging is docked. - if (!side_tray->isTabAttached(getName())) return FALSE; + if (!side_tray->isTabAttached(mTabName)) return FALSE; // Same value is hardcoded in LLDragHandle::handleHover(). const S32 undock_threshold = 12; @@ -505,7 +505,7 @@ public: if (delta_x <= -undock_threshold || delta_x >= undock_threshold || delta_y <= -undock_threshold || delta_y >= undock_threshold) { - LLSideTrayTab* tab = side_tray->getTab(getName()); + LLSideTrayTab* tab = side_tray->getTab(mTabName); if (!tab) return FALSE; tab->setDocked(false); @@ -544,7 +544,12 @@ protected: , mDragLastScreenX(0) , mDragLastScreenY(0) , mBadgeDriver(NULL) - {} + { + // Find out the tab name to use in handleHover(). + size_t pos = getName().find("_button"); + llassert(pos != std::string::npos); + mTabName = getName().substr(0, pos); + } friend class LLUICtrlFactory; @@ -562,6 +567,7 @@ private: S32 mDragLastScreenX; S32 mDragLastScreenY; + std::string mTabName; LLSideTrayTabBadgeDriver* mBadgeDriver; }; @@ -679,6 +685,7 @@ LLSideTrayTab* LLSideTray::getTab(const std::string& name) bool LLSideTray::isTabAttached(const std::string& name) { LLSideTrayTab* tab = getTab(name); + llassert(tab); if (!tab) return false; return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end(); -- cgit v1.2.3 From 541e26d947e19cf087e068ab3f1bd46fb1d8fd4f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 23 Aug 2011 07:55:34 -0400 Subject: STORM-1567 Mute button for llDialog popup Updating patch to current version of viewer-development --- indra/newview/lltoastnotifypanel.cpp | 26 ++++++++++++++++++++++ indra/newview/llviewermessage.cpp | 25 ++++++++++++++++----- .../newview/skins/default/xui/en/notifications.xml | 4 ++++ 3 files changed, 50 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index fa91f129b8..ea047a1878 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -305,10 +305,17 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect().getWidth(); LLButton* ignore_btn = NULL; + LLButton* mute_btn = NULL; for (std::vector::const_iterator it = buttons.begin(); it != buttons.end(); it++) { + if (-2 == it->first) + { + mute_btn = it->second; + continue; + } if (it->first == -1) { ignore_btn = it->second; @@ -328,6 +335,8 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectoraddChild(btn, -1); } + + U32 ignore_btn_width = 0; if (mIsScriptDialog && ignore_btn != NULL) { LLRect ignore_btn_rect(ignore_btn->getRect()); @@ -337,11 +346,28 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorsetRect(ignore_btn_rect); + ignore_btn_width = ignore_btn_rect.getWidth(); mControlPanel->addChild(ignore_btn, -1); } + + if (mIsScriptDialog && mute_btn != NULL) + { + LLRect mute_btn_rect(mute_btn->getRect()); + S32 buttons_per_row = max_width / BUTTON_WIDTH; //assume that h_pad far less than BUTTON_WIDTH + S32 mute_btn_left = buttons_per_row * BUTTON_WIDTH + (buttons_per_row - 1) * h_pad - mute_btn_rect.getWidth() - ignore_btn_width - (h_pad / 2); + if (mute_btn_left + mute_btn_rect.getWidth() > max_width) // make sure that the mute button is in panel + { + mute_btn_left = max_width - mute_btn_rect.getWidth() - 2 * HPAD; + } + mute_btn_rect.setOriginAndSize(mute_btn_left, BOTTOM_PAD,// always move mute button at the bottom + mute_btn_rect.getWidth(), mute_btn_rect.getHeight()); + mute_btn->setRect(mute_btn_rect); + mControlPanel->addChild(mute_btn); + } } void LLToastNotifyPanel::adjustPanelForScriptNotice(S32 button_panel_width, S32 button_panel_height) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 321d02aaf1..8471de3004 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6544,8 +6544,22 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response) rtn_text = LLNotification::getSelectedOptionName(response); } - // Didn't click "Ignore" - if (button_idx != -1) + // Button -2 = Mute + // Button -1 = Ignore - no processing needed for this button + // Buttons 0 and above = dialog choices + + if (-2 == button_idx) + { + std::string object_name = notification["payload"]["object_name"].asString(); + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLMute mute(object_id, object_name, LLMute::OBJECT); + if (LLMuteList::getInstance()->add(mute)) + { + LLPanelBlockedList::showPanelAndSelect(object_id); + } + } + + if (0 <= button_idx) { LLMessageSystem* msg = gMessageSystem; msg->newMessage("ScriptDialogReply"); @@ -6588,12 +6602,12 @@ void process_script_dialog(LLMessageSystem* msg, void**) std::string message; std::string first_name; std::string last_name; - std::string title; + std::string object_name; S32 chat_channel; msg->getString("Data", "FirstName", first_name); msg->getString("Data", "LastName", last_name); - msg->getString("Data", "ObjectName", title); + msg->getString("Data", "ObjectName", object_name); msg->getString("Data", "Message", message); msg->getS32("Data", "ChatChannel", chat_channel); @@ -6604,6 +6618,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) payload["sender"] = msg->getSender().getIPandPort(); payload["object_id"] = object_id; payload["chat_channel"] = chat_channel; + payload["object_name"] = object_name; // build up custom form S32 button_count = msg->getNumberOfBlocks("Buttons"); @@ -6622,7 +6637,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) } LLSD args; - args["TITLE"] = title; + args["TITLE"] = object_name; args["MESSAGE"] = message; LLNotificationPtr notification; if (!first_name.empty()) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index c9ccd44b83..43e01a1080 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6275,6 +6275,10 @@ Grant this request? [GROUPNAME]'s '<nolink>[TITLE]</nolink>' [MESSAGE]
+