aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterbuyland.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llfloaterbuyland.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llfloaterbuyland.cpp')
-rw-r--r--linden/indra/newview/llfloaterbuyland.cpp55
1 files changed, 37 insertions, 18 deletions
diff --git a/linden/indra/newview/llfloaterbuyland.cpp b/linden/indra/newview/llfloaterbuyland.cpp
index 2786a34..ee78eaa 100644
--- a/linden/indra/newview/llfloaterbuyland.cpp
+++ b/linden/indra/newview/llfloaterbuyland.cpp
@@ -53,7 +53,7 @@
53#include "lltexturectrl.h" 53#include "lltexturectrl.h"
54#include "llviewchildren.h" 54#include "llviewchildren.h"
55#include "llviewercontrol.h" 55#include "llviewercontrol.h"
56#include "llvieweruictrlfactory.h" 56#include "lluictrlfactory.h"
57#include "llviewerparcelmgr.h" 57#include "llviewerparcelmgr.h"
58#include "llviewerregion.h" 58#include "llviewerregion.h"
59#include "llviewertexteditor.h" 59#include "llviewertexteditor.h"
@@ -187,6 +187,7 @@ public:
187 virtual void draw(); 187 virtual void draw();
188 virtual BOOL canClose(); 188 virtual BOOL canClose();
189 virtual void onClose(bool app_quitting); 189 virtual void onClose(bool app_quitting);
190 /*virtual*/ void setMinimized(BOOL b);
190 191
191private: 192private:
192 class SelectionObserver : public LLParcelObserver 193 class SelectionObserver : public LLParcelObserver
@@ -290,7 +291,7 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded)
290 { 291 {
291 sInstance = new LLFloaterBuyLandUI(); 292 sInstance = new LLFloaterBuyLandUI();
292 293
293 gUICtrlFactory->buildFloater(sInstance, "floater_buy_land.xml"); 294 LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_land.xml");
294 sInstance->center(); 295 sInstance->center();
295 296
296 static bool observingCacheName = false; 297 static bool observingCacheName = false;
@@ -304,7 +305,7 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded)
304 if (!parcelSelectionObserver) 305 if (!parcelSelectionObserver)
305 { 306 {
306 parcelSelectionObserver = new SelectionObserver; 307 parcelSelectionObserver = new SelectionObserver;
307 gParcelMgr->addObserver(parcelSelectionObserver); 308 LLViewerParcelMgr::getInstance()->addObserver(parcelSelectionObserver);
308 } 309 }
309 } 310 }
310 311
@@ -333,7 +334,7 @@ LLFloaterBuyLandUI::~LLFloaterBuyLandUI()
333{ 334{
334 delete mTransaction; 335 delete mTransaction;
335 336
336 gParcelMgr->deleteParcelBuy(mParcelBuyInfo); 337 LLViewerParcelMgr::getInstance()->deleteParcelBuy(mParcelBuyInfo);
337 338
338 if (sInstance == this) 339 if (sInstance == this)
339 { 340 {
@@ -346,14 +347,14 @@ void LLFloaterBuyLandUI::SelectionObserver::changed()
346 LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false); 347 LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false);
347 if (ui) 348 if (ui)
348 { 349 {
349 if (gParcelMgr->selectionEmpty()) 350 if (LLViewerParcelMgr::getInstance()->selectionEmpty())
350 { 351 {
351 ui->close(); 352 ui->close();
352 } 353 }
353 else { 354 else {
354 ui->setParcel( 355 ui->setParcel(
355 gParcelMgr->getSelectionRegion(), 356 LLViewerParcelMgr::getInstance()->getSelectionRegion(),
356 gParcelMgr->getParcelSelection()); 357 LLViewerParcelMgr::getInstance()->getParcelSelection());
357 } 358 }
358 } 359 }
359} 360}
@@ -430,7 +431,7 @@ void LLFloaterBuyLandUI::updateParcelInfo()
430 parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); 431 parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus());
431 // Can't have more than region max tasks, regardless of parcel 432 // Can't have more than region max tasks, regardless of parcel
432 // object bonus factor. 433 // object bonus factor.
433 LLViewerRegion* region = gParcelMgr->getSelectionRegion(); 434 LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
434 if(region) 435 if(region)
435 { 436 {
436 S32 max_tasks_per_region = (S32)region->getMaxTasks(); 437 S32 max_tasks_per_region = (S32)region->getMaxTasks();
@@ -518,7 +519,7 @@ void LLFloaterBuyLandUI::updateParcelInfo()
518 519
519void LLFloaterBuyLandUI::updateCovenantInfo() 520void LLFloaterBuyLandUI::updateCovenantInfo()
520{ 521{
521 LLViewerRegion* region = gParcelMgr->getSelectionRegion(); 522 LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
522 if(!region) return; 523 if(!region) return;
523 524
524 LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); 525 LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
@@ -728,7 +729,7 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
728 } 729 }
729 730
730 BOOL remove_contribution = childGetValue("remove_contribution").asBoolean(); 731 BOOL remove_contribution = childGetValue("remove_contribution").asBoolean();
731 mParcelBuyInfo = gParcelMgr->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(), 732 mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(),
732 gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution); 733 gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution);
733 734
734 if (mParcelBuyInfo 735 if (mParcelBuyInfo
@@ -746,7 +747,7 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
746 747
747 if (mSiteMembershipUpgrade) 748 if (mSiteMembershipUpgrade)
748 { 749 {
749 LLComboBox* levels = LLUICtrlFactory::getComboBoxByName(this, "account_level"); 750 LLComboBox* levels = getChild<LLComboBox>( "account_level");
750 if (levels) 751 if (levels)
751 { 752 {
752 mUserPlanChoice = levels->getCurrentIndex(); 753 mUserPlanChoice = levels->getCurrentIndex();
@@ -797,8 +798,8 @@ void LLFloaterBuyLandUI::sendBuyLand()
797{ 798{
798 if (mParcelBuyInfo) 799 if (mParcelBuyInfo)
799 { 800 {
800 gParcelMgr->sendParcelBuy(mParcelBuyInfo); 801 LLViewerParcelMgr::getInstance()->sendParcelBuy(mParcelBuyInfo);
801 gParcelMgr->deleteParcelBuy(mParcelBuyInfo); 802 LLViewerParcelMgr::getInstance()->deleteParcelBuy(mParcelBuyInfo);
802 mBought = true; 803 mBought = true;
803 } 804 }
804} 805}
@@ -968,9 +969,27 @@ void LLFloaterBuyLandUI::draw()
968 } 969 }
969} 970}
970 971
972// virtual
971BOOL LLFloaterBuyLandUI::canClose() 973BOOL LLFloaterBuyLandUI::canClose()
972{ 974{
973 return (mTransaction ? FALSE : TRUE) && mCurrency.canCancel(); 975 bool can_close = (mTransaction ? FALSE : TRUE) && mCurrency.canCancel();
976 if (!can_close)
977 {
978 // explain to user why they can't do this, see DEV-9605
979 gViewerWindow->alertXml("CannotCloseFloaterBuyLand");
980 }
981 return can_close;
982}
983
984// virtual
985void LLFloaterBuyLandUI::setMinimized(BOOL minimize)
986{
987 bool restored = (isMinimized() && !minimize);
988 LLFloater::setMinimized(minimize);
989 if (restored)
990 {
991 refreshUI();
992 }
974} 993}
975 994
976void LLFloaterBuyLandUI::onClose(bool app_quitting) 995void LLFloaterBuyLandUI::onClose(bool app_quitting)
@@ -984,7 +1003,7 @@ void LLFloaterBuyLandUI::refreshUI()
984{ 1003{
985 // section zero: title area 1004 // section zero: title area
986 { 1005 {
987 LLTextureCtrl* snapshot = LLViewerUICtrlFactory::getTexturePickerByName(this, "info_image"); 1006 LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image");
988 if (snapshot) 1007 if (snapshot)
989 { 1008 {
990 snapshot->setImageAssetID( 1009 snapshot->setImageAssetID(
@@ -1042,7 +1061,7 @@ void LLFloaterBuyLandUI::refreshUI()
1042 ? LLViewChildren::BADGE_ERROR 1061 ? LLViewChildren::BADGE_ERROR
1043 : LLViewChildren::BADGE_WARN); 1062 : LLViewChildren::BADGE_WARN);
1044 1063
1045 LLTextBox* message = LLUICtrlFactory::getTextBoxByName(this, "error_message"); 1064 LLTextBox* message = getChild<LLTextBox>("error_message");
1046 if (message) 1065 if (message)
1047 { 1066 {
1048 message->setVisible(true); 1067 message->setVisible(true);
@@ -1076,7 +1095,7 @@ void LLFloaterBuyLandUI::refreshUI()
1076 : getString("cant_own_land") 1095 : getString("cant_own_land")
1077 ); 1096 );
1078 1097
1079 LLComboBox* levels = LLUICtrlFactory::getComboBoxByName(this, "account_level"); 1098 LLComboBox* levels = getChild<LLComboBox>( "account_level");
1080 if (levels) 1099 if (levels)
1081 { 1100 {
1082 levels->setVisible(mSiteMembershipUpgrade); 1101 levels->setVisible(mSiteMembershipUpgrade);
@@ -1277,7 +1296,7 @@ void LLFloaterBuyLandUI::startBuyPreConfirm()
1277 action += mSiteMembershipAction; 1296 action += mSiteMembershipAction;
1278 action += "\n"; 1297 action += "\n";
1279 1298
1280 LLComboBox* levels = LLUICtrlFactory::getComboBoxByName(this, "account_level"); 1299 LLComboBox* levels = getChild<LLComboBox>( "account_level");
1281 if (levels) 1300 if (levels)
1282 { 1301 {
1283 action += " * "; 1302 action += " * ";