From 61b28f5a1cdaed3e4b60a199604b8796079aec31 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 10 May 2011 17:45:07 -0700 Subject: converted spaces to tabs --- indra/newview/llviewermessage.cpp | 90 +++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fc11cbc28a..a49545f5e3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -265,7 +265,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ msg->newMessageFast(_PREHASH_MoneyTransferRequest); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_MoneyData); msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_DestID, uuid); @@ -337,7 +337,7 @@ void process_logout_reply(LLMessageSystem* msg, void**) LL_INFOS("Messaging") << "process_logout_reply item not found: " << item_id << LL_ENDL; } } - LLAppViewer::instance()->forceQuit(); + LLAppViewer::instance()->forceQuit(); } void process_layer_data(LLMessageSystem *mesgsys, void **user_data) @@ -1868,7 +1868,7 @@ void inventory_offer_handler(LLOfferInfo* info) info->mPersist = true; p.name = "ObjectGiveItem"; // Pop up inv offer chiclet and let the user accept (keep), or reject (and silently delete) the inventory. - LLPostponedNotification::add(p, info->mFromID, info->mFromGroup == TRUE); + LLPostponedNotification::add(p, info->mFromID, info->mFromGroup == TRUE); } else // Agent -> Agent Inventory Offer { @@ -1899,8 +1899,8 @@ void inventory_offer_handler(LLOfferInfo* info) // Inform user that there is a script floater via toast system { payload["give_inventory_notification"] = TRUE; - p.payload = payload; - LLPostponedNotification::add(p, info->mFromID, false); + p.payload = payload; + LLPostponedNotification::add(p, info->mFromID, false); } } @@ -2198,11 +2198,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) binary_bucket_size = msg->getSizeFast(_PREHASH_MessageBlock, _PREHASH_BinaryBucket); EInstantMessage dialog = (EInstantMessage)d; - // make sure that we don't have an empty or all-whitespace name + // make sure that we don't have an empty or all-whitespace name LLStringUtil::trim(name); if (name.empty()) { - name = LLTrans::getString("Unnamed"); + name = LLTrans::getString("Unnamed"); } // IDEVO convert new-style "Resident" names for display name = clean_name_from_im(name, dialog); @@ -2240,7 +2240,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.name = "IMSystemMessageTip"; params.substitutions = args; params.payload = payload; - LLPostponedNotification::add(params, from_id, false); + LLPostponedNotification::add(params, from_id, false); break; case IM_NOTHING_SPECIAL: @@ -2817,10 +2817,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["lure_id"] = session_id; payload["godlike"] = FALSE; - LLNotification::Params params("TeleportOffered"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add( params, from_id, false); + LLNotification::Params params("TeleportOffered"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); } } break; @@ -2884,15 +2884,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if(message.empty()) { //support for frienship offers from clients before July 2008 - LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); + LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); } else { args["[MESSAGE]"] = message; - LLNotification::Params params("OfferFriendship"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add( params, from_id, false); + LLNotification::Params params("OfferFriendship"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); } } } @@ -4252,8 +4252,8 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) F32 phase; U64 space_time_usec; - U32 seconds_per_day; - U32 seconds_per_year; + U32 seconds_per_day; + U32 seconds_per_year; // "SimulatorViewerTimeMessage" mesgsys->getU64Fast(_PREHASH_TimeInfo, _PREHASH_UsecSinceStart, space_time_usec); @@ -4420,7 +4420,7 @@ void process_attached_sound_gain_change(LLMessageSystem *mesgsys, void **user_da return; } - mesgsys->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); + mesgsys->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); objectp->adjustAudioGain(gain); } @@ -4548,7 +4548,7 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) break; default: // Used to be a commented out warning. - LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL; + LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL; break; } } @@ -5035,7 +5035,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) msg->getStringFast(_PREHASH_MoneyData, _PREHASH_Description, desc); LL_INFOS("Messaging") << "L$, credit, committed: " << balance << " " << credit << " " << committed << LL_ENDL; - + if (gStatusBar) { gStatusBar->setBalance(balance); @@ -5149,9 +5149,9 @@ static void money_balance_group_notify(const LLUUID& group_id, static void money_balance_avatar_notify(const LLUUID& agent_id, const LLAvatarName& av_name, - std::string notification, - LLSD args, - LLSD payload) + std::string notification, + LLSD args, + LLSD payload) { // Message uses name SLURLs, don't actually have to substitute in // the name. We're just making sure it's available. @@ -5161,24 +5161,24 @@ static void money_balance_avatar_notify(const LLUUID& agent_id, static void process_money_balance_reply_extended(LLMessageSystem* msg) { - // Added in server 1.40 and viewer 2.1, support for localization - // and agent ids for name lookup. - S32 transaction_type = 0; - LLUUID source_id; + // Added in server 1.40 and viewer 2.1, support for localization + // and agent ids for name lookup. + S32 transaction_type = 0; + LLUUID source_id; BOOL is_source_group = FALSE; - LLUUID dest_id; + LLUUID dest_id; BOOL is_dest_group = FALSE; - S32 amount = 0; - std::string item_description; + S32 amount = 0; + std::string item_description; - msg->getS32("TransactionInfo", "TransactionType", transaction_type); - msg->getUUID("TransactionInfo", "SourceID", source_id); + msg->getS32("TransactionInfo", "TransactionType", transaction_type); + msg->getUUID("TransactionInfo", "SourceID", source_id); msg->getBOOL("TransactionInfo", "IsSourceGroup", is_source_group); - msg->getUUID("TransactionInfo", "DestID", dest_id); + msg->getUUID("TransactionInfo", "DestID", dest_id); msg->getBOOL("TransactionInfo", "IsDestGroup", is_dest_group); - msg->getS32("TransactionInfo", "Amount", amount); - msg->getString("TransactionInfo", "ItemDescription", item_description); - LL_INFOS("Money") << "MoneyBalanceReply source " << source_id + msg->getS32("TransactionInfo", "Amount", amount); + msg->getString("TransactionInfo", "ItemDescription", item_description); + LL_INFOS("Money") << "MoneyBalanceReply source " << source_id << " dest " << dest_id << " type " << transaction_type << " item " << item_description << LL_ENDL; @@ -6477,10 +6477,10 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLSD payload; LLUUID object_id; - LLUUID owner_id; + LLUUID owner_id; msg->getUUID("Data", "ObjectID", object_id); - msg->getUUID("OwnerData", "OwnerID", owner_id); + msg->getUUID("OwnerData", "OwnerID", owner_id); if (LLMuteList::getInstance()->isMuted(object_id) || LLMuteList::getInstance()->isMuted(owner_id)) { @@ -6630,7 +6630,7 @@ void process_load_url(LLMessageSystem* msg, void**) // Check if object or owner is muted if (LLMuteList::getInstance()->isMuted(object_id, object_name) || - LLMuteList::getInstance()->isMuted(owner_id)) + LLMuteList::getInstance()->isMuted(owner_id)) { LL_INFOS("Messaging")<<"Ignoring load_url from muted object/owner."<incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || - LL_ERR_FILE_EMPTY == status) + LL_ERR_FILE_EMPTY == status) { covenant_text = "Estate covenant notecard is missing from database."; } @@ -6895,7 +6895,7 @@ void invalid_message_callback(LLMessageSystem* msg, void*, EMessageException exception) { - LLAppViewer::instance()->badNetworkHandler(); + LLAppViewer::instance()->badNetworkHandler(); } // Please do not add more message handlers here. This file is huge. -- cgit v1.3 From 1e87fc43d7c07be618678aab6ee9f5511e593e92 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 21 Jun 2011 14:57:02 -0700 Subject: Fix for memory leak & extra inventory observers in start_new_inventory_observer. Reviewed by Richard --- indra/newview/llviewermessage.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3832be727f..766df29a81 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -937,7 +937,6 @@ protected: //one global instance to bind them LLOpenTaskOffer* gNewInventoryObserver=NULL; - class LLNewInventoryHintObserver : public LLInventoryAddedObserver { protected: @@ -947,6 +946,8 @@ protected: } }; +LLNewInventoryHintObserver* gNewInventoryHintObserver=NULL; + void start_new_inventory_observer() { if (!gNewInventoryObserver) //task offer observer @@ -963,7 +964,12 @@ void start_new_inventory_observer() gInventory.addObserver(gInventoryMoveObserver); } - gInventory.addObserver(new LLNewInventoryHintObserver()); + if (!gNewInventoryHintObserver) + { + // Observer is deleted by gInventory + gNewInventoryHintObserver = new LLNewInventoryHintObserver(); + gInventory.addObserver(gNewInventoryHintObserver); + } } class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver -- cgit v1.3 From 8c6e6c305850f196e0eed7ebb4bf8aa528613fa4 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 29 Jun 2011 15:24:05 -0700 Subject: EXP-895 Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel --- indra/newview/llinventorybridge.cpp | 10 ++++ indra/newview/llviewermessage.cpp | 101 +++++++++++++++++++++++++++++++----- indra/newview/llviewermessage.h | 2 + 3 files changed, 99 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 58579bdf4f..6644eea219 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1798,6 +1798,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { + if (gInventory.isObjectDescendentOf(inv_cat->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) + { + set_dad_inbox_object(inv_cat->getUUID()); + } // Reparent the folder and restamp children if it's moving // into trash. @@ -3176,6 +3180,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // (move the item, restamp if into trash) else { + // set up observer to select item once drag and drop from inbox is complete + if (gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) + { + set_dad_inbox_object(inv_item->getUUID()); + } + LLInvFVBridge::changeItemParent( model, (LLViewerInventoryItem*)inv_item, diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fa394e55b3..2ff540b625 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -694,7 +694,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) return false; } -static void highlight_inventory_items_in_panel(const std::vector& items, LLInventoryPanel *inventory_panel) +static void highlight_inventory_objects_in_panel(const std::vector& items, LLInventoryPanel *inventory_panel) { if (NULL == inventory_panel) return; @@ -708,7 +708,7 @@ static void highlight_inventory_items_in_panel(const std::vector& items, continue; } - LLInventoryItem* item = gInventory.getItem(item_id); + LLInventoryObject* item = gInventory.getObject(item_id); llassert(item); if (!item) { continue; @@ -787,7 +787,6 @@ class LLViewerInventoryMoveFromWorldObserver : public LLInventoryAddItemByAssetO public: LLViewerInventoryMoveFromWorldObserver() : LLInventoryAddItemByAssetObserver() - , mActivePanel(NULL) { } @@ -798,13 +797,16 @@ private: /*virtual */void onAssetAdded(const LLUUID& asset_id) { // Store active Inventory panel. - mActivePanel = LLInventoryPanel::getActiveInventoryPanel(); + if (LLInventoryPanel::getActiveInventoryPanel()) + { + mActivePanel = LLInventoryPanel::getActiveInventoryPanel()->getHandle(); + } // Store selected items (without destination folder) mSelectedItems.clear(); - if (mActivePanel) + if (LLInventoryPanel::getActiveInventoryPanel()) { - mSelectedItems = mActivePanel->getRootFolder()->getSelectionList(); + mSelectedItems = LLInventoryPanel::getActiveInventoryPanel()->getRootFolder()->getSelectionList(); } mSelectedItems.erase(mMoveIntoFolderID); } @@ -815,12 +817,14 @@ private: */ void done() { + LLInventoryPanel* active_panel = dynamic_cast(mActivePanel.get()); + // if selection is not changed since watch started lets hightlight new items. - if (mActivePanel && !isSelectionChanged()) + if (active_panel && !isSelectionChanged()) { LL_DEBUGS("Inventory_Move") << "Selecting new items..." << LL_ENDL; - mActivePanel->clearSelection(); - highlight_inventory_items_in_panel(mAddedItems, mActivePanel); + active_panel->clearSelection(); + highlight_inventory_objects_in_panel(mAddedItems, active_panel); } } @@ -828,16 +832,16 @@ private: * Returns true if selected inventory items were changed since moved inventory items were started to watch. */ bool isSelectionChanged() - { - const LLInventoryPanel * const current_active_panel = LLInventoryPanel::getActiveInventoryPanel(); + { + LLInventoryPanel* active_panel = dynamic_cast(mActivePanel.get()); - if (NULL == mActivePanel || current_active_panel != mActivePanel) + if (NULL == active_panel) { return true; } // get selected items (without destination folder) - selected_items_t selected_items = mActivePanel->getRootFolder()->getSelectionList(); + selected_items_t selected_items = active_panel->getRootFolder()->getSelectionList(); selected_items.erase(mMoveIntoFolderID); // compare stored & current sets of selected items @@ -851,7 +855,7 @@ private: return different_items.size() > 0; } - LLInventoryPanel *mActivePanel; + LLHandle mActivePanel; typedef std::set selected_items_t; selected_items_t mSelectedItems; @@ -880,6 +884,75 @@ void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder gInventoryMoveObserver->watchAsset(inv_item->getAssetUUID()); } + +/** + * Class to observe moving of items and to select them in inventory. + * + * Used currently for dragging from inbox to regular inventory folders + */ + +class LLViewerInventoryMoveObserver : public LLInventoryObserver +{ +public: + + LLViewerInventoryMoveObserver(const LLUUID& object_id) + : LLInventoryObserver() + , mObjectID(object_id) + { + if (LLInventoryPanel::getActiveInventoryPanel()) + { + mActivePanel = LLInventoryPanel::getActiveInventoryPanel()->getHandle(); + } + } + + virtual ~LLViewerInventoryMoveObserver() {} + virtual void changed(U32 mask); + +private: + LLUUID mObjectID; + LLHandle mActivePanel; + +}; + +void LLViewerInventoryMoveObserver::changed(U32 mask) +{ + LLInventoryPanel* active_panel = dynamic_cast(mActivePanel.get()); + + if (NULL == active_panel) + { + gInventory.removeObserver(this); + return; + } + + if((mask & (LLInventoryObserver::STRUCTURE)) != 0) + { + const std::set& changed_items = gInventory.getChangedIDs(); + + std::set::const_iterator id_it = changed_items.begin(); + std::set::const_iterator id_end = changed_items.end(); + for (;id_it != id_end; ++id_it) + { + if ((*id_it) == mObjectID) + { + active_panel->clearSelection(); + std::vector items; + items.push_back(mObjectID); + highlight_inventory_objects_in_panel(items, active_panel); + active_panel->getRootFolder()->scrollToShowSelection(); + + gInventory.removeObserver(this); + break; + } + } + } +} + +void set_dad_inbox_object(const LLUUID& object_id) +{ + LLViewerInventoryMoveObserver* move_observer = new LLViewerInventoryMoveObserver(object_id); + gInventory.addObserver(move_observer); +} + //unlike the FetchObserver for AgentOffer, we only make one //instance of the AddedObserver for TaskOffers //and it never dies. We do this because we don't know the UUID of diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index b4a9b8e677..9d09d9c01a 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -203,6 +203,8 @@ void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name) bool highlight_offered_object(const LLUUID& obj_id); void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid); +void set_dad_inbox_object(const LLUUID& object_id); + class LLOfferInfo : public LLNotificationResponderInterface { -- cgit v1.3 From 02c9c49788c6677a4332246a8d748d3e002c712f Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 5 Jul 2011 22:52:31 +0300 Subject: STORM-1330 WIP Override region sun position when switching the region to fixed sky. --- indra/newview/llfloaterregioninfo.cpp | 50 +++++++++++++++++++++++++++++++++++ indra/newview/llfloaterregioninfo.h | 8 +++--- indra/newview/llregioninfomodel.cpp | 15 ++++++++++- indra/newview/llregioninfomodel.h | 4 ++- indra/newview/llviewermessage.cpp | 4 +-- 5 files changed, 74 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index b6339387a9..59a996b2ed 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2994,6 +2994,8 @@ bool LLDispatchEstateUpdateInfo::operator()( const LLUUID& invoice, const sparam_t& strings) { + lldebugs << "Received estate update" << llendl; + LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); if (!panel) return true; @@ -3020,10 +3022,13 @@ bool LLDispatchEstateUpdateInfo::operator()( F32 sun_hour = ((F32)(strtod(strings[4].c_str(), NULL)))/1024.0f; if(sun_hour == 0 && (flags & REGION_FLAGS_SUN_FIXED ? FALSE : TRUE)) { + // no need to overwrite region sun phase? + lldebugs << "Estate uses global time" << llendl; panel->setGlobalTime(TRUE); } else { + lldebugs << "Estate sun hour: " << sun_hour << llendl; panel->setGlobalTime(FALSE); panel->setSunHour(sun_hour); } @@ -3355,6 +3360,33 @@ void LLPanelEnvironmentInfo::setDirty(bool dirty) getChildView("cancel_btn")->setEnabled(dirty); } +void LLPanelEnvironmentInfo::sendRegionSunUpdate(F32 sun_angle) +{ + LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + bool region_use_fixed_sky = sun_angle >= 0.f; + + // Set sun hour. + if (region_use_fixed_sky) + { + LLWLParamSet param_set; + LLSD params; + std::string unused; + if (!getSelectedSkyParams(params, unused)) + { + return; + } + param_set.setAll(params); + + // convert value range from 0..2pi to 6..30 + region_info.mSunHour = fmodf((sun_angle / F_TWO_PI) * 24.f, 24.f) + 6.f; + } + + region_info.setUseFixedSun(region_use_fixed_sky); + region_info.mUseEstateSun = !region_use_fixed_sky; + + region_info.sendRegionTerrain(LLFloaterRegionInfo::getLastInvoice()); +} + void LLPanelEnvironmentInfo::populateWaterPresetsList() { mWaterPresetCombo->removeall(); @@ -3634,6 +3666,7 @@ void LLPanelEnvironmentInfo::onBtnApply() LLSD day_cycle; LLSD sky_map; LLSD water_params; + F32 sun_angle = -1.f; // invalid value meaning no fixed sky if (use_defaults) { @@ -3666,6 +3699,9 @@ void LLPanelEnvironmentInfo::onBtnApply() param_set.setAll(params); refs[LLWLParamKey(preset_name, LLEnvKey::SCOPE_LOCAL)] = param_set; // scope doesn't matter here sky_map = LLWLParamManager::createSkyMap(refs); + + // Remember the sun angle to set fixed region sun hour below. + sun_angle = param_set.getSunAngle(); } else // use day cycle { @@ -3686,6 +3722,16 @@ void LLPanelEnvironmentInfo::onBtnApply() LL_DEBUGS("Windlight") << "Fixing negative time" << LL_ENDL; day_cycle[0][0] = 0.0f; } + + // If the day cycle contains exactly one preset (i.e it's effectively a fixed sky), + // remember the preset's sun angle to set fixed region sun hour below. + if (sky_map.size() == 1) + { + LLWLParamSet param_set; + llassert(sky_map.isMap()); + param_set.setAll(sky_map.beginMap()->second); + sun_angle = param_set.getSunAngle(); + } } // Get water params. @@ -3705,6 +3751,10 @@ void LLPanelEnvironmentInfo::onBtnApply() return; } + // Set the region sun phase/flags according to the chosen new preferences. + sendRegionSunUpdate(sun_angle); + + // Start spinning the progress indicator. setApplyProgress(true); } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 6075842e76..810a71f463 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -328,10 +328,10 @@ public: BOOL getGlobalTime(); void setGlobalTime(bool b); - BOOL getFixedSun(); + BOOL getFixedSun(); // *TODO: deprecated - F32 getSunHour(); - void setSunHour(F32 sun_hour); + F32 getSunHour(); // *TODO: deprecated + void setSunHour(F32 sun_hour); // *TODO: deprecated const std::string getEstateName() const; void setEstateName(const std::string& name); @@ -450,6 +450,8 @@ private: void setApplyProgress(bool started); void setDirty(bool dirty); + void sendRegionSunUpdate(F32 sun_angle); + void populateWaterPresetsList(); void populateSkyPresetsList(); void populateDayCyclesList(); diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index e1ef57f8e9..6238f183c1 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -122,6 +122,18 @@ bool LLRegionInfoModel::getUseFixedSun() const return mRegionFlags & REGION_FLAGS_SUN_FIXED; } +void LLRegionInfoModel::setUseFixedSun(bool fixed) +{ + if (fixed) + { + mRegionFlags |= REGION_FLAGS_SUN_FIXED; + } + else + { + mRegionFlags &= ~REGION_FLAGS_SUN_FIXED; + } +} + void LLRegionInfoModel::update(LLMessageSystem* msg) { reset(); @@ -192,8 +204,9 @@ void LLRegionInfoModel::sendEstateOwnerMessage( { std::vector::const_iterator it = strings.begin(); std::vector::const_iterator end = strings.end(); - for (; it != end; ++it) + for (unsigned i = 0; it != end; ++it, ++i) { + lldebugs << "- [" << i << "] " << (*it) << llendl; msg->nextBlock("ParamList"); msg->addString("Parameter", *it); } diff --git a/indra/newview/llregioninfomodel.h b/indra/newview/llregioninfomodel.h index cbb5e5210a..89efd82767 100644 --- a/indra/newview/llregioninfomodel.h +++ b/indra/newview/llregioninfomodel.h @@ -46,6 +46,8 @@ public: bool getUseFixedSun() const; + void setUseFixedSun(bool fixed); + // *TODO: Add getters and make the data private. U8 mSimAccess; U8 mAgentLimit; @@ -63,7 +65,7 @@ public: F32 mWaterHeight; F32 mTerrainRaiseLimit; F32 mTerrainLowerLimit; - F32 mSunHour; + F32 mSunHour; // 6..30 BOOL mUseEstateSun; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f6b01e92cb..9f7559ad15 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4265,8 +4265,8 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) LLWorld::getInstance()->setSpaceTimeUSec(space_time_usec); - //LL_DEBUGS("Messaging") << "time_synch() - " << sun_direction << ", " << sun_ang_velocity - // << ", " << phase << LL_ENDL; + LL_DEBUGS("Windlight Sync") << "time_synch() - " << sun_direction << ", " << sun_ang_velocity + << ", " << phase << LL_ENDL; gSky.setSunPhase(phase); gSky.setSunTargetDirection(sun_direction, sun_ang_velocity); -- cgit v1.3 From e92d3dcf1013ab340fdef514b41ebf790f79e04c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 5 Jul 2011 23:40:19 -0700 Subject: EXP-971 FIX New Direct Delivery item does not sort as most recent item in Recent Tab if that tab is open when item delivered --- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llavataractions.cpp | 1 + indra/newview/llfilteredwearablelist.cpp | 1 + indra/newview/llfolderview.h | 16 ---------- indra/newview/llfolderviewitem.cpp | 5 +-- indra/newview/llfolderviewitem.h | 1 + indra/newview/llinventorybridge.cpp | 1 + indra/newview/llinventoryfunctions.h | 24 ++++++++++++-- indra/newview/llinventorymodelbackgroundfetch.cpp | 2 ++ indra/newview/llinventorypanel.cpp | 38 ++++++++++++++++++++++- indra/newview/llinventorypanel.h | 16 +++++----- indra/newview/llpanelappearancetab.cpp | 1 + indra/newview/llpanellandmarks.cpp | 1 + indra/newview/llpanelmarketplaceinbox.cpp | 1 + indra/newview/llpanelmarketplaceinboxinventory.h | 4 +-- indra/newview/llpanelobjectinventory.cpp | 3 ++ indra/newview/llpaneloutfitedit.cpp | 2 +- indra/newview/llpreviewgesture.cpp | 1 + indra/newview/llsidepanelappearance.cpp | 1 + indra/newview/llviewermenu.cpp | 1 + indra/newview/llviewermessage.cpp | 2 ++ 21 files changed, 89 insertions(+), 35 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index d426afb17c..36272f0c7c 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -33,7 +33,6 @@ #include "llagentwearablesfetch.h" #include "llappearancemgr.h" #include "llcallbacklist.h" -#include "llfolderview.h" #include "llgesturemgr.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" @@ -45,6 +44,7 @@ #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltexlayer.h" +#include "lltooldraganddrop.h" #include "llviewerregion.h" #include "llvoavatarself.h" #include "llwearable.h" diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index b2d97a796a..4685865bce 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -49,6 +49,7 @@ #include "llfloaterpay.h" #include "llfloaterwebcontent.h" #include "llfloaterworldmap.h" +#include "llfolderview.h" #include "llgiveinventory.h" #include "llinventorybridge.h" #include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp index cd5e779c4d..a29ccf2b6d 100644 --- a/indra/newview/llfilteredwearablelist.cpp +++ b/indra/newview/llfilteredwearablelist.cpp @@ -31,6 +31,7 @@ #include "llinventoryfunctions.h" #include "llinventoryitemslist.h" #include "llinventorymodel.h" +#include "llviewerinventory.h" LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector) diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 96027e55a8..0b92548fd0 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -58,22 +58,6 @@ class LLScrollContainer; class LLUICtrl; class LLTextBox; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFolderViewFunctor -// -// Simple abstract base class for applying a functor to folders and -// items in a folder view hierarchy. This is suboptimal for algorithms -// that only work folders or only work on items, but I'll worry about -// that later when it's determined to be too slow. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLFolderViewFunctor -{ -public: - virtual ~LLFolderViewFunctor() {} - virtual void doFolder(LLFolderViewFolder* folder) = 0; - virtual void doItem(LLFolderViewItem* item) = 0; -}; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLFolderView // diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index b76e8395fb..02fa77f6ab 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -33,6 +33,7 @@ #include "llviewerfoldertype.h" #include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator() #include "llinventoryfilter.h" +#include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" #include "llpanel.h" #include "llviewercontrol.h" // gSavedSettings @@ -2042,7 +2043,7 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) requestArrange(); requestSort(); LLFolderViewFolder* parentp = getParentFolder(); - while (parentp && !parentp->getCreationDate()) + while (parentp && parentp->mSortFunction.isByDate()) { // parent folder doesn't have a time stamp yet, so get it from us parentp->requestSort(); @@ -2068,7 +2069,7 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) folder->requestArrange(TRUE); requestSort(); LLFolderViewFolder* parentp = getParentFolder(); - while (parentp && !parentp->getCreationDate()) + while (parentp && !parentp->mSortFunction.isByDate()) { // parent folder doesn't have a time stamp yet, so get it from us parentp->requestSort(); diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index f9b47e29ee..e2f94a2b63 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -66,6 +66,7 @@ public: // Returns true if order has changed bool updateSort(U32 order); U32 getSort() { return mSortOrder; } + bool isByDate() { return mByDate; } bool operator()(const LLFolderViewItem* const& a, const LLFolderViewItem* const& b); private: diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6644eea219..75d4c4e80d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -40,6 +40,7 @@ #include "llfloateropenobject.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" +#include "llfolderview.h" #include "llfriendcard.h" #include "llgesturemgr.h" #include "llgiveinventory.h" diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index cfe1747fd4..2016b92666 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -28,9 +28,9 @@ #ifndef LL_LLINVENTORYFUNCTIONS_H #define LL_LLINVENTORYFUNCTIONS_H -#include "llinventorytype.h" -#include "llfolderview.h" -#include "llfolderviewitem.h" +#include "llinventorymodel.h" +#include "llinventory.h" +#include "llwearabletype.h" /******************************************************************************** ** ** @@ -417,6 +417,24 @@ public: /** Inventory Collector Functions ** ** *******************************************************************************/ +class LLFolderViewItem; +class LLFolderViewFolder; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFolderViewFunctor +// +// Simple abstract base class for applying a functor to folders and +// items in a folder view hierarchy. This is suboptimal for algorithms +// that only work folders or only work on items, but I'll worry about +// that later when it's determined to be too slow. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFolderViewFunctor +{ +public: + virtual ~LLFolderViewFunctor() {} + virtual void doFolder(LLFolderViewFolder* folder) = 0; + virtual void doItem(LLFolderViewItem* item) = 0; +}; class LLInventoryState { diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 7b1ff102e7..afaf660cb7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -31,7 +31,9 @@ #include "llappviewer.h" #include "llcallbacklist.h" #include "llinventorypanel.h" +#include "llinventorymodel.h" #include "llviewercontrol.h" +#include "llviewerinventory.h" #include "llviewermessage.h" #include "llviewerregion.h" #include "llviewerwindow.h" diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 25e43b34a6..d11e7572fe 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -35,6 +35,7 @@ #include "llavataractions.h" #include "llfloaterinventory.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llimfloater.h" #include "llimview.h" #include "llinventorybridge.h" @@ -340,6 +341,17 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType getFilter()->setFilterCategoryTypes(types); } +U32 LLInventoryPanel::getFilterObjectTypes() const +{ + return mFolderRoot->getFilterObjectTypes(); +} + +U32 LLInventoryPanel::getFilterPermMask() const +{ + return mFolderRoot->getFilterPermissions(); +} + + void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { getFilter()->setFilterPermissions(filter_perm_mask); @@ -355,6 +367,12 @@ void LLInventoryPanel::setFilterSubString(const std::string& string) getFilter()->setFilterSubString(string); } +const std::string LLInventoryPanel::getFilterSubString() +{ + return mFolderRoot->getFilterSubString(); +} + + void LLInventoryPanel::setSortOrder(U32 order) { getFilter()->setSortOrder(order); @@ -366,6 +384,12 @@ void LLInventoryPanel::setSortOrder(U32 order) } } +U32 LLInventoryPanel::getSortOrder() const +{ + return mFolderRoot->getSortOrder(); +} + + void LLInventoryPanel::setSinceLogoff(BOOL sl) { getFilter()->setDateRangeLastLogoff(sl); @@ -537,6 +561,12 @@ void LLInventoryPanel::modelChanged(U32 mask) } } +LLFolderView* LLInventoryPanel::getRootFolder() +{ + return mFolderRoot; +} + + // static void LLInventoryPanel::onIdle(void *userdata) { @@ -800,6 +830,12 @@ void LLInventoryPanel::openSelected() bridge->openItem(); } +void LLInventoryPanel::unSelectAll() +{ + mFolderRoot->setSelection(NULL, FALSE, FALSE); +} + + BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask) { BOOL handled = LLView::handleHover(x, y, mask); @@ -879,7 +915,7 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_foc mFolderRoot->setSelectionByID(obj_id, take_keyboard_focus); } -void LLInventoryPanel::setSelectCallback(const LLFolderView::signal_t::slot_type& cb) +void LLInventoryPanel::setSelectCallback(const boost::function& items, BOOL user_action)>& cb) { if (mFolderRoot) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index e3fc4b227c..4894b43a56 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -33,12 +33,12 @@ #include "llfloater.h" #include "llinventory.h" #include "llinventoryfilter.h" -#include "llfolderview.h" #include "llinventorymodel.h" #include "llscrollcontainer.h" #include "lluictrlfactory.h" #include +class LLFolderView; class LLFolderViewFolder; class LLFolderViewItem; class LLInventoryFilter; @@ -128,17 +128,17 @@ public: // Call this method to set the selection. void openAllFolders(); void setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus); - void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); + void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); void clearSelection(); LLInventoryFilter* getFilter(); const LLInventoryFilter* getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); - U32 getFilterObjectTypes() const { return mFolderRoot->getFilterObjectTypes(); } + U32 getFilterObjectTypes() const; void setFilterPermMask(PermissionMask filter_perm_mask); - U32 getFilterPermMask() const { return mFolderRoot->getFilterPermissions(); } + U32 getFilterPermMask() const; void setFilterWearableTypes(U64 filter); void setFilterSubString(const std::string& string); - const std::string getFilterSubString() { return mFolderRoot->getFilterSubString(); } + const std::string getFilterSubString(); void setSinceLogoff(BOOL sl); void setHoursAgo(U32 hours); BOOL getSinceLogoff(); @@ -148,7 +148,7 @@ public: LLInventoryFilter::EFolderShow getShowFolderState(); // This method is called when something has changed about the inventory. void modelChanged(U32 mask); - LLFolderView* getRootFolder() { return mFolderRoot; } + LLFolderView* getRootFolder(); LLScrollContainer* getScrollableContainer() { return mScroller; } void onSelectionChange(const std::deque &items, BOOL user_action); @@ -163,7 +163,7 @@ public: static void dumpSelectionInformation(void* user_data); void openSelected(); - void unSelectAll() { mFolderRoot->setSelection(NULL, FALSE, FALSE); } + void unSelectAll(); static void onIdle(void* user_data); @@ -204,7 +204,7 @@ public: static const std::string INHERIT_SORT_ORDER; void setSortOrder(U32 order); - U32 getSortOrder() const { return mFolderRoot->getSortOrder(); } + U32 getSortOrder() const; private: std::string mSortOrderSetting; diff --git a/indra/newview/llpanelappearancetab.cpp b/indra/newview/llpanelappearancetab.cpp index 9910a3a2ac..8fa8867c69 100644 --- a/indra/newview/llpanelappearancetab.cpp +++ b/indra/newview/llpanelappearancetab.cpp @@ -31,6 +31,7 @@ #include "llinventoryfunctions.h" #include "llinventorymodel.h" +#include "llviewerinventory.h" //virtual bool LLPanelAppearanceTab::canTakeOffSelected() diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 9b9573d06b..a9cc247d1b 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -46,6 +46,7 @@ #include "llfolderviewitem.h" #include "llinventorymodelbackgroundfetch.h" #include "llinventorypanel.h" +#include "llinventoryfunctions.h" #include "lllandmarkactions.h" #include "llmenubutton.h" #include "llplacesinventorybridge.h" diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 4e7e72a469..af74f8f261 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -31,6 +31,7 @@ #include "llappviewer.h" #include "llbutton.h" #include "llinventorypanel.h" +#include "llfolderview.h" #include "llsidepanelinventory.h" diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 71b8d0be67..262d2c367a 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -30,8 +30,6 @@ #include "llbadgeowner.h" #include "llinventorypanel.h" -#include "llfolderviewitem.h" - class LLInboxInventoryPanel : public LLInventoryPanel { @@ -48,7 +46,7 @@ public: void buildFolderView(const LLInventoryPanel::Params& params); // virtual - LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); + class LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); }; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index e0d0239929..e3b61f695a 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -44,6 +44,7 @@ #include "llcallbacklist.h" #include "llbuycurrencyhtml.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfilter.h" @@ -58,8 +59,10 @@ #include "llselectmgr.h" #include "llsidetray.h" #include "llstatusbar.h" +#include "lltooldraganddrop.h" #include "lltrans.h" #include "llviewerassettype.h" +#include "llviewerinventory.h" #include "llviewerregion.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 62f582c343..35e2e96bab 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -36,7 +36,7 @@ #include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" -#include "llfolderviewitem.h" +#include "llfolderview.h" #include "llinventory.h" #include "llinventoryitemslist.h" #include "llviewercontrol.h" diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 9f5c55bad1..f47928b131 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -42,6 +42,7 @@ #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" +#include "llkeyboard.h" #include "llmultigesture.h" #include "llnotificationsutil.h" #include "llradiogroup.h" diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 16729f045a..28ec11d1c7 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -32,6 +32,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llfolderview.h" #include "llinventorypanel.h" #include "llfiltereditor.h" #include "llfloaterreg.h" diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 41d8b57f36..4035928904 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -107,6 +107,7 @@ #include "lltrans.h" #include "lleconomy.h" #include "lltoolgrab.h" +#include "llwindow.h" #include "boost/unordered_map.hpp" using namespace LLVOAvatarDefines; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2ff540b625..30485d5e07 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -37,6 +37,7 @@ #include "lleconomy.h" #include "lleventtimer.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llfollowcamparams.h" #include "llinventorydefines.h" #include "lllslconstants.h" @@ -87,6 +88,7 @@ #include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" +#include "llviewerinventory.h" #include "llviewerjoystick.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" -- cgit v1.3