diff --git a/indra/newview/NACLfloaterexploresounds.cpp b/indra/newview/NACLfloaterexploresounds.cpp index 5dcf0b4021..2ca4403030 100644 --- a/indra/newview/NACLfloaterexploresounds.cpp +++ b/indra/newview/NACLfloaterexploresounds.cpp @@ -62,12 +62,23 @@ BOOL NACLFloaterExploreSounds::postBuild() getChild("bl_btn")->setClickedCallback(boost::bind(&NACLFloaterExploreSounds::blacklistSound, this)); mHistoryScroller = getChild("sound_list"); + mHistoryScroller->setCommitCallback(boost::bind(&NACLFloaterExploreSounds::handleSelection, this)); mHistoryScroller->setDoubleClickCallback(boost::bind(&NACLFloaterExploreSounds::handlePlayLocally, this)); mHistoryScroller->sortByColumn("playing", TRUE); return TRUE; } +void NACLFloaterExploreSounds::handleSelection() +{ + S32 num_selected = mHistoryScroller->getAllSelected().size(); + bool multiple = (num_selected > 1); + childSetEnabled("look_at_btn", (num_selected && !multiple)); + childSetEnabled("play_locally_btn", num_selected); + childSetEnabled("stop_btn", num_selected); + childSetEnabled("bl_btn", num_selected); +} + LLSoundHistoryItem NACLFloaterExploreSounds::getItem(LLUUID itemID) { if(gSoundHistory.find(itemID) != gSoundHistory.end()) diff --git a/indra/newview/NACLfloaterexploresounds.h b/indra/newview/NACLfloaterexploresounds.h index 5b7c2ec997..4ee81d6cd0 100644 --- a/indra/newview/NACLfloaterexploresounds.h +++ b/indra/newview/NACLfloaterexploresounds.h @@ -27,6 +27,7 @@ private: void handlePlayLocally(); void handleLookAt(); void handleStop(); + void handleSelection(); void blacklistSound(); LLScrollListCtrl* mHistoryScroller; diff --git a/indra/newview/skins/default/xui/en/floater_NACL_explore_sounds.xml b/indra/newview/skins/default/xui/en/floater_NACL_explore_sounds.xml index daa5701f68..5318c58c70 100644 --- a/indra/newview/skins/default/xui/en/floater_NACL_explore_sounds.xml +++ b/indra/newview/skins/default/xui/en/floater_NACL_explore_sounds.xml @@ -49,9 +49,9 @@ -