aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstatusbar.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/llstatusbar.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 '')
-rw-r--r--linden/indra/newview/llstatusbar.cpp55
1 files changed, 22 insertions, 33 deletions
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp
index 4e31151..c11d46d 100644
--- a/linden/indra/newview/llstatusbar.cpp
+++ b/linden/indra/newview/llstatusbar.cpp
@@ -74,7 +74,7 @@
74#include "llviewermenu.h" // for gMenuBarView 74#include "llviewermenu.h" // for gMenuBarView
75#include "llviewerparcelmgr.h" 75#include "llviewerparcelmgr.h"
76#include "llviewerthrottle.h" 76#include "llviewerthrottle.h"
77#include "llvieweruictrlfactory.h" 77#include "lluictrlfactory.h"
78#include "llvoiceclient.h" // for gVoiceClient 78#include "llvoiceclient.h" // for gVoiceClient
79 79
80#include "lltoolmgr.h" 80#include "lltoolmgr.h"
@@ -137,7 +137,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
137 mBalanceTimer = new LLFrameTimer(); 137 mBalanceTimer = new LLFrameTimer();
138 mHealthTimer = new LLFrameTimer(); 138 mHealthTimer = new LLFrameTimer();
139 139
140 gUICtrlFactory->buildPanel(this,"panel_status_bar.xml"); 140 LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml");
141 141
142 // status bar can never get a tab 142 // status bar can never get a tab
143 setFocusRoot(FALSE); 143 setFocusRoot(FALSE);
@@ -145,11 +145,11 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
145 // build date necessary data (must do after panel built) 145 // build date necessary data (must do after panel built)
146 setupDate(); 146 setupDate();
147 147
148 mTextParcelName = LLUICtrlFactory::getTextBoxByName( this, "ParcelNameText" ); 148 mTextParcelName = getChild<LLTextBox>("ParcelNameText" );
149 mTextBalance = LLUICtrlFactory::getTextBoxByName( this, "BalanceText" ); 149 mTextBalance = getChild<LLTextBox>("BalanceText" );
150 150
151 mTextHealth = LLUICtrlFactory::getTextBoxByName( this, "HealthText" ); 151 mTextHealth = getChild<LLTextBox>("HealthText" );
152 mTextTime = LLUICtrlFactory::getTextBoxByName( this, "TimeText" ); 152 mTextTime = getChild<LLTextBox>("TimeText" );
153 153
154 childSetAction("scriptout", onClickScriptDebug, this); 154 childSetAction("scriptout", onClickScriptDebug, this);
155 childSetAction("health", onClickHealth, this); 155 childSetAction("health", onClickHealth, this);
@@ -166,6 +166,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
166 166
167 childSetVisible("search_editor", gSavedSettings.getBOOL("ShowSearchBar")); 167 childSetVisible("search_editor", gSavedSettings.getBOOL("ShowSearchBar"));
168 childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar")); 168 childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar"));
169 childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar"));
169 170
170 childSetActionTextbox("ParcelNameText", onClickParcelInfo ); 171 childSetActionTextbox("ParcelNameText", onClickParcelInfo );
171 childSetActionTextbox("BalanceText", onClickBalance ); 172 childSetActionTextbox("BalanceText", onClickBalance );
@@ -177,7 +178,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
177 r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); 178 r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1);
178 mSGBandwidth = new LLStatGraph("BandwidthGraph", r); 179 mSGBandwidth = new LLStatGraph("BandwidthGraph", r);
179 mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); 180 mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
180 mSGBandwidth->setStat(&gViewerStats->mKBitStat); 181 mSGBandwidth->setStat(&LLViewerStats::getInstance()->mKBitStat);
181 LLString text = childGetText("bandwidth_tooltip") + " "; 182 LLString text = childGetText("bandwidth_tooltip") + " ";
182 LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven 183 LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven
183 mSGBandwidth->setLabel(bandwidth_tooltip.getString().c_str()); 184 mSGBandwidth->setLabel(bandwidth_tooltip.getString().c_str());
@@ -190,7 +191,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
190 r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); 191 r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1);
191 mSGPacketLoss = new LLStatGraph("PacketLossPercent", r); 192 mSGPacketLoss = new LLStatGraph("PacketLossPercent", r);
192 mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); 193 mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
193 mSGPacketLoss->setStat(&gViewerStats->mPacketsLostPercentStat); 194 mSGPacketLoss->setStat(&LLViewerStats::getInstance()->mPacketsLostPercentStat);
194 text = childGetText("packet_loss_tooltip") + " "; 195 text = childGetText("packet_loss_tooltip") + " ";
195 LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven 196 LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven
196 mSGPacketLoss->setLabel(packet_loss_tooltip.getString().c_str()); 197 mSGPacketLoss->setLabel(packet_loss_tooltip.getString().c_str());
@@ -220,18 +221,6 @@ LLStatusBar::~LLStatusBar()
220 // LLView destructor cleans up children 221 // LLView destructor cleans up children
221} 222}
222 223
223//virtual
224EWidgetType LLStatusBar::getWidgetType() const
225{
226 return WIDGET_TYPE_STATUS_BAR;
227}
228
229//virtual
230LLString LLStatusBar::getWidgetTag() const
231{
232 return LL_STATUS_BAR_TAG;
233}
234
235//----------------------------------------------------------------------- 224//-----------------------------------------------------------------------
236// Overrides 225// Overrides
237//----------------------------------------------------------------------- 226//-----------------------------------------------------------------------
@@ -321,7 +310,7 @@ void LLStatusBar::refresh()
321 } 310 }
322 311
323 LLViewerRegion *region = gAgent.getRegion(); 312 LLViewerRegion *region = gAgent.getRegion();
324 LLParcel *parcel = gParcelMgr->getAgentParcel(); 313 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
325 314
326 LLRect buttonRect; 315 LLRect buttonRect;
327 316
@@ -464,7 +453,7 @@ void LLStatusBar::refresh()
464 453
465 BOOL canBuyLand = parcel 454 BOOL canBuyLand = parcel
466 && !parcel->isPublic() 455 && !parcel->isPublic()
467 && gParcelMgr->canAgentBuyParcel(parcel, false); 456 && LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false);
468 childSetVisible("buyland", canBuyLand); 457 childSetVisible("buyland", canBuyLand);
469 if (canBuyLand) 458 if (canBuyLand)
470 { 459 {
@@ -524,7 +513,7 @@ void LLStatusBar::refresh()
524 mRegionDetails.mZ = pos_z; 513 mRegionDetails.mZ = pos_z;
525 mRegionDetails.mArea = parcel->getArea(); 514 mRegionDetails.mArea = parcel->getArea();
526 mRegionDetails.mForSale = parcel->getForSale(); 515 mRegionDetails.mForSale = parcel->getForSale();
527 mRegionDetails.mTraffic = gParcelMgr->getDwelling(); 516 mRegionDetails.mTraffic = LLViewerParcelMgr::getInstance()->getDwelling();
528 517
529 if (parcel->isPublic()) 518 if (parcel->isPublic())
530 { 519 {
@@ -599,15 +588,14 @@ void LLStatusBar::refresh()
599 if (search_visible) 588 if (search_visible)
600 { 589 {
601 childGetRect("search_btn", r); 590 childGetRect("search_btn", r);
602 r.translate( new_right - r.mRight, 0); 591 //r.translate( new_right - r.mRight, 0);
603 childSetRect("search_btn", r); 592 //childSetRect("search_btn", r);
604 new_right -= r.getWidth(); 593 new_right -= r.getWidth();
605 594
606 childGetRect("search_editor", r); 595 childGetRect("search_editor", r);
607 r.translate( new_right - r.mRight, 0); 596 //r.translate( new_right - r.mRight, 0);
608 childSetRect("search_editor", r); 597 //childSetRect("search_editor", r);
609 new_right -= r.getWidth() + 6; 598 new_right -= r.getWidth() + 6;
610
611 } 599 }
612 else 600 else
613 { 601 {
@@ -645,6 +633,7 @@ void LLStatusBar::refresh()
645 // Set search bar visibility 633 // Set search bar visibility
646 childSetVisible("search_editor", search_visible); 634 childSetVisible("search_editor", search_visible);
647 childSetVisible("search_btn", search_visible); 635 childSetVisible("search_btn", search_visible);
636 childSetVisible("menubar_search_bevel_bg", search_visible);
648 mSGBandwidth->setVisible(! search_visible); 637 mSGBandwidth->setVisible(! search_visible);
649 mSGPacketLoss->setVisible(! search_visible); 638 mSGPacketLoss->setVisible(! search_visible);
650 childSetEnabled("stat_btn", ! search_visible); 639 childSetEnabled("stat_btn", ! search_visible);
@@ -674,7 +663,7 @@ void LLStatusBar::creditBalance(S32 credit)
674 663
675void LLStatusBar::setBalance(S32 balance) 664void LLStatusBar::setBalance(S32 balance)
676{ 665{
677 LLString money_str = gResMgr->getMonetaryString( balance ); 666 LLString money_str = LLResMgr::getInstance()->getMonetaryString( balance );
678 LLString balance_str = "L$"; 667 LLString balance_str = "L$";
679 balance_str += money_str; 668 balance_str += money_str;
680 mTextBalance->setText( balance_str ); 669 mTextBalance->setText( balance_str );
@@ -768,7 +757,7 @@ S32 LLStatusBar::getSquareMetersLeft() const
768 757
769static void onClickParcelInfo(void* data) 758static void onClickParcelInfo(void* data)
770{ 759{
771 gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); 760 LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
772 761
773 LLFloaterLand::showInstance(); 762 LLFloaterLand::showInstance();
774} 763}
@@ -832,8 +821,8 @@ static void onClickScripts(void*)
832 821
833static void onClickBuyLand(void*) 822static void onClickBuyLand(void*)
834{ 823{
835 gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); 824 LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
836 gParcelMgr->startBuyLand(); 825 LLViewerParcelMgr::getInstance()->startBuyLand();
837} 826}
838 827
839// sets the static variables necessary for the date 828// sets the static variables necessary for the date
@@ -917,7 +906,7 @@ void LLStatusBar::onClickSearch(void* data)
917// static 906// static
918void LLStatusBar::onClickStatGraph(void* data) 907void LLStatusBar::onClickStatGraph(void* data)
919{ 908{
920 LLFloaterLagMeter::show(data); 909 LLFloaterLagMeter::showInstance();
921} 910}
922 911
923BOOL can_afford_transaction(S32 cost) 912BOOL can_afford_transaction(S32 cost)