diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index 9f0c0d1606..7f07511d9b 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -330,7 +330,7 @@ void FSFloaterIM::sendMsgFromInputEditor() } else { - llinfos << "Cannot send IM to everyone unless you're a god." << llendl; + LL_INFOS("FSFloaterIM") << "Cannot send IM to everyone unless you're a god." << LL_ENDL; } } @@ -429,80 +429,12 @@ FSFloaterIM::~FSFloaterIM() } } -// Callbacks previously in llcontrol_panel, moved to this floater. - -void FSFloaterIM::onViewProfileButtonClicked() -{ - lldebugs << "FSFloaterIM::onViewProfileButtonClicked" << llendl; - LLAvatarActions::showProfile(mOtherParticipantUUID); -} - -void FSFloaterIM::onAddFriendButtonClicked() -{ - lldebugs << "FSFloaterIM::onAddFriendButtonClicked" << llendl; - //[FIX FIRE-2009: SJ] Offering friendship gives wrong status message. full_name was emtpy on call but was also obsolete - // - //LLAvatarIconCtrl* avatar_icon = getChild("avatar_icon"); - //std::string full_name = avatar_icon->getFullName(); - //LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID, full_name); - LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID); -} - -void FSFloaterIM::onShareButtonClicked() -{ - lldebugs << "FSFloaterIM::onShareButtonClicked" << llendl; - LLAvatarActions::share(mOtherParticipantUUID); -} - -void FSFloaterIM::onPayButtonClicked() -{ - lldebugs << "FSFloaterIM::onPayButtonClicked" << llendl; - LLAvatarActions::pay(mOtherParticipantUUID); -} - -void FSFloaterIM::onGroupInfoButtonClicked() -{ - lldebugs << "FSFloaterIM::onGroupInfoButtonClicked" << llendl; - LLGroupActions::show(mSessionID); -} - -void FSFloaterIM::onCallButtonClicked() -{ - lldebugs << "FSFloaterIM::onCallButtonClicked" << llendl; - gIMMgr->startCall(mSessionID); -} - -void FSFloaterIM::onEndCallButtonClicked() -{ - lldebugs << "FSFloaterIM::onEndCallButtonClicked" << llendl; - gIMMgr->endCall(mSessionID); -} - -void FSFloaterIM::onOpenVoiceControlsClicked() -{ - lldebugs << "FSFloaterIM::onOpenVoiceControlsClicked" << llendl; - LLFloaterReg::showInstance("fs_voice_controls"); -} - void FSFloaterIM::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { - lldebugs << "FSFloaterIM::onVoiceChannelStateChanged" << llendl; + LL_DEBUGS("FSFloaterIM") << "FSFloaterIM::onVoiceChannelStateChanged" << LL_ENDL; updateButtons(new_state >= LLVoiceChannel::STATE_CALL_STARTED); } -void FSFloaterIM::onHistoryButtonClicked() -{ - lldebugs << "FSFloaterIM::onHistoryButtonClicked" << llendl; - if (gSavedSettings.getBOOL("FSUseBuiltInHistory")) - { - LLFloaterReg::showInstance("preview_conversation", mSessionID, true); - } - else - { - gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(LLIMModel::instance().getHistoryFileName(mSessionID))); - } -} - void FSFloaterIM::doToSelected(const LLSD& userdata) { const std::string command = userdata.asString(); @@ -510,8 +442,35 @@ void FSFloaterIM::doToSelected(const LLSD& userdata) LLAvatarActions::offerTeleport(mOtherParticipantUUID); else if (command == "request_tp") LLAvatarActions::teleportRequest(mOtherParticipantUUID); + else if (command == "share") + LLAvatarActions::share(mOtherParticipantUUID); + else if (command == "pay") + LLAvatarActions::pay(mOtherParticipantUUID); + else if (command == "show_profile") + LLAvatarActions::showProfile(mOtherParticipantUUID); + else if (command == "group_info") + LLGroupActions::show(mSessionID); + else if (command == "call") + gIMMgr->startCall(mSessionID); + else if (command == "end_call") + gIMMgr->endCall(mSessionID); + else if (command == "volume") + LLFloaterReg::showInstance("fs_voice_controls"); + else if (command == "add_friend") + LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID); + else if (command == "history") + { + if (gSavedSettings.getBOOL("FSUseBuiltInHistory")) + { + LLFloaterReg::showInstance("preview_conversation", mSessionID, true); + } + else + { + gViewerWindow->getWindow()->openFile(LLLogChat::makeLogFileName(LLIMModel::instance().getHistoryFileName(mSessionID))); + } + } else - LL_WARNS("IMFloater") << "Unhandled command '" << command << "'. Ignoring." << LL_ENDL; + LL_WARNS("FSFloaterIM") << "Unhandled command '" << command << "'. Ignoring." << LL_ENDL; } // support sysinfo button -Zi @@ -557,7 +516,6 @@ void FSFloaterIM::onSysinfoButtonVisibilityChanged(const LLSD& yes) void FSFloaterIM::onChange(EStatusType status, const std::string &channelURI, bool proximal) { - // llinfos << "FSFloaterIM::onChange" << llendl; if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL) { return; @@ -568,7 +526,6 @@ void FSFloaterIM::onChange(EStatusType status, const std::string &channelURI, bo void FSFloaterIM::updateCallButton() { - // llinfos << "FSFloaterIM::updateCallButton" << llendl; // hide/show call button bool voice_enabled = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); @@ -588,25 +545,13 @@ void FSFloaterIM::updateCallButton() //&& callback_enabled; BOOL enable_connect = voice_enabled && callback_enabled; - //if (voice_enabled) - //{ - // llinfos << "FSFloaterIM::updateCallButton - voice enabled" << llendl; - //} - //if (session_initialized) - //{ - // llinfos << "FSFloaterIM::updateCallButton - session_initialized" << llendl; - //} - //if (callback_enabled) - //{ - // llinfos << "FSFloaterIM::updateCallButton - callback_enabled" << llendl; - //} getChild("call_btn")->setEnabled(enable_connect); } void FSFloaterIM::updateButtons(bool is_call_started) { - llinfos << "FSFloaterIM::updateButtons" << llendl; + LL_DEBUGS("FSFloaterIM") << "FSFloaterIM::updateButtons" << LL_ENDL; getChild("ls_control_panel")->reshape(240,20,true); getChildView("end_call_btn_panel")->setVisible( is_call_started); getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started); @@ -614,7 +559,7 @@ void FSFloaterIM::updateButtons(bool is_call_started) updateCallButton(); // AO: force resize the widget because llpanels don't resize properly on vis change. - llinfos << "force resize the widget" << llendl; + LL_DEBUGS("FSFloaterIM") << "force resize the widget" << LL_ENDL; LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(mSessionID); switch (pIMSession->mSessionType) { @@ -641,7 +586,7 @@ void FSFloaterIM::updateButtons(bool is_call_started) void FSFloaterIM::changed(U32 mask) { - llinfos << "FSFloaterIM::changed(U32 mask)" << llendl; + LL_DEBUGS("FSFloaterIM") << "FSFloaterIM::changed(U32 mask)" << LL_ENDL; getChild("call_btn")->setEnabled(!LLAvatarActions::isFriend(mOtherParticipantUUID)); // Disable "Teleport" button if friend is offline @@ -665,12 +610,10 @@ BOOL FSFloaterIM::postBuild() mControlPanel->setSessionId(mSessionID); // AO: always hide the control panel to start. - llinfos << "mControlPanel->getParent()" << mControlPanel->getParent() << llendl; - mControlPanel->getParent()->setVisible(false); - - //mControlPanel->getParent()->setVisible(gSavedSettings.getBOOL("IMShowControlPanel")); + LL_DEBUGS("FSFloaterIM") << "mControlPanel->getParent()" << mControlPanel->getParent() << LL_ENDL; + mControlPanel->getParent()->setVisible(false); - llinfos << "buttons setup in IM start" << llendl; + LL_DEBUGS("FSFloaterIM") << "buttons setup in IM start" << LL_ENDL; LLButton* button = getChild("slide_left_btn"); button->setVisible(mControlPanel->getParent()->getVisible()); @@ -679,33 +622,6 @@ BOOL FSFloaterIM::postBuild() button = getChild("slide_right_btn"); button->setVisible(!mControlPanel->getParent()->getVisible()); button->setClickedCallback(boost::bind(&FSFloaterIM::onSlide, this)); - - button = getChild("view_profile_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onViewProfileButtonClicked, this)); - - button = getChild("group_info_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onGroupInfoButtonClicked, this)); - - button = getChild("call_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onCallButtonClicked, this)); - - button = getChild("end_call_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onEndCallButtonClicked, this)); - - button = getChild("voice_ctrls_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onOpenVoiceControlsClicked, this)); - - button = getChild("share_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onShareButtonClicked, this)); - - button = getChild("pay_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onPayButtonClicked, this)); - - button = getChild("add_friend_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onAddFriendButtonClicked, this)); - - button = getChild("im_history_btn"); - button->setClickedCallback(boost::bind(&FSFloaterIM::onHistoryButtonClicked, this)); // support sysinfo button -Zi mSysinfoButton=getChild("send_sysinfo_btn"); @@ -719,25 +635,25 @@ BOOL FSFloaterIM::postBuild() { case LLIMModel::LLIMSession::P2P_SESSION: // One-on-one IM { - llinfos << "LLIMModel::LLIMSession::P2P_SESSION" << llendl; + LL_DEBUGS("FSFloaterIM") << "LLIMModel::LLIMSession::P2P_SESSION" << LL_ENDL; getChild("slide_panel")->setVisible(false); getChild("gprofile_panel")->setVisible(false); getChild("end_call_btn_panel")->setVisible(false); getChild("voice_ctrls_btn_panel")->setVisible(false); getChild("ls_control_panel")->reshape(200,20,true); - llinfos << "adding FSFloaterIM removing/adding particularfriendobserver" << llendl; + LL_DEBUGS("FSFloaterIM") << "adding FSFloaterIM removing/adding particularfriendobserver" << LL_ENDL; LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this); LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this); // Disable "Add friend" button for friends. - llinfos << "add_friend_btn check start" << llendl; + LL_DEBUGS("FSFloaterIM") << "add_friend_btn check start" << LL_ENDL; getChild("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mOtherParticipantUUID)); // Disable "Teleport" button if friend is offline if(LLAvatarActions::isFriend(mOtherParticipantUUID)) { - llinfos << "LLAvatarActions::isFriend - tp button" << llendl; + LL_DEBUGS("FSFloaterIM") << "LLAvatarActions::isFriend - tp button" << LL_ENDL; getChild("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mOtherParticipantUUID)); } @@ -753,7 +669,7 @@ BOOL FSFloaterIM::postBuild() } case LLIMModel::LLIMSession::GROUP_SESSION: // Group chat { - llinfos << "LLIMModel::LLIMSession::GROUP_SESSION start" << llendl; + LL_DEBUGS("FSFloaterIM") << "LLIMModel::LLIMSession::GROUP_SESSION start" << LL_ENDL; getChild("profile_panel")->setVisible(false); getChild("friend_panel")->setVisible(false); getChild("tp_panel")->setVisible(false); @@ -763,12 +679,12 @@ BOOL FSFloaterIM::postBuild() getChild("voice_ctrls_btn_panel")->setVisible(false); getChild("ls_control_panel")->reshape(140,20,true); - llinfos << "LLIMModel::LLIMSession::GROUP_SESSION end" << llendl; + LL_DEBUGS("FSFloaterIM") << "LLIMModel::LLIMSession::GROUP_SESSION end" << LL_ENDL; break; } case LLIMModel::LLIMSession::ADHOC_SESSION: // Conference chat { - llinfos << "LLIMModel::LLIMSession::ADHOC_SESSION start" << llendl; + LL_DEBUGS("FSFloaterIM") << "LLIMModel::LLIMSession::ADHOC_SESSION start" << LL_ENDL; getChild("profile_panel")->setVisible(false); getChild("gprofile_panel")->setVisible(false); getChild("friend_panel")->setVisible(false); @@ -778,26 +694,26 @@ BOOL FSFloaterIM::postBuild() getChild("end_call_btn_panel")->setVisible(false); getChild("voice_ctrls_btn_panel")->setVisible(false); getChild("ls_control_panel")->reshape(120,20,true); - llinfos << "LLIMModel::LLIMSession::ADHOC_SESSION end" << llendl; + LL_DEBUGS("FSFloaterIM") << "LLIMModel::LLIMSession::ADHOC_SESSION end" << LL_ENDL; break; } default: - llinfos << "default buttons start" << llendl; + LL_DEBUGS("FSFloaterIM") << "default buttons start" << LL_ENDL; getChild("end_call_btn_panel")->setVisible(false); getChild("voice_ctrls_btn_panel")->setVisible(false); - llinfos << "default buttons end" << llendl; + LL_DEBUGS("FSFloaterIM") << "default buttons end" << LL_ENDL; break; } } LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); if(voice_channel) { - llinfos << "voice_channel start" << llendl; + LL_DEBUGS("FSFloaterIM") << "voice_channel start" << LL_ENDL; mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&FSFloaterIM::onVoiceChannelStateChanged, this, _1, _2)); //call (either p2p, group or ad-hoc) can be already in started state updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); - llinfos << "voice_channel end" << llendl; + LL_DEBUGS("FSFloaterIM") << "voice_channel end" << LL_ENDL; } LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); @@ -951,7 +867,7 @@ void FSFloaterIM::onAvatarNameCache(const LLUUID& agent_id, updateSessionName(name, name); mTypingStart.setArg("[NAME]", name); - llinfos << "Setting IM tab name to '" << name << "'" << llendl; + LL_DEBUGS("FSFloaterIM") << "Setting IM tab name to '" << name << "'" << LL_ENDL; // } @@ -1673,8 +1589,8 @@ public: void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) { - llwarns << "Error inviting all agents to session [status:" - << statusNum << "]: " << content << llendl; + LL_WARNS("FSFloaterIM") << "Error inviting all agents to session [status:" + << statusNum << "]: " << content << LL_ENDL; //TODO: throw something back to the viewer here? } @@ -1693,7 +1609,7 @@ BOOL FSFloaterIM::inviteToSession(const uuid_vec_t& ids) if( isInviteAllowed() && (count > 0) ) { - llinfos << "FSFloaterIM::inviteToSession() - inviting participants" << llendl; + LL_DEBUGS("FSFloaterIM") << "FSFloaterIM::inviteToSession() - inviting participants" << LL_ENDL; std::string url = region->getCapability("ChatSessionRequest"); @@ -1709,9 +1625,9 @@ BOOL FSFloaterIM::inviteToSession(const uuid_vec_t& ids) } else { - llinfos << "LLFloaterIMSession::inviteToSession -" - << " no need to invite agents for " - << mDialog << llendl; + LL_DEBUGS("FSFloaterIM") << "LLFloaterIMSession::inviteToSession -" + << " no need to invite agents for " + << mDialog << LL_ENDL; // successful add, because everyone that needed to get added // was added. } @@ -1854,7 +1770,7 @@ void FSFloaterIM::onClickCloseBtn(bool app_quitting) if (session == NULL) { - llwarns << "Empty session." << llendl; + LL_WARNS("FSFloaterIM") << "Empty session." << LL_ENDL; return; } diff --git a/indra/newview/fsfloaterim.h b/indra/newview/fsfloaterim.h index 8e58960f6a..20f9ca00ad 100644 --- a/indra/newview/fsfloaterim.h +++ b/indra/newview/fsfloaterim.h @@ -95,9 +95,6 @@ public: static void newIMCallback(const LLSD& data); //AO: Callbacks for voice handling formerly in llPanelImControlPanel - void onCallButtonClicked(); - void onEndCallButtonClicked(); - void onOpenVoiceControlsClicked(); void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); void onChange(EStatusType status, const std::string &channelURI, bool proximal); void updateButtons(bool is_call_started); @@ -181,14 +178,7 @@ private: static void onInputEditorFocusReceived( LLFocusableElement* caller, void* userdata ); static void onInputEditorFocusLost(LLFocusableElement* caller, void* userdata); static void onInputEditorKeystroke(LLTextEditor* caller, void* userdata); - - // AO, originally from llpaneChatControlPanel trees - void onViewProfileButtonClicked(); - void onAddFriendButtonClicked(); - void onShareButtonClicked(); - void onPayButtonClicked(); - void onGroupInfoButtonClicked(); - void onHistoryButtonClicked(); + void doToSelected(const LLSD& userdata); // support sysinfo button -Zi diff --git a/indra/newview/skins/default/xui/en/floater_fs_im_session.xml b/indra/newview/skins/default/xui/en/floater_fs_im_session.xml index a47a8d207f..76ca07a8b0 100644 --- a/indra/newview/skins/default/xui/en/floater_fs_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_fs_im_session.xml @@ -42,23 +42,23 @@ height="24" width="40" follows="left|top"> + - +