diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llfavoritesbar.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llpanellogin.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llpanellogin.h | 1 |
4 files changed, 46 insertions, 3 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6eab73cd8a..73efa16abe 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8613,6 +8613,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>UpdateRememberPasswordSetting</key> + <map> + <key>Comment</key> + <string>Save 'rememeber password' setting for current user.</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>OctreeMaxNodeCapacity</key> <map> <key>Comment</key> diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 6b93f204f7..a02bb56489 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1614,7 +1614,7 @@ void LLFavoritesOrderStorage::destroyClass() file.close(); LLFile::remove(filename); } - if(mSaveOnExit) + if(mSaveOnExit || gSavedSettings.getBOOL("UpdateRememberPasswordSetting")) { LLFavoritesOrderStorage::instance().saveFavoritesRecord(true); } @@ -1974,7 +1974,7 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed) } } - if((items != mPrevFavorites) || name_changed || pref_changed) + if((items != mPrevFavorites) || name_changed || pref_changed || gSavedSettings.getBOOL("UpdateRememberPasswordSetting")) { std::string filename = getStoredFavoritesFilename(); if (!filename.empty()) @@ -1995,6 +1995,12 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed) LLSD user_llsd; S32 fav_iter = 0; mMissingSLURLs.clear(); + + LLSD save_pass; + save_pass["save_password"] = gSavedSettings.getBOOL("RememberPassword"); + user_llsd[fav_iter] = save_pass; + fav_iter++; + for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); it++) { LLSD value; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 302ff40bbc..9df3a8e31a 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -326,6 +326,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLCheckBoxCtrl* remember_name = getChild<LLCheckBoxCtrl>("remember_name"); remember_name->setCommitCallback(boost::bind(&LLPanelLogin::onRememberUserCheck, this)); + getChild<LLCheckBoxCtrl>("remember_password")->setCommitCallback(boost::bind(&LLPanelLogin::onRememberPasswordCheck, this)); } void LLPanelLogin::addFavoritesToStartLocation() @@ -398,10 +399,22 @@ void LLPanelLogin::addFavoritesToStartLocation() combo->addSeparator(); LL_DEBUGS() << "Loading favorites for " << iter->first << LL_ENDL; LLSD user_llsd = iter->second; + bool update_password_setting = true; for (LLSD::array_const_iterator iter1 = user_llsd.beginArray(); iter1 != user_llsd.endArray(); ++iter1) { - std::string label = (*iter1)["name"].asString(); + if ((*iter1).has("save_password")) + { + bool save_password = (*iter1)["save_password"].asBoolean(); + gSavedSettings.setBOOL("RememberPassword", save_password); + if (!save_password) + { + getChild<LLButton>("connect_btn")->setEnabled(false); + } + update_password_setting = false; + } + + std::string label = (*iter1)["name"].asString(); std::string value = (*iter1)["slurl"].asString(); if(label != "" && value != "") { @@ -413,6 +426,10 @@ void LLPanelLogin::addFavoritesToStartLocation() } } } + if (update_password_setting) + { + gSavedSettings.setBOOL("UpdateRememberPasswordSetting", TRUE); + } break; } if (combo->getValue().asString().empty()) @@ -1081,6 +1098,14 @@ void LLPanelLogin::onRememberUserCheck(void*) } } +void LLPanelLogin::onRememberPasswordCheck(void*) +{ + if (sInstance) + { + gSavedSettings.setBOOL("UpdateRememberPasswordSetting", TRUE); + } +} + // static void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index c5e6b41def..c6254f72cf 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -107,6 +107,7 @@ private: static void onUserNameTextEnty(void*); static void onUserListCommit(void*); static void onRememberUserCheck(void*); + static void onRememberPasswordCheck(void*); static void onPassKey(LLLineEditor* caller, void* user_data); static void updateServerCombo(); |