summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-10-15 13:58:21 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-10-15 13:58:21 -0700
commit5a5df259ffc23a6289d25deac906047a7356fb42 (patch)
tree37534a7be9108e0865d17f85cb677120f26b771b
parentd7d0416547958792517a9b739b370e51c717fb23 (diff)
CHUI-380: Final commit for this issue. After code review changed some method names to be more accurate. Also using dynamic_cast instead of static_cast for safety.
-rw-r--r--indra/llkdu/llimagej2ckdu.cpp4
-rw-r--r--indra/newview/llchiclet.h2
-rw-r--r--indra/newview/llchicletbar.h2
-rw-r--r--indra/newview/llconversationlog.h2
-rw-r--r--indra/newview/llimfloatercontainer.cpp24
-rw-r--r--indra/newview/llimfloatercontainer.h4
-rw-r--r--indra/newview/llimview.cpp8
-rw-r--r--indra/newview/llimview.h5
-rw-r--r--indra/newview/llsyswellwindow.h2
9 files changed, 32 insertions, 21 deletions
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp
index db75b6e003..cf88de12b4 100644
--- a/indra/llkdu/llimagej2ckdu.cpp
+++ b/indra/llkdu/llimagej2ckdu.cpp
@@ -166,12 +166,12 @@ void LLKDUMessageWarning::put_text(const kdu_uint16 *s)
void LLKDUMessageError::put_text(const char *s)
{
- //llinfos << "KDU Error: " << s << llendl;
+ llinfos << "KDU Error: " << s << llendl;
}
void LLKDUMessageError::put_text(const kdu_uint16 *s)
{
- //llinfos << "KDU Error: " << s << llendl;
+ llinfos << "KDU Error: " << s << llendl;
}
void LLKDUMessageError::flush(bool end_of_message)
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 3a52b0a67b..6395f5b694 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -874,7 +874,7 @@ class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver
friend class LLUICtrlFactory;
public:
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
- /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
+ /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};
/*virtual*/ void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); }
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {}
diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h
index 0589a9fccc..a9a5b61ae7 100644
--- a/indra/newview/llchicletbar.h
+++ b/indra/newview/llchicletbar.h
@@ -51,7 +51,7 @@ public:
// LLIMSessionObserver observe triggers
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
- /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {};
+ /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {};
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};
/*virtual*/ void sessionRemoved(const LLUUID& session_id);
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h
index 70f04b21c8..b92cf0f5e2 100644
--- a/indra/newview/llconversationlog.h
+++ b/indra/newview/llconversationlog.h
@@ -124,7 +124,7 @@ public:
// LLIMSessionObserver triggers
virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
- virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub
+ virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub
virtual void sessionRemoved(const LLUUID& session_id){} // Stub
virtual void sessionVoiceOrIMStarted(const LLUUID& session_id){}; // Stub
virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){}; // Stub
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 0250854f36..c8897c1f92 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -101,9 +101,9 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str
addConversationListItem(session_id);
}
-void LLIMFloaterContainer::sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
+void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
{
- doSomething(session_id);
+ setItemSelect(session_id);
}
void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
@@ -1064,6 +1064,7 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata)
return false;
}
+//Will select only the conversation item
void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)
{
LLFolderViewItem* widget = mConversationsWidgets[session_id];
@@ -1074,15 +1075,22 @@ void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)
}
}
-void LLIMFloaterContainer::doSomething(const LLUUID& session_id)
+//Will select the conversation/participant item
+void LLIMFloaterContainer::setItemSelect(const LLUUID& session_id)
{
- LLConversationItem* vmi = static_cast<LLConversationItem*>(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem());
- if(session_id != vmi->getUUID())
+ if(mConversationsRoot->getCurSelectedItem() && mConversationsRoot->getCurSelectedItem()->getParentFolder())
{
- mSelectedSession = session_id;
- LLFolderViewItem* widget = mConversationsWidgets[session_id];
- (widget->getRoot())->setSelection(widget, FALSE, FALSE);
+ //Retreive the conversation id. When a participant is selected, then have to to get the converation id from the parent.
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem());
+
+ //Will allow selection/highlighting of the conversation/participant
+ if(session_id != vmi->getUUID())
+ {
+ mSelectedSession = session_id;
+ LLFolderViewItem* widget = mConversationsWidgets[session_id];
+ (widget->getRoot())->setSelection(widget, FALSE, FALSE);
+ }
}
}
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index da134c498f..c9da213f8c 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -64,7 +64,7 @@ public:
BOOL select_added_floater,
LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
void setConvItemSelect(const LLUUID& session_id);
- void doSomething(const LLUUID& session_id);
+ void setItemSelect(const LLUUID& session_id);
/*virtual*/ void tabClose();
static LLFloater* getCurrentVoiceFloater();
@@ -82,7 +82,7 @@ public:
// LLIMSessionObserver observe triggers
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
- /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
+ /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id);
/*virtual*/ void sessionRemoved(const LLUUID& session_id);
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index e75db1b7af..eea59c223a 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2650,14 +2650,16 @@ LLUUID LLIMMgr::addSession(
}
}
+ //Notify observers that a session was added
if (new_session)
{
LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids, voice);
}
+ //Notifies observers that the session was already added
else
{
std::string session_name = LLIMModel::getInstance()->getName(session_id);
- LLIMMgr::getInstance()->notifyObserverSessionAlreadyAdded(session_id, session_name, other_participant_id);
+ LLIMMgr::getInstance()->notifyObserverSessionActivated(session_id, session_name, other_participant_id);
}
//we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions
@@ -2961,11 +2963,11 @@ void LLIMMgr::notifyObserverSessionAdded(const LLUUID& session_id, const std::st
}
}
-void LLIMMgr::notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
+void LLIMMgr::notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
{
for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++)
{
- (*it)->sessionAlreadyAdded(session_id, name, other_participant_id);
+ (*it)->sessionActivated(session_id, name, other_participant_id);
}
}
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index a34359eb00..00b67f520c 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -303,7 +303,7 @@ class LLIMSessionObserver
public:
virtual ~LLIMSessionObserver() {}
virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0;
- virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0;
+ virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0;
virtual void sessionVoiceOrIMStarted(const LLUUID& session_id) = 0;
virtual void sessionRemoved(const LLUUID& session_id) = 0;
virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) = 0;
@@ -470,7 +470,8 @@ private:
static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group);
void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
- void notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
+ //Triggers when a session has already been added
+ void notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
void notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id);
void notifyObserverSessionRemoved(const LLUUID& session_id);
void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h
index 302007c9aa..378d5e0aa2 100644
--- a/indra/newview/llsyswellwindow.h
+++ b/indra/newview/llsyswellwindow.h
@@ -171,7 +171,7 @@ public:
// LLIMSessionObserver observe triggers
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
- /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
+ /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};
/*virtual*/ void sessionRemoved(const LLUUID& session_id);
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);