summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llspeakers.cpp5
-rw-r--r--indra/newview/llstatusbar.cpp89
-rw-r--r--indra/newview/llstatusbar.h2
-rw-r--r--indra/newview/llviewernetwork.cpp22
-rw-r--r--indra/newview/llviewernetwork.h3
-rw-r--r--indra/newview/skins/default/xui/en/panel_chat_header.xml25
6 files changed, 65 insertions, 81 deletions
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index bf00b47c21..5128ab6a18 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -74,7 +74,10 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy
void LLSpeaker::lookupName()
{
- gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4));
+ if (mDisplayName.empty())
+ {
+ gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4));
+ }
}
void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group)
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index fc5937ea7d..213925ecdf 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -195,9 +195,6 @@ BOOL LLStatusBar::postBuild()
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
- childSetAction("scriptout", onClickScriptDebug, this);
- childSetAction("health", onClickHealth, this);
-
// Adding Net Stat Graph
S32 x = getRect().getWidth() - 2;
S32 y = 0;
@@ -247,14 +244,17 @@ BOOL LLStatusBar::postBuild()
mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
mPanelNearByMedia->setVisible(FALSE);
+ mScriptOut = getChildView("scriptout");
+
return TRUE;
}
// Per-frame updates of visibility
void LLStatusBar::refresh()
{
- bool net_stats_visible = gSavedSettings.getBOOL("ShowNetStats");
-
+ static LLCachedControl<bool> show_net_stats(gSavedSettings, "ShowNetStats", false);
+ bool net_stats_visible = show_net_stats;
+
if (net_stats_visible)
{
// Adding Net Stat Meter back in
@@ -266,26 +266,30 @@ void LLStatusBar::refresh()
mSGBandwidth->setThreshold(2, bwtotal);
}
- // Get current UTC time, adjusted for the user's clock
- // being off.
- time_t utc_time;
- utc_time = time_corrected();
-
- std::string timeStr = getString("time");
- LLSD substitution;
- substitution["datetime"] = (S32) utc_time;
- LLStringUtil::format (timeStr, substitution);
- mTextTime->setText(timeStr);
-
- // set the tooltip to have the date
- std::string dtStr = getString("timeTooltip");
- LLStringUtil::format (dtStr, substitution);
- mTextTime->setToolTip (dtStr);
+ // update clock every 10 seconds
+ if(mClockUpdateTimer.getElapsedTimeF32() > 10.f)
+ {
+ mClockUpdateTimer.reset();
+
+ // Get current UTC time, adjusted for the user's clock
+ // being off.
+ time_t utc_time;
+ utc_time = time_corrected();
+
+ std::string timeStr = getString("time");
+ LLSD substitution;
+ substitution["datetime"] = (S32) utc_time;
+ LLStringUtil::format (timeStr, substitution);
+ mTextTime->setText(timeStr);
+
+ // set the tooltip to have the date
+ std::string dtStr = getString("timeTooltip");
+ LLStringUtil::format (dtStr, substitution);
+ mTextTime->setToolTip (dtStr);
+ }
LLRect r;
const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge();
- S32 x = MENU_RIGHT + MENU_PARCEL_SPACING;
- S32 y = 0;
// reshape menu bar to its content's width
if (MENU_RIGHT != gMenuBarView->getRect().getWidth())
@@ -293,47 +297,6 @@ void LLStatusBar::refresh()
gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight());
}
- LLViewerRegion *region = gAgent.getRegion();
- LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
-
- LLRect buttonRect;
-
- if (LLHUDIcon::iconsNearby())
- {
- LLView* script_out = getChildView("scriptout");
- buttonRect = script_out->getRect();
- r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
- script_out->setShape(r);
- script_out->setVisible( true);
- x += buttonRect.getWidth();
- }
- else
- {
- getChildView("scriptout")->setVisible( false);
- }
-
- if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK &&
- ((region && region->getAllowDamage()) || (parcel && parcel->getAllowDamage())))
- {
- // set visibility based on flashing
- if( mHealthTimer->hasExpired() )
- {
- getChildView("health")->setVisible( true);
- }
- else
- {
- BOOL flash = S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1;
- getChildView("health")->setVisible( flash);
- }
-
- // Health
- LLView* healthp = getChildView("health");
- buttonRect = healthp->getRect();
- r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
- healthp->setShape(r);
- x += buttonRect.getWidth();
- }
-
mSGBandwidth->setVisible(net_stats_visible);
mSGPacketLoss->setVisible(net_stats_visible);
getChildView("stat_btn")->setEnabled(net_stats_visible);
diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h
index 32f29e9e1c..2e2187bafe 100644
--- a/indra/newview/llstatusbar.h
+++ b/indra/newview/llstatusbar.h
@@ -112,6 +112,8 @@ private:
LLButton *mBtnVolume;
LLButton *mMediaToggle;
+ LLView* mScriptOut;
+ LLFrameTimer mClockUpdateTimer;
S32 mBalance;
S32 mHealth;
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index fec112b9e7..1fac4d003d 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -49,6 +49,7 @@ const char* DEFAULT_SLURL_BASE = "https://%s/region/";
const char* DEFAULT_APP_SLURL_BASE = "x-grid-location-info://%s/app";
LLGridManager::LLGridManager()
+: mIsInProductionGrid(false)
{
// by default, we use the 'grids.xml' file in the user settings directory
// this file is an LLSD file containing multiple grid definitions.
@@ -308,6 +309,10 @@ void LLGridManager::initialize(const std::string& grid_file)
addGrid(grid);
}
+ gSavedSettings.getControl("CurrentGrid")->getSignal()->connect(boost::bind(&LLGridManager::updateIsInProductionGrid, this));
+ // since above only triggers on changes, trigger the callback manually to initialize state
+ updateIsInProductionGrid();
+
LL_DEBUGS("GridManager") << "Selected grid is " << mGrid << LL_ENDL;
setGridChoice(mGrid);
if(mGridList[mGrid][GRID_LOGIN_URI_VALUE].isArray())
@@ -559,23 +564,30 @@ std::string LLGridManager::getLoginPage()
return mGridList[mGrid][GRID_LOGIN_PAGE_VALUE];
}
-bool LLGridManager::isInProductionGrid()
+void LLGridManager::updateIsInProductionGrid()
{
+ mIsInProductionGrid = false;
+
// *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice,
// but it seems that loginURI trumps that.
std::vector<std::string> uris;
getLoginURIs(uris);
- if (uris.size() < 1)
+ if (uris.empty())
{
- return 1;
+ mIsInProductionGrid = true;
+ return;
}
LLStringUtil::toLower(uris[0]);
if((uris[0].find("agni") != std::string::npos))
{
- return true;
+ mIsInProductionGrid = true;
+ return;
}
+}
- return false;
+bool LLGridManager::isInProductionGrid()
+{
+ return mIsInProductionGrid;
}
void LLGridManager::saveFavorites()
diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h
index 8c3a15b7cf..f6cbd57ac0 100644
--- a/indra/newview/llviewernetwork.h
+++ b/indra/newview/llviewernetwork.h
@@ -136,6 +136,8 @@ public:
protected:
+ void updateIsInProductionGrid();
+
// helper function for adding the predefined grids
void addSystemGrid(const std::string& label,
const std::string& name,
@@ -148,6 +150,7 @@ protected:
std::string mGrid;
std::string mGridFile;
LLSD mGridList;
+ bool mIsInProductionGrid;
};
const S32 MAC_ADDRESS_BYTES = 6;
diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml
index c98213f6c7..17e8d4d2df 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_header.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml
@@ -38,16 +38,17 @@
use_ellipses="true"
valign="bottom"
value="Ericag Vader" />
- <text
- font="SansSerifSmall"
- follows="right"
- halign="right"
- height="13"
- layout="topleft"
- left_pad="5"
- name="time_box"
- right="-5"
- top="8"
- value="23:30"
- width="110" />
+ <text
+ allow_scroll="false"
+ font="SansSerifSmall"
+ follows="right"
+ halign="right"
+ height="13"
+ layout="topleft"
+ left_pad="5"
+ name="time_box"
+ right="-5"
+ top="8"
+ value="23:30"
+ width="110" />
</panel>