MAINT-3880 FIX Show favorite landmarks on login screen checkbox, is checked in preferences after being unchecked

master
callum_linden 2014-03-28 15:36:50 -07:00
parent 62d0ad23f9
commit ef095034d1
4 changed files with 32 additions and 2 deletions

View File

@ -752,6 +752,16 @@ void LLFloaterPreference::initDoNotDisturbResponse()
}
}
//static
void LLFloaterPreference::updateShowFavoritesCheckbox(bool val)
{
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if (instance)
{
instance->getChild<LLUICtrl>("favorites_on_login_check")->setValue(val);
}
}
void LLFloaterPreference::setHardwareDefaults()
{
LLFeatureManager::getInstance()->applyRecommendedSettings();
@ -1602,6 +1612,7 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
getChildView("chat_font_size")->setEnabled(TRUE);
}
void LLFloaterPreference::refreshUI()
{
refresh();
@ -1889,6 +1900,8 @@ BOOL LLPanelPreference::postBuild()
if (hasChild("favorites_on_login_check", TRUE))
{
getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setCommitCallback(boost::bind(&showFavoritesOnLoginWarning, _1, _2));
bool show_favorites_at_login = LLPanelLogin::getShowFavorites();
getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setValue(show_favorites_at_login);
}
//////////////////////PanelAdvanced ///////////////////

View File

@ -84,6 +84,9 @@ public:
// translate user's do not disturb response message according to current locale if message is default, otherwise do nothing
static void initDoNotDisturbResponse();
// update Show Favorites checkbox
static void updateShowFavoritesCheckbox(bool val);
void processProperties( void* pData, EAvatarProcessorType type );
void processProfileProperties(const LLAvatarData* pAvatarData );
void storeAvatarProperties( const LLAvatarData* pAvatarData );

View File

@ -176,7 +176,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
mUsernameLength(0),
mPasswordLength(0),
mLocationLength(0),
mFavoriteSelected(false)
mFavoriteSelected(false),
mShowFavorites(false)
{
setBackgroundVisible(FALSE);
setBackgroundOpaque(TRUE);
@ -317,7 +318,8 @@ void LLPanelLogin::addUsersWithFavoritesToUsername()
LLSD fav_llsd;
llifstream file;
file.open(filename);
if (!file.is_open()) return;
if (!file.is_open())
return;
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
@ -350,6 +352,7 @@ void LLPanelLogin::addFavoritesToStartLocation()
file.open(filename);
if (!file.is_open()) return;
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
{
@ -373,6 +376,7 @@ void LLPanelLogin::addFavoritesToStartLocation()
std::string value = (*iter1)["slurl"].asString();
if(label != "" && value != "")
{
mShowFavorites = true;
combo->add(label, value);
}
}
@ -1119,3 +1123,9 @@ void LLPanelLogin::onLocationSLURL()
LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above
}
// static
bool LLPanelLogin::getShowFavorites()
{
return sInstance->mShowFavorites;
}

View File

@ -81,6 +81,9 @@ public:
/// to be called from LLStartUp::setStartSLURL
static void onUpdateStartSLURL(const LLSLURL& new_start_slurl);
// called from prefs when initializing panel
static bool getShowFavorites();
private:
friend class LLPanelLoginListener;
void addFavoritesToStartLocation();
@ -110,6 +113,7 @@ private:
void* mCallbackData;
BOOL mPasswordModified;
bool mShowFavorites;
static LLPanelLogin* sInstance;
static BOOL sCapslockDidNotification;