summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2011-08-10 14:15:15 -0700
committerRichard Nelson <richard@lindenlab.com>2011-08-10 14:15:15 -0700
commite630e98253ab226a9af00da75ba8d91c82326aac (patch)
treea18f1119b2962b9986c359f2cec4e005a9d1dd4b /indra/newview/llviewermenu.cpp
parente1532afb1267b2012a6fbb9b72b09ab80a85f763 (diff)
EXP-1028 FIX Move mode switching to logged in UI
added mode switching button to status bars for advanced and basic mode, changed login combo box to use menu instead
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp73
1 files changed, 63 insertions, 10 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index f74bcafc5c..e5dfa51e7f 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -831,7 +831,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() );
@@ -844,18 +845,19 @@ class LLAdvancedToggleFeature : public view_listener_t{
};
class LLAdvancedCheckFeature : public view_listener_t
-{bool handleEvent(const LLSD& userdata)
{
- U32 feature = feature_from_string( userdata.asString() );
- bool new_value = false;
-
- if ( feature != 0 )
+ bool handleEvent(const LLSD& userdata)
{
- new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature );
- }
+ U32 feature = feature_from_string( userdata.asString() );
+ bool new_value = false;
- return new_value;
-}
+ if ( feature != 0 )
+ {
+ new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature );
+ }
+
+ return new_value;
+ }
};
void toggle_destination_and_avatar_picker(const LLSD& show)
@@ -7774,6 +7776,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();
@@ -8263,6 +8314,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));