diff options
-rwxr-xr-x | indra/newview/llappviewer.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llversioninfo.cpp | 40 | ||||
-rwxr-xr-x | indra/newview/llversioninfo.h | 9 | ||||
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 56 |
4 files changed, 80 insertions, 29 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 54c5d1b9f4..2150955a32 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3088,8 +3088,8 @@ void LLAppViewer::initUpdater() U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod"); bool willing_to_test; LL_DEBUGS("UpdaterService") << "channel " << channel << LL_ENDL; - static const boost::regex is_test_channel("\\bTest$"); - if (boost::regex_search(channel, is_test_channel)) + + if (LLVersionInfo::TEST_VIEWER == LLVersionInfo::getViewerMaturity()) { LL_INFOS("UpdaterService") << "Test build: overriding willing_to_test by sending testno" << LL_ENDL; willing_to_test = false; diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 6a8fad0134..178ea3d50e 100755 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -133,3 +133,43 @@ void LLVersionInfo::resetChannel(const std::string& channel) sWorkingChannelName = channel; sVersionChannel.clear(); // Reset version and channel string til next use. } + +//static +ViewerMaturity getViewerMaturity() +{ + ViewerMaturity maturity; + + std::string channel = getChannel(); + + static const boost::regex is_test_channel("\\bTest\\b"); + static const boost::regex is_beta_channel("\\bBeta\\b"); + static const boost::regex is_project_channel("\\bProject\\b"); + static const boost::regex is_release_channel("\\bRelease\\b"); + + if (boost::regex_search(channel, is_release_channel)) + { + maturity = RELEASE_VIEWER; + } + else if (boost::regex_search(channel, is_beta_channel)) + { + maturity = BETA_VIEWER; + } + else if (boost::regex_search(channel, is_project_channel)) + { + maturity = PROJECT_VIEWER; + } + else if (boost::regex_search(channel, is_test_channel)) + { + maturity = TEST_VIEWER; + } + else + { + LL_WARNS() << "Channel '" << channel + << "' does not follow naming convention, assuming Test" + << LL_ENDL; + maturity = TEST_VIEWER; + } + return maturity; +} + + diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index 077105cae8..4e75535ec5 100755 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -68,6 +68,15 @@ public: /// reset the channel name used by the viewer. static void resetChannel(const std::string& channel); + + typedef enum + { + TEST_VIEWER, + PROJECT_VIEWER, + BETA_VIEWER, + RELEASE_VIEWER + } ViewerMaturity; + static ViewerMaturity getViewerMaturity(); }; #endif diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 756248a356..1f08641008 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2336,12 +2336,6 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) LLSD args; LLColor4 new_bg_color; - // no l10n problem because channel is always an english string - std::string channel = LLVersionInfo::getChannel(); - 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 ) { @@ -2354,27 +2348,35 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" ); } } - 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 (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" ); - } - + else + { + switch (LLVersionInfo::getViewerMaturity()) + { + case LLVersionInfo::TEST_VIEWER: + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarTestBgColor" ); + break; + + case LLVersionInfo::PROJECT_VIEWER: + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarProjectBgColor" ); + break; + + case LLVersionInfo::BETA_VIEWER: + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBetaBgColor" ); + break; + + case LLVersionInfo::RELEASE_VIEWER: + if(!LLGridManager::getInstance()->isInProductionGrid()) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); + } + else + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); + } + break; + } + } + if(gMenuBarView) { gMenuBarView->setBackgroundColor( new_bg_color ); |