aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterregioninfo.cpp')
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp95
1 files changed, 45 insertions, 50 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index 671e03e..2f01844 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -13,12 +13,12 @@
13 * ("GPL"), unless you have obtained a separate licensing agreement 13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of 14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or 15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlife.com/developers/opensource/gplv2 16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 * 17 *
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlife.com/developers/opensource/flossexception 21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 22 *
23 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -161,50 +161,55 @@ bool estate_dispatch_initialized = false;
161/// LLFloaterRegionInfo 161/// LLFloaterRegionInfo
162///---------------------------------------------------------------------------- 162///----------------------------------------------------------------------------
163 163
164LLFloaterRegionInfo* LLFloaterRegionInfo::sInstance = NULL;
165//S32 LLFloaterRegionInfo::sRequestSerial = 0; 164//S32 LLFloaterRegionInfo::sRequestSerial = 0;
166LLUUID LLFloaterRegionInfo::sRequestInvoice; 165LLUUID LLFloaterRegionInfo::sRequestInvoice;
167 166
168LLFloaterRegionInfo::LLFloaterRegionInfo(const LLRect& rect) : 167LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed)
169 LLFloater("regioninfo", rect, "Region/Estate")
170{ 168{
171 LLRect tr(0, rect.getHeight() - LLFLOATER_HEADER_SIZE, rect.getWidth(), 0); 169 gUICtrlFactory->buildFloater(this, "floater_region_info.xml", NULL, FALSE);
172 mTab = new LLTabContainer("tab", tr, LLTabContainer::TOP, NULL,NULL,""); 170}
173 mTab->setBorderVisible(FALSE); 171
174 addChild(mTab); 172BOOL LLFloaterRegionInfo::postBuild()
173{
174 mTab = gUICtrlFactory->getTabContainerByName(this, "region_panels");
175 175
176 // contruct the panels 176 // contruct the panels
177 LLPanel* panel; 177 LLPanelRegionInfo* panel;
178 panel = new LLPanelRegionGeneralInfo; 178 panel = new LLPanelRegionGeneralInfo;
179 mInfoPanels.push_back((LLPanelRegionInfo*)panel); 179 mInfoPanels.push_back(panel);
180 gUICtrlFactory->buildPanel(panel, "panel_region_general.xml"); 180 gUICtrlFactory->buildPanel(panel, "panel_region_general.xml");
181 mTab->addTabPanel(panel, panel->getLabel(), TRUE); 181 mTab->addTabPanel(panel, panel->getLabel(), TRUE);
182 182
183 panel = new LLPanelRegionDebugInfo; 183 panel = new LLPanelRegionDebugInfo;
184 mInfoPanels.push_back((LLPanelRegionInfo*)panel); 184 mInfoPanels.push_back(panel);
185 gUICtrlFactory->buildPanel(panel, "panel_region_debug.xml"); 185 gUICtrlFactory->buildPanel(panel, "panel_region_debug.xml");
186 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 186 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
187 187
188 panel = new LLPanelRegionTextureInfo; 188 panel = new LLPanelRegionTextureInfo;
189 mInfoPanels.push_back((LLPanelRegionInfo*)panel); 189 mInfoPanels.push_back(panel);
190 gUICtrlFactory->buildPanel(panel, "panel_region_texture.xml"); 190 gUICtrlFactory->buildPanel(panel, "panel_region_texture.xml");
191 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 191 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
192 192
193 panel = new LLPanelRegionTerrainInfo; 193 panel = new LLPanelRegionTerrainInfo;
194 mInfoPanels.push_back((LLPanelRegionInfo*)panel); 194 mInfoPanels.push_back(panel);
195 gUICtrlFactory->buildPanel(panel, "panel_region_terrain.xml"); 195 gUICtrlFactory->buildPanel(panel, "panel_region_terrain.xml");
196 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 196 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
197 197
198 panel = new LLPanelEstateInfo; 198 panel = new LLPanelEstateInfo;
199 mInfoPanels.push_back((LLPanelRegionInfo*)panel); 199 mInfoPanels.push_back(panel);
200 gUICtrlFactory->buildPanel(panel, "panel_region_estate.xml"); 200 gUICtrlFactory->buildPanel(panel, "panel_region_estate.xml");
201 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 201 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
202 202
203 panel = new LLPanelEstateCovenant; 203 panel = new LLPanelEstateCovenant;
204 mInfoPanels.push_back((LLPanelRegionInfo*)panel); 204 mInfoPanels.push_back(panel);
205 gUICtrlFactory->buildPanel(panel, "panel_region_covenant.xml"); 205 gUICtrlFactory->buildPanel(panel, "panel_region_covenant.xml");
206 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 206 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
207 207
208 gMessageSystem->setHandlerFunc(
209 "EstateOwnerMessage",
210 &processEstateOwnerRequest);
211
212 return TRUE;
208} 213}
209 214
210LLFloaterRegionInfo::~LLFloaterRegionInfo() 215LLFloaterRegionInfo::~LLFloaterRegionInfo()
@@ -212,23 +217,20 @@ LLFloaterRegionInfo::~LLFloaterRegionInfo()
212 sInstance = NULL; 217 sInstance = NULL;
213} 218}
214 219
215// static 220void LLFloaterRegionInfo::onOpen()
216void LLFloaterRegionInfo::show(LLViewerRegion* region)
217{ 221{
218 if (!sInstance) 222 LLRect rect = gSavedSettings.getRect("FloaterRegionInfo");
219 { 223 S32 left, top;
220 LLRect rect = gSavedSettings.getRect("FloaterRegionInfo"); 224 gFloaterView->getNewFloaterPosition(&left, &top);
221 S32 left, top; 225 rect.translate(left,top);
222 gFloaterView->getNewFloaterPosition(&left, &top);
223 rect.translate(left,top);
224 sInstance = new LLFloaterRegionInfo(rect);
225 gMessageSystem->setHandlerFunc(
226 "EstateOwnerMessage",
227 &processEstateOwnerRequest);
228 }
229 sInstance->open(); /* Flawfinder: ignore*/
230 sInstance->refreshFromRegion(region);
231 226
227 requestRegionInfo();
228 refreshFromRegion(gAgent.getRegion());
229 LLFloater::onOpen();
230}
231
232void LLFloaterRegionInfo::requestRegionInfo()
233{
232 // Must allow anyone to request the RegionInfo data 234 // Must allow anyone to request the RegionInfo data
233 // so non-owners/non-gods can see the values. 235 // so non-owners/non-gods can see the values.
234 // Therefore can't use an EstateOwnerMessage JC 236 // Therefore can't use an EstateOwnerMessage JC
@@ -242,18 +244,6 @@ void LLFloaterRegionInfo::show(LLViewerRegion* region)
242} 244}
243 245
244// static 246// static
245void LLFloaterRegionInfo::show(void*)
246{
247 show(gAgent.getRegion());
248}
249
250// static
251LLFloaterRegionInfo* LLFloaterRegionInfo::getInstance()
252{
253 return sInstance;
254}
255
256// static
257void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**) 247void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
258{ 248{
259 static LLDispatcher dispatch; 249 static LLDispatcher dispatch;
@@ -264,7 +254,7 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
264 LLPanelEstateInfo::initDispatch(dispatch); 254 LLPanelEstateInfo::initDispatch(dispatch);
265 } 255 }
266 256
267 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(sInstance, "tab"); 257 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(sInstance, "region_panels");
268 if (!tab) return; 258 if (!tab) return;
269 259
270 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab, "Estate"); 260 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab, "Estate");
@@ -293,7 +283,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
293 283
294 llinfos << "LLFloaterRegionInfo::processRegionInfo" << llendl; 284 llinfos << "LLFloaterRegionInfo::processRegionInfo" << llendl;
295 if(!sInstance) return; 285 if(!sInstance) return;
296 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(sInstance, "tab"); 286 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(sInstance, "region_panels");
297 if(!tab) return; 287 if(!tab) return;
298 288
299 // extract message 289 // extract message
@@ -376,7 +366,7 @@ LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate()
376{ 366{
377 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); 367 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
378 if (!floater) return NULL; 368 if (!floater) return NULL;
379 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(floater, "tab"); 369 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(floater, "region_panels");
380 if (!tab) return NULL; 370 if (!tab) return NULL;
381 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab,"Estate"); 371 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab,"Estate");
382 return panel; 372 return panel;
@@ -387,7 +377,7 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant()
387{ 377{
388 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); 378 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
389 if (!floater) return NULL; 379 if (!floater) return NULL;
390 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(floater, "tab"); 380 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(floater, "region_panels");
391 if (!tab) return NULL; 381 if (!tab) return NULL;
392 LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)LLUICtrlFactory::getPanelByName(tab, "Covenant"); 382 LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)LLUICtrlFactory::getPanelByName(tab, "Covenant");
393 return panel; 383 return panel;
@@ -1241,7 +1231,7 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
1241 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); 1231 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
1242 if (!floater) return true; 1232 if (!floater) return true;
1243 1233
1244 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(floater, "tab"); 1234 LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(floater, "region_panels");
1245 if (!tab) return true; 1235 if (!tab) return true;
1246 1236
1247 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab, "Estate"); 1237 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab, "Estate");
@@ -2388,7 +2378,12 @@ BOOL LLPanelEstateInfo::checkRemovalButton(std::string name)
2388 } 2378 }
2389 else if (name == "estate_manager_name_list") 2379 else if (name == "estate_manager_name_list")
2390 { 2380 {
2391 btn_name = "remove_estate_manager_btn"; 2381 //ONLY OWNER CAN ADD /DELET ESTATE MANAGER
2382 LLViewerRegion* region = gAgent.getRegion();
2383 if (region && (region->getOwner() == gAgent.getID()))
2384 {
2385 btn_name = "remove_estate_manager_btn";
2386 }
2392 } 2387 }
2393 2388
2394 // enable the remove button if something is selected 2389 // enable the remove button if something is selected
@@ -2803,7 +2798,7 @@ bool LLDispatchSetEstateOwner::operator()(
2803 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); 2798 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
2804 if (!floater) return true; 2799 if (!floater) return true;
2805 2800
2806 LLTabContainer* tab = (LLTabContainer*)(floater->getChildByName("tab")); 2801 LLTabContainer* tab = (LLTabContainer*)(floater->getChildByName("region_panels"));
2807 if (!tab) return true; 2802 if (!tab) return true;
2808 2803
2809 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)(tab->getChildByName("Estate")); 2804 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)(tab->getChildByName("Estate"));