summaryrefslogtreecommitdiff
path: root/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-09-24 11:23:07 -0700
committerMerov Linden <merov@lindenlab.com>2010-09-24 11:23:07 -0700
commitb85cf7b12562a3359e52147d26eb1051ce388559 (patch)
tree3f656bb586e7cd2a25763d8053365e106365a063 /indra/newview/llstatusbar.cpp
parent24473fc0d619beaafab029170a7aacde5855be1a (diff)
parentb34856d66dfa1a725cb85d813982709566b6db7a (diff)
Pull update from viewer-development
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--indra/newview/llstatusbar.cpp86
1 files changed, 11 insertions, 75 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index b622e98971..c3e4775fe1 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -33,6 +33,7 @@
#include "llagentcamera.h"
#include "llbutton.h"
#include "llcommandhandler.h"
+#include "llfirstuse.h"
#include "llviewercontrol.h"
#include "llfloaterbuycurrency.h"
#include "llbuycurrencyhtml.h"
@@ -41,6 +42,7 @@
#include "llpanelvolumepulldown.h"
#include "llfloaterregioninfo.h"
#include "llfloaterscriptdebug.h"
+#include "llhints.h"
#include "llhudicon.h"
#include "llnavigationbar.h"
#include "llkeyboard.h"
@@ -107,10 +109,6 @@ const S32 TEXT_HEIGHT = 18;
static void onClickVolume(void*);
-std::vector<std::string> LLStatusBar::sDays;
-std::vector<std::string> LLStatusBar::sMonths;
-const U32 LLStatusBar::MAX_DATE_STRING_LENGTH = 2000;
-
LLStatusBar::LLStatusBar(const LLRect& rect)
: LLPanel(),
mTextTime(NULL),
@@ -127,14 +125,10 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
// status bar can possible overlay menus?
setMouseOpaque(FALSE);
- // size of day of the weeks and year
- sDays.reserve(7);
- sMonths.reserve(12);
-
mBalanceTimer = new LLFrameTimer();
mHealthTimer = new LLFrameTimer();
- LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml");
+ buildFromFile("panel_status_bar.xml");
}
LLStatusBar::~LLStatusBar()
@@ -169,9 +163,6 @@ BOOL LLStatusBar::postBuild()
{
gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3));
- // build date necessary data (must do after panel built)
- setupDate();
-
mTextTime = getChild<LLTextBox>("TimeText" );
getChild<LLUICtrl>("buyL")->setCommitCallback(
@@ -185,6 +176,8 @@ BOOL LLStatusBar::postBuild()
mMediaToggle->setClickedCallback( &LLStatusBar::onClickMediaToggle, this );
mMediaToggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this));
+ LLHints::registerHintTarget("linden_balance", getChild<LLView>("balance_bg")->getHandle());
+
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
// Adding Net Stat Graph
@@ -332,6 +325,11 @@ void LLStatusBar::creditBalance(S32 credit)
void LLStatusBar::setBalance(S32 balance)
{
+ if (balance > getBalance() && getBalance() != 0)
+ {
+ LLFirstUse::receiveLindens();
+ }
+
std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance );
LLTextBox* balance_box = getChild<LLTextBox>("balance");
@@ -454,6 +452,7 @@ void LLStatusBar::onClickBuyCurrency()
// open a currency floater - actual one open depends on
// value specified in settings.xml
LLBuyCurrencyHTML::openCurrencyFloater();
+ LLFirstUse::receiveLindens(false);
}
void LLStatusBar::onMouseEnterVolume()
@@ -517,69 +516,6 @@ void LLStatusBar::onClickMediaToggle(void* data)
LLViewerMedia::setAllMediaEnabled(enable);
}
-// sets the static variables necessary for the date
-void LLStatusBar::setupDate()
-{
- // fill the day array with what's in the xui
- std::string day_list = getString("StatBarDaysOfWeek");
- size_t length = day_list.size();
-
- // quick input check
- if(length < MAX_DATE_STRING_LENGTH)
- {
- // tokenize it and put it in the array
- std::string cur_word;
- for(size_t i = 0; i < length; ++i)
- {
- if(day_list[i] == ':')
- {
- sDays.push_back(cur_word);
- cur_word.clear();
- }
- else
- {
- cur_word.append(1, day_list[i]);
- }
- }
- sDays.push_back(cur_word);
- }
-
- // fill the day array with what's in the xui
- std::string month_list = getString( "StatBarMonthsOfYear" );
- length = month_list.size();
-
- // quick input check
- if(length < MAX_DATE_STRING_LENGTH)
- {
- // tokenize it and put it in the array
- std::string cur_word;
- for(size_t i = 0; i < length; ++i)
- {
- if(month_list[i] == ':')
- {
- sMonths.push_back(cur_word);
- cur_word.clear();
- }
- else
- {
- cur_word.append(1, month_list[i]);
- }
- }
- sMonths.push_back(cur_word);
- }
-
- // make sure we have at least 7 days and 12 months
- if(sDays.size() < 7)
- {
- sDays.resize(7);
- }
-
- if(sMonths.size() < 12)
- {
- sMonths.resize(12);
- }
-}
-
// static
void LLStatusBar::onClickStatGraph(void* data)
{