diff options
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 104 |
1 files changed, 54 insertions, 50 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 06c1b2c12b..504760175b 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -64,6 +64,7 @@ #include "lllineeditor.h" #include "llalertdialog.h" #include "llnamelistctrl.h" +#include "llscrolllistitem.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "lltabcontainer.h" @@ -80,6 +81,7 @@ #include "llviewertexteditor.h" #include "llviewerwindow.h" #include "llvlcomposition.h" +#include "lltrans.h" #define ELAR_ENABLED 0 // Enable when server support is implemented @@ -161,8 +163,9 @@ bool estate_dispatch_initialized = false; LLUUID LLFloaterRegionInfo::sRequestInvoice; LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) + : LLFloater() { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", FALSE); } BOOL LLFloaterRegionInfo::postBuild() @@ -174,32 +177,32 @@ BOOL LLFloaterRegionInfo::postBuild() panel = new LLPanelRegionGeneralInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); - mTab->addTabPanel(panel, panel->getLabel(), TRUE); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); panel = new LLPanelRegionDebugInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelRegionTextureInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelRegionTerrainInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelEstateInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelEstateCovenant; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); gMessageSystem->setHandlerFunc( "EstateOwnerMessage", @@ -212,22 +215,16 @@ LLFloaterRegionInfo::~LLFloaterRegionInfo() { } -void LLFloaterRegionInfo::onOpen() +void LLFloaterRegionInfo::onOpen(const LLSD& key) { - LLRect rect = gSavedSettings.getRect("FloaterRegionInfo"); - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - rect.translate(left,top); - refreshFromRegion(gAgent.getRegion()); requestRegionInfo(); - LLFloater::onOpen(); } // static void LLFloaterRegionInfo::requestRegionInfo() { - LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); + LLTabContainer* tab = getChild<LLTabContainer>("region_panels"); tab->getChild<LLPanel>("General")->setCtrlsEnabled(FALSE); tab->getChild<LLPanel>("Debug")->setCtrlsEnabled(FALSE); @@ -436,6 +433,11 @@ void LLFloaterRegionInfo::refresh() // LLPanelRegionInfo // +LLPanelRegionInfo::LLPanelRegionInfo() + : LLPanel() +{ +} + // static void LLPanelRegionInfo::onBtnSet(void* user_data) { @@ -719,7 +721,7 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L // static void LLPanelRegionGeneralInfo::onClickManageTelehub(void* data) { - LLFloaterRegionInfo::getInstance()->close(); + LLFloaterRegionInfo::getInstance()->closeFloater(); LLFloaterTelehub::show(); } @@ -1074,7 +1076,7 @@ BOOL LLPanelRegionTextureInfo::postBuild() initCtrl(buffer); } -// LLButton* btn = new LLButton("dump", LLRect(0, 20, 100, 0), "", onClickDump, this); +// LLButton* btn = ("dump", LLRect(0, 20, 100, 0), "", onClickDump, this); // btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT); // addChild(btn); @@ -1363,9 +1365,10 @@ void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data) // static void LLPanelRegionTerrainInfo::onClickBakeTerrain(void* data) { - LLNotifications::instance().add( - LLNotification::Params("ConfirmBakeTerrain") - .functor(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2))); + LLNotification::Params::Functor functor_params; + functor_params.function(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2)); + + LLNotifications::instance().add(LLNotification::Params("ConfirmBakeTerrain").functor(functor_params)); } bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, const LLSD& response) @@ -1478,11 +1481,9 @@ void LLPanelEstateInfo::onClickRemoveAllowedAgent(void* user_data) accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list"); } -// static -void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data) +void LLPanelEstateInfo::onClickAddAllowedGroup() { - LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; - LLCtrlListInterface *list = self->childGetListInterface("allowed_group_name_list"); + LLCtrlListInterface *list = childGetListInterface("allowed_group_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) { @@ -1493,7 +1494,7 @@ void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data) } LLNotification::Params params("ChangeLindenAccess"); - params.functor(boost::bind(&LLPanelEstateInfo::addAllowedGroup, self, _1, _2)); + params.functor.function(boost::bind(&LLPanelEstateInfo::addAllowedGroup, this, _1, _2)); if (isLindenEstate()) { LLNotifications::instance().add(params); @@ -1515,7 +1516,7 @@ bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& re widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); if (widget) { - widget->setSelectCallback(addAllowedGroup2, NULL); + widget->setSelectGroupCallback(boost::bind(&LLPanelEstateInfo::addAllowedGroup2, this, _1)); if (parent_floater) { LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); @@ -1656,26 +1657,29 @@ bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& re std::string all_estates_text() { LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return "(error)"; + if (!panel) return "(" + LLTrans::getString("RegionInfoError") + ")"; + LLStringUtil::format_map_t args; std::string owner = panel->getOwnerName(); LLViewerRegion* region = gAgent.getRegion(); if (gAgent.isGodlike()) { - return llformat("all estates\nowned by %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesOwnedBy", args); } else if (region && region->getOwner() == gAgent.getID()) { - return "all estates you own"; + return LLTrans::getString("AllEstatesYouOwn"); } else if (region && region->isEstateManager()) { - return llformat("all estates that\nyou manage for %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesYouManage", args); } else { - return "(error)"; + return "(" + LLTrans::getString("RegionInfoError") + ")"; } } @@ -1725,8 +1729,7 @@ struct LLEstateAccessChangeInfo }; // Special case callback for groups, since it has different callback format than names -// static -void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data) +void LLPanelEstateInfo::addAllowedGroup2(LLUUID id) { LLSD payload; payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD; @@ -1739,7 +1742,7 @@ void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data) LLNotification::Params params("EstateAllowedGroupAdd"); params.payload(payload) .substitutions(args) - .functor(accessCoreConfirm); + .functor.function(accessCoreConfirm); if (isLindenEstate()) { LLNotifications::instance().forceResponse(params, 0); @@ -1760,7 +1763,7 @@ void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dia LLNotification::Params params("ChangeLindenAccess"); params.payload(payload) - .functor(accessAddCore2); + .functor.function(accessAddCore2); if (isLindenEstate()) { @@ -1848,7 +1851,7 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co LLNotification::Params params(change_info->mDialogName); params.substitutions(args) .payload(change_info->asLLSD()) - .functor(accessCoreConfirm); + .functor.function(accessCoreConfirm); if (isLindenEstate()) { @@ -1888,7 +1891,7 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string& LLNotification::Params params("ChangeLindenAccess"); params.payload(payload) - .functor(accessRemoveCore2); + .functor.function(accessRemoveCore2); if (isLindenEstate()) { @@ -2121,7 +2124,7 @@ BOOL LLPanelEstateInfo::postBuild() initCtrl("limit_age_verified"); initCtrl("voice_chat_check"); childSetCommitCallback("abuse_email_address", onChangeAnything, this); - childSetKeystrokeCallback("abuse_email_address", onChangeText, this); + getChild<LLLineEditor>("abuse_email_address")->setKeystrokeCallback(onChangeText, this); initHelpBtn("estate_manager_help", "HelpEstateEstateManager"); initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime"); @@ -2161,7 +2164,7 @@ BOOL LLPanelEstateInfo::postBuild() group_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); } - childSetAction("add_allowed_group_btn", onClickAddAllowedGroup, this); + getChild<LLUICtrl>("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onClickAddAllowedGroup, this)); childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this); childSetCommitCallback("banned_avatar_name_list", onChangeChildCtrl, this); @@ -2213,7 +2216,7 @@ BOOL LLPanelEstateInfo::sendUpdate() llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; LLNotification::Params params("ChangeLindenEstate"); - params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); + params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); if (getEstateID() <= ESTATE_LAST_LINDEN) { @@ -2556,8 +2559,7 @@ void LLPanelEstateInfo::callbackCacheName( const LLUUID& id, const std::string& first, const std::string& last, - BOOL is_group, - void*) + BOOL is_group) { LLPanelEstateInfo* self = LLFloaterRegionInfo::getPanelEstate(); if (!self) return; @@ -2852,7 +2854,7 @@ void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp) else { mAssetStatus = ASSET_LOADED; - setCovenantTextEditor("There is no Covenant provided for this Estate."); + setCovenantTextEditor(LLTrans::getString("RegionNoCovenant")); sendChangeCovenantID(LLUUID::null); } } @@ -3063,7 +3065,7 @@ bool LLDispatchEstateUpdateInfo::operator()( regionp->setOwner(owner_id); // Update estate owner name in UI const BOOL is_group = FALSE; - gCacheName->get(owner_id, is_group, LLPanelEstateInfo::callbackCacheName); + gCacheName->get(owner_id, is_group, &LLPanelEstateInfo::callbackCacheName); U32 estate_id = strtoul(strings[2].c_str(), NULL, 10); panel->setEstateID(estate_id); @@ -3162,9 +3164,10 @@ bool LLDispatchSetEstateAccess::operator()( totalAllowedAgents += allowed_agent_name_list->getItemCount(); } - std::string msg = llformat("Allowed residents: (%d, max %d)", - totalAllowedAgents, - ESTATE_MAX_ACCESS_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); panel->childSetValue("allow_resident_label", LLSD(msg)); if (allowed_agent_name_list) @@ -3186,9 +3189,10 @@ bool LLDispatchSetEstateAccess::operator()( LLNameListCtrl* allowed_group_name_list; allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list"); - std::string msg = llformat("Allowed groups: (%d, max %d)", - num_allowed_groups, - (S32) ESTATE_MAX_GROUP_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); panel->childSetValue("allow_group_label", LLSD(msg)); if (allowed_group_name_list) |