summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2009-12-11 21:40:29 +0200
committerAndrew Dyukov <adyukov@productengine.com>2009-12-11 21:40:29 +0200
commit2acb204c4b1bdc4cc11c7af51ebfd09c47c3e231 (patch)
treee31d0e1aa9b61ccec294b04c1dce5a55ad6a02c1
parent7863d7d412ecd4dbbb7a27978493e85f446250fb (diff)
Fixed normal bug EXT-3281 (Group : Disable "Leave Group" for none).
--HG-- branch : product-engine
-rw-r--r--indra/newview/llpanelpeople.cpp6
-rw-r--r--indra/newview/llpanelpeople.h2
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml2
3 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 5fb7dab7be..79a593a8c9 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -586,6 +586,7 @@ BOOL LLPanelPeople::postBuild()
registrar.add("People.Groups.ViewSort.Action", boost::bind(&LLPanelPeople::onGroupsViewSortMenuItemClicked, this, _2));
registrar.add("People.Recent.ViewSort.Action", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemClicked, this, _2));
+ enable_registrar.add("People.Group.Minus.Enable", boost::bind(&LLPanelPeople::isRealGroup, this));
enable_registrar.add("People.Friends.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemCheck, this, _2));
enable_registrar.add("People.Recent.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemCheck, this, _2));
enable_registrar.add("People.Nearby.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemCheck, this, _2));
@@ -921,6 +922,11 @@ void LLPanelPeople::reSelectedCurrentTab()
mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex());
}
+bool LLPanelPeople::isRealGroup()
+{
+ return getCurrentItemID() != LLUUID::null;
+}
+
void LLPanelPeople::onFilterEdit(const std::string& search_string)
{
std::string search_upper = search_string;
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index a9cc6d0ccb..750d3b573f 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -118,6 +118,8 @@ private:
void onGroupsViewSortMenuItemClicked(const LLSD& userdata);
void onRecentViewSortMenuItemClicked(const LLSD& userdata);
+ //returns false only if group is "none"
+ bool isRealGroup();
bool onFriendsViewSortMenuItemCheck(const LLSD& userdata);
bool onRecentViewSortMenuItemCheck(const LLSD& userdata);
bool onNearbyViewSortMenuItemCheck(const LLSD& userdata);
diff --git a/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml
index 304492bedb..df3cb26b04 100644
--- a/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml
@@ -19,5 +19,7 @@
name="Leave Selected Group">
<menu_item_call.on_click
function="People.Group.Minus.Action"/>
+ <menu_item_call.on_enable
+ function="People.Group.Minus.Enable"/>
</menu_item_call>
</menu>