diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-30 10:09:05 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-30 10:09:05 +0100 |
commit | 96099cff3851fa9546a4294ff23864c2d7e6b8c8 (patch) | |
tree | a39f0797061585796a26ebcf28ea806c8006dcf0 | |
parent | 8996a338bd150c37fb2cafdefeba19b6eaf3bcc9 (diff) | |
parent | 966882b3d9bf3e77a435d21a0cd53eb168aad283 (diff) |
merge from viewer-release
-rw-r--r-- | indra/llui/llmenugl.cpp | 9 | ||||
-rw-r--r-- | indra/llui/llmenugl.h | 1 | ||||
-rw-r--r-- | indra/newview/llnearbychatbar.cpp | 46 | ||||
-rw-r--r-- | indra/newview/llnearbychatbar.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/fr/strings.xml | 4 |
6 files changed, 50 insertions, 14 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 8610d79142..12007f7b52 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -928,6 +928,15 @@ void LLMenuItemCheckGL::setValue(const LLSD& value) } } +//virtual +LLSD LLMenuItemCheckGL::getValue() const +{ + // Get our boolean value from the view model. + // If we don't override this method then the implementation from + // LLMenuItemGL will return a string. (EXT-8501) + return LLUICtrl::getValue(); +} + // called to rebuild the draw label void LLMenuItemCheckGL::buildDrawLabel( void ) { diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index a484405eaa..bf40163dac 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -322,6 +322,7 @@ public: virtual void onCommit( void ); virtual void setValue(const LLSD& value); + virtual LLSD getValue() const; // called to rebuild the draw label virtual void buildDrawLabel( void ); diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index a300e15edd..8a52cf715f 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -317,9 +317,19 @@ void LLGestureComboList::refreshGestures() if (gestures) { - S32 index = gestures->getSelectedValue().asInteger(); - if(index > 0) - gesture = mGestures.at(index); + S32 sel_index = gestures->getFirstSelectedIndex(); + if (sel_index != 0) + { + S32 index = gestures->getSelectedValue().asInteger(); + if (index<0 || index >= (S32)mGestures.size()) + { + llwarns << "out of range gesture access" << llendl; + } + else + { + gesture = mGestures.at(index); + } + } } if(gesture && LLGestureMgr::instance().isGesturePlaying(gesture)) @@ -335,13 +345,13 @@ void LLGestureComboList::onCommitGesture() LLCtrlListInterface* gestures = getListInterface(); if (gestures) { - S32 index = gestures->getFirstSelectedIndex(); - if (index == 0) + S32 sel_index = gestures->getFirstSelectedIndex(); + if (sel_index == 0) { return; } - index = gestures->getSelectedValue().asInteger(); + S32 index = gestures->getSelectedValue().asInteger(); if (mViewAllItemIndex == index) { @@ -357,13 +367,20 @@ void LLGestureComboList::onCommitGesture() return; } - LLMultiGesture* gesture = mGestures.at(index); - if(gesture) + if (index<0 || index >= (S32)mGestures.size()) + { + llwarns << "out of range gesture index" << llendl; + } + else { - LLGestureMgr::instance().playGesture(gesture); - if(!gesture->mReplaceText.empty()) + LLMultiGesture* gesture = mGestures.at(index); + if(gesture) { - LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE); + LLGestureMgr::instance().playGesture(gesture); + if(!gesture->mReplaceText.empty()) + { + LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE); + } } } } @@ -374,6 +391,13 @@ LLGestureComboList::~LLGestureComboList() LLGestureMgr::instance().removeObserver(this); } +LLCtrlListInterface* LLGestureComboList::getListInterface() +{ + LLCtrlListInterface *result = mList; + llassert((LLCtrlListInterface*)mList==result); + return mList; +}; + LLNearbyChatBar::LLNearbyChatBar() : LLPanel() , mChatBox(NULL) diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 83c174fd10..0eaa60ce81 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -68,7 +68,7 @@ public: ~LLGestureComboList(); - LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)mList; }; + LLCtrlListInterface* getListInterface(); virtual void showList(); virtual void hideList(); virtual BOOL handleKeyHere(KEY key, MASK mask); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 090b7bba90..a83980dc23 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2411,6 +2411,8 @@ static void init_default_item_label(const std::string& item_name) boost::unordered_map<std::string, LLStringExplicit>::iterator it = sDefaultItemLabels.find(item_name); if (it == sDefaultItemLabels.end()) { + // *NOTE: This will not work for items of type LLMenuItemCheckGL because they return boolean value + // (doesn't seem to matter much ATM). LLStringExplicit default_label = gMenuHolder->childGetValue(item_name).asString(); if (!default_label.empty()) { diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 7ef67d5912..7aadaed209 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -1472,7 +1472,7 @@ Solde </string> <string name="Credits"> - Remerciements + Crédits </string> <string name="Debits"> Débits @@ -1787,7 +1787,7 @@ Solde </string> <string name="GroupMoneyCredits"> - Remerciements + Crédits </string> <string name="GroupMoneyDebits"> Débits |