//TT CrashLoggingPatch

--HG--
branch : Firestorm_2.4.1
master
Tozh 2011-01-24 21:31:49 -05:00
parent 7f4649b58e
commit 9165e49bbc
1 changed files with 34 additions and 0 deletions

View File

@ -291,6 +291,7 @@ void LLIMFloater::sendMsg()
LLIMFloater::~LLIMFloater()
{
llinfos << "~LLIMFLoater, instance exists is: " << ((LLTransientFloaterMgr::getInstance()) == NULL) << llendl;
LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::IM, (LLView*)this);
mVoiceChannelStateChangeConnection.disconnect();
if(LLVoiceClient::instanceExists())
@ -303,49 +304,60 @@ LLIMFloater::~LLIMFloater()
void LLIMFloater::onViewProfileButtonClicked()
{
llinfos << "LLIMFloater::onViewProfileButtonClicked" << llendl;
LLAvatarActions::showProfile(mOtherParticipantUUID);
}
void LLIMFloater::onAddFriendButtonClicked()
{
llinfos << "LLIMFloater::onAddFriendButtonClicked" << llendl;
LLAvatarIconCtrl* avatar_icon = getChild<LLAvatarIconCtrl>("avatar_icon");
std::string full_name = avatar_icon->getFullName();
LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID, full_name);
}
void LLIMFloater::onShareButtonClicked()
{
llinfos << "LLIMFloater::onShareButtonClicked" << llendl;
LLAvatarActions::share(mOtherParticipantUUID);
}
void LLIMFloater::onTeleportButtonClicked()
{
llinfos << "LLIMFloater::onTeleportButtonClicked" << llendl;
LLAvatarActions::offerTeleport(mOtherParticipantUUID);
}
void LLIMFloater::onPayButtonClicked()
{
llinfos << "LLIMFloater::onPayButtonClicked" << llendl;
LLAvatarActions::pay(mOtherParticipantUUID);
}
void LLIMFloater::onGroupInfoButtonClicked()
{
llinfos << "LLIMFloater::onGroupInfoButtonClicked" << llendl;
LLGroupActions::show(mSessionID);
}
void LLIMFloater::onCallButtonClicked()
{
llinfos << "LLIMFloater::onCallButtonClicked" << llendl;
gIMMgr->startCall(mSessionID);
}
void LLIMFloater::onEndCallButtonClicked()
{
llinfos << "LLIMFloater::onEndCallButtonClicked" << llendl;
gIMMgr->endCall(mSessionID);
}
void LLIMFloater::onOpenVoiceControlsClicked()
{
llinfos << "LLIMFloater::onOpenVoiceControlsClicked" << llendl;
LLFloaterReg::showInstance("voice_controls");
}
void LLIMFloater::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state)
{
llinfos << "LLIMFloater::onVoiceChannelStateChanged" << llendl;
updateButtons(new_state >= LLVoiceChannel::STATE_CALL_STARTED);
}
void LLIMFloater::onChange(EStatusType status, const std::string &channelURI, bool proximal)
{
llinfos << "LLIMFloater::onChange" << llendl;
if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL)
{
return;
@ -356,6 +368,7 @@ void LLIMFloater::onChange(EStatusType status, const std::string &channelURI, bo
void LLIMFloater::updateCallButton()
{
llinfos << "LLIMFloater::updateCallButton" << llendl;
// hide/show call button
bool voice_enabled = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking();
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID);
@ -377,6 +390,7 @@ void LLIMFloater::updateCallButton()
void LLIMFloater::updateButtons(bool is_call_started)
{
llinfos << "LLIMFloater::updateButtons" << llendl;
getChild<LLLayoutStack>("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);
@ -384,6 +398,7 @@ void LLIMFloater::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;
LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(mSessionID);
switch (pIMSession->mSessionType)
{
@ -410,6 +425,7 @@ void LLIMFloater::updateButtons(bool is_call_started)
void LLIMFloater::changed(U32 mask)
{
llinfos << "LLIMFloater::changed(U32 mask)" << llendl;
getChild<LLButton>("call_btn")->setEnabled(!LLAvatarActions::isFriend(mOtherParticipantUUID));
// Disable "Teleport" button if friend is offline
@ -439,10 +455,13 @@ BOOL LLIMFloater::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"));
llinfos << "buttons setup in IM start" << llendl;
LLButton* slide_left = getChild<LLButton>("slide_left_btn");
slide_left->setVisible(mControlPanel->getParent()->getVisible());
slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this));
@ -480,6 +499,9 @@ BOOL LLIMFloater::postBuild()
// extra icon controls -AO
LLButton* transl = getChild<LLButton>("translate_btn");
//TT
llinfos << "transl" << (transl == NULL) << llendl;
if (transl != NULL)
transl->setVisible(true);
// type-specfic controls
@ -490,6 +512,7 @@ BOOL LLIMFloater::postBuild()
{
case LLIMModel::LLIMSession::P2P_SESSION: // One-on-one IM
{
llinfos << "LLIMModel::LLIMSession::P2P_SESSION" << llendl;
getChild<LLLayoutPanel>("slide_panel")->setVisible(false);
getChild<LLLayoutPanel>("gprofile_panel")->setVisible(false);
getChild<LLLayoutPanel>("end_call_btn_panel")->setVisible(false);
@ -500,17 +523,20 @@ BOOL LLIMFloater::postBuild()
LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this);
LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this);
// Disable "Add friend" button for friends.
llinfos << "add_friend_btn check start" << llendl;
getChild<LLButton>("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mOtherParticipantUUID));
// Disable "Teleport" button if friend is offline
if(LLAvatarActions::isFriend(mOtherParticipantUUID))
{
llinfos << "LLAvatarActions::isFriend - tp button" << llendl;
getChild<LLButton>("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mOtherParticipantUUID));
}
break;
}
case LLIMModel::LLIMSession::GROUP_SESSION: // Group chat
{
llinfos << "LLIMModel::LLIMSession::GROUP_SESSION start" << llendl;
getChild<LLLayoutPanel>("profile_panel")->setVisible(false);
getChild<LLLayoutPanel>("friend_panel")->setVisible(false);
getChild<LLLayoutPanel>("tp_panel")->setVisible(false);
@ -519,10 +545,13 @@ BOOL LLIMFloater::postBuild()
getChild<LLLayoutPanel>("end_call_btn_panel")->setVisible(false);
getChild<LLLayoutPanel>("voice_ctrls_btn_panel")->setVisible(false);
getChild<LLLayoutStack>("ls_control_panel")->reshape(120,20,true);
llinfos << "LLIMModel::LLIMSession::GROUP_SESSION end" << llendl;
break;
}
case LLIMModel::LLIMSession::ADHOC_SESSION: // Conference chat
{
llinfos << "LLIMModel::LLIMSession::ADHOC_SESSION start" << llendl;
getChild<LLLayoutPanel>("profile_panel")->setVisible(false);
getChild<LLLayoutPanel>("gprofile_panel")->setVisible(false);
getChild<LLLayoutPanel>("friend_panel")->setVisible(false);
@ -532,21 +561,26 @@ BOOL LLIMFloater::postBuild()
getChild<LLLayoutPanel>("end_call_btn_panel")->setVisible(false);
getChild<LLLayoutPanel>("voice_ctrls_btn_panel")->setVisible(false);
getChild<LLLayoutStack>("ls_control_panel")->reshape(100,20,true);
llinfos << "LLIMModel::LLIMSession::ADHOC_SESSION end" << llendl;
break;
}
default:
llinfos << "default buttons start" << llendl;
getChild<LLLayoutPanel>("end_call_btn_panel")->setVisible(false);
getChild<LLLayoutPanel>("voice_ctrls_btn_panel")->setVisible(false);
llinfos << "default buttons end" << llendl;
break;
}
}
LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID);
if(voice_channel)
{
llinfos << "voice_channel start" << llendl;
mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLIMFloater::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;
}
LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this);