EXT-7221 FIXED Now the 'Get More >>' link exists exactly before the 'View All >>' link in the Gestures list

- Added new setting GesturesMarketplaceURL in settings.xml to represent URL which points to the Gesture's Marketplace.
- Added mGetMoreItemIndex instance variable (similar to mViewAllItemIndex which was already there).
- Added mGetMoreItemIndex handling in the LLGestureComboList::onCommitGesture() (again, similar to mViewAllItemIndex).
- Added new string in strings.xml with name GetMoreGestures to represent Gesture's list item.

Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/386/

--HG--
branch : product-engine
meow-7.2.2
Andrew Polunin 2010-05-14 13:03:44 +03:00
parent 07678ad2db
commit 61316403aa
4 changed files with 26 additions and 3 deletions

View File

@ -3578,6 +3578,17 @@
<key>Value</key>
<integer>1024</integer>
</map>
<key>GesturesMarketplaceURL</key>
<map>
<key>Comment</key>
<string>URL to the Gestures Marketplace</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>https://www.xstreetsl.com/modules.php?name=Marketplace&amp;CategoryID=233</string>
</map>
<key>GridCrossSections</key>
<map>
<key>Comment</key>

View File

@ -79,6 +79,7 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p)
: LLUICtrl(p)
, mLabel(p.label)
, mViewAllItemIndex(0)
, mGetMoreItemIndex(0)
{
LLButton::Params button_params = p.combo_button;
button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT);
@ -260,9 +261,12 @@ void LLGestureComboList::refreshGestures()
sortByName();
// store index followed by the last added Gesture and add View All item at bottom
mViewAllItemIndex = idx;
// store indices for Get More and View All items (idx is the index followed by the last added Gesture)
mGetMoreItemIndex = idx;
mViewAllItemIndex = idx + 1;
// add Get More and View All items at the bottom
mList->addSimpleElement(LLTrans::getString("GetMoreGestures"), ADD_BOTTOM, LLSD(mGetMoreItemIndex));
mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex));
// Insert label after sorting, at top, with separator below it
@ -318,6 +322,12 @@ void LLGestureComboList::onCommitGesture()
return;
}
if (mGetMoreItemIndex == index)
{
LLWeb::loadURLExternal(gSavedSettings.getString("GesturesMarketplaceURL"));
return;
}
LLMultiGesture* gesture = mGestures.at(index);
if(gesture)
{

View File

@ -62,6 +62,7 @@ protected:
std::vector<LLMultiGesture*> mGestures;
std::string mLabel;
LLSD::Integer mViewAllItemIndex;
LLSD::Integer mGetMoreItemIndex;
public:

View File

@ -1894,6 +1894,7 @@ Clears (deletes) the media and all params from the given face.
<string name="Wave" value=" Wave " />
<string name="HelloAvatar" value=" Hello, avatar! " />
<string name="ViewAllGestures" value=" View All &gt;&gt;" />
<string name="GetMoreGestures" value=" Get More &gt;&gt;" />
<!-- inventory filter -->
<!-- use value="" because they have preceding spaces -->