diff options
author | Oz Linden <oz@lindenlab.com> | 2013-04-30 08:57:29 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-04-30 08:57:29 -0400 |
commit | 889d02b52d9d53b59e1bab953b8e19a60c49fd4f (patch) | |
tree | 7991f8b9b0972027cc2bc7301a99779e9850141f /indra/newview/llviewerwindow.cpp | |
parent | ca7de31a6c5031bb928d283362e96bb63e37ce85 (diff) | |
parent | 2ef8fc41e74b6949e02a7715b2b8399094ebd3ea (diff) |
merge changes for CHOP-913
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0910b7536d..fe4d5b3e4d 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -34,6 +34,7 @@ #include <fstream> #include <algorithm> #include <boost/lambda/core.hpp> +#include <boost/regex.hpp> #include "llagent.h" #include "llagentcamera.h" @@ -2249,29 +2250,42 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) // no l10n problem because channel is always an english string std::string channel = LLVersionInfo::getChannel(); - bool isProject = (channel.find("Project") != std::string::npos); + static const boost::regex is_beta_channel("\\bBeta\\b"); + static const boost::regex is_project_channel("\\bProject\\b"); + static const boost::regex is_test_channel("\\bTest$"); // god more important than project, proj more important than grid - if(god_mode && LLGridManager::getInstance()->isInProductionGrid()) + if ( god_mode ) { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarGodBgColor" ); - } - else if(god_mode && !LLGridManager::getInstance()->isInProductionGrid()) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" ); + if ( LLGridManager::getInstance()->isInProductionGrid() ) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarGodBgColor" ); + } + else + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" ); + } } - else if (!god_mode && isProject) + else if (boost::regex_search(channel, is_beta_channel)) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBetaBgColor" ); + } + else if (boost::regex_search(channel, is_project_channel)) { new_bg_color = LLUIColorTable::instance().getColor( "MenuBarProjectBgColor" ); - } - else if(!god_mode && !LLGridManager::getInstance()->isInProductionGrid()) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); - } - else - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); - } + } + else if (boost::regex_search(channel, is_test_channel)) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarTestBgColor" ); + } + else if(!LLGridManager::getInstance()->isInProductionGrid()) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); + } + else + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); + } if(gMenuBarView) { |