aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-05-24 18:09:15 -0700
committerJacek Antonelli2010-06-19 02:43:00 -0500
commitffa1ba7bd3fd4ad69f4a55fdd042834dff37c618 (patch)
tree22bb49c526ac85c40928d189f505c5feae3659eb
parentAdded 'Reload All' button to the notification console for easier debugging (r... (diff)
downloadmeta-impy-ffa1ba7bd3fd4ad69f4a55fdd042834dff37c618.zip
meta-impy-ffa1ba7bd3fd4ad69f4a55fdd042834dff37c618.tar.gz
meta-impy-ffa1ba7bd3fd4ad69f4a55fdd042834dff37c618.tar.bz2
meta-impy-ffa1ba7bd3fd4ad69f4a55fdd042834dff37c618.tar.xz
Added button to Preferences > Advanced to reset all preferences (#272)
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llappviewer.cpp15
-rw-r--r--linden/indra/newview/llprefsadvanced.cpp20
-rw-r--r--linden/indra/newview/llprefsadvanced.h3
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/notifications.xml14
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml4
6 files changed, 65 insertions, 2 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index da9cdc6..333c8b5 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -404,6 +404,17 @@
404 <key>Value</key> 404 <key>Value</key>
405 <integer>1</integer> 405 <integer>1</integer>
406 </map> 406 </map>
407 <key>ResetAllPreferences</key>
408 <map>
409 <key>Comment</key>
410 <string>Reset all preferences to their default values on successful quit</string>
411 <key>Persist</key>
412 <integer>0</integer>
413 <key>Type</key>
414 <string>Boolean</string>
415 <key>Value</key>
416 <integer>0</integer>
417 </map>
407 <key>RezWithLandGroup</key> 418 <key>RezWithLandGroup</key>
408 <map> 419 <map>
409 <key>Comment</key> 420 <key>Comment</key>
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 44693c2..79a78b9 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -1362,13 +1362,24 @@ bool LLAppViewer::cleanup()
1362 // Store the time of our current logoff 1362 // Store the time of our current logoff
1363 gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); 1363 gSavedPerAccountSettings.setU32("LastLogoff", time_corrected());
1364 1364
1365 // Get filenames of settings files to reset if we do -- MC
1366 std::string per_account_settings_filename = gSavedSettings.getString("PerAccountSettingsFile");
1367 std::string settings_filename = gSavedSettings.getString("ClientSettingsFile");
1368
1369 // Reset all preferences to default settings before we save everything -- MC
1370 if (gSavedSettings.getBOOL("ResetAllPreferences"))
1371 {
1372 llinfos << "Resetting all viewer preferences" << llendflush;
1373 gSavedSettings.resetToDefaults();
1374 gSavedPerAccountSettings.resetToDefaults();
1375 }
1376
1365 // Must do this after all panels have been deleted because panels that have persistent rects 1377 // Must do this after all panels have been deleted because panels that have persistent rects
1366 // save their rects on delete. 1378 // save their rects on delete.
1367 gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); 1379 gSavedSettings.saveToFile(settings_filename, TRUE);
1368 1380
1369 // PerAccountSettingsFile should be empty if no use has been logged on. 1381 // PerAccountSettingsFile should be empty if no use has been logged on.
1370 // *FIX:Mani This should get really saved in a "logoff" mode. 1382 // *FIX:Mani This should get really saved in a "logoff" mode.
1371 std::string per_account_settings_filename = gSavedSettings.getString("PerAccountSettingsFile");
1372 if (!per_account_settings_filename.empty()) 1383 if (!per_account_settings_filename.empty())
1373 { 1384 {
1374 gSavedPerAccountSettings.saveToFile(per_account_settings_filename, TRUE); 1385 gSavedPerAccountSettings.saveToFile(per_account_settings_filename, TRUE);
diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp
index da7b8a7..e109818 100644
--- a/linden/indra/newview/llprefsadvanced.cpp
+++ b/linden/indra/newview/llprefsadvanced.cpp
@@ -41,6 +41,8 @@ LLPrefsAdvanced::LLPrefsAdvanced()
41{ 41{
42 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_advanced.xml"); 42 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_advanced.xml");
43 childSetCommitCallback("speed_rez_check", onCommitCheckBox, this); 43 childSetCommitCallback("speed_rez_check", onCommitCheckBox, this);
44
45 childSetAction("reset_btn", onClickResetPrefs, this);
44} 46}
45 47
46LLPrefsAdvanced::~LLPrefsAdvanced() 48LLPrefsAdvanced::~LLPrefsAdvanced()
@@ -145,3 +147,21 @@ void LLPrefsAdvanced::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
145 LLPrefsAdvanced* self = (LLPrefsAdvanced*)user_data; 147 LLPrefsAdvanced* self = (LLPrefsAdvanced*)user_data;
146 self->refresh(); 148 self->refresh();
147} 149}
150
151// static
152void LLPrefsAdvanced::onClickResetPrefs(void* user_data)
153{
154 LLPrefsAdvanced* self = (LLPrefsAdvanced*)user_data;
155 LLNotifications::instance().add("ConfirmResetAllPreferences", LLSD(), LLSD(), boost::bind(callbackReset, _1, _2, self));
156}
157
158// static
159bool LLPrefsAdvanced::callbackReset(const LLSD& notification, const LLSD& response, LLPrefsAdvanced *self)
160{
161 S32 option = LLNotification::getSelectedOption(notification, response);
162 if ( option == 0 )
163 {
164 gSavedSettings.setBOOL("ResetAllPreferences", TRUE);
165 }
166 return false;
167}
diff --git a/linden/indra/newview/llprefsadvanced.h b/linden/indra/newview/llprefsadvanced.h
index 37fd050..efd0d40 100644
--- a/linden/indra/newview/llprefsadvanced.h
+++ b/linden/indra/newview/llprefsadvanced.h
@@ -47,6 +47,9 @@ public:
47 47
48private: 48private:
49 static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); 49 static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data);
50 static void onClickResetPrefs(void* user_data);
51
52 static bool callbackReset(const LLSD& notification, const LLSD& response, LLPrefsAdvanced *self);
50}; 53};
51 54
52#endif // LLPREFSADVANCED_H 55#endif // LLPREFSADVANCED_H
diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
index e64b9b6..873f069 100644
--- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
@@ -6598,6 +6598,20 @@ Are you sure you want to take off all clothes?
6598 notext="Cancel" 6598 notext="Cancel"
6599 yestext="Take Off"/> 6599 yestext="Take Off"/>
6600 </notification> 6600 </notification>
6601
6602 <notification
6603 icon="alert.tga"
6604 name="ConfirmResetAllPreferences"
6605 type="alert">
6606Are you sure you want to reset ALL preferences?
6607
6608Preferences will be reset when you restart [VIEWER_NAME].
6609 <usetemplate
6610 ignoretext="When resetting preferences"
6611 name="okcancelignore"
6612 notext="Cancel"
6613 yestext="Reset"/>
6614 </notification>
6601 6615
6602 <notification 6616 <notification
6603 icon="alert.tga" 6617 icon="alert.tga"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
index 6c0b1f1..9c769de 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
@@ -52,4 +52,8 @@
52 label="Enable Wind" left="12" mouse_opaque="true" 52 label="Enable Wind" left="12" mouse_opaque="true"
53 name="mute_wind_check" radio_style="false" width="217" /> 53 name="mute_wind_check" radio_style="false" width="217" />
54 54
55 <button bottom="5" follows="left|top" font="SansSerifSmall" height="20" width="250"
56 label="Reset All Preferences To Default" name="reset_btn" left="12"
57 tool_tip="Reset all preferences to their default values (requires a restart)" />
58
55</panel> 59</panel>