diff options
author | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
commit | a8a62201ba762e98dff92cf49033e577fc34d8d4 (patch) | |
tree | 11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/newview/llfloaterland.cpp | |
parent | Second Life viewer sources 1.18.6.4-RC (diff) | |
download | meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2 meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz |
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/newview/llfloaterland.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterland.cpp | 196 |
1 files changed, 55 insertions, 141 deletions
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 5af46f3..447571d 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -1045,7 +1045,10 @@ BOOL LLPanelLandObjects::postBuild() | |||
1045 | 1045 | ||
1046 | mSelectedObjects = LLUICtrlFactory::getTextBoxByName(this, "selected_objects_text"); | 1046 | mSelectedObjects = LLUICtrlFactory::getTextBoxByName(this, "selected_objects_text"); |
1047 | mCleanOtherObjectsTime = LLUICtrlFactory::getLineEditorByName(this, "clean other time"); | 1047 | mCleanOtherObjectsTime = LLUICtrlFactory::getLineEditorByName(this, "clean other time"); |
1048 | mCleanOtherObjectsTime->setFocusLostCallback(onLostFocus); | 1048 | |
1049 | mCleanOtherObjectsTime->setFocusLostCallback(onLostFocus, this); | ||
1050 | mCleanOtherObjectsTime->setCommitCallback(onCommitClean); | ||
1051 | |||
1049 | childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32); | 1052 | childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32); |
1050 | childSetUserData("clean other time", this); | 1053 | childSetUserData("clean other time", this); |
1051 | 1054 | ||
@@ -1066,44 +1069,8 @@ BOOL LLPanelLandObjects::postBuild() | |||
1066 | image_id.set( gViewerArt.getString("icon_group.tga") ); | 1069 | image_id.set( gViewerArt.getString("icon_group.tga") ); |
1067 | mIconGroup = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); | 1070 | mIconGroup = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); |
1068 | 1071 | ||
1069 | mCurrentSortColumn = 3; // sort by number of objects by default. | ||
1070 | mCurrentSortAscending = FALSE; | ||
1071 | |||
1072 | // Column widths for various columns | ||
1073 | const S32 SORTER_WIDTH = 308; | ||
1074 | const S32 DESC_BTN_WIDTH = 64; | ||
1075 | const S32 ICON_WIDTH = 24; | ||
1076 | mColWidth[0] = ICON_WIDTH; // type icon | ||
1077 | mColWidth[1] = -1; // hidden type code | ||
1078 | mColWidth[2] = SORTER_WIDTH - mColWidth[0] - DESC_BTN_WIDTH; | ||
1079 | mColWidth[3] = DESC_BTN_WIDTH; // info | ||
1080 | mColWidth[4] = -1; // type data 1 | ||
1081 | mColWidth[5] = -1; | ||
1082 | mColWidth[6] = -1; // type data 3 | ||
1083 | mColWidth[7] = -1; // type data 4 | ||
1084 | mColWidth[8] = -1; // type data 5 | ||
1085 | |||
1086 | // Adjust description for other widths | ||
1087 | S32 sum = 0; | ||
1088 | for (S32 i = 0; i < 8; i++) | ||
1089 | { | ||
1090 | if (mColWidth[i] > 0) | ||
1091 | { | ||
1092 | sum += mColWidth[i]; | ||
1093 | } | ||
1094 | } | ||
1095 | mColWidth[8] = mRect.getWidth() - HPAD - sum - HPAD - HPAD; | ||
1096 | |||
1097 | mBtnType = LLUICtrlFactory::getButtonByName(this, "Type"); | ||
1098 | mBtnType->setClickedCallback(onClickType, this); | ||
1099 | |||
1100 | mBtnName = LLUICtrlFactory::getButtonByName(this, "Name"); | ||
1101 | mBtnName->setClickedCallback(onClickName, this); | ||
1102 | |||
1103 | mBtnDescription = LLUICtrlFactory::getButtonByName(this, "Count"); | ||
1104 | mBtnDescription->setClickedCallback(onClickDesc, this); | ||
1105 | |||
1106 | mOwnerList = LLUICtrlFactory::getNameListByName(this, "owner list"); | 1072 | mOwnerList = LLUICtrlFactory::getNameListByName(this, "owner list"); |
1073 | mOwnerList->sortByColumn(3, FALSE); | ||
1107 | childSetCommitCallback("owner list", onCommitList, this); | 1074 | childSetCommitCallback("owner list", onCommitList, this); |
1108 | mOwnerList->setDoubleClickCallback(onDoubleClickOwner); | 1075 | mOwnerList->setDoubleClickCallback(onDoubleClickOwner); |
1109 | 1076 | ||
@@ -1134,7 +1101,7 @@ void LLPanelLandObjects::onDoubleClickOwner(void *userdata) | |||
1134 | return; | 1101 | return; |
1135 | } | 1102 | } |
1136 | // Is this a group? | 1103 | // Is this a group? |
1137 | BOOL is_group = cell->getText() == OWNER_GROUP; | 1104 | BOOL is_group = cell->getValue().asString() == OWNER_GROUP; |
1138 | if (is_group) | 1105 | if (is_group) |
1139 | { | 1106 | { |
1140 | LLFloaterGroupInfo::showFromUUID(owner_id); | 1107 | LLFloaterGroupInfo::showFromUUID(owner_id); |
@@ -1179,19 +1146,16 @@ void LLPanelLandObjects::refresh() | |||
1179 | } | 1146 | } |
1180 | else | 1147 | else |
1181 | { | 1148 | { |
1182 | S32 sw_max = 0; | 1149 | S32 sw_max = parcel->getSimWideMaxPrimCapacity(); |
1183 | S32 sw_total = 0; | 1150 | S32 sw_total = parcel->getSimWidePrimCount(); |
1184 | S32 max = 0; | 1151 | S32 max = llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); |
1185 | S32 total = 0; | 1152 | S32 total = parcel->getPrimCount(); |
1186 | S32 owned = 0; | 1153 | S32 owned = parcel->getOwnerPrimCount(); |
1187 | S32 group = 0; | 1154 | S32 group = parcel->getGroupPrimCount(); |
1188 | S32 other = 0; | 1155 | S32 other = parcel->getOtherPrimCount(); |
1189 | S32 selected = 0; | 1156 | S32 selected = parcel->getSelectedPrimCount(); |
1190 | F32 parcel_object_bonus = 0.f; | 1157 | F32 parcel_object_bonus = parcel->getParcelPrimBonus(); |
1191 | 1158 | mOtherTime = parcel->getCleanOtherTime(); | |
1192 | gParcelMgr->getPrimInfo(sw_max, sw_total, | ||
1193 | max, total, owned, group, other, selected, | ||
1194 | parcel_object_bonus, mOtherTime); | ||
1195 | 1159 | ||
1196 | // Can't have more than region max tasks, regardless of parcel | 1160 | // Can't have more than region max tasks, regardless of parcel |
1197 | // object bonus factor. | 1161 | // object bonus factor. |
@@ -1441,14 +1405,6 @@ void LLPanelLandObjects::onClickReturnOwnerList(void* userdata) | |||
1441 | { | 1405 | { |
1442 | LLPanelLandObjects *self = (LLPanelLandObjects *)userdata; | 1406 | LLPanelLandObjects *self = (LLPanelLandObjects *)userdata; |
1443 | 1407 | ||
1444 | S32 sw_max, sw_total; | ||
1445 | S32 max, total; | ||
1446 | S32 owned, group, other, selected; | ||
1447 | F32 parcel_object_bonus; | ||
1448 | S32 other_time; | ||
1449 | |||
1450 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | ||
1451 | |||
1452 | LLParcel* parcelp = self->mParcel->getParcel(); | 1408 | LLParcel* parcelp = self->mParcel->getParcel(); |
1453 | if (!parcelp) return; | 1409 | if (!parcelp) return; |
1454 | 1410 | ||
@@ -1491,7 +1447,7 @@ void LLPanelLandObjects::onClickRefresh(void* userdata) | |||
1491 | 1447 | ||
1492 | // ready the list for results | 1448 | // ready the list for results |
1493 | self->mOwnerList->deleteAllItems(); | 1449 | self->mOwnerList->deleteAllItems(); |
1494 | self->mOwnerList->addSimpleItem("Searching..."); | 1450 | self->mOwnerList->addCommentText("Searching..."); |
1495 | self->mOwnerList->setEnabled(FALSE); | 1451 | self->mOwnerList->setEnabled(FALSE); |
1496 | self->mFirstReply = TRUE; | 1452 | self->mFirstReply = TRUE; |
1497 | 1453 | ||
@@ -1552,24 +1508,24 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1552 | LLScrollListItem *row = new LLScrollListItem( TRUE, NULL, owner_id); | 1508 | LLScrollListItem *row = new LLScrollListItem( TRUE, NULL, owner_id); |
1553 | if (is_group_owned) | 1509 | if (is_group_owned) |
1554 | { | 1510 | { |
1555 | row->addColumn(self->mIconGroup, self->mColWidth[0]); | 1511 | row->addColumn(self->mIconGroup.notNull() ? self->mIconGroup->getID() : LLUUID::null); |
1556 | row->addColumn(OWNER_GROUP, FONT, self->mColWidth[1]); | 1512 | row->addColumn(OWNER_GROUP, FONT); |
1557 | } | 1513 | } |
1558 | else if (is_online) | 1514 | else if (is_online) |
1559 | { | 1515 | { |
1560 | row->addColumn(self->mIconAvatarOnline, self->mColWidth[0]); | 1516 | row->addColumn(self->mIconAvatarOnline.notNull() ? self->mIconAvatarOnline->getID() : LLUUID::null); |
1561 | row->addColumn(OWNER_ONLINE, FONT, self->mColWidth[1]); | 1517 | row->addColumn(OWNER_ONLINE, FONT); |
1562 | } | 1518 | } |
1563 | else // offline | 1519 | else // offline |
1564 | { | 1520 | { |
1565 | row->addColumn(self->mIconAvatarOffline, self->mColWidth[0]); | 1521 | row->addColumn(self->mIconAvatarOffline.notNull() ? self->mIconAvatarOffline->getID() : LLUUID::null); |
1566 | row->addColumn(OWNER_OFFLINE, FONT, self->mColWidth[1]); | 1522 | row->addColumn(OWNER_OFFLINE, FONT); |
1567 | } | 1523 | } |
1568 | // Placeholder for name. | 1524 | // Placeholder for name. |
1569 | row->addColumn(LLString::null, FONT, self->mColWidth[2]); | 1525 | row->addColumn(LLString::null, FONT); |
1570 | 1526 | ||
1571 | snprintf(object_count_str, sizeof(object_count_str), "%d", object_count); /* Flawfinder: ignore */ | 1527 | snprintf(object_count_str, sizeof(object_count_str), "%d", object_count); /* Flawfinder: ignore */ |
1572 | row->addColumn(object_count_str, FONT, self->mColWidth[3]); | 1528 | row->addColumn(object_count_str, FONT); |
1573 | 1529 | ||
1574 | if (is_group_owned) | 1530 | if (is_group_owned) |
1575 | { | 1531 | { |
@@ -1583,12 +1539,10 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1583 | lldebugs << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent") | 1539 | lldebugs << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent") |
1584 | << ") owns " << object_count << " objects." << llendl; | 1540 | << ") owns " << object_count << " objects." << llendl; |
1585 | } | 1541 | } |
1586 | self->mOwnerList->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); | ||
1587 | |||
1588 | // check for no results | 1542 | // check for no results |
1589 | if (0 == self->mOwnerList->getItemCount()) | 1543 | if (0 == self->mOwnerList->getItemCount()) |
1590 | { | 1544 | { |
1591 | self->mOwnerList->addSimpleItem("None found."); | 1545 | self->mOwnerList->addCommentText("None found."); |
1592 | } | 1546 | } |
1593 | else | 1547 | else |
1594 | { | 1548 | { |
@@ -1596,21 +1550,6 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1596 | } | 1550 | } |
1597 | } | 1551 | } |
1598 | 1552 | ||
1599 | void LLPanelLandObjects::sortBtnCore(S32 column) | ||
1600 | { | ||
1601 | if (column == (S32)mCurrentSortColumn) // is this already our sorted column? | ||
1602 | { | ||
1603 | mCurrentSortAscending = !mCurrentSortAscending; | ||
1604 | } | ||
1605 | else // default to ascending first time a column is clicked | ||
1606 | { | ||
1607 | mCurrentSortColumn = column; | ||
1608 | mCurrentSortAscending = TRUE; | ||
1609 | } | ||
1610 | |||
1611 | mOwnerList->sortByColumn(column, mCurrentSortAscending); | ||
1612 | } | ||
1613 | |||
1614 | // static | 1553 | // static |
1615 | void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) | 1554 | void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) |
1616 | { | 1555 | { |
@@ -1631,11 +1570,11 @@ void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) | |||
1631 | return; | 1570 | return; |
1632 | } | 1571 | } |
1633 | // Is this a group? | 1572 | // Is this a group? |
1634 | self->mSelectedIsGroup = cell->getText() == OWNER_GROUP; | 1573 | self->mSelectedIsGroup = cell->getValue().asString() == OWNER_GROUP; |
1635 | cell = item->getColumn(2); | 1574 | cell = item->getColumn(2); |
1636 | self->mSelectedName = cell->getText(); | 1575 | self->mSelectedName = cell->getValue().asString(); |
1637 | cell = item->getColumn(3); | 1576 | cell = item->getColumn(3); |
1638 | self->mSelectedCount = atoi(cell->getText().c_str()); | 1577 | self->mSelectedCount = atoi(cell->getValue().asString().c_str()); |
1639 | 1578 | ||
1640 | // Set the selection, and enable the return button. | 1579 | // Set the selection, and enable the return button. |
1641 | self->mSelectedOwners.clear(); | 1580 | self->mSelectedOwners.clear(); |
@@ -1648,28 +1587,6 @@ void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) | |||
1648 | } | 1587 | } |
1649 | 1588 | ||
1650 | // static | 1589 | // static |
1651 | void LLPanelLandObjects::onClickType(void* userdata) | ||
1652 | { | ||
1653 | // Sort on hidden type column | ||
1654 | LLPanelLandObjects* self = (LLPanelLandObjects*)userdata; | ||
1655 | self->sortBtnCore(1); | ||
1656 | } | ||
1657 | |||
1658 | // static | ||
1659 | void LLPanelLandObjects::onClickDesc(void* userdata) | ||
1660 | { | ||
1661 | LLPanelLandObjects* self = (LLPanelLandObjects*)userdata; | ||
1662 | self->sortBtnCore(3); | ||
1663 | } | ||
1664 | |||
1665 | // static | ||
1666 | void LLPanelLandObjects::onClickName(void* userdata) | ||
1667 | { | ||
1668 | LLPanelLandObjects* self = (LLPanelLandObjects*)userdata; | ||
1669 | self->sortBtnCore(2); | ||
1670 | } | ||
1671 | |||
1672 | // static | ||
1673 | void LLPanelLandObjects::clickShowCore(LLPanelLandObjects* self, S32 return_type, uuid_list_t* list) | 1590 | void LLPanelLandObjects::clickShowCore(LLPanelLandObjects* self, S32 return_type, uuid_list_t* list) |
1674 | { | 1591 | { |
1675 | LLParcel* parcel = self->mParcel->getParcel(); | 1592 | LLParcel* parcel = self->mParcel->getParcel(); |
@@ -1699,18 +1616,14 @@ void LLPanelLandObjects::onClickShowOtherObjects(void* userdata) | |||
1699 | // static | 1616 | // static |
1700 | void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) | 1617 | void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) |
1701 | { | 1618 | { |
1702 | S32 sw_max=0, sw_total=0; | 1619 | S32 owned = 0; |
1703 | S32 max=0, total=0; | ||
1704 | S32 owned=0, group=0, other=0, selected=0; | ||
1705 | F32 parcel_object_bonus=0; | ||
1706 | S32 other_time=0; | ||
1707 | |||
1708 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | ||
1709 | 1620 | ||
1710 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; | 1621 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; |
1711 | LLParcel* parcel = panelp->mParcel->getParcel(); | 1622 | LLParcel* parcel = panelp->mParcel->getParcel(); |
1712 | if (!parcel) return; | 1623 | if (!parcel) return; |
1713 | 1624 | ||
1625 | owned = parcel->getOwnerPrimCount(); | ||
1626 | |||
1714 | send_parcel_select_objects(parcel->getLocalID(), RT_OWNER); | 1627 | send_parcel_select_objects(parcel->getLocalID(), RT_OWNER); |
1715 | 1628 | ||
1716 | LLUUID owner_id = parcel->getOwnerID(); | 1629 | LLUUID owner_id = parcel->getOwnerID(); |
@@ -1738,14 +1651,6 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) | |||
1738 | // static | 1651 | // static |
1739 | void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) | 1652 | void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) |
1740 | { | 1653 | { |
1741 | S32 sw_max=0, sw_total=0; | ||
1742 | S32 max=0, total=0; | ||
1743 | S32 owned=0, group=0, other=0, selected=0; | ||
1744 | F32 parcel_object_bonus=0; | ||
1745 | S32 other_time=0; | ||
1746 | |||
1747 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | ||
1748 | |||
1749 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; | 1654 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; |
1750 | LLParcel* parcel = panelp->mParcel->getParcel(); | 1655 | LLParcel* parcel = panelp->mParcel->getParcel(); |
1751 | if (!parcel) return; | 1656 | if (!parcel) return; |
@@ -1757,7 +1662,7 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) | |||
1757 | 1662 | ||
1758 | LLStringBase<char>::format_map_t args; | 1663 | LLStringBase<char>::format_map_t args; |
1759 | args["[NAME]"] = group_name; | 1664 | args["[NAME]"] = group_name; |
1760 | args["[N]"] = llformat("%d",group); | 1665 | args["[N]"] = llformat("%d", parcel->getGroupPrimCount()); |
1761 | 1666 | ||
1762 | // create and show confirmation textbox | 1667 | // create and show confirmation textbox |
1763 | gViewerWindow->alertXml("ReturnObjectsDeededToGroup", args, callbackReturnGroupObjects, userdata); | 1668 | gViewerWindow->alertXml("ReturnObjectsDeededToGroup", args, callbackReturnGroupObjects, userdata); |
@@ -1766,17 +1671,13 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) | |||
1766 | // static | 1671 | // static |
1767 | void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) | 1672 | void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) |
1768 | { | 1673 | { |
1769 | S32 sw_max=0, sw_total=0; | 1674 | S32 other = 0; |
1770 | S32 max=0, total=0; | ||
1771 | S32 owned=0, group=0, other=0, selected=0; | ||
1772 | F32 parcel_object_bonus=0; | ||
1773 | S32 other_time=0; | ||
1774 | |||
1775 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | ||
1776 | 1675 | ||
1777 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; | 1676 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; |
1778 | LLParcel* parcel = panelp->mParcel->getParcel(); | 1677 | LLParcel* parcel = panelp->mParcel->getParcel(); |
1779 | if (!parcel) return; | 1678 | if (!parcel) return; |
1679 | |||
1680 | other = parcel->getOtherPrimCount(); | ||
1780 | 1681 | ||
1781 | send_parcel_select_objects(parcel->getLocalID(), RT_OTHER); | 1682 | send_parcel_select_objects(parcel->getLocalID(), RT_OTHER); |
1782 | 1683 | ||
@@ -1816,7 +1717,13 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) | |||
1816 | } | 1717 | } |
1817 | 1718 | ||
1818 | // static | 1719 | // static |
1819 | void LLPanelLandObjects::onLostFocus(LLUICtrl *caller, void* user_data) | 1720 | void LLPanelLandObjects::onLostFocus(LLFocusableElement* caller, void* user_data) |
1721 | { | ||
1722 | onCommitClean((LLUICtrl*)caller, user_data); | ||
1723 | } | ||
1724 | |||
1725 | // static | ||
1726 | void LLPanelLandObjects::onCommitClean(LLUICtrl *caller, void* user_data) | ||
1820 | { | 1727 | { |
1821 | LLPanelLandObjects *lop = (LLPanelLandObjects *)user_data; | 1728 | LLPanelLandObjects *lop = (LLPanelLandObjects *)user_data; |
1822 | LLParcel* parcel = lop->mParcel->getParcel(); | 1729 | LLParcel* parcel = lop->mParcel->getParcel(); |
@@ -2401,6 +2308,13 @@ void LLPanelLandMedia::refresh() | |||
2401 | mCheckSoundLocal->set( parcel->getSoundLocal() ); | 2308 | mCheckSoundLocal->set( parcel->getSoundLocal() ); |
2402 | mCheckSoundLocal->setEnabled( can_change_media ); | 2309 | mCheckSoundLocal->setEnabled( can_change_media ); |
2403 | 2310 | ||
2311 | LLViewerRegion* selection_region = gParcelMgr->getSelectionRegion(); | ||
2312 | BOOL region_allows_voice = FALSE; | ||
2313 | if (selection_region) | ||
2314 | { | ||
2315 | region_allows_voice = selection_region->isVoiceEnabled(); | ||
2316 | } | ||
2317 | |||
2404 | if(parcel->getVoiceEnabled()) | 2318 | if(parcel->getVoiceEnabled()) |
2405 | { | 2319 | { |
2406 | if(parcel->getVoiceUseEstateChannel()) | 2320 | if(parcel->getVoiceUseEstateChannel()) |
@@ -2413,7 +2327,7 @@ void LLPanelLandMedia::refresh() | |||
2413 | mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable); | 2327 | mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable); |
2414 | } | 2328 | } |
2415 | 2329 | ||
2416 | mRadioVoiceChat->setEnabled( can_change_media ); | 2330 | mRadioVoiceChat->setEnabled( can_change_media && region_allows_voice ); |
2417 | 2331 | ||
2418 | // don't display urls if you're not able to change it | 2332 | // don't display urls if you're not able to change it |
2419 | // much requested change in forums so people can't 'steal' urls | 2333 | // much requested change in forums so people can't 'steal' urls |
@@ -2528,7 +2442,7 @@ void LLPanelLandMedia::onClickStopMedia ( void* data ) | |||
2528 | void LLPanelLandMedia::onClickStartMedia ( void* data ) | 2442 | void LLPanelLandMedia::onClickStartMedia ( void* data ) |
2529 | { | 2443 | { |
2530 | // force a commit | 2444 | // force a commit |
2531 | gFocusMgr.setKeyboardFocus ( NULL, NULL ); | 2445 | gFocusMgr.setKeyboardFocus ( NULL ); |
2532 | 2446 | ||
2533 | // force a reload | 2447 | // force a reload |
2534 | LLMediaEngine::getInstance ()->convertImageAndLoadUrl ( true, false, std::string()); | 2448 | LLMediaEngine::getInstance ()->convertImageAndLoadUrl ( true, false, std::string()); |
@@ -2904,7 +2818,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2904 | LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); | 2818 | LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); |
2905 | if (passcombo) | 2819 | if (passcombo) |
2906 | { | 2820 | { |
2907 | if (passcombo->getSimpleSelectedValue().asString() == "group") | 2821 | if (passcombo->getSelectedValue().asString() == "group") |
2908 | { | 2822 | { |
2909 | use_access_list = FALSE; | 2823 | use_access_list = FALSE; |
2910 | } | 2824 | } |