diff options
author | Andrew Productengine <adyukov@productengine.com> | 2010-12-06 18:05:44 +0200 |
---|---|---|
committer | Andrew Productengine <adyukov@productengine.com> | 2010-12-06 18:05:44 +0200 |
commit | d6f8efae246db921b8d52fc1f86bbf667931dd93 (patch) | |
tree | 463d81d77d942faa47b0b09dd3377e0ff8a79a3c /indra/newview/llfloaterpreference.cpp | |
parent | 45c7663cef287665945a148cce5751f253ee3a0f (diff) |
STORM-34 FIXED Saving of user's favorites into file and showing them in "Start at" combobox on login screen was implemented.
Implementation details:
- File is saved on exit from viewer and not immediately on changes as was written in spec. It is done to make this file consistent with favorites order: order of favorites is saved on exit,
so if favorites info is saved in other moment earlier, crashing viewer or other unexpected way of finishing its work (i.e. via Windows task bar) would cause inconsistence between favorites order
saved per account and one from this new file.
- File is saved in user_settings\stored_favorites.xml.
- If you uncheck the option in Preferences and press OK, the file gets immediately deleted (according to spec).
Issues that require further changes:
- Currently only favorites of last logged in user are shown in login screen. Showing favorites of multiple users will be implemented later when design for it is approved by Esbee.
- Preference is now global for all users, because design states it may be changed before login, and we don't have account info at the moment. But it doesn't seem to be a good idea, so changes in design are needed.
- Currently the way of retrieving SLURLs needs optimization in a separate ticket.
More detailed design approved by Esbee is needed to develop it further, perhaps in new tickets.
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6a7b5171b5..6500aefb10 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -330,6 +330,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); + + mFavoritesFileMayExist = gSavedSettings.getBOOL("ShowFavoritesOnLogin"); } BOOL LLFloaterPreference::postBuild() @@ -489,6 +491,13 @@ void LLFloaterPreference::apply() updateDoubleClickSettings(); mDoubleClickActionDirty = false; } + + if (mFavoritesFileMayExist && !gSavedSettings.getBOOL("ShowFavoritesOnLogin")) + { + mFavoritesFileMayExist = false; + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); + LLFile::remove(filename); + } } void LLFloaterPreference::cancel() @@ -1491,6 +1500,10 @@ BOOL LLPanelPreference::postBuild() { getChild<LLCheckBoxCtrl>("voice_call_friends_only_check")->setCommitCallback(boost::bind(&showFriendsOnlyWarning, _1, _2)); } + if (hasChild("favorites_on_login_check")) + { + getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setCommitCallback(boost::bind(&showFavoritesOnLoginWarning, _1, _2)); + } // Panel Advanced if (hasChild("modifier_combo")) @@ -1558,6 +1571,14 @@ void LLPanelPreference::showFriendsOnlyWarning(LLUICtrl* checkbox, const LLSD& v } } +void LLPanelPreference::showFavoritesOnLoginWarning(LLUICtrl* checkbox, const LLSD& value) +{ + if (checkbox && checkbox->getValue()) + { + LLNotificationsUtil::add("FavoritesOnLogin"); + } +} + void LLPanelPreference::cancel() { for (control_values_map_t::iterator iter = mSavedValues.begin(); |