summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-04-01 14:13:05 -0700
committerRichard Linden <none@none>2011-04-01 14:13:05 -0700
commit878b0e2da1b91f06757b349640e1ac22bccb3a55 (patch)
tree0cb57ebd49ad77879d02181998938730fffa3954 /indra/newview/llpanellogin.cpp
parent4aad5ee313f580e08f9689b7ff4c4c088c20f831 (diff)
parent84f242ff4fc7743e909f53695a4e7a51c3c60299 (diff)
Automated merge with http://bitbucket.org/merov_linden/viewer-autobuild2010
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
-rw-r--r--indra/newview/llpanellogin.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 903cf4780d..7820ac3ecd 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -214,7 +214,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
}
updateLocationCombo(false);
- gSavedSettings.getControl("SessionSettingsFile")->getSignal()->connect(boost::bind(&onModeChange));
+ 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);
@@ -1159,23 +1161,26 @@ void LLPanelLogin::updateLoginPanelLinks()
sInstance->getChildView("forgot_password_text")->setVisible( system_grid);
}
-//static
-void LLPanelLogin::onModeChange()
+void LLPanelLogin::onModeChange(const LLSD& original_value, const LLSD& new_value)
{
- LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&onModeChangeConfirm, _1, _2));
+ if (original_value.asString() != new_value.asString())
+ {
+ LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLPanelLogin::onModeChangeConfirm, this, original_value, new_value, _1, _2));
+ }
}
-//static
-void LLPanelLogin::onModeChangeConfirm(const LLSD& notification, const LLSD& response)
+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:
- LLAppViewer::instance()->requestQuit();
+ gSavedSettings.getControl("SessionSettingsFile")->set(new_value);
+ LLAppViewer::instance()->forceQuit();
break;
case 1:
- // do nothing
+ // revert to original value
+ getChild<LLUICtrl>("mode_combo")->setValue(original_value);
break;
default:
break;