From faafa7405f2fe70996c1554605b55679c28fd10b Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 13 Aug 2009 04:40:19 +0000 Subject: merge -r 130196-130356 skinning-20 -> viewer-2.0.0-3 * EXT-449 EXT-131 EXT-464 * People and Places panel layout changes * Some I18N fixes, test language * Updated group panels following proposed new design * made ims easier to read by color coding --- indra/llui/llfocusmgr.cpp | 71 +++--- indra/newview/llimpanel.cpp | 64 +++++- indra/newview/llimpanel.h | 7 +- indra/newview/llpanelimcontrolpanel.cpp | 33 ++- indra/newview/llpanelimcontrolpanel.h | 36 ++- .../skins/default/xui/da/floater_world_map.xml | 2 +- .../skins/default/xui/de/floater_world_map.xml | 2 +- .../newview/skins/default/xui/de/notifications.xml | 6 +- .../skins/default/xui/en/floater_env_settings.xml | 9 - .../skins/default/xui/en/floater_im_session.xml | 2 - indra/newview/skins/default/xui/en/menu_viewer.xml | 145 +++++++------ .../newview/skins/default/xui/en/notifications.xml | 11 +- .../skins/default/xui/en/panel_bottomtray.xml | 2 +- .../default/xui/en/panel_group_control_panel.xml | 31 +++ .../skins/default/xui/en/panel_group_general.xml | 241 ++++++++------------- .../skins/default/xui/en/panel_group_notices.xml | 24 +- indra/newview/skins/default/xui/en/panel_notes.xml | 160 +++++++------- .../skins/default/xui/en/panel_pick_info.xml | 105 ++++----- .../skins/default/xui/en/panel_pick_list_item.xml | 44 ++-- indra/newview/skins/default/xui/en/panel_picks.xml | 77 ++----- .../newview/skins/default/xui/en/panel_places.xml | 45 ++-- .../skins/default/xui/en/panel_profile_view.xml | 61 +++--- .../default/xui/en/panel_side_tray_tab_caption.xml | 32 +-- .../skins/default/xui/fr/floater_world_map.xml | 2 +- .../newview/skins/default/xui/fr/notifications.xml | 6 +- .../skins/default/xui/it/floater_world_map.xml | 2 +- .../newview/skins/default/xui/it/notifications.xml | 140 ++++++------ .../skins/default/xui/ja/floater_world_map.xml | 2 +- .../newview/skins/default/xui/ja/notifications.xml | 12 +- .../skins/default/xui/nl/floater_world_map.xml | 2 +- .../newview/skins/default/xui/nl/notifications.xml | 34 +-- .../skins/default/xui/pl/floater_world_map.xml | 2 +- .../newview/skins/default/xui/pl/notifications.xml | 6 +- .../skins/default/xui/pt/floater_world_map.xml | 2 +- .../newview/skins/default/xui/pt/notifications.xml | 22 +- 35 files changed, 720 insertions(+), 722 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_group_control_panel.xml diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 3899897c5f..b8142216fc 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -88,6 +88,12 @@ void LLFocusMgr::releaseFocusIfNeeded( const LLView* view ) void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock, BOOL keystrokes_only) { + // notes if keyboard focus is changed again (by onFocusLost/onFocusReceived) + // making the rest of our processing unnecessary since it will already be + // handled by the recursive call + static bool focus_dirty; + focus_dirty = false; + if (mLockedView && (new_focus == NULL || (new_focus != mLockedView && !new_focus->hasAncestor(mLockedView)))) @@ -104,6 +110,8 @@ void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock, BOOL keystroke mLastKeyboardFocus = mKeyboardFocus; mKeyboardFocus = new_focus; + // list of the focus and it's ancestors + view_handle_list_t old_focus_list = mCachedKeyboardFocusList; view_handle_list_t new_focus_list; // walk up the tree to root and add all views to the new_focus_list @@ -111,42 +119,53 @@ void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock, BOOL keystroke { if (ctrl) { - new_focus_list.push_front(ctrl->getHandle()); + new_focus_list.push_back(ctrl->getHandle()); } } - view_handle_list_t::iterator new_focus_iter = new_focus_list.begin(); - view_handle_list_t::iterator old_focus_iter = mCachedKeyboardFocusList.begin(); - - // compare the new focus sub-tree to the old focus sub-tree - // iterate through the lists in lockstep until we get to a non-common ancestor - while ((new_focus_iter != new_focus_list.end()) && - (old_focus_iter != mCachedKeyboardFocusList.end()) && - ((*new_focus_iter) == (*old_focus_iter))) + // remove all common ancestors since their focus is unchanged + while (!new_focus_list.empty() && + !old_focus_list.empty() && + new_focus_list.back() == old_focus_list.back()) { - new_focus_iter++; - old_focus_iter++; + new_focus_list.pop_back(); + old_focus_list.pop_back(); } - - // call onFocusLost on all remaining in the old focus list - while (old_focus_iter != mCachedKeyboardFocusList.end()) - { - if (old_focus_iter->get() != NULL) { - old_focus_iter->get()->onFocusLost(); + + // walk up the old focus branch calling onFocusLost + // we bubble up the tree to release focus, and back down to add + for (view_handle_list_t::iterator old_focus_iter = old_focus_list.begin(); + old_focus_iter != old_focus_list.end() && !focus_dirty; + old_focus_iter++) + { + LLView* old_focus_view = old_focus_iter->get(); + if (old_focus_view) + { + mCachedKeyboardFocusList.pop_front(); + old_focus_view->onFocusLost(); } - old_focus_iter++; } - // call onFocusReceived on all remaining in the new focus list - while (new_focus_iter != new_focus_list.end()) + // walk down the new focus branch calling onFocusReceived + for (view_handle_list_t::reverse_iterator new_focus_riter = new_focus_list.rbegin(); + new_focus_riter != new_focus_list.rend() && !focus_dirty; + new_focus_riter++) + { + LLView* new_focus_view = new_focus_riter->get(); + if (new_focus_view) + { + mCachedKeyboardFocusList.push_front(new_focus_view->getHandle()); + new_focus_view->onFocusReceived(); + } + } + + // if focus was changed as part of an onFocusLost or onFocusReceived call + // stop iterating on current list since it is now invalid + if (focus_dirty) { - new_focus_iter->get()->onFocusReceived(); - new_focus_iter++; + return; } - // cache the new focus list for next time - swap(mCachedKeyboardFocusList, new_focus_list); - #ifdef _DEBUG mKeyboardFocusName = new_focus ? new_focus->getName() : std::string("none"); #endif @@ -181,6 +200,8 @@ void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock, BOOL keystroke { lockFocus(); } + + focus_dirty = true; } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index eeb127c878..d1eb94c371 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -2011,6 +2011,7 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const LLIMFloater::LLIMFloater(const LLUUID& session_id) : LLFloater(session_id), + mControlPanel(NULL), mSessionID(session_id), mLastMessageIndex(-1), mDialog(IM_NOTHING_SPECIAL), @@ -2018,6 +2019,20 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id) mInputEditor(NULL), mPositioned(false) { + LLIMModel::LLIMSession* session = get_if_there(LLIMModel::instance().sSessionsMap, mSessionID, (LLIMModel::LLIMSession*)NULL); + if(session) + { + mDialog = session->mType; + } + + if (mDialog == IM_NOTHING_SPECIAL) + { + mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelIMControl, this); + } + else + { + mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelGroupControl, this); + } // LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im_session.xml"); } @@ -2089,22 +2104,19 @@ LLIMFloater::~LLIMFloater() //virtual BOOL LLIMFloater::postBuild() { - LLPanelIMControlPanel* im_control_panel = getChild("panel_im_control_panel"); - LLIMModel::LLIMSession* session = get_if_there(LLIMModel::instance().sSessionsMap, mSessionID, (LLIMModel::LLIMSession*)NULL); if(session) { mOtherParticipantUUID = session->mOtherParticipantID; - im_control_panel->setAvatarId(session->mOtherParticipantID); - mDialog = session->mType; + mControlPanel->setID(session->mOtherParticipantID); } LLButton* slide_left = getChild("slide_left_btn"); - slide_left->setVisible(im_control_panel->getVisible()); + slide_left->setVisible(mControlPanel->getVisible()); slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); LLButton* slide_right = getChild("slide_right_btn"); - slide_right->setVisible(!im_control_panel->getVisible()); + slide_right->setVisible(!mControlPanel->getVisible()); slide_right->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); mInputEditor = getChild("chat_editor"); @@ -2131,6 +2143,30 @@ BOOL LLIMFloater::postBuild() return TRUE; } + + +// static +void* LLIMFloater::createPanelIMControl(void* userdata) +{ + LLIMFloater *self = (LLIMFloater*)userdata; + self->mControlPanel = new LLPanelIMControlPanel(); + LLUICtrlFactory::getInstance()->buildPanel(self->mControlPanel, "panel_im_control_panel.xml"); + self->mControlPanel->setVisible(FALSE); + return self->mControlPanel; +} + + +// static +void* LLIMFloater::createPanelGroupControl(void* userdata) +{ + LLIMFloater *self = (LLIMFloater*)userdata; + self->mControlPanel = new LLPanelGroupControlPanel(); + LLUICtrlFactory::getInstance()->buildPanel(self->mControlPanel, "panel_group_control_panel.xml"); + self->mControlPanel->setVisible(FALSE); + return self->mControlPanel; +} + + const U32 UNDOCK_LEAP_HEIGHT = 12; const U32 DOCK_ICON_HEIGHT = 6; @@ -2147,6 +2183,7 @@ void LLIMFloater::onFocusLost() } + //virtual void LLIMFloater::setDocked(bool docked, bool pop_on_undock) { @@ -2203,17 +2240,22 @@ void LLIMFloater::updateMessages() for (; iter != iter_end; ++iter) { LLSD msg = *iter; - - message << msg["from"].asString() << " : " << msg["time"].asString() << "\n " << msg["message"].asString() << "\n"; - + + message << "[" << msg["time"].asString() << "] " << msg["from"].asString() << ": \n"; + mHistoryEditor->appendColoredText(message.str(), false, false, LLUIColorTable::instance().getColor("LtGray_50")); + message.str(""); + + message << msg["message"].asString() << "\n"; + mHistoryEditor->appendColoredText(message.str(), false, false, LLUIColorTable::instance().getColor("IMChatColor")); + message.str(""); + mLastMessageIndex = msg["index"].asInteger(); } - mHistoryEditor->appendText(message.str(), false, false); mHistoryEditor->setCursorAndScrollToEnd(); } - } + // static void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* userdata ) { diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index dcb0f2416f..8650d8fa07 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -47,6 +47,7 @@ class LLInventoryItem; class LLInventoryCategory; class LLIMSpeakerMgr; class LLPanelActiveSpeakers; +class LLPanelChatControlPanel; class LLVoiceChannel : public LLVoiceClientStatusObserver { @@ -405,9 +406,11 @@ private: static void onInputEditorFocusLost(LLFocusableElement* caller, void* userdata); static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata); void setTyping(BOOL typing); - - void onSlide(); + void onSlide(); + static void* createPanelIMControl(void* userdata); + static void* createPanelGroupControl(void* userdata); + LLPanelChatControlPanel* mControlPanel; LLUUID mSessionID; S32 mLastMessageIndex; EInstantMessage mDialog; diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 45fe625a13..d34ca88fc6 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -37,11 +37,9 @@ #include "llavataractions.h" #include "llavatariconctrl.h" #include "llbutton.h" - -static LLRegisterPanelClassWrapper t_im_control_panel("panel_im_control_panel"); +#include "llfloatergroupinfo.h" LLPanelIMControlPanel::LLPanelIMControlPanel() -: LLPanel() { } @@ -81,7 +79,34 @@ void LLPanelIMControlPanel::onShareButtonClicked() // *TODO: Implement } -void LLPanelIMControlPanel::setAvatarId(const LLUUID& avatar_id) +void LLPanelIMControlPanel::setID(const LLUUID& avatar_id) { getChild("avatar_icon")->setValue(avatar_id); } + + + +BOOL LLPanelGroupControlPanel::postBuild() +{ + childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this)); + childSetAction("call_btn", boost::bind(&LLPanelGroupControlPanel::onCallButtonClicked, this)); + + return TRUE; +} + +void LLPanelGroupControlPanel::onGroupInfoButtonClicked() +{ + LLFloaterGroupInfo::showFromUUID(mGroupID); +} + + +void LLPanelGroupControlPanel::onCallButtonClicked() +{ + // *TODO: Implement +} + + +void LLPanelGroupControlPanel::setID(const LLUUID& id) +{ + mGroupID = id; +} diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index be3b2d3130..e82942a31d 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -35,7 +35,19 @@ #include "llpanel.h" -class LLPanelIMControlPanel : public LLPanel + +class LLPanelChatControlPanel : public LLPanel +{ +public: + LLPanelChatControlPanel() {}; + ~LLPanelChatControlPanel() {}; + + // sets the group or avatar UUID + virtual void setID(const LLUUID& avatar_id)= 0; +}; + + +class LLPanelIMControlPanel : public LLPanelChatControlPanel { public: LLPanelIMControlPanel(); @@ -43,7 +55,7 @@ public: BOOL postBuild(); - void setAvatarId(const LLUUID& avatar_id); + void setID(const LLUUID& avatar_id); private: void onViewProfileButtonClicked(); @@ -52,4 +64,24 @@ private: void onShareButtonClicked(); }; + +class LLPanelGroupControlPanel : public LLPanelChatControlPanel +{ +public: + LLPanelGroupControlPanel() {}; + ~LLPanelGroupControlPanel() {}; + + BOOL postBuild(); + + void setID(const LLUUID& id); + +private: + void onGroupInfoButtonClicked(); + void onCallButtonClicked(); + + LLUUID mGroupID; +}; + + + #endif // LL_LLPANELIMCONTROLPANEL_H diff --git a/indra/newview/skins/default/xui/da/floater_world_map.xml b/indra/newview/skins/default/xui/da/floater_world_map.xml index f058cf0468..53c53dd707 100644 --- a/indra/newview/skins/default/xui/da/floater_world_map.xml +++ b/indra/newview/skins/default/xui/da/floater_world_map.xml @@ -52,6 +52,6 @@