From 42701ad3233bfeddf42fb1163f2b83d810b27131 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 23 Aug 2012 15:14:04 -0700 Subject: CHUI-303: Problem: When pasting the item, the item's filtering flag was not updated. The filtering flag determines visibility. Resolution: Upon pasting the item to the folder from the clipboard, update the filtering flag so that visibility can properly be determined. --- indra/newview/llinventorybridge.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 215a08b34a..ac9f087d11 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3194,6 +3194,16 @@ void LLFolderBridge::pasteFromClipboard() llassert(vicat); if (vicat) { + //Set the pasted folder to dirty, could do this in changeCategoryParent() but only need to set dirty + //when pasting from the clipboard. Setting dirty allows updating the filter state, which determines + //visibility in the new pasted location. + + LLFolderViewFolder * folderViewItem = mInventoryPanel.get() ? mInventoryPanel.get()->getFolderByID(item_id) : NULL; + if(folderViewItem && folderViewItem->getViewModelItem()) + { + folderViewItem->getViewModelItem()->dirtyFilter(); + } + changeCategoryParent(model, vicat, parent_id, FALSE); } } @@ -3203,6 +3213,7 @@ void LLFolderBridge::pasteFromClipboard() llassert(viitem); if (viitem) { + //changeItemParent() implicity calls dirtyFilter changeItemParent(model, viitem, parent_id, FALSE); } } -- cgit v1.2.3 From 6e92b96e88401aaca203b627e84ce311b7f75e4a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 24 Aug 2012 13:53:17 -0700 Subject: kicking off another build (whitespace change) --- indra/newview/llinventorybridge.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ac9f087d11..91798e0f10 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3197,7 +3197,6 @@ void LLFolderBridge::pasteFromClipboard() //Set the pasted folder to dirty, could do this in changeCategoryParent() but only need to set dirty //when pasting from the clipboard. Setting dirty allows updating the filter state, which determines //visibility in the new pasted location. - LLFolderViewFolder * folderViewItem = mInventoryPanel.get() ? mInventoryPanel.get()->getFolderByID(item_id) : NULL; if(folderViewItem && folderViewItem->getViewModelItem()) { -- cgit v1.2.3 From 14708a3ace184b0654ca7923732be6e06962d583 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Wed, 22 Aug 2012 18:27:29 +0300 Subject: CHUI_310 make NearbyChat a singletone --- indra/newview/llagent.cpp | 4 +- indra/newview/llchatitemscontainerctrl.cpp | 4 +- indra/newview/llfirstuse.cpp | 2 +- indra/newview/llfloatertranslationsettings.cpp | 2 +- indra/newview/llgesturemgr.cpp | 2 +- indra/newview/llimconversation.cpp | 32 +++++++++-- indra/newview/llimfloatercontainer.cpp | 6 +-- indra/newview/llimview.cpp | 7 +-- indra/newview/llnearbychat.cpp | 41 ++++++-------- indra/newview/llnearbychat.h | 8 +-- indra/newview/llnearbychathandler.cpp | 6 +-- indra/newview/llnotificationhandlerutil.cpp | 5 +- indra/newview/llnotificationtiphandler.cpp | 3 +- indra/newview/llstartup.cpp | 1 + indra/newview/llviewerfloaterreg.cpp | 2 +- indra/newview/llviewergesture.cpp | 2 +- indra/newview/llviewerkeyboard.cpp | 2 +- indra/newview/llviewermessage.cpp | 9 ++-- indra/newview/llviewerwindow.cpp | 62 +++++++++++----------- .../skins/default/xui/da/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/de/floater_chat_bar.xml | 2 +- .../skins/default/xui/de/panel_nearby_chat_bar.xml | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 4 +- .../skins/default/xui/en/panel_bottomtray_lite.xml | 2 +- .../skins/default/xui/en/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/es/floater_chat_bar.xml | 2 +- .../skins/default/xui/es/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/fr/floater_chat_bar.xml | 2 +- .../skins/default/xui/fr/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/it/floater_chat_bar.xml | 2 +- .../skins/default/xui/it/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/ja/floater_chat_bar.xml | 2 +- .../skins/default/xui/ja/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/pl/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/pt/floater_chat_bar.xml | 2 +- .../skins/default/xui/pt/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/ru/floater_chat_bar.xml | 2 +- .../skins/default/xui/ru/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/tr/floater_chat_bar.xml | 2 +- .../skins/default/xui/tr/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/zh/panel_nearby_chat_bar.xml | 2 +- 41 files changed, 125 insertions(+), 121 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f187318c0f..be6901c36a 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1911,7 +1911,7 @@ void LLAgent::startTyping() { sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_START); } - LLNearbyChat::getInstance()->sendChatFromViewer("", CHAT_TYPE_START, FALSE); + (LLNearbyChat::instance()).sendChatFromViewer("", CHAT_TYPE_START, FALSE); } //----------------------------------------------------------------------------- @@ -1923,7 +1923,7 @@ void LLAgent::stopTyping() { clearRenderState(AGENT_STATE_TYPING); sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_STOP); - LLNearbyChat::getInstance()->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE); + (LLNearbyChat::instance()).sendChatFromViewer("", CHAT_TYPE_STOP, FALSE); } } diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 61772b4bb7..e6340e0fa3 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -323,12 +323,12 @@ BOOL LLNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask) return TRUE; else { - LLNearbyChat::getInstance()->showHistory(); + LLNearbyChat::instance().showHistory(); return FALSE; } } - LLNearbyChat::getInstance()->showHistory(); + LLNearbyChat::instance().showHistory(); return LLPanel::handleMouseUp(x,y,mask); } diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index a9f52282a5..e2850f5181 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -74,7 +74,7 @@ void LLFirstUse::resetFirstUse() // static void LLFirstUse::otherAvatarChatFirst(bool enable) { - firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "chat_bar").with("direction", "top_right").with("distance", 24)); + firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat").with("direction", "top_right").with("distance", 24)); } // static diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp index bb01ce5a7e..b5b86dadc2 100644 --- a/indra/newview/llfloatertranslationsettings.cpp +++ b/indra/newview/llfloatertranslationsettings.cpp @@ -293,6 +293,6 @@ void LLFloaterTranslationSettings::onBtnOK() gSavedSettings.setString("TranslationService", getSelectedService()); gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey()); gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey()); - LLNearbyChat::getInstance()->showTranslationCheckbox(LLTranslate::isTranslationConfigured()); + LLNearbyChat::instance().showTranslationCheckbox(LLTranslate::isTranslationConfigured()); closeFloater(false); } diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 26b63bdacb..0377337af6 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -997,7 +997,7 @@ void LLGestureMgr::runStep(LLMultiGesture* gesture, LLGestureStep* step) const BOOL animate = FALSE; - LLNearbyChat::getInstance()->sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate); + LLNearbyChat::instance().sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate); gesture->mCurrentStep++; break; diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index ee7f58b01f..2212673d3a 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -81,13 +81,35 @@ LLIMConversation::~LLIMConversation() //static LLIMConversation* LLIMConversation::findConversation(const LLUUID& uuid) { - return LLFloaterReg::findTypedInstance(uuid.isNull()? "chat_bar" : "impanel", LLSD(uuid)); + LLIMConversation* conv; + + if (uuid.isNull()) + { + conv = LLFloaterReg::findTypedInstance("nearby_chat"); + } + else + { + conv = LLFloaterReg::findTypedInstance("impanel", LLSD(uuid)); + } + + return conv; }; //static LLIMConversation* LLIMConversation::getConversation(const LLUUID& uuid) { - return LLFloaterReg::getTypedInstance(uuid.isNull()? "chat_bar" : "impanel", LLSD(uuid)); + LLIMConversation* conv; + + if (uuid.isNull()) + { + conv = LLFloaterReg::getTypedInstance("nearby_chat"); + } + else + { + conv = LLFloaterReg::getTypedInstance("impanel", LLSD(uuid)); + } + + return conv; }; @@ -336,15 +358,15 @@ void LLIMConversation::processChatHistoryStyleUpdate() } } - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if (nearby_chat) + if (LLNearbyChat::instanceExists()) { - nearby_chat->reloadMessages(); + LLNearbyChat::instance().reloadMessages(); } } void LLIMConversation::updateCallBtnState(bool callIsActive) { +llwarns<<(this->getName())<("voice_call_btn")->setImageOverlay( callIsActive? getString("call_btn_stop") : getString("call_btn_start")); enableDisableCallBtn(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 4d0bd623f8..a3f5e357c9 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -315,13 +315,13 @@ void LLIMFloaterContainer::setVisible(BOOL visible) if (visible) { // Make sure we have the Nearby Chat present when showing the conversation container - LLIMConversation* nearby_chat = LLIMConversation::findConversation(LLUUID::null); + LLIMConversation* nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); if (nearby_chat == NULL) { // If not found, force the creation of the nearby chat conversation panel // *TODO: find a way to move this to XML as a default panel or something like that - LLSD name("chat_bar"); - LLFloaterReg::toggleInstanceOrBringToFront(name, LLSD(LLUUID::null)); + LLSD name("nearby_chat"); + LLFloaterReg::toggleInstanceOrBringToFront(name); } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d88a558125..216db15c94 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2486,12 +2486,9 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess LLChat chat(message); chat.mSourceType = CHAT_SOURCE_SYSTEM; - - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - - if(nearby_chat) + if (LLNearbyChat::instanceExists()) { - nearby_chat->addMessage(chat); + LLNearbyChat::instance().addMessage(chat); } } else // going to IM session diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index e1454fb5dc..a723748094 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -123,8 +123,8 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { }; -LLNearbyChat::LLNearbyChat(const LLSD& key) -: LLIMConversation(key), +LLNearbyChat::LLNearbyChat(const LLSD& llsd) +: LLIMConversation(LLSD()), //mOutputMonitor(NULL), mSpeakerMgr(NULL), mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) @@ -133,6 +133,7 @@ LLNearbyChat::LLNearbyChat(const LLSD& key) setIsChrome(TRUE); mKey = LLSD(); mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); + setName("nearby_chat"); } //virtual @@ -379,11 +380,6 @@ void LLNearbyChat::onChatFontChange(LLFontGL* fontp) } } -//static -LLNearbyChat* LLNearbyChat::getInstance() -{ - return LLFloaterReg::getTypedInstance("chat_bar", LLSD(LLUUID::null)); -} void LLNearbyChat::show() { @@ -646,7 +642,10 @@ void LLNearbyChat::appendMessage(const LLChat& chat, const LLSD &args) chat_args["show_time"] = gSavedSettings.getBOOL("IMShowTime"); chat_args["show_names_for_p2p_conv"] = true; - mChatHistory->appendMessage(chat, chat_args); + if (mChatHistory) + { + mChatHistory->appendMessage(chat, chat_args); + } } } @@ -781,22 +780,20 @@ void LLNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType type, BO // static void LLNearbyChat::startChat(const char* line) { - LLNearbyChat* cb = LLNearbyChat::getInstance(); - - if (cb ) + if (LLNearbyChat::instanceExists()) { - cb->show(); - cb->setVisible(TRUE); - cb->setFocus(TRUE); - cb->mInputEditor->setFocus(TRUE); + (LLNearbyChat::instance()).show(); + (LLNearbyChat::instance()).setVisible(TRUE); + (LLNearbyChat::instance()).setFocus(TRUE); + (LLNearbyChat::instance().mInputEditor)->setFocus(TRUE); if (line) { std::string line_string(line); - cb->mInputEditor->setText(line_string); + (LLNearbyChat::instance().mInputEditor)->setText(line_string); } - cb->mInputEditor->endOfDoc(); + (LLNearbyChat::instance().mInputEditor)->endOfDoc(); } } @@ -804,14 +801,10 @@ void LLNearbyChat::startChat(const char* line) // static void LLNearbyChat::stopChat() { - LLNearbyChat* cb = LLNearbyChat::getInstance(); - - if (cb) + if (LLNearbyChat::instanceExists()) { - cb->mInputEditor->setFocus(FALSE); - - // stop typing animation - gAgent.stopTyping(); + (LLNearbyChat::instance().mInputEditor)->setFocus(FALSE); + gAgent.stopTyping(); } } diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 7c58e3037e..379bfbee4b 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -35,17 +35,19 @@ #include "lloutputmonitorctrl.h" #include "llspeakers.h" #include "llscrollbar.h" +#include "llsingleton.h" #include "llviewerchat.h" #include "llpanel.h" class LLResizeBar; class LLNearbyChat - : public LLIMConversation + : public LLIMConversation, + public LLSingleton { public: // constructor for inline chat-bars (e.g. hosted in chat history window) - LLNearbyChat(const LLSD& key); + LLNearbyChat(const LLSD& key = LLSD()); ~LLNearbyChat() {} /*virtual*/ BOOL postBuild(); @@ -61,8 +63,6 @@ public: void reloadMessages(); void removeScreenChat(); - static LLNearbyChat* getInstance(); - void addToHost(); void show(); bool isChatVisible() const; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index c97e3585e1..37f4cc4c19 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -487,8 +487,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, if(chat_msg.mText.empty()) return;//don't process empty messages - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - // Build notification data LLSD chat; chat["message"] = chat_msg.mText; @@ -539,7 +537,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, } } - nearby_chat->addMessage(chat_msg, true, args); + LLNearbyChat::instance().addMessage(chat_msg, true, args); if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull() @@ -555,7 +553,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // Send event on to LLEventStream sChatWatcher->post(chat); - if( nearby_chat->isInVisibleChain() + if( LLNearbyChat::instance().isInVisibleChain() || ( chat_msg.mSourceType == CHAT_SOURCE_AGENT && gSavedSettings.getBOOL("UseChatBubbles") ) || mChannel.isDead() diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index cba22b233b..db8e917435 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -181,14 +181,13 @@ void LLHandlerUtil::logGroupNoticeToIMGroup( // static void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChatSourceType type) { - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if(nearby_chat) + if (LLNearbyChat::instanceExists()) { LLChat chat_msg(notification->getMessage()); chat_msg.mSourceType = type; chat_msg.mFromName = SYSTEM_FROM; chat_msg.mFromID = LLUUID::null; - nearby_chat->addMessage(chat_msg); + LLNearbyChat::instance().addMessage(chat_msg); } } diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index a420c0d2ed..67fc9b27dc 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -85,8 +85,7 @@ bool LLTipHandler::processNotification(const LLNotificationPtr& notification) LLHandlerUtil::logToNearbyChat(notification, CHAT_SOURCE_SYSTEM); // don't show toast if Nearby Chat is opened - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if (nearby_chat->isChatVisible()) + if (LLNearbyChat::instance().isChatVisible()) { return false; } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index ab72b4e512..c827b39d0e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -64,6 +64,7 @@ #include "llmessageconfig.h" #include "llmoveview.h" #include "llimfloatercontainer.h" +#include "llnearbychat.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llteleporthistory.h" diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 50735d10bd..927ee8f380 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -192,7 +192,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("chat_bar", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("nearby_chat", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("conversation", "floater_conversation_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewergesture.cpp b/indra/newview/llviewergesture.cpp index c7d37e102e..a2dea31d9b 100644 --- a/indra/newview/llviewergesture.cpp +++ b/indra/newview/llviewergesture.cpp @@ -130,7 +130,7 @@ void LLViewerGesture::doTrigger( BOOL send_chat ) { // Don't play nodding animation, since that might not blend // with the gesture animation. - LLNearbyChat::getInstance()->sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE); + LLNearbyChat::instance().sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE); } } diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 385d3cd29a..7105720eb4 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -543,7 +543,7 @@ void start_gesture( EKeystate s ) if (KEYSTATE_UP == s && ! (focus_ctrlp && focus_ctrlp->acceptsTextInput())) { - if (LLNearbyChat::getInstance()->getCurrentChat().empty()) + if (LLNearbyChat::instance().getCurrentChat().empty()) { // No existing chat in chat editor, insert '/' LLNearbyChat::startChat("/"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b20b86a582..9abd269f0f 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2297,12 +2297,10 @@ void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::string m // Treat like a system message and put in chat history. chat.mText = av_name.getCompleteName() + ": " + message; - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if(nearby_chat) + if (LLNearbyChat::instanceExists()) { - nearby_chat->addMessage(chat); + LLNearbyChat::instance().addMessage(chat); } - } void process_improved_im(LLMessageSystem *msg, void **user_data) @@ -2897,8 +2895,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Note: lie to Nearby Chat, pretending that this is NOT an IM, because // IMs from obejcts don't open IM sessions. - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if(!chat_from_system && nearby_chat) + if(!chat_from_system && LLNearbyChat::instanceExists()) { chat.mOwnerID = from_id; LLSD args; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1bcf15913f..23d2b1633d 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -198,7 +198,6 @@ #include "llfloaternotificationsconsole.h" -#include "llnearbychat.h" #include "llwindowlistener.h" #include "llviewerwindowlistener.h" #include "llpaneltopinfobar.h" @@ -2497,43 +2496,42 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // Traverses up the hierarchy if( keyboard_focus ) { - LLNearbyChat* nearby_chat = LLFloaterReg::findTypedInstance("chat_bar"); - - if (nearby_chat) + if (LLNearbyChat::instanceExists()) { - LLChatEntry* chat_editor = nearby_chat->getChatBox(); - - // arrow keys move avatar while chatting hack - if (chat_editor && chat_editor->hasFocus()) - { - // If text field is empty, there's no point in trying to move - // cursor with arrow keys, so allow movement - if (chat_editor->getText().empty() - || gSavedSettings.getBOOL("ArrowKeysAlwaysMove")) + LLChatEntry* chat_editor = LLNearbyChat::instance().getChatBox(); + + // arrow keys move avatar while chatting hack + if (chat_editor && chat_editor->hasFocus()) { - // let Control-Up and Control-Down through for chat line history, - if (!(key == KEY_UP && mask == MASK_CONTROL) - && !(key == KEY_DOWN && mask == MASK_CONTROL)) + // If text field is empty, there's no point in trying to move + // cursor with arrow keys, so allow movement + if (chat_editor->getText().empty() + || gSavedSettings.getBOOL("ArrowKeysAlwaysMove")) { - switch(key) + // let Control-Up and Control-Down through for chat line history, + if (!(key == KEY_UP && mask == MASK_CONTROL) + && !(key == KEY_DOWN && mask == MASK_CONTROL)) { - case KEY_LEFT: - case KEY_RIGHT: - case KEY_UP: - case KEY_DOWN: - case KEY_PAGE_UP: - case KEY_PAGE_DOWN: - case KEY_HOME: - // when chatbar is empty or ArrowKeysAlwaysMove set, - // pass arrow keys on to avatar... - return FALSE; - default: - break; + switch(key) + { + case KEY_LEFT: + case KEY_RIGHT: + case KEY_UP: + case KEY_DOWN: + case KEY_PAGE_UP: + case KEY_PAGE_DOWN: + case KEY_HOME: + // when chatbar is empty or ArrowKeysAlwaysMove set, + // pass arrow keys on to avatar... + return FALSE; + default: + break; + } } } } } - } + if (keyboard_focus->handleKey(key, mask, FALSE)) { return TRUE; @@ -2564,11 +2562,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) if ( gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() && !keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) ) { - LLChatEntry* chat_editor = LLNearbyChat::getInstance()->getChatBox(); + LLChatEntry* chat_editor = LLNearbyChat::instance().getChatBox(); if (chat_editor) { // passing NULL here, character will be added later when it is handled by character handler. - LLNearbyChat::getInstance()->startChat(NULL); + LLNearbyChat::instance().startChat(NULL); return TRUE; } } diff --git a/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml index 949cbcbd7b..eb104201f8 100644 --- a/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml @@ -1,5 +1,5 @@ - +