summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-09-13 12:11:11 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-09-13 12:11:11 -0400
commitb2853c1a74ab86b3a06e76986d742323f6d89208 (patch)
tree7ce9cef683b03fc2989da1f639c9661488892ab7 /indra/newview/llpanellogin.cpp
parentb56e4cf0e428187c5ed4037b843c05610ed0da2a (diff)
parent18af6e397ef477287324b510471f640443ce0e33 (diff)
merge
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
-rw-r--r--indra/newview/llpanellogin.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index bef809f3a7..db7d836799 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -154,6 +154,10 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
}
updateLocationCombo(false);
+ LLUICtrl& mode_combo = getChildRef<LLUICtrl>("mode_combo");
+ mode_combo.setValue(gSavedSettings.getString("SessionSettingsFile"));
+ mode_combo.setCommitCallback(boost::bind(&LLPanelLogin::onModeChange, this, getChild<LLUICtrl>("mode_combo")->getValue(), _2));
+
LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
server_choice_combo->setCommitCallback(onSelectServer, NULL);
server_choice_combo->setFocusLostCallback(boost::bind(onServerComboLostFocus, _1));
@@ -1021,6 +1025,32 @@ void LLPanelLogin::updateLoginPanelLinks()
sInstance->getChildView("forgot_password_text")->setVisible( system_grid);
}
+void LLPanelLogin::onModeChange(const LLSD& original_value, const LLSD& new_value)
+{
+ if (original_value.asString() != new_value.asString())
+ {
+ LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLPanelLogin::onModeChangeConfirm, this, original_value, new_value, _1, _2));
+ }
+}
+
+void LLPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ switch (option)
+ {
+ case 0:
+ gSavedSettings.getControl("SessionSettingsFile")->set(new_value);
+ LLAppViewer::instance()->requestQuit();
+ break;
+ case 1:
+ // revert to original value
+ getChild<LLUICtrl>("mode_combo")->setValue(original_value);
+ break;
+ default:
+ break;
+ }
+}
+
std::string canonicalize_username(const std::string& name)
{
std::string cname = name;