diff options
author | Denis Serdjuk <dserduk@productengine.com> | 2009-11-16 19:27:35 +0200 |
---|---|---|
committer | Denis Serdjuk <dserduk@productengine.com> | 2009-11-16 19:27:35 +0200 |
commit | e12126bf89ee862603f02f709f69bb013c8a8635 (patch) | |
tree | ae92b80d44c07d26f4e89a1e2b6ba3b431ffc306 /indra | |
parent | aba8b04cfc6763ee565a5ae9929e8be044272b08 (diff) |
implemented task EXT-1899 Add button to Gestures floater which activates/deactivates
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatergesture.cpp | 30 | ||||
-rw-r--r-- | indra/newview/llfloatergesture.h | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_gesture.xml | 15 |
3 files changed, 43 insertions, 8 deletions
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 854d02873a..af86274472 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -161,6 +161,7 @@ BOOL LLFloaterGesture::postBuild() getChild<LLUICtrl>("play_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickPlay, this)); getChild<LLUICtrl>("stop_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickPlay, this)); + getChild<LLButton>("activate_btn")->setClickedCallback(boost::bind(&LLFloaterGesture::onActivateBtnClick, this)); getChild<LLUICtrl>("new_gesture_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickNew, this)); @@ -179,7 +180,7 @@ BOOL LLFloaterGesture::postBuild() childSetFocus("gesture_list"); - LLCtrlListInterface *list = childGetListInterface("gesture_list"); + LLCtrlListInterface *list = getGestureList(); if (list) { const BOOL ascending = TRUE; @@ -198,7 +199,7 @@ void LLFloaterGesture::refreshAll() { buildGestureList(); - LLCtrlListInterface *list = childGetListInterface("gesture_list"); + LLCtrlListInterface *list = getGestureList(); if (!list) return; if (mSelectedID.isNull()) @@ -219,7 +220,7 @@ void LLFloaterGesture::refreshAll() void LLFloaterGesture::buildGestureList() { - LLCtrlListInterface *list = childGetListInterface("gesture_list"); + LLCtrlListInterface *list = getGestureList(); LLCtrlScrollInterface *scroll = childGetScrollInterface("gesture_list"); if (! (list && scroll)) return; @@ -347,7 +348,7 @@ void LLFloaterGesture::addGesture(const LLUUID& item_id , LLMultiGesture* gestur void LLFloaterGesture::onClickInventory() { - LLCtrlListInterface *list = childGetListInterface("gesture_list"); + LLCtrlListInterface *list = getGestureList(); if (!list) return; const LLUUID& item_id = list->getCurrentID(); @@ -358,7 +359,7 @@ void LLFloaterGesture::onClickInventory() void LLFloaterGesture::onClickPlay() { - LLCtrlListInterface *list = childGetListInterface("gesture_list"); + LLCtrlListInterface *list = getGestureList(); if (!list) return; const LLUUID& item_id = list->getCurrentID(); if(item_id.isNull()) return; @@ -396,10 +397,27 @@ void LLFloaterGesture::onClickNew() LLInventoryType::IT_GESTURE, NOT_WEARABLE, PERM_MOVE | PERM_TRANSFER, cb); } +void LLFloaterGesture::onActivateBtnClick() +{ + LLCtrlListInterface* list = getGestureList(); + + LLUUID gesture_inv_id = list->getSelectedValue(); + LLGestureManager* gm = LLGestureManager::getInstance(); + + if(gm->isGestureActive(gesture_inv_id)) + { + gm->deactivateGesture(gesture_inv_id); + } + else + { + gm->activateGesture(gesture_inv_id); + } +} + void LLFloaterGesture::onClickEdit() { - LLCtrlListInterface *list = childGetListInterface("gesture_list"); + LLCtrlListInterface *list = getGestureList(); if (!list) return; const LLUUID& item_id = list->getCurrentID(); diff --git a/indra/newview/llfloatergesture.h b/indra/newview/llfloatergesture.h index e7819d2a03..50bef818da 100644 --- a/indra/newview/llfloatergesture.h +++ b/indra/newview/llfloatergesture.h @@ -77,7 +77,11 @@ protected: void onClickNew(); void onCommitList(); void playGesture(LLUUID item_id); - + LLCtrlListInterface* getGestureList() const + { + return childGetListInterface("gesture_list"); + } + void onActivateBtnClick(); protected: LLUUID mSelectedID; LLUUID mGestureFolderID; diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml index a3ac878202..21d292847a 100644 --- a/indra/newview/skins/default/xui/en/floater_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_gesture.xml @@ -83,7 +83,20 @@ tool_tip="Make new gesture" top_delta="0" width="18" /> - <button + <button + follows="bottom|left" + font="SansSerifBigBold" + height="10" + image_hover_selected="Activate_Checkmark" + image_selected="Activate_Checkmark" + image_unselected="Activate_Checkmark" + layout="topleft" + left_pad="5" + name="activate_btn" + tool_tip="Activate/Deactivate selected gesture" + top="10" + width="10" /> + <button follows="bottom|right" font="SansSerifBigBold" height="18" |