summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-03-25 16:24:56 -0700
committerRichard Linden <none@none>2011-03-25 16:24:56 -0700
commitd01afc8a6a1af4df7208724c71f916b5c111da95 (patch)
treeb597fc6e6a34c6c7c0ca48835153b78bc69ea2cb
parent08846c3f72c22aa1d0006548204f62b5b8d1bd05 (diff)
SOCIAL-751 FIX Don't Quit button on 'Changing modes...' dialog gives the false impression that it does nothing
combo box now changes back to previous label when selecting don't quit
-rw-r--r--indra/newview/llpanellogin.cpp21
-rw-r--r--indra/newview/llpanellogin.h4
-rw-r--r--indra/newview/skins/default/xui/en/panel_login.xml1
-rw-r--r--indra/newview/skins/minimal/xui/en/panel_login.xml1
4 files changed, 15 insertions, 12 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;
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index 1430bec832..9cc5e3456a 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -98,8 +98,8 @@ private:
static void onServerComboLostFocus(LLFocusableElement*);
static void updateServerCombo();
static void updateStartSLURL();
- static void onModeChange();
- static void onModeChangeConfirm(const LLSD& notification, const LLSD& response);
+ void onModeChange(const LLSD& original_value, const LLSD& new_value);
+ void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response);
static void updateLoginPanelLinks();
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 4c2faddfe4..8d0f1437e6 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -133,7 +133,6 @@ label="Remember password"
max_chars="128"
tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
top_pad="0"
- control_name="SessionSettingsFile"
name="mode_combo"
width="110">
<combo_box.item
diff --git a/indra/newview/skins/minimal/xui/en/panel_login.xml b/indra/newview/skins/minimal/xui/en/panel_login.xml
index ef058e5567..3903658e71 100644
--- a/indra/newview/skins/minimal/xui/en/panel_login.xml
+++ b/indra/newview/skins/minimal/xui/en/panel_login.xml
@@ -134,7 +134,6 @@ top="20"
max_chars="128"
top_pad="0"
tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
- control_name="SessionSettingsFile"
name="mode_combo"
width="120">
<combo_box.item