MAINT-5147: correct menu colors for test viewers
parent
749cf1b257
commit
b2200f06da
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in New Issue