diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-02-17 11:56:21 +0200 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-02-17 11:56:21 +0200 |
commit | 200f7dedf258ec7cbbe2266fce6a189386df7249 (patch) | |
tree | d6bf78ea03f23838bcb37d94b7c5217f559715d2 /indra/newview | |
parent | fb487d9270e1fc433ae23319df4cabf989319c37 (diff) |
MAINT-6142 Assorted viewer crashes when viewer is in a disconnected state & certain floaters are opened.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llfloaterland.cpp | 162 | ||||
-rwxr-xr-x | indra/newview/llfloaterregioninfo.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/llfloaterregioninfo.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelgroupexperiences.cpp | 4 |
4 files changed, 112 insertions, 79 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index f9fd5069af..7f952d4dd4 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -39,6 +39,7 @@ #include "llagent.h" #include "llagentaccess.h" +#include "llappviewer.h" #include "llbutton.h" #include "llcheckboxctrl.h" #include "llcombobox.h" @@ -475,13 +476,36 @@ BOOL LLPanelLandGeneral::postBuild() mBtnBuyLand = getChild<LLButton>("Buy Land..."); mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND); + + mBtnBuyGroupLand = getChild<LLButton>("Buy For Group..."); + mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); + + + mBtnBuyPass = getChild<LLButton>("Buy Pass..."); + mBtnBuyPass->setClickedCallback(onClickBuyPass, this); + + mBtnReleaseLand = getChild<LLButton>("Abandon Land..."); + mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); + + mBtnReclaimLand = getChild<LLButton>("Reclaim Land..."); + mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); + + mBtnStartAuction = getChild<LLButton>("Linden Sale..."); + mBtnStartAuction->setClickedCallback(onClickStartAuction, this); + + mBtnScriptLimits = getChild<LLButton>("Scripts..."); + + if(gDisconnected) + { + return TRUE; + } + // note: on region change this will not be re checked, should not matter on Agni as // 99% of the time all regions will return the same caps. In case of an erroneous setting // to enabled the floater will just throw an error when trying to get it's cap std::string url = gAgent.getRegion()->getCapability("LandResources"); if (!url.empty()) { - mBtnScriptLimits = getChild<LLButton>("Scripts..."); if(mBtnScriptLimits) { mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this); @@ -489,28 +513,11 @@ BOOL LLPanelLandGeneral::postBuild() } else { - mBtnScriptLimits = getChild<LLButton>("Scripts..."); if(mBtnScriptLimits) { mBtnScriptLimits->setVisible(false); } } - - mBtnBuyGroupLand = getChild<LLButton>("Buy For Group..."); - mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); - - - mBtnBuyPass = getChild<LLButton>("Buy Pass..."); - mBtnBuyPass->setClickedCallback(onClickBuyPass, this); - - mBtnReleaseLand = getChild<LLButton>("Abandon Land..."); - mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); - - mBtnReclaimLand = getChild<LLButton>("Reclaim Land..."); - mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); - - mBtnStartAuction = getChild<LLButton>("Linden Sale..."); - mBtnStartAuction->setClickedCallback(onClickStartAuction, this); return TRUE; } @@ -524,9 +531,58 @@ LLPanelLandGeneral::~LLPanelLandGeneral() // public void LLPanelLandGeneral::refresh() { - mBtnStartAuction->setVisible(gAgent.isGodlike()); + mEditName->setEnabled(FALSE); + mEditName->setText(LLStringUtil::null); - LLParcel *parcel = mParcel->getParcel(); + mEditDesc->setEnabled(FALSE); + mEditDesc->setText(getString("no_selection_text")); + + mTextSalePending->setText(LLStringUtil::null); + mTextSalePending->setEnabled(FALSE); + + mBtnDeedToGroup->setEnabled(FALSE); + mBtnSetGroup->setEnabled(FALSE); + mBtnStartAuction->setEnabled(FALSE); + + mCheckDeedToGroup ->set(FALSE); + mCheckDeedToGroup ->setEnabled(FALSE); + mCheckContributeWithDeed->set(FALSE); + mCheckContributeWithDeed->setEnabled(FALSE); + + mTextOwner->setText(LLStringUtil::null); + mContentRating->setText(LLStringUtil::null); + mLandType->setText(LLStringUtil::null); + mBtnProfile->setLabel(getString("profile_text")); + mBtnProfile->setEnabled(FALSE); + + mTextClaimDate->setText(LLStringUtil::null); + mTextGroup->setText(LLStringUtil::null); + mTextPrice->setText(LLStringUtil::null); + + mSaleInfoForSale1->setVisible(FALSE); + mSaleInfoForSale2->setVisible(FALSE); + mSaleInfoForSaleObjects->setVisible(FALSE); + mSaleInfoForSaleNoObjects->setVisible(FALSE); + mSaleInfoNotForSale->setVisible(FALSE); + mBtnSellLand->setVisible(FALSE); + mBtnStopSellLand->setVisible(FALSE); + + mTextPriceLabel->setText(LLStringUtil::null); + mTextDwell->setText(LLStringUtil::null); + + mBtnBuyLand->setEnabled(FALSE); + mBtnScriptLimits->setEnabled(FALSE); + mBtnBuyGroupLand->setEnabled(FALSE); + mBtnReleaseLand->setEnabled(FALSE); + mBtnReclaimLand->setEnabled(FALSE); + mBtnBuyPass->setEnabled(FALSE); + + if(gDisconnected) + { + return; + } + + mBtnStartAuction->setVisible(gAgent.isGodlike()); bool region_owner = false; LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(regionp && (regionp->getOwner() == gAgent.getID())) @@ -540,56 +596,8 @@ void LLPanelLandGeneral::refresh() mBtnReleaseLand->setVisible(TRUE); mBtnReclaimLand->setVisible(FALSE); } - if (!parcel) - { - // nothing selected, disable panel - mEditName->setEnabled(FALSE); - mEditName->setText(LLStringUtil::null); - - mEditDesc->setEnabled(FALSE); - mEditDesc->setText(getString("no_selection_text")); - - mTextSalePending->setText(LLStringUtil::null); - mTextSalePending->setEnabled(FALSE); - - mBtnDeedToGroup->setEnabled(FALSE); - mBtnSetGroup->setEnabled(FALSE); - mBtnStartAuction->setEnabled(FALSE); - - mCheckDeedToGroup ->set(FALSE); - mCheckDeedToGroup ->setEnabled(FALSE); - mCheckContributeWithDeed->set(FALSE); - mCheckContributeWithDeed->setEnabled(FALSE); - - mTextOwner->setText(LLStringUtil::null); - mContentRating->setText(LLStringUtil::null); - mLandType->setText(LLStringUtil::null); - mBtnProfile->setLabel(getString("profile_text")); - mBtnProfile->setEnabled(FALSE); - - mTextClaimDate->setText(LLStringUtil::null); - mTextGroup->setText(LLStringUtil::null); - mTextPrice->setText(LLStringUtil::null); - - mSaleInfoForSale1->setVisible(FALSE); - mSaleInfoForSale2->setVisible(FALSE); - mSaleInfoForSaleObjects->setVisible(FALSE); - mSaleInfoForSaleNoObjects->setVisible(FALSE); - mSaleInfoNotForSale->setVisible(FALSE); - mBtnSellLand->setVisible(FALSE); - mBtnStopSellLand->setVisible(FALSE); - - mTextPriceLabel->setText(LLStringUtil::null); - mTextDwell->setText(LLStringUtil::null); - - mBtnBuyLand->setEnabled(FALSE); - mBtnScriptLimits->setEnabled(FALSE); - mBtnBuyGroupLand->setEnabled(FALSE); - mBtnReleaseLand->setEnabled(FALSE); - mBtnReclaimLand->setEnabled(FALSE); - mBtnBuyPass->setEnabled(FALSE); - } - else + LLParcel *parcel = mParcel->getParcel(); + if (parcel) { // something selected, hooray! BOOL is_leased = (LLParcel::OS_LEASED == parcel->getOwnershipStatus()); @@ -1246,7 +1254,7 @@ void LLPanelLandObjects::refresh() mOwnerList->deleteAllItems(); mOwnerList->setEnabled(FALSE); - if (!parcel) + if (!parcel || gDisconnected) { mSWTotalObjects->setTextArg("[COUNT]", llformat("%d", 0)); mSWTotalObjects->setTextArg("[TOTAL]", llformat("%d", 0)); @@ -1974,7 +1982,7 @@ void LLPanelLandOptions::refresh() refreshSearch(); LLParcel *parcel = mParcel->getParcel(); - if (!parcel) + if (!parcel || gDisconnected) { mCheckEditObjects ->set(FALSE); mCheckEditObjects ->setEnabled(FALSE); @@ -2154,7 +2162,7 @@ void LLPanelLandOptions::draw() void LLPanelLandOptions::refreshSearch() { LLParcel *parcel = mParcel->getParcel(); - if (!parcel) + if (!parcel || gDisconnected) { mCheckShowDirectory->set(FALSE); mCheckShowDirectory->setEnabled(FALSE); @@ -2419,7 +2427,7 @@ void LLPanelLandAccess::refresh() LLParcel *parcel = mParcel->getParcel(); // Display options - if (parcel) + if (parcel && !gDisconnected) { BOOL use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); @@ -2599,7 +2607,7 @@ void LLPanelLandAccess::refresh_ui() getChildView("remove_banned")->setEnabled(FALSE); LLParcel *parcel = mParcel->getParcel(); - if (parcel) + if (parcel && !gDisconnected) { BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); @@ -2945,7 +2953,7 @@ BOOL LLPanelLandCovenant::postBuild() void LLPanelLandCovenant::refresh() { LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); - if(!region) return; + if(!region || gDisconnected) return; LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); if (region_name) @@ -3170,7 +3178,7 @@ void LLPanelLandExperiences::refreshPanel(LLPanelExperienceListEditor* panel, U3 { return; } - if (parcel == NULL) + if (!parcel || gDisconnected) { // disable the panel panel->setEnabled(FALSE); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index df5b226d98..bbde0baa8f 100755 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -232,6 +232,11 @@ BOOL LLFloaterRegionInfo::postBuild() panel->buildFromFile("panel_region_debug.xml"); mTab->addTabPanel(panel); + if(gDisconnected) + { + return TRUE; + } + if(!gAgent.getRegion()->getCapability("RegionExperiences").empty()) { panel = new LLPanelRegionExperiences; @@ -255,6 +260,11 @@ LLFloaterRegionInfo::~LLFloaterRegionInfo() void LLFloaterRegionInfo::onOpen(const LLSD& key) { + if(gDisconnected) + { + disableTabCtrls(); + return; + } refreshFromRegion(gAgent.getRegion()); requestRegionInfo(); requestMeshRezInfo(); @@ -478,7 +488,16 @@ LLPanelRegionExperiences* LLFloaterRegionInfo::getPanelExperiences() return (LLPanelRegionExperiences*)tab->getChild<LLPanel>("Experiences"); } +void LLFloaterRegionInfo::disableTabCtrls() +{ + LLTabContainer* tab = getChild<LLTabContainer>("region_panels"); + tab->getChild<LLPanel>("General")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Debug")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Terrain")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("panel_env_info")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Estate")->setCtrlsEnabled(FALSE); +} void LLFloaterRegionInfo::onTabSelected(const LLSD& param) { @@ -3129,6 +3148,11 @@ bool LLPanelEnvironmentInfo::refreshFromRegion(LLViewerRegion* region) void LLPanelEnvironmentInfo::refresh() { + if(gDisconnected) + { + return; + } + populateWaterPresetsList(); populateSkyPresetsList(); populateDayCyclesList(); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 4cd50c0882..7bbd1b79ee 100755 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -110,6 +110,7 @@ private: protected: void onTabSelected(const LLSD& param); + void disableTabCtrls(); void refreshFromRegion(LLViewerRegion* region); // member data diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index 76b68122fb..bba2447ba7 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -30,7 +30,7 @@ #include "lluictrlfactory.h" #include "roles_constants.h" - +#include "llappviewer.h" #include "llhttpclient.h" #include "llagent.h" #include "llviewerregion.h" @@ -96,7 +96,7 @@ BOOL LLPanelGroupExperiences::postBuild() void LLPanelGroupExperiences::activate() { - if (getGroupID() == LLUUID::null) + if ((getGroupID() == LLUUID::null) || gDisconnected) { return; } |