summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2011-05-20 16:00:36 -0400
committerLogan Dethrow <log@lindenlab.com>2011-05-20 16:00:36 -0400
commit4b97f03b04e7df25e5b3622122f6d124d4a5f617 (patch)
tree574f9f5cf37b90c6ab94e0c1147f14b6d2dfb774 /indra/newview/llfloaterpreference.cpp
parent39ad3f1d880a26dcf8189cad2501002c189a7ac2 (diff)
Revamped viewer cache preference controls.
Implemented improved cache control user interface, changes approved by wolf. * Moved viewer cache controls from the setup preference panel to advanced * Changed cache size control slider into a spinner * Readded a clear cache button along with a cache clear confirmation dialog * Renamed the reset button to "Default Location" to clarify its function Related JIRAs: ER-815 ER-816 ER-818 ER-820 ER-821 ER-831
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 8d13e59a79..396ea53ff3 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -187,12 +187,26 @@ void LLVoiceSetKeyDialog::onCancel(void* user_data)
void handleNameTagOptionChanged(const LLSD& newvalue);
void handleDisplayNamesOptionChanged(const LLSD& newvalue);
bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response);
+bool callback_clear_cache(const LLSD& notification, const LLSD& response);
//bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater);
//bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater);
void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator);
+bool callback_clear_cache(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if ( option == 0 ) // YES
+ {
+ // flag client texture cache for clearing next time the client runs
+ gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE);
+ LLNotificationsUtil::add("CacheWillClear");
+ }
+
+ return false;
+}
+
bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -305,7 +319,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this));
mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this));
-// mCommitCallbackRegistrar.add("Pref.ClearCache", boost::bind(&LLFloaterPreference::onClickClearCache, this));
+ mCommitCallbackRegistrar.add("Pref.ClearCache", boost::bind(&LLFloaterPreference::onClickClearCache, this));
mCommitCallbackRegistrar.add("Pref.WebClearCache", boost::bind(&LLFloaterPreference::onClickBrowserClearCache, this));
mCommitCallbackRegistrar.add("Pref.SetCache", boost::bind(&LLFloaterPreference::onClickSetCache, this));
mCommitCallbackRegistrar.add("Pref.ResetCache", boost::bind(&LLFloaterPreference::onClickResetCache, this));
@@ -809,6 +823,11 @@ void LLFloaterPreference::refreshEnabledGraphics()
}
}
+void LLFloaterPreference::onClickClearCache()
+{
+ LLNotificationsUtil::add("ConfirmClearCache", LLSD(), LLSD(), callback_clear_cache);
+}
+
void LLFloaterPreference::onClickBrowserClearCache()
{
LLNotificationsUtil::add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache);