diff options
43 files changed, 376 insertions, 507 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4c0c895a7d..1c32c690a8 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -156,13 +156,11 @@ set(viewer_SOURCE_FILES llfloaterbuycurrency.cpp llfloaterbuyland.cpp llfloatercamera.cpp - llfloaterchatterbox.cpp llfloatercolorpicker.cpp llfloatercustomize.cpp llfloaterdaycycle.cpp llfloaterenvsettings.cpp llfloaterfonttest.cpp - llfloaterfriends.cpp llfloatergesture.cpp llfloatergodtools.cpp llfloatergroupinvite.cpp @@ -241,7 +239,6 @@ set(viewer_SOURCE_FILES llimfloater.cpp llimfloatercontainer.cpp llimhandler.cpp - llimpanel.cpp llimview.cpp llinspect.cpp llinspectavatar.cpp @@ -273,7 +270,6 @@ set(viewer_SOURCE_FILES llmaniptranslate.cpp llmediactrl.cpp llmediadataclient.cpp - llmediaremotectrl.cpp llmemoryview.cpp llmenucommands.cpp llmetricperformancetester.cpp @@ -297,7 +293,6 @@ set(viewer_SOURCE_FILES llnotificationscripthandler.cpp llnotificationtiphandler.cpp lloutputmonitorctrl.cpp - lloverlaybar.cpp llpanelavatar.cpp llpanelavatartag.cpp llpanelblockedlist.cpp @@ -418,7 +413,6 @@ set(viewer_SOURCE_FILES lltoastnotifypanel.cpp lltoastpanel.cpp lltool.cpp - lltoolbar.cpp lltoolbrush.cpp lltoolcomp.cpp lltooldraganddrop.cpp @@ -513,7 +507,6 @@ set(viewer_SOURCE_FILES llvoground.cpp llvoicechannel.cpp llvoiceclient.cpp - llvoiceremotectrl.cpp llvoicevisualizer.cpp llvoinventorylistener.cpp llvopartgroup.cpp @@ -663,13 +656,11 @@ set(viewer_HEADER_FILES llfloaterbuycurrency.h llfloaterbuyland.h llfloatercamera.h - llfloaterchatterbox.h llfloatercolorpicker.h llfloatercustomize.h llfloaterdaycycle.h llfloaterenvsettings.h llfloaterfonttest.h - llfloaterfriends.h llfloatergesture.h llfloatergodtools.h llfloatergroupinvite.h @@ -747,7 +738,6 @@ set(viewer_HEADER_FILES llhudview.h llimfloater.h llimfloatercontainer.h - llimpanel.h llimview.h llinspect.h llinspectavatar.h @@ -780,7 +770,6 @@ set(viewer_HEADER_FILES llmaniptranslate.h llmediactrl.h llmediadataclient.h - llmediaremotectrl.h llmemoryview.h llmenucommands.h llmetricperformancetester.h @@ -799,7 +788,6 @@ set(viewer_HEADER_FILES llnotificationhandler.h llnotificationmanager.h lloutputmonitorctrl.h - lloverlaybar.h llpanelavatar.h llpanelavatartag.h llpanelblockedlist.h @@ -923,7 +911,6 @@ set(viewer_HEADER_FILES lltoastnotifypanel.h lltoastpanel.h lltool.h - lltoolbar.h lltoolbrush.h lltoolcomp.h lltooldraganddrop.h @@ -1016,7 +1003,6 @@ set(viewer_HEADER_FILES llvoground.h llvoicechannel.h llvoiceclient.h - llvoiceremotectrl.h llvoicevisualizer.h llvoinventorylistener.h llvopartgroup.h diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index dd50b482cf..38d1e01d08 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -35,11 +35,11 @@ #include "llsingleton.h" #include "llinventorymodel.h" -#include "llviewerinventory.h" #include "llcallbacklist.h" class LLWearable; class LLWearableHoldingPattern; +class LLInventoryCallback; class LLAppearanceManager: public LLSingleton<LLAppearanceManager> { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9aa15789ed..9bb0977c1a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -163,7 +163,6 @@ #include "llvotree.h" #include "llvoavatar.h" #include "llfolderview.h" -#include "lltoolbar.h" #include "llagentpilot.h" #include "llvovolume.h" #include "llflexibleobject.h" @@ -414,7 +413,6 @@ static void settings_to_globals() LLVOAvatar::sVisibleInFirstPerson = gSavedSettings.getBOOL("FirstPersonAvatarVisible"); // clamp auto-open time to some minimum usable value LLFolderView::sAutoOpenTime = llmax(0.25f, gSavedSettings.getF32("FolderAutoOpenDelay")); - LLToolBar::sInventoryAutoOpenTime = gSavedSettings.getF32("InventoryAutoOpenDelay"); LLSelectMgr::sRectSelectInclusive = gSavedSettings.getBOOL("RectangleSelectInclusive"); LLSelectMgr::sRenderHiddenSelections = gSavedSettings.getBOOL("RenderHiddenSelections"); LLSelectMgr::sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius"); diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 0e42ff09d8..57e6619470 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -685,7 +685,7 @@ void LLFavoritesBarCtrl::updateButtons() { // an child's order and mItems should be same if (button->getLandmarkId() != item->getUUID() // sort order has been changed - || button->getLabelSelected() != item->getDisplayName() // favorite's name has been changed + || button->getLabelSelected() != item->getName() // favorite's name has been changed || button->getRect().mRight < rightest_point) // favbar's width has been changed { break; @@ -780,7 +780,7 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem * Empty space (or ...) is displaying instead of last symbols, even though the width of the button is enough. * Problem will gone, if we stretch out the button. For that reason I have to put additional 20 pixels. */ - int requred_width = mFont->getWidth(item->getDisplayName()) + 20; + int requred_width = mFont->getWidth(item->getName()) + 20; int width = requred_width > def_button_width? def_button_width : requred_width; LLFavoriteLandmarkButton* fav_btn = NULL; diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 5c3a54e34b..b2f700069f 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -43,6 +43,7 @@ #include "llviewerregion.h" #include "lscript_rt_interface.h" #include "llviewercontrol.h" +#include "llviewerinventory.h" #include "llviewerobject.h" #include "llviewerregion.h" #include "llresmgr.h" diff --git a/indra/newview/llfloaterbulkpermission.h b/indra/newview/llfloaterbulkpermission.h index 31f4f5c3e1..bffcff7059 100644 --- a/indra/newview/llfloaterbulkpermission.h +++ b/indra/newview/llfloaterbulkpermission.h @@ -44,8 +44,6 @@ #include "llfloater.h" #include "llscrolllistctrl.h" -#include "llviewerinventory.h" - class LLFloaterBulkPermission : public LLFloater, public LLVOInventoryListener { friend class LLFloaterReg; diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index 84b423399e..774caaec90 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -216,11 +216,11 @@ void LLFloaterChatterBox::onOpen(const LLSD& key) } else if (key.isDefined()) { - LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID()); + /*LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID()); if (impanel) { impanel->openFloater(); - } + }*/ } } diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index de65c6f876..b684e1f985 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -367,7 +367,14 @@ void LLFloaterGesture::addGesture(const LLUUID& item_id , LLMultiGesture* gestur element["columns"][3]["font"]["name"] = "SANSSERIF"; element["columns"][3]["font"]["style"] = font_style; } - list->addElement(element, ADD_BOTTOM); + + LLScrollListItem* sl_item = list->addElement(element, ADD_BOTTOM); + if(sl_item) + { + LLFontGL::StyleFlags style = LLGestureManager::getInstance()->isGestureActive(item_id) ? LLFontGL::BOLD : LLFontGL::NORMAL; + // *TODO find out why ["font"]["style"] does not affect font style + ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(style); + } } void LLFloaterGesture::getSelectedIds(std::vector<LLUUID>& ids) @@ -401,8 +408,7 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command) } return false; } - else if("copy_uuid" == command_name || "edit_gesture" == command_name - || "inspect" == command_name) + else if("copy_uuid" == command_name || "edit_gesture" == command_name) { return mGestureList->getAllSelected().size() == 1; } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 4b48626b22..b05eb84e52 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -40,7 +40,6 @@ #include "llinventoryfilter.h" #include "llpanel.h" #include "llviewercontrol.h" // gSavedSettings -#include "llviewerinventory.h" #include "llviewerwindow.h" // Argh, only for setCursor() // linden library includes diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index d6e2bb0445..3653371d76 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -75,11 +75,12 @@ public: return false; } + //*TODO by what to replace showing groups floater? if (tokens[0].asString() == "list") { if (tokens[1].asString() == "show") { - LLFloaterReg::showInstance("contacts", "groups"); + //LLFloaterReg::showInstance("contacts", "groups"); return true; } return false; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 1254664330..80d2778934 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -52,7 +52,6 @@ #include "llbottomtray.h" #include "llcallingcard.h" #include "llchat.h" -#include "llfloaterchatterbox.h" #include "llimfloater.h" #include "llgroupiconctrl.h" #include "llmd5.h" @@ -64,6 +63,7 @@ #include "llnotificationsutil.h" #include "llnearbychat.h" #include "llspeakers.h" //for LLIMSpeakerMgr +#include "lltextbox.h" #include "lltextutil.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" @@ -538,13 +538,6 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con gIMMgr->startCall(new_session_id); } } - - //*TODO remove this "floater" stuff when Communicate Floater is gone - LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(old_session_id); - if (floater) - { - floater->sessionInitReplyReceived(new_session_id); - } } void LLIMModel::testMessages() @@ -679,15 +672,6 @@ bool LLIMModel::proccessOnlineOfflineNotification( const LLUUID& session_id, const std::string& utf8_text) { - // Add message to old one floater - LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); - if ( floater ) - { - if ( !utf8_text.empty() ) - { - floater->addHistoryLine(utf8_text, LLUIColorTable::instance().getColor("SystemChatColor")); - } - } // Add system message to history return addMessage(session_id, SYSTEM_FROM, LLUUID::null, utf8_text); } @@ -955,9 +939,6 @@ void LLIMModel::sendMessage(const std::string& utf8_text, history_echo += ": " + utf8_text; - LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(im_session_id); - if (floater) floater->addHistoryLine(history_echo, LLUIColorTable::instance().getColor("IMChatColor"), true, gAgent.getID()); - LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); if (speaker_mgr) { @@ -1275,33 +1256,16 @@ LLUUID LLIMMgr::computeSessionID( return session_id; } -inline LLFloater* getFloaterBySessionID(const LLUUID session_id) -{ - LLFloater* floater = NULL; - if ( gIMMgr ) - { - floater = dynamic_cast < LLFloater* > - ( gIMMgr->findFloaterBySession(session_id) ); - } - if ( !floater ) - { - floater = dynamic_cast < LLFloater* > - ( LLIMFloater::findInstance(session_id) ); - } - return floater; -} - void LLIMMgr::showSessionStartError( const std::string& error_string, const LLUUID session_id) { - const LLFloater* floater = getFloaterBySessionID (session_id); - if (!floater) return; + if (!hasSession(session_id)) return; LLSD args; args["REASON"] = LLTrans::getString(error_string); - args["RECIPIENT"] = floater->getTitle(); + args["RECIPIENT"] = LLIMModel::getInstance()->getName(session_id); LLSD payload; payload["session_id"] = session_id; @@ -1339,12 +1303,11 @@ LLIMMgr::showSessionForceClose( const std::string& reason_string, const LLUUID session_id) { - const LLFloater* floater = getFloaterBySessionID (session_id); - if (!floater) return; + if (!hasSession(session_id)) return; LLSD args; - args["NAME"] = floater->getTitle(); + args["NAME"] = LLIMModel::getInstance()->getName(session_id); args["REASON"] = LLTrans::getString(reason_string); LLSD payload; @@ -1366,7 +1329,7 @@ LLIMMgr::onConfirmForceCloseError( //only 1 option really LLUUID session_id = notification["payload"]["session_id"]; - LLFloater* floater = getFloaterBySessionID (session_id); + LLFloater* floater = LLIMFloater::findInstance(session_id); if ( floater ) { floater->closeFloater(FALSE); @@ -2114,8 +2077,7 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) // Member Functions // -LLIMMgr::LLIMMgr() : - mIMReceived(FALSE) +LLIMMgr::LLIMMgr() { mPendingInvitations = LLSD::emptyMap(); mPendingAgentListUpdates = LLSD::emptyMap(); @@ -2146,7 +2108,6 @@ void LLIMMgr::addMessage( return; } - LLFloaterIMPanel* floater; LLUUID new_session_id = session_id; if (new_session_id.isNull()) { @@ -2165,32 +2126,7 @@ void LLIMMgr::addMessage( if (new_session) { LLIMModel::getInstance()->newSession(new_session_id, fixed_session_name, dialog, other_participant_id); - } - - floater = findFloaterBySession(new_session_id); - if (!floater) - { - floater = findFloaterBySession(other_participant_id); - if (floater) - { - llinfos << "found the IM session " << session_id - << " by participant " << other_participant_id << llendl; - } - } - - // create IM window as necessary - if(!floater) - { - floater = createFloater( - new_session_id, - other_participant_id, - fixed_session_name, - dialog, - FALSE); - } - if (new_session) - { // When we get a new IM, and if you are a god, display a bit // of information about the source. This is to help liaisons // when answering questions. @@ -2209,50 +2145,13 @@ void LLIMMgr::addMessage( //<< "*** region_id: " << region_id << std::endl //<< "*** position: " << position << std::endl; - floater->addHistoryLine(bonus_info.str(), LLUIColorTable::instance().getColor("SystemChatColor")); LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str()); } make_ui_sound("UISndNewIncomingIMSession"); } - // now add message to floater - bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM); - const LLColor4& color = ( is_from_system ? - LLUIColorTable::instance().getColor("SystemChatColor") : - LLUIColorTable::instance().getColor("IMChatColor")); - if ( !link_name ) - { - floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally - } - else - { - floater->addHistoryLine(msg, color, true, other_participant_id, from); // Insert linked name to front of message - } - LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); - - if( !LLFloaterReg::instanceVisible("communicate") && !floater->getVisible()) - { - LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(); - - //if the IM window is not open and the floater is not visible (i.e. not torn off) - LLFloater* previouslyActiveFloater = chat_floater->getActiveFloater(); - - // select the newly added floater (or the floater with the new line added to it). - // it should be there. - chat_floater->selectFloater(floater); - - //there was a previously unseen IM, make that old tab flashing - //it is assumed that the most recently unseen IM tab is the one current selected/active - if ( previouslyActiveFloater && getIMReceived() ) - { - chat_floater->setFloaterFlashing(previouslyActiveFloater, TRUE); - } - - //notify of a new IM - notifyNewIM(); - } } void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args) @@ -2285,14 +2184,6 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess } } -void LLIMMgr::notifyNewIM() -{ - if(!LLFloaterReg::instanceVisible("communicate")) - { - mIMReceived = TRUE; - } -} - S32 LLIMMgr::getNumberOfUnreadIM() { std::map<LLUUID, LLIMModel::LLIMSession*>::iterator it; @@ -2319,16 +2210,6 @@ S32 LLIMMgr::getNumberOfUnreadParticipantMessages() return num; } -void LLIMMgr::clearNewIMNotification() -{ - mIMReceived = FALSE; -} - -BOOL LLIMMgr::getIMReceived() const -{ - return mIMReceived; -} - void LLIMMgr::autoStartCallOnStartup(const LLUUID& session_id) { LLIMModel::LLIMSession *session = LLIMModel::getInstance()->findIMSession(session_id); @@ -2416,21 +2297,6 @@ LLUUID LLIMMgr::addSession( LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids, voice); } - //*TODO remove this "floater" thing when Communicate Floater's gone - LLFloaterIMPanel* floater = findFloaterBySession(session_id); - if(!floater) - { - // On creation, use the first element of ids as the - // "other_participant_id" - floater = createFloater( - session_id, - other_participant_id, - name, - dialog, - TRUE, - ids); - } - //we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions if (!new_session) return session_id; @@ -2441,7 +2307,7 @@ LLUUID LLIMMgr::addSession( // Only warn for regular IMs - not group IMs if( dialog == IM_NOTHING_SPECIAL ) { - noteMutedUsers(session_id, floater, ids); + noteMutedUsers(session_id, ids); } return session_id; @@ -2462,14 +2328,6 @@ void LLIMMgr::removeSession(const LLUUID& session_id) { llassert_always(hasSession(session_id)); - //*TODO remove this floater thing when Communicate Floater is being deleted (IB) - LLFloaterIMPanel* floater = findFloaterBySession(session_id); - if(floater) - { - mFloaters.erase(floater->getHandle()); - LLFloaterChatterBox::getInstance()->removeFloater(floater); - } - clearPendingInvitation(session_id); clearPendingAgentListUpdates(session_id); @@ -2579,50 +2437,12 @@ void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::stri LLFloaterReg::showInstance("incoming_call", payload, TRUE); } +//*TODO disconnects all sessions void LLIMMgr::disconnectAllSessions() { - LLFloaterIMPanel* floater = NULL; - std::set<LLHandle<LLFloater> >::iterator handle_it; - for(handle_it = mFloaters.begin(); - handle_it != mFloaters.end(); - ) - { - floater = (LLFloaterIMPanel*)handle_it->get(); - - // MUST do this BEFORE calling floater->onClose() because that may remove the item from the set, causing the subsequent increment to crash. - ++handle_it; - - if (floater) - { - floater->setEnabled(FALSE); - floater->closeFloater(TRUE); - } - } -} - - -// This method returns the im panel corresponding to the uuid -// provided. The uuid can either be a session id or an agent -// id. Returns NULL if there is no matching panel. -LLFloaterIMPanel* LLIMMgr::findFloaterBySession(const LLUUID& session_id) -{ - LLFloaterIMPanel* rv = NULL; - std::set<LLHandle<LLFloater> >::iterator handle_it; - for(handle_it = mFloaters.begin(); - handle_it != mFloaters.end(); - ++handle_it) - { - rv = (LLFloaterIMPanel*)handle_it->get(); - if(rv && session_id == rv->getSessionID()) - { - break; - } - rv = NULL; - } - return rv; + //*TODO disconnects all IM sessions } - BOOL LLIMMgr::hasSession(const LLUUID& session_id) { return LLIMModel::getInstance()->findIMSession(session_id) != NULL; @@ -2806,49 +2626,14 @@ bool LLIMMgr::isVoiceCall(const LLUUID& session_id) return im_session->mStartedAsIMCall; } -// create a floater and update internal representation for -// consistency. Returns the pointer, caller (the class instance since -// it is a private method) is not responsible for deleting the -// pointer. Add the floater to this but do not select it. -LLFloaterIMPanel* LLIMMgr::createFloater( - const LLUUID& session_id, - const LLUUID& other_participant_id, - const std::string& session_label, - EInstantMessage dialog, - BOOL user_initiated, - const LLDynamicArray<LLUUID>& ids) -{ - if (session_id.isNull()) - { - llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; - } - - llinfos << "LLIMMgr::createFloater: from " << other_participant_id - << " in session " << session_id << llendl; - LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, - session_id, - other_participant_id, - ids, - dialog); - LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; - LLFloaterChatterBox::getInstance()->addFloater(floater, FALSE, i_pt); - mFloaters.insert(floater->getHandle()); - return floater; -} - void LLIMMgr::noteOfflineUsers( const LLUUID& session_id, - LLFloaterIMPanel* floater, const LLDynamicArray<LLUUID>& ids) { S32 count = ids.count(); if(count == 0) { const std::string& only_user = LLTrans::getString("only_user_message"); - if (floater) - { - floater->addHistoryLine(only_user, LLUIColorTable::instance().getColor("SystemChatColor")); - } LLIMModel::getInstance()->addMessage(session_id, SYSTEM_FROM, LLUUID::null, only_user); } else @@ -2872,7 +2657,7 @@ void LLIMMgr::noteOfflineUsers( } } -void LLIMMgr::noteMutedUsers(const LLUUID& session_id, LLFloaterIMPanel* floater, +void LLIMMgr::noteMutedUsers(const LLUUID& session_id, const LLDynamicArray<LLUUID>& ids) { // Don't do this if we don't have a mute list. @@ -2893,9 +2678,6 @@ void LLIMMgr::noteMutedUsers(const LLUUID& session_id, LLFloaterIMPanel* floater { LLUIString muted = LLTrans::getString("muted_message"); - //*TODO remove this "floater" thing when Communicate Floater's gone - floater->addHistoryLine(muted); - im_model->addMessage(session_id, SYSTEM_FROM, LLUUID::null, muted); break; } @@ -2916,12 +2698,6 @@ void LLIMMgr::processIMTypingStop(const LLIMInfo* im_info) void LLIMMgr::processIMTypingCore(const LLIMInfo* im_info, BOOL typing) { LLUUID session_id = computeSessionID(im_info->mIMType, im_info->mFromID); - LLFloaterIMPanel* floater = findFloaterBySession(session_id); - if (floater) - { - floater->processIMTyping(im_info, typing); - } - LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); if ( im_floater ) { @@ -2967,15 +2743,6 @@ public: speaker_mgr->updateSpeakers(gIMMgr->getPendingAgentListUpdates(session_id)); } - LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id); - if (floaterp) - { - if ( body.has("session_info") ) - { - floaterp->processSessionUpdate(body["session_info"]); - } - } - LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); if ( im_floater ) { @@ -3070,11 +2837,6 @@ public: const LLSD& input) const { LLUUID session_id = input["body"]["session_id"].asUUID(); - LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id); - if (floaterp) - { - floaterp->processSessionUpdate(input["body"]["info"]); - } LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); if ( im_floater ) { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 0386ff234d..b573490fa3 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -39,9 +39,8 @@ #include "lllogchat.h" #include "llvoicechannel.h" -class LLFloaterChatterBox; -class LLUUID; -class LLFloaterIMPanel; + + class LLFriendObserver; class LLCallDialogManager; class LLIMSpeakerMgr; @@ -361,15 +360,9 @@ public: void processIMTypingStart(const LLIMInfo* im_info); void processIMTypingStop(const LLIMInfo* im_info); - void notifyNewIM(); - void clearNewIMNotification(); - // automatically start a call once the session has initialized void autoStartCallOnStartup(const LLUUID& session_id); - // IM received that you haven't seen yet - BOOL getIMReceived() const; - // Calc number of all unread IMs S32 getNumberOfUnreadIM(); @@ -386,11 +379,6 @@ public: BOOL hasSession(const LLUUID& session_id); - // This method returns the im panel corresponding to the uuid - // provided. The uuid must be a session id. Returns NULL if there - // is no matching panel. - LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id); - static LLUUID computeSessionID(EInstantMessage dialog, const LLUUID& other_participant_id); void clearPendingInvitation(const LLUUID& session_id); @@ -402,10 +390,6 @@ public: const LLSD& updates); void clearPendingAgentListUpdates(const LLUUID& session_id); - //HACK: need a better way of enumerating existing session, or listening to session create/destroy events - //@deprecated, is used only by LLToolBox, which is not used anywhere, right? (IB) - const std::set<LLHandle<LLFloater> >& getIMFloaterHandles() { return mFloaters; } - void addSessionObserver(LLIMSessionObserver *); void removeSessionObserver(LLIMSessionObserver *); @@ -436,23 +420,12 @@ private: */ void removeSession(const LLUUID& session_id); - // create a panel and update internal representation for - // consistency. Returns the pointer, caller (the class instance - // since it is a private method) is not responsible for deleting - // the pointer. - LLFloaterIMPanel* createFloater(const LLUUID& session_id, - const LLUUID& target_id, - const std::string& name, - EInstantMessage dialog, - BOOL user_initiated = FALSE, - const LLDynamicArray<LLUUID>& ids = LLDynamicArray<LLUUID>()); - // This simple method just iterates through all of the ids, and // prints a simple message if they are not online. Used to help // reduce 'hello' messages to the linden employees unlucky enough // to have their calling card in the default inventory. - void noteOfflineUsers(const LLUUID& session_id, LLFloaterIMPanel* panel, const LLDynamicArray<LLUUID>& ids); - void noteMutedUsers(const LLUUID& session_id, LLFloaterIMPanel* panel, const LLDynamicArray<LLUUID>& ids); + void noteOfflineUsers(const LLUUID& session_id, const LLDynamicArray<LLUUID>& ids); + void noteMutedUsers(const LLUUID& session_id, const LLDynamicArray<LLUUID>& ids); void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); @@ -464,15 +437,9 @@ private: private: - //*TODO should be deleted when Communicate Floater is being deleted - std::set<LLHandle<LLFloater> > mFloaters; - typedef std::list <LLIMSessionObserver *> session_observers_list_t; session_observers_list_t mSessionObservers; - // An IM has been received that you haven't seen yet. - BOOL mIMReceived; - LLSD mPendingInvitations; LLSD mPendingAgentListUpdates; }; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6c9c7d15be..e04d3ec5a0 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5079,7 +5079,7 @@ void LLLandmarkBridgeAction::doIt() payload["asset_id"] = item->getAssetUUID(); LLSD args; - args["LOCATION"] = item->getDisplayName(); + args["LOCATION"] = item->getName(); LLNotificationsUtil::add("TeleportFromLandmark", args, payload); } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index b4dcb566e4..cd20d64ca8 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -39,7 +39,6 @@ #include "llfolderviewitem.h" #include "llinventorymodel.h" // gInventory.backgroundFetchActive() #include "llviewercontrol.h" -#include "llviewerinventory.h" #include "llfolderview.h" // linden library includes diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 2885ba13fa..33623539e9 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -76,7 +76,6 @@ #include "lltabcontainer.h" #include "lltooldraganddrop.h" #include "lluictrlfactory.h" -#include "llviewerinventory.h" #include "llviewermessage.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 961f7adc0a..bdf1ebddac 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -142,6 +142,105 @@ bool LLCanCache::operator()(LLInventoryCategory* cat, LLInventoryItem* item) return rv; } +/* +This namespace contains a functionality to remove LM prefixes were used to store sort order of +Favorite Landmarks in landmarks' names. +Once being in Favorites folder LM inventory Item has such prefix. +Due to another solution is implemented in EXT-3985 these prefixes should be removed. + +*NOTE: It will be unnecessary after the first successful session in viewer 2.0. +Can be removed before public release. + +Implementation details: +At the first run with this patch it patches all cached landmarks: removes LM sort prefixes and +updates them on the viewer and server sides. +Also it calls fetching agent's inventory to process not yet loaded landmarks too. +If fetching is successfully done it will store special per-agent empty file-marker +in the user temporary folder (where cached inventory is loaded) while caching agent's inventory. +After that in will not affect the viewer until cached marker is removed. +*/ +namespace LMSortPrefix +{ + bool cleanup_done = false; + const std::string getMarkerPath() + { + std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, gAgentID.asString())); + std::string marker_filename = llformat("%s-lm_prefix_marker", path.c_str()); + + return marker_filename; + } + bool wasClean() + { + static bool was_clean = false; + static bool already_init = false; + if (already_init) return was_clean; + + already_init = true; + std::string path_to_marker = getMarkerPath(); + was_clean = LLFile::isfile(path_to_marker); + + return was_clean; + } + + void setLandmarksWereCleaned() + { + if (cleanup_done) + { + std::string path_to_marker = getMarkerPath(); + LLFILE* file = LLFile::fopen(path_to_marker, "w"); + if(!file) + { + llwarns << "unable to save marker that LM prefixes were removed: " << path_to_marker << llendl; + return; + } + + fclose(file); + } + } + + void removePrefix(LLPointer<LLViewerInventoryItem> inv_item) + { + if (wasClean()) + { + LL_INFOS_ONCE("") << "Inventory was cleaned for this avatar. Patch can be removed." << LL_ENDL; + return; + } + + if (LLInventoryType::IT_LANDMARK != inv_item->getInventoryType()) return; + + std::string old_name = inv_item->getName(); + + S32 sort_field = -1; + std::string display_name; + BOOL exists = LLViewerInventoryItem::extractSortFieldAndDisplayName(old_name, &sort_field, &display_name); + if (exists && sort_field != -1) + { + llinfos << "Removing Landmark sort field and separator for: " << old_name << " | " << inv_item->getUUID() << llendl; + LLUUID parent_uuid = inv_item->getParentUUID(); + if (gInventory.getCategory(parent_uuid)) + { + llinfos << "parent folder is: " << gInventory.getCategory(parent_uuid)->getName() << llendl; + } + + + // mark item completed to avoid error while copying and updating server + inv_item->setComplete(TRUE); + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item.get()); + new_item->rename(display_name); + gInventory.updateItem(new_item); + new_item->updateServer(FALSE); + + gInventory.notifyObservers(); + } + } + + void completeCleanup() + { + // background fetch is completed. can save marker + cleanup_done = true; + } +} + ///---------------------------------------------------------------------------- /// Class LLInventoryModel ///---------------------------------------------------------------------------- @@ -1736,6 +1835,8 @@ void LLInventoryModel::stopBackgroundFetch() gIdleCallbacks.deleteFunction(&LLInventoryModel::backgroundFetch, NULL); sBulkFetchCount=0; sMinTimeBetweenFetches=0.0f; + + LMSortPrefix::completeCleanup(); } } @@ -1882,6 +1983,13 @@ void LLInventoryModel::cache( const LLUUID& parent_folder_id, const LLUUID& agent_id) { + if (getRootFolderID() == parent_folder_id) + { + // *TODO: mantipov: can be removed before public release, EXT-3985 + //save marker to avoid fetching inventory on future sessions + LMSortPrefix::setLandmarksWereCleaned(); + } + lldebugs << "Caching " << parent_folder_id << " for " << agent_id << llendl; LLViewerInventoryCategory* root_cat = getCategory(parent_folder_id); @@ -2692,6 +2800,28 @@ void LLInventoryModel::buildParentChildMap() // The inv tree is built. mIsAgentInvUsable = true; + {// *TODO: mantipov: can be removed before public release, EXT-3985 + /* + *HACK: mantipov: to cleanup landmarks were marked with sort index prefix in name. + Is necessary to be called once per account after EXT-3985 is implemented. + So, let fetch agent's inventory, processing will be done in processInventoryDescendents() + Should be removed before public release. + */ + if (!LMSortPrefix::wasClean()) + { + cat_array_t cats; + item_array_t items; + collectDescendents(agent_inv_root_id, cats, items, INCLUDE_TRASH); + + for (item_array_t::const_iterator it= items.begin(); it != items.end(); ++it) + { + LMSortPrefix::removePrefix(*it); + } + + gInventory.startBackgroundFetch(agent_inv_root_id); + } + } + llinfos << "Inventory initialized, notifying observers" << llendl; addChangedMask(LLInventoryObserver::ALL, LLUUID::null); notifyObservers(); @@ -3457,6 +3587,10 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) continue; } gInventory.updateItem(titem); + + {// *TODO: mantipov: can be removed before public release, EXT-3985 + LMSortPrefix::removePrefix(titem); + } } // set version and descendentcount according to message. diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 7e71ac90b4..12a2c370d2 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -759,7 +759,9 @@ bool LLInventoryPanel::beginIMSession() S32 count = item_array.count(); if(count > 0) { - LLFloaterReg::showInstance("communicate"); + //*TODO by what to replace that? + //LLFloaterReg::showInstance("communicate"); + // create the session LLAvatarTracker& at = LLAvatarTracker::instance(); LLUUID id; diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 5981baab60..4bf2bac649 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -651,6 +651,9 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view) // Detach from movement controls. parent->removeChild(this); mOriginalParent.get()->addChild(this); + // update parent with self visibility (it is changed in setVisible()). EXT-4743 + mOriginalParent.get()->setVisible(getVisible()); + mAttached = false; updatePosition(); // don't defer until next draw() to avoid flicker } diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index c1666f5666..2d3c4b187e 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -58,7 +58,6 @@ #include "llagent.h" #include "llviewergenericmessage.h" // for gGenericDispatcher #include "llworld.h" //for particle system banning -#include "llimpanel.h" #include "llimview.h" #include "llnotifications.h" #include "llviewerobjectlist.h" @@ -472,12 +471,6 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n if (reason == LLMuteList::AR_IM) { - LLFloaterIMPanel *timp = gIMMgr->findFloaterBySession(agent_id); - if (timp) - { - timp->addHistoryLine(message); - } - LLIMModel::getInstance()->addMessage(agent_id, SYSTEM_FROM, LLUUID::null, message); } } diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 9d591ef43d..2a7d097f94 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -50,7 +50,6 @@ // project includes #include "llagent.h" -#include "llfloaterbulkpermission.h" #include "llpanelobjectinventory.h" #include "llpreviewscript.h" #include "llresmgr.h" @@ -60,6 +59,7 @@ #include "lltoolmgr.h" #include "lltrans.h" #include "llviewerassettype.h" +#include "llviewerinventory.h" #include "llviewerobject.h" #include "llviewerregion.h" #include "llviewerwindow.h" diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 45fc3d4688..6210973dae 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -614,7 +614,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject, mViewInventoryIcon->setVisible(TRUE); std::stringstream ss; - ss << " " << LLViewerInventoryItem::getDisplayName(inventory_name); + ss << " " << inventory_name; mViewInventoryName->setText(ss.str()); mBtnOpenAttachment->setEnabled(TRUE); diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 7a17d4a1f0..36a542cfa0 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -367,7 +367,6 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) } LLStringUtil::replaceChar(desc, '\n', ' '); - LLViewerInventoryItem::insertDefaultSortField(name); // If no folder chosen use the "Landmarks" folder. LLLandmarkActions::createLandmarkHere(name, desc, diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 501dac5dff..470cfca8fe 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -61,7 +61,14 @@ ContextMenu::~ContextMenu() // It can have registered Enable callbacks which are called from the LLMenuHolderGL::draw() // via selected item (menu_item_call) by calling LLMenuItemCallGL::buildDrawLabel. // we can have a crash via using callbacks of deleted instance of ContextMenu. EXT-4725 - if (mMenu) mMenu->die(); + + // menu holder deletes its menus on viewer exit, so we have no way to determine if instance + // of mMenu has already been deleted except of using LLHandle. EXT-4762. + if (!mMenuHandle.isDead()) + { + mMenu->die(); + mMenu = NULL; + } } void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids, S32 x, S32 y) @@ -86,6 +93,7 @@ void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids, std::copy(uuids.begin(), uuids.end(), mUUIDs.begin()); mMenu = createMenu(); + mMenuHandle = mMenu->getHandle(); mMenu->show(x, y); LLMenuGL::showPopup(spawning_view, mMenu, x, y); } diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 7251f6dbbd..913638d8c8 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -62,6 +62,7 @@ protected: std::vector<LLUUID> mUUIDs; LLContextMenu* mMenu; + LLHandle<LLView> mMenuHandle; }; /** diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 6005881148..43e0f9a88c 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -46,7 +46,6 @@ #include "llnotificationsutil.h" #include "lltextbox.h" #include "llviewermenu.h" -#include "llviewerinventory.h" #include "lllandmarkactions.h" #include "llclipboard.h" diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 84bdaafacf..53e351e66e 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -155,6 +155,12 @@ LLPreviewGesture* LLPreviewGesture::show(const LLUUID& item_id, const LLUUID& ob return preview; } +void LLPreviewGesture::draw() +{ + // Skip LLPreview::draw() to avoid description update + LLFloater::draw(); +} + // virtual BOOL LLPreviewGesture::handleKeyHere(KEY key, MASK mask) { @@ -497,11 +503,9 @@ BOOL LLPreviewGesture::postBuild() if (item) { - childSetCommitCallback("desc", LLPreview::onText, this); childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); - childSetCommitCallback("name", LLPreview::onText, this); childSetText("name", item->getName()); childSetPrevalidate("name", &LLLineEditor::prevalidateASCIIPrintableNoPipe); } @@ -1077,6 +1081,8 @@ void LLPreviewGesture::saveIfNeeded() } else { + LLPreview::onCommit(); + // Every save gets a new UUID. Yup. LLTransactionID tid; LLAssetID asset_id; diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index 19fa1dcc37..5968e936ef 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -60,6 +60,7 @@ public: virtual ~LLPreviewGesture(); // LLView + /*virtual*/ void draw(); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, diff --git a/indra/newview/llsidepanelinventorysubpanel.cpp b/indra/newview/llsidepanelinventorysubpanel.cpp index 56e342c3ce..f51462dcce 100644 --- a/indra/newview/llsidepanelinventorysubpanel.cpp +++ b/indra/newview/llsidepanelinventorysubpanel.cpp @@ -44,7 +44,6 @@ #include "lllineeditor.h" #include "llradiogroup.h" #include "llviewercontrol.h" -#include "llviewerinventory.h" #include "llviewerobjectlist.h" diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index e49044cdca..add61c00cf 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -127,17 +127,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification pAttachLink->setVisible(hasInventory); pAttachIcon->setVisible(hasInventory); if (hasInventory) { - std::string dis_name; - std::string inv_name = payload["inventory_name"]; - - if (LLViewerInventoryItem::extractSortFieldAndDisplayName(inv_name, NULL, &dis_name)) - { - pAttachLink->setValue(dis_name); - } - else - { - pAttachLink->setValue(inv_name); - } + pAttachLink->setValue(payload["inventory_name"]); mInventoryOffer = new LLOfferInfo(payload["inventory_offer"]); childSetActionTextbox("attachment", boost::bind( diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index e7dc7ae522..404eab9249 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -54,7 +54,6 @@ #include "lltooldraganddrop.h" #include "llfloaterinventory.h" #include "llfloaterchatterbox.h" -#include "llfloaterfriends.h" #include "llfloatersnapshot.h" #include "llinventorypanel.h" #include "lltoolmgr.h" @@ -70,7 +69,6 @@ #include "llviewerwindow.h" #include "lltoolgrab.h" #include "llcombobox.h" -#include "llimpanel.h" #include "lllayoutstack.h" #if LL_DARWIN @@ -265,12 +263,12 @@ void LLToolBar::updateCommunicateList() communicate_button->removeall(); - LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); + //LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); LLScrollListItem* itemp = NULL; LLSD contact_sd; contact_sd["value"] = "contacts"; - contact_sd["columns"][0]["value"] = LLFloaterMyFriends::getInstance()->getShortTitle(); + /*contact_sd["columns"][0]["value"] = LLFloaterMyFriends::getInstance()->getShortTitle(); if (LLFloaterMyFriends::getInstance() == frontmost_floater) { contact_sd["columns"][0]["font"]["name"] = "SANSSERIF_SMALL"; @@ -280,7 +278,7 @@ void LLToolBar::updateCommunicateList() { selected = "contacts"; } - } + }*/ itemp = communicate_button->addElement(contact_sd, ADD_TOP); communicate_button->addSeparator(ADD_TOP); @@ -290,7 +288,7 @@ void LLToolBar::updateCommunicateList() std::set<LLHandle<LLFloater> >::const_iterator floater_handle_it; - if (gIMMgr->getIMFloaterHandles().size() > 0) + /*if (gIMMgr->getIMFloaterHandles().size() > 0) { communicate_button->addSeparator(ADD_TOP); } @@ -316,7 +314,7 @@ void LLToolBar::updateCommunicateList() } itemp = communicate_button->addElement(im_sd, ADD_TOP); } - } + }*/ communicate_button->setValue(selected); } @@ -340,7 +338,7 @@ void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data) } else if (selected_option.asString() == "redock") { - LLFloaterChatterBox* chatterbox_instance = LLFloaterChatterBox::getInstance(); + /*LLFloaterChatterBox* chatterbox_instance = LLFloaterChatterBox::getInstance(); if(chatterbox_instance) { chatterbox_instance->addFloater(LLFloaterMyFriends::getInstance(), FALSE); @@ -361,7 +359,7 @@ void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data) } } LLFloaterReg::showInstance("communicate", session_to_show); - } + }*/ } else if (selected_option.asString() == "mute list") { @@ -369,11 +367,11 @@ void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data) } else if (selected_option.isUndefined()) // user just clicked the communicate button, treat as toggle { - LLFloaterReg::toggleInstance("communicate"); + /*LLFloaterReg::toggleInstance("communicate");*/ } else // otherwise selection_option is undifined or a specific IM session id { - LLFloaterReg::showInstance("communicate", selected_option); + /*LLFloaterReg::showInstance("communicate", selected_option);*/ } } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 57434bd1e4..64eabe65cf 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -63,7 +63,6 @@ #include "llviewerjoystick.h" #include "llviewerparcelmgr.h" #include "llparcel.h" -#include "lloverlaybar.h" #include "llkeyboard.h" #include "llerrorcontrol.h" #include "llappviewer.h" @@ -257,35 +256,6 @@ static bool handleJoystickChanged(const LLSD& newvalue) return true; } -static bool handleAudioStreamMusicChanged(const LLSD& newvalue) -{ - if (gAudiop) - { - if ( newvalue.asBoolean() ) - { - if (LLViewerParcelMgr::getInstance()->getAgentParcel() - && !LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL().empty()) - { - // if music isn't playing, start it - if (gOverlayBar && !gOverlayBar->musicPlaying()) - { - LLOverlayBar::toggleMusicPlay(NULL); - } - } - } - else - { - // if music is playing, stop it. - if (gOverlayBar && gOverlayBar->musicPlaying()) - { - LLOverlayBar::toggleMusicPlay(NULL); - } - - } - } - return true; -} - static bool handleUseOcclusionChanged(const LLSD& newvalue) { LLPipeline::sUseOcclusion = (newvalue.asBoolean() && gGLManager.mHasOcclusionQuery @@ -592,7 +562,6 @@ void settings_setup_listeners() gSavedSettings.getControl("AudioLevelVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("AudioLevelDoppler")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("AudioLevelRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); - gSavedSettings.getControl("AudioStreamingMusic")->getSignal()->connect(boost::bind(&handleAudioStreamMusicChanged, _2)); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("MuteMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("MuteMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index e87d380e4d..658d1c9ddd 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -54,7 +54,6 @@ #include "llfloaterbulkpermission.h" #include "llfloaterbump.h" #include "llfloatercamera.h" -#include "llfloaterchatterbox.h" #include "llfloaterdaycycle.h" #include "llfloatersearch.h" #include "llfloaterenvsettings.h" @@ -69,7 +68,6 @@ #include "llfloaterhud.h" #include "llfloaterimagepreview.h" #include "llimfloater.h" -#include "llimpanel.h" #include "llfloaterinspect.h" #include "llfloaterinventory.h" #include "llfloaterjoystick.h" @@ -116,7 +114,6 @@ #include "llinspectobject.h" #include "llinspectremoteobject.h" #include "llinspecttoast.h" -#include "llmediaremotectrl.h" #include "llmoveview.h" #include "llnearbychat.h" #include "llpanelblockedlist.h" @@ -155,9 +152,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>); //LLFloaterReg::add("chat", "floater_chat_history.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChat>); LLFloaterReg::add("nearby_chat", "floater_nearby_chat.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChat>); - LLFloaterReg::add("communicate", "floater_chatterbox.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChatterBox>); + LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>); - LLFloaterReg::add("contacts", "floater_my_friends.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMyFriends>); LLFloaterReg::add("env_day_cycle", "floater_day_cycle_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDayCycle>); LLFloaterReg::add("env_post_process", "floater_post_process.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostProcess>); @@ -265,8 +261,5 @@ void LLViewerFloaterReg::registerFloaters() // *NOTE: Please keep these alphabetized for easier merges - // debug use only - LLFloaterReg::add("media_remote_ctrl", "floater_media_remote.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaRemoteCtrl>); - LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b330c1ba83..3001992630 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -34,6 +34,7 @@ #include "llviewerinventory.h" #include "llnotificationsutil.h" +#include "llsdserialize.h" #include "message.h" #include "indra_constants.h" @@ -1171,81 +1172,196 @@ const std::string& LLViewerInventoryItem::getName() const return linked_category->getName(); } - return getDisplayName(); + return LLInventoryItem::getName(); } -const std::string& LLViewerInventoryItem::getDisplayName() const +/** + * Class to store sorting order of favorites landmarks in a local file. EXT-3985. + * It replaced previously implemented solution to store sort index in landmark's name as a "<N>@" prefix. + * Data are stored in user home directory. + */ +class LLFavoritesOrderStorage : public LLSingleton<LLFavoritesOrderStorage> + , public LLDestroyClass<LLFavoritesOrderStorage> { - std::string result; - BOOL hasSortField = extractSortFieldAndDisplayName(0, &result); +public: + /** + * Sets sort index for specified with LLUUID favorite landmark + */ + void setSortIndex(const LLUUID& inv_item_id, S32 sort_index); + + /** + * Gets sort index for specified with LLUUID favorite landmark + */ + S32 getSortIndex(const LLUUID& inv_item_id); + void removeSortIndex(const LLUUID& inv_item_id); + + /** + * Implementation of LLDestroyClass. Calls cleanup() instance method. + * + * It is important this callback is called before gInventory is cleaned. + * For now it is called from LLAppViewer::cleanup() -> LLAppViewer::disconnectViewer(), + * Inventory is cleaned later from LLAppViewer::cleanup() after LLAppViewer::disconnectViewer() is called. + * @see cleanup() + */ + static void destroyClass(); + + const static S32 NO_INDEX; +private: + friend class LLSingleton<LLFavoritesOrderStorage>; + LLFavoritesOrderStorage() : mIsDirty(false) { load(); } + ~LLFavoritesOrderStorage() { save(); } + + /** + * Removes sort indexes for items which are not in Favorites bar for now. + */ + void cleanup(); + + const static std::string SORTING_DATA_FILE_NAME; + + void load(); + void save(); + + typedef std::map<LLUUID, S32> sort_index_map_t; + sort_index_map_t mSortIndexes; + + bool mIsDirty; + + struct IsNotInFavorites + { + IsNotInFavorites(const LLInventoryModel::item_array_t& items) + : mFavoriteItems(items) + { - return mDisplayName = hasSortField ? result : LLInventoryItem::getName(); -} + } -// static -std::string LLViewerInventoryItem::getDisplayName(const std::string& name) -{ - std::string result; - BOOL hasSortField = extractSortFieldAndDisplayName(name, 0, &result); + /** + * Returns true if specified item is not found among inventory items + */ + bool operator()(const sort_index_map_t::value_type& id_index_pair) const + { + LLPointer<LLViewerInventoryItem> item = gInventory.getItem(id_index_pair.first); + if (item.isNull()) return true; - return hasSortField ? result : name; -} + LLInventoryModel::item_array_t::const_iterator found_it = + std::find(mFavoriteItems.begin(), mFavoriteItems.end(), item); -S32 LLViewerInventoryItem::getSortField() const -{ - S32 result; - BOOL hasSortField = extractSortFieldAndDisplayName(&result, 0); + return found_it == mFavoriteItems.end(); + } + private: + LLInventoryModel::item_array_t mFavoriteItems; + }; + +}; + +const std::string LLFavoritesOrderStorage::SORTING_DATA_FILE_NAME = "landmarks_sorting.xml"; +const S32 LLFavoritesOrderStorage::NO_INDEX = -1; - return hasSortField ? result : -1; +void LLFavoritesOrderStorage::setSortIndex(const LLUUID& inv_item_id, S32 sort_index) +{ + mSortIndexes[inv_item_id] = sort_index; + mIsDirty = true; } -void LLViewerInventoryItem::setSortField(S32 sortField) +S32 LLFavoritesOrderStorage::getSortIndex(const LLUUID& inv_item_id) { - using std::string; + sort_index_map_t::const_iterator it = mSortIndexes.find(inv_item_id); + if (it != mSortIndexes.end()) + { + return it->second; + } + return NO_INDEX; +} - std::stringstream ss; - ss << sortField; +void LLFavoritesOrderStorage::removeSortIndex(const LLUUID& inv_item_id) +{ + mSortIndexes.erase(inv_item_id); + mIsDirty = true; +} - string newSortField = ss.str(); +// static +void LLFavoritesOrderStorage::destroyClass() +{ + LLFavoritesOrderStorage::instance().cleanup(); +} - const char separator = getSeparator(); - const string::size_type separatorPos = mName.find(separator, 0); +void LLFavoritesOrderStorage::load() +{ + // load per-resident sorting information + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, SORTING_DATA_FILE_NAME); - if (separatorPos < string::npos) + LLSD settings_llsd; + llifstream file; + file.open(filename); + if (file.is_open()) { - // the name of the LLViewerInventoryItem already consists of sort field and display name. - mName = newSortField + separator + mName.substr(separatorPos + 1, string::npos); + LLSDSerialize::fromXML(settings_llsd, file); } - else + + for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); + iter != settings_llsd.endMap(); ++iter) { - // there is no sort field in the name of LLViewerInventoryItem, we should add it - mName = newSortField + separator + mName; + mSortIndexes.insert(std::make_pair(LLUUID(iter->first), (S32)iter->second.asInteger())); } } -void LLViewerInventoryItem::rename(const std::string& n) +void LLFavoritesOrderStorage::save() { - using std::string; + // nothing to save if clean + if (!mIsDirty) return; - string new_name(n); - LLStringUtil::replaceNonstandardASCII(new_name, ' '); - LLStringUtil::replaceChar(new_name, '|', ' '); - LLStringUtil::trim(new_name); - LLStringUtil::truncate(new_name, DB_INV_ITEM_NAME_STR_LEN); + // If we quit from the login screen we will not have an SL account + // name. Don't try to save, otherwise we'll dump a file in + // C:\Program Files\SecondLife\ or similar. JC + std::string user_dir = gDirUtilp->getLindenUserDir(); + if (!user_dir.empty()) + { + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, SORTING_DATA_FILE_NAME); + LLSD settings_llsd; - const char separator = getSeparator(); - const string::size_type separatorPos = mName.find(separator, 0); + for(sort_index_map_t::const_iterator iter = mSortIndexes.begin(); iter != mSortIndexes.end(); ++iter) + { + settings_llsd[iter->first.asString()] = iter->second; + } - if (separatorPos < string::npos) - { - mName.replace(separatorPos + 1, string::npos, new_name); - } - else - { - mName = new_name; + llofstream file; + file.open(filename); + LLSDSerialize::toPrettyXML(settings_llsd, file); } } +void LLFavoritesOrderStorage::cleanup() +{ + // nothing to clean + if (!mIsDirty) return; + + const LLUUID fav_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(fav_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); + + IsNotInFavorites is_not_in_fav(items); + + sort_index_map_t aTempMap; + //copy unremoved values from mSortIndexes to aTempMap + std::remove_copy_if(mSortIndexes.begin(), mSortIndexes.end(), + inserter(aTempMap, aTempMap.begin()), + is_not_in_fav); + + //Swap the contents of mSortIndexes and aTempMap + mSortIndexes.swap(aTempMap); +} + + +S32 LLViewerInventoryItem::getSortField() const +{ + return LLFavoritesOrderStorage::instance().getSortIndex(mUUID); +} + +void LLViewerInventoryItem::setSortField(S32 sortField) +{ + LLFavoritesOrderStorage::instance().setSortIndex(mUUID, sortField); +} + const LLPermissions& LLViewerInventoryItem::getPermissions() const { // Use the actual permissions of the symlink, not its parent. @@ -1334,6 +1450,8 @@ U32 LLViewerInventoryItem::getCRC32() const return LLInventoryItem::getCRC32(); } +// *TODO: mantipov: should be removed with LMSortPrefix patch in llinventorymodel.cpp, EXT-3985 +static char getSeparator() { return '@'; } BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName) { using std::string; @@ -1369,12 +1487,6 @@ BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& na return result; } -void LLViewerInventoryItem::insertDefaultSortField(std::string& name) -{ - name.insert(0, std::string("1") + getSeparator()); -} - - // This returns true if the item that this item points to // doesn't exist in memory (i.e. LLInventoryModel). The baseitem // might still be in the database but just not loaded yet. diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 7f3f019b07..c24f76c87a 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -64,12 +64,8 @@ public: virtual LLAssetType::EType getType() const; virtual const LLUUID& getAssetUUID() const; virtual const std::string& getName() const; - virtual const std::string& getDisplayName() const; - static std::string getDisplayName(const std::string& name); - static char getSeparator() { return '@'; } virtual S32 getSortField() const; virtual void setSortField(S32 sortField); - virtual void rename(const std::string& new_name); virtual const LLPermissions& getPermissions() const; virtual const LLUUID& getCreatorUUID() const; virtual const std::string& getDescription() const; @@ -82,7 +78,6 @@ public: virtual U32 getCRC32() const; // really more of a checksum. static BOOL extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName); - static void insertDefaultSortField(std::string& name); // construct a complete viewer inventory item LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid, diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 96251f7571..f7f30a5136 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -53,7 +53,6 @@ #include "llfloaterbuycontents.h" #include "llfloaterbuycurrency.h" #include "llfloatercustomize.h" -#include "llfloaterchatterbox.h" #include "llfloatergodtools.h" #include "llfloaterinventory.h" #include "llfloaterland.h" @@ -82,7 +81,6 @@ #include "llsidetray.h" #include "llstatusbar.h" #include "lltextureview.h" -#include "lltoolbar.h" #include "lltoolcomp.h" #include "lltoolmgr.h" #include "lltoolpie.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f24fe07065..55b0d6fa8b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1435,31 +1435,6 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const return false; } -std::string get_display_name(const std::string& name) -{ - // We receive landmark name as \'<n>@name\' where <n> is a number - // LLViewerInventoryItem::getDisplayName will remove \'<n>@ though we need the \' - // Lets save all chars preceding @ and insert them back after <n>@ was removed - - std::string saved; - - if(std::string::npos != name.find(LLViewerInventoryItem::getSeparator())) - { - int n = 0; - while(!isdigit(name[n]) && LLViewerInventoryItem::getSeparator() != name[n]) - { - ++n; - } - saved = name.substr(0, n); - } - - std::string d_name = LLViewerInventoryItem::getDisplayName(name); - d_name.insert(0, saved); - LLStringUtil::trim(d_name); - - return d_name; -} - void inventory_offer_handler(LLOfferInfo* info) { //Until throttling is implmented, busy mode should reject inventory instead of silently @@ -1497,11 +1472,6 @@ void inventory_offer_handler(LLOfferInfo* info) LLStringUtil::truncate(msg, indx); } - if(LLAssetType::AT_LANDMARK == info->mType) - { - msg = get_display_name(msg); - } - LLSD args; args["[OBJECTNAME]"] = msg; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index b3450a8f36..c537865937 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -69,7 +69,6 @@ #include "llviewerparceloverlay.h" #include "llviewerregion.h" #include "llworld.h" -#include "lloverlaybar.h" #include "roles_constants.h" #include "llweb.h" diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8692cdcc57..cd6b9e2c50 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -101,7 +101,6 @@ #include "llfloaterbuildoptions.h" #include "llfloaterbuyland.h" #include "llfloatercamera.h" -#include "llfloaterchatterbox.h" #include "llfloatercustomize.h" #include "llfloaterland.h" #include "llfloaterinspect.h" @@ -128,7 +127,6 @@ #include "llmorphview.h" #include "llmoveview.h" #include "llnavigationbar.h" -#include "lloverlaybar.h" #include "llpreviewtexture.h" #include "llprogressview.h" #include "llresmgr.h" @@ -147,7 +145,6 @@ #include "lltexturefetch.h" #include "lltextureview.h" #include "lltool.h" -#include "lltoolbar.h" #include "lltoolcomp.h" #include "lltooldraganddrop.h" #include "lltoolface.h" @@ -1463,10 +1460,6 @@ void LLViewerWindow::initWorldUI() bottom_tray_container->addChild(bottom_tray); bottom_tray_container->setVisible(TRUE); - // Pre initialize instance communicate instance; - // currently needs to happen before initializing chat or IM - LLFloaterReg::getInstance("communicate"); - LLRect morph_view_rect = full_window; morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); morph_view_rect.mTop = full_window.mTop - 32; diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 589999c026..9d49fb69d6 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -698,7 +698,11 @@ void LLVoiceChannelProximal::handleStatusChange(EStatusType status) // do not notify user when leaving proximal channel return; case STATUS_VOICE_DISABLED: - LLCallInfoDialog::show("unavailable", mNotifyArgs); + //skip showing "Voice not available at your current location" when agent voice is disabled (EXT-4749) + if(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking()) + { + LLCallInfoDialog::show("unavailable", mNotifyArgs); + } return; default: break; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index a0d42d9b5f..560c2ab469 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -72,8 +72,6 @@ #include "llvoavatarself.h" #include "llvoicechannel.h" -#include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel - // for base64 decoding #include "apr_base64.h" diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 5636256856..d6a9837b86 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -38,7 +38,6 @@ #include "llassetstorage.h" #include "llagent.h" #include "llvoavatar.h" -#include "llviewerinventory.h" #include "llviewerstats.h" #include "llnotificationsutil.h" #include "llinventorymodel.h" diff --git a/indra/newview/skins/default/xui/en/menu_gesture_gear.xml b/indra/newview/skins/default/xui/en/menu_gesture_gear.xml index d96f3c5494..649f0edff7 100644 --- a/indra/newview/skins/default/xui/en/menu_gesture_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_gesture_gear.xml @@ -62,14 +62,4 @@ function="Gesture.EnableAction" parameter="edit_gesture" /> </menu_item_call> - <menu_item_call - label="Inspect" - layout="topleft" - name="inspect"> - <on_click - function="Gesture.Action.ShowPreview" /> - <on_enable - function="Gesture.EnableAction" - parameter="inspect" /> - </menu_item_call> </menu> diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml index 39170b90ca..072ea882e6 100644 --- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml @@ -29,7 +29,7 @@ text_color="white" top="5" width="250"> - Blocked List + Block List </text> <scroll_list follows="all" |