From ef095034d17bfa71dbd8525fcdda8a520bd7e20f Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 28 Mar 2014 15:36:50 -0700 Subject: MAINT-3880 FIX Show favorite landmarks on login screen checkbox, is checked in preferences after being unchecked --- indra/newview/llfloaterpreference.cpp | 13 +++++++++++++ indra/newview/llfloaterpreference.h | 3 +++ indra/newview/llpanellogin.cpp | 14 ++++++++++++-- indra/newview/llpanellogin.h | 4 ++++ 4 files changed, 32 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index b50a2e6f85..1846f3c568 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -752,6 +752,16 @@ void LLFloaterPreference::initDoNotDisturbResponse() } } +//static +void LLFloaterPreference::updateShowFavoritesCheckbox(bool val) +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->getChild("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("favorites_on_login_check")->setCommitCallback(boost::bind(&showFavoritesOnLoginWarning, _1, _2)); + bool show_favorites_at_login = LLPanelLogin::getShowFavorites(); + getChild("favorites_on_login_check")->setValue(show_favorites_at_login); } //////////////////////PanelAdvanced /////////////////// diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index cb180f6f1e..f6a41529e0 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -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 ); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 8bd5602f48..9baa443b55 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -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; +} diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index be06967195..0e68ae3ccf 100755 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -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; -- cgit v1.2.3