summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-08-11 10:11:59 -0700
committerRichard Linden <none@none>2011-08-11 10:11:59 -0700
commitb215c724c1394e7c27a0309341ffc3b4f2154b25 (patch)
treec9a5eba93a0d333285bc2e87e15ed40e546f7d28 /indra/newview/llviewermenu.cpp
parentc7b6a25728cd360348d1c3da5ace0971767206a4 (diff)
parent9a9e78740ada6a64847d1e915ae8e92258e8f10a (diff)
Automated merge with http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp57
1 files changed, 55 insertions, 2 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index f6499e12de..ebd7c6c688 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -832,7 +832,8 @@ U32 feature_from_string(std::string feature)
};
-class LLAdvancedToggleFeature : public view_listener_t{
+class LLAdvancedToggleFeature : public view_listener_t
+{
bool handleEvent(const LLSD& userdata)
{
U32 feature = feature_from_string( userdata.asString() );
@@ -845,7 +846,8 @@ class LLAdvancedToggleFeature : public view_listener_t{
};
class LLAdvancedCheckFeature : public view_listener_t
-{bool handleEvent(const LLSD& userdata)
+{
+ bool handleEvent(const LLSD& userdata)
{
U32 feature = feature_from_string( userdata.asString() );
bool new_value = false;
@@ -7777,6 +7779,55 @@ class LLToggleUIHints : public view_listener_t
}
};
+class LLCheckSessionsSettings : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ std::string expected = userdata.asString();
+ return gSavedSettings.getString("SessionSettingsFile") == expected;
+ }
+};
+
+class LLChangeMode : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ std::string mode = userdata.asString();
+ if (mode == "basic")
+ {
+ if (gSavedSettings.getString("SessionSettingsFile") != "settings_minimal.xml")
+ {
+ LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "settings_minimal.xml", _1, _2));
+ }
+ return true;
+ }
+ else if (mode == "advanced")
+ {
+ if (gSavedSettings.getString("SessionSettingsFile") != "")
+ {
+ LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "", _1, _2));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ static void onModeChangeConfirm(const std::string& new_session_settings_file, const LLSD& notification, const LLSD& response)
+ {
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ switch (option)
+ {
+ case 0:
+ gSavedSettings.getControl("SessionSettingsFile")->set(new_session_settings_file);
+ LLAppViewer::instance()->forceQuit();
+ break;
+ case 1:
+ default:
+ break;
+ }
+ }
+};
+
void LLUploadCostCalculator::calculateCost()
{
S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
@@ -8266,6 +8317,8 @@ void initialize_menus()
view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
+ view_listener_t::addMenu(new LLCheckSessionsSettings(), "CheckSessionSettings");
+ view_listener_t::addMenu(new LLChangeMode(), "ChangeMode");
commit.add("Destination.show", boost::bind(&toggle_destination_and_avatar_picker, 0));
commit.add("Avatar.show", boost::bind(&toggle_destination_and_avatar_picker, 1));