From cf40fc0447606fd3b435a32c5dec7b48565cae4c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 21 Feb 2013 13:22:25 -0500 Subject: add menu bar background colors for new build/channel scheme --- indra/newview/llviewerwindow.cpp | 47 +++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 48a69129eb..8c72421888 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2235,29 +2235,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); + bool isProject = (channel.find("Project") != std::string::npos); // TBD - should be a regex + bool isBeta = (channel.find("Beta") != std::string::npos); // TBD - should be a regex + bool isTest = (channel.find("Test") != std::string::npos); // TBD - should be a regex // 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 (isBeta) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBetaBgColor" ); + } + else if (isProject) { 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 (isTest) + { + 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) { -- cgit v1.2.3 From 49ed1a4e32013cda716998784338a01b12c663ef Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 27 Feb 2013 17:40:39 -0500 Subject: finish changes to update handling, including notices of channel changes --- indra/newview/llviewerwindow.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8c72421888..2d9c127b87 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "llagent.h" #include "llagentcamera.h" @@ -2235,9 +2236,9 @@ 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); // TBD - should be a regex - bool isBeta = (channel.find("Beta") != std::string::npos); // TBD - should be a regex - bool isTest = (channel.find("Test") != std::string::npos); // TBD - should be a regex + 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 ) @@ -2251,15 +2252,15 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" ); } } - else if (isBeta) + else if (boost::regex_search(channel, is_beta_channel)) { new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBetaBgColor" ); } - else if (isProject) + else if (boost::regex_search(channel, is_project_channel)) { new_bg_color = LLUIColorTable::instance().getColor( "MenuBarProjectBgColor" ); } - else if (isTest) + else if (boost::regex_search(channel, is_test_channel)) { new_bg_color = LLUIColorTable::instance().getColor( "MenuBarTestBgColor" ); } -- cgit v1.2.3