Skip to content
Snippets Groups Projects
Commit 73ba940f authored by Andrew Dyukov's avatar Andrew Dyukov
Browse files

A little refactoring.

Removed unused code and xml data which were once used for date in status bar.
parent f0ba3d35
No related branches found
No related tags found
No related merge requests found
...@@ -107,10 +107,6 @@ const S32 TEXT_HEIGHT = 18; ...@@ -107,10 +107,6 @@ const S32 TEXT_HEIGHT = 18;
static void onClickVolume(void*); 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) LLStatusBar::LLStatusBar(const LLRect& rect)
: LLPanel(), : LLPanel(),
mTextTime(NULL), mTextTime(NULL),
...@@ -127,10 +123,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) ...@@ -127,10 +123,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
// status bar can possible overlay menus? // status bar can possible overlay menus?
setMouseOpaque(FALSE); setMouseOpaque(FALSE);
// size of day of the weeks and year
sDays.reserve(7);
sMonths.reserve(12);
mBalanceTimer = new LLFrameTimer(); mBalanceTimer = new LLFrameTimer();
mHealthTimer = new LLFrameTimer(); mHealthTimer = new LLFrameTimer();
...@@ -169,9 +161,6 @@ BOOL LLStatusBar::postBuild() ...@@ -169,9 +161,6 @@ BOOL LLStatusBar::postBuild()
{ {
gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); 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" ); mTextTime = getChild<LLTextBox>("TimeText" );
getChild<LLUICtrl>("buyL")->setCommitCallback( getChild<LLUICtrl>("buyL")->setCommitCallback(
...@@ -517,69 +506,6 @@ void LLStatusBar::onClickMediaToggle(void* data) ...@@ -517,69 +506,6 @@ void LLStatusBar::onClickMediaToggle(void* data)
LLViewerMedia::setAllMediaEnabled(enable); 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 // static
void LLStatusBar::onClickStatGraph(void* data) void LLStatusBar::onClickStatGraph(void* data)
{ {
......
...@@ -85,9 +85,7 @@ class LLStatusBar ...@@ -85,9 +85,7 @@ class LLStatusBar
LLPanelNearByMedia* getNearbyMediaPanel() { return mPanelNearByMedia; } LLPanelNearByMedia* getNearbyMediaPanel() { return mPanelNearByMedia; }
private: private:
// simple method to setup the part that holds the date
void setupDate();
void onClickBuyCurrency(); void onClickBuyCurrency();
void onVolumeChanged(const LLSD& newvalue); void onVolumeChanged(const LLSD& newvalue);
...@@ -117,9 +115,6 @@ class LLStatusBar ...@@ -117,9 +115,6 @@ class LLStatusBar
LLFrameTimer* mHealthTimer; LLFrameTimer* mHealthTimer;
LLPanelVolumePulldown* mPanelVolumePulldown; LLPanelVolumePulldown* mPanelVolumePulldown;
LLPanelNearByMedia* mPanelNearByMedia; LLPanelNearByMedia* mPanelNearByMedia;
static std::vector<std::string> sDays;
static std::vector<std::string> sMonths;
static const U32 MAX_DATE_STRING_LENGTH;
}; };
// *HACK: Status bar owns your cached money balance. JC // *HACK: Status bar owns your cached money balance. JC
......
...@@ -13,14 +13,6 @@ ...@@ -13,14 +13,6 @@
top="19" top="19"
tab_stop="false" tab_stop="false"
width="1000"> width="1000">
<panel.string
name="StatBarDaysOfWeek">
Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday
</panel.string>
<panel.string
name="StatBarMonthsOfYear">
January:February:March:April:May:June:July:August:September:October:November:December
</panel.string>
<panel.string <panel.string
name="packet_loss_tooltip"> name="packet_loss_tooltip">
Packet Loss Packet Loss
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment