From 64a34c13703155679a9cba3057b785ff8d55a070 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 12 Jun 2012 06:50:22 -0400
Subject: [PATCH] minor ui tweaks from review

---
 .../newview/llfloaterautoreplacesettings.cpp  |  2 +
 indra/newview/llfloaterspellchecksettings.cpp | 19 ++++-----
 indra/newview/llfloaterspellchecksettings.h   |  3 +-
 .../default/xui/en/floater_autoreplace.xml    |  8 ++--
 .../default/xui/en/floater_spellcheck.xml     | 40 ++-----------------
 .../default/xui/en/panel_preferences_chat.xml |  6 +--
 6 files changed, 21 insertions(+), 57 deletions(-)

diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp
index 1449c888207..7d1bcba978a 100644
--- a/indra/newview/llfloaterautoreplacesettings.cpp
+++ b/indra/newview/llfloaterautoreplacesettings.cpp
@@ -128,6 +128,8 @@ BOOL LLFloaterAutoReplaceSettings::postBuild(void)
 	mReplacementsList->setCommitCallback(boost::bind(&LLFloaterAutoReplaceSettings::onSelectEntry, this));
 	mReplacementsList->setCommitOnSelectionChange(true);
 
+	center();
+
 	mSelectedListName.clear();
 	updateListNames();
 	updateListNamesControls();
diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp
index 059a28fbcd0..d3506377902 100644
--- a/indra/newview/llfloaterspellchecksettings.cpp
+++ b/indra/newview/llfloaterspellchecksettings.cpp
@@ -68,17 +68,10 @@ BOOL LLFloaterSpellCheckerSettings::postBuild(void)
 	getChild<LLUICtrl>("spellcheck_main_combo")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerSettings::refreshDictionaries, this, false));
 	getChild<LLUICtrl>("spellcheck_moveleft_btn")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerSettings::onBtnMove, this, "spellcheck_active_list", "spellcheck_available_list"));
 	getChild<LLUICtrl>("spellcheck_moveright_btn")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerSettings::onBtnMove, this, "spellcheck_available_list", "spellcheck_active_list"));
-	getChild<LLUICtrl>("spellcheck_ok")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerSettings::onBtnOK, this));
-	getChild<LLUICtrl>("spellcheck_cancel")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerSettings::onBtnCancel, this));
 
 	return true;
 }
 
-void LLFloaterSpellCheckerSettings::onBtnCancel()
-{
-	closeFloater(false);
-}
-
 void LLFloaterSpellCheckerSettings::onBtnImport()
 {
 	LLFloaterReg::showInstance("prefs_spellchecker_import");
@@ -104,8 +97,14 @@ void LLFloaterSpellCheckerSettings::onBtnMove(const std::string& from, const std
 	from_ctrl->deleteSelectedItems();
 }
 
-void LLFloaterSpellCheckerSettings::onBtnOK()
+void LLFloaterSpellCheckerSettings::onClose(bool app_quitting)
 {
+	if (app_quitting)
+	{
+		// don't save anything
+		return;
+	}
+	
 	std::list<std::string> list_dict;
 
 	LLComboBox* dict_combo = findChild<LLComboBox>("spellcheck_main_combo");
@@ -126,8 +125,6 @@ void LLFloaterSpellCheckerSettings::onBtnOK()
 		}
 	}
 	gSavedSettings.setString("SpellCheckDictionary", boost::join(list_dict, ","));
-
-	closeFloater(false);
 }
 
 void LLFloaterSpellCheckerSettings::onOpen(const LLSD& key)
@@ -254,7 +251,7 @@ BOOL LLFloaterSpellCheckerImport::postBuild(void)
 	getChild<LLUICtrl>("dictionary_path_browse")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerImport::onBtnBrowse, this));
 	getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerImport::onBtnOK, this));
 	getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterSpellCheckerImport::onBtnCancel, this));
-
+	center();
 	return true;
 }
 
diff --git a/indra/newview/llfloaterspellchecksettings.h b/indra/newview/llfloaterspellchecksettings.h
index c1c998915fc..4bc68e2a884 100644
--- a/indra/newview/llfloaterspellchecksettings.h
+++ b/indra/newview/llfloaterspellchecksettings.h
@@ -37,12 +37,11 @@ class LLFloaterSpellCheckerSettings : public LLFloater
 	/*virtual*/ void draw();
 	/*virtual*/ BOOL postBuild();
 	/*virtual*/ void onOpen(const LLSD& key);
+	/*virtual*/ void onClose(bool app_quitting);
 
 protected:
-	void onBtnCancel();
 	void onBtnImport();
 	void onBtnMove(const std::string& from, const std::string& to);
-	void onBtnOK();
 	void onBtnRemove();
 	void onSpellCheckSettingsChange();
 	void refreshDictionaries(bool from_settings);
diff --git a/indra/newview/skins/default/xui/en/floater_autoreplace.xml b/indra/newview/skins/default/xui/en/floater_autoreplace.xml
index 1a19e51c21d..0bfefc8abe3 100644
--- a/indra/newview/skins/default/xui/en/floater_autoreplace.xml
+++ b/indra/newview/skins/default/xui/en/floater_autoreplace.xml
@@ -3,20 +3,20 @@
  border="true"
  can_close="true"
  can_minimize="true"
- bottom="400"
- left="300"
  can_resize="false"
+ help_topic="autoreplace_settings"
+ save_rect="true"
  height="455"
  width="490"
  name="autoreplace_floater"
- title="Autoreplace Settings">
+ title="Auto-Replace Settings">
   <check_box
    bottom_delta="30"
    left_delta="15"
    height="16"
    width="100"
    follows="left|top"
-   label="Enable Autoreplace"
+   label="Enable Auto-Replace"
    name="autoreplace_enable"
    tool_tip="As you enter chat text, replace any of the keywords entered with the corresponding replacement"/>
   <view_border
diff --git a/indra/newview/skins/default/xui/en/floater_spellcheck.xml b/indra/newview/skins/default/xui/en/floater_spellcheck.xml
index 786b830ad96..76a350dd294 100644
--- a/indra/newview/skins/default/xui/en/floater_spellcheck.xml
+++ b/indra/newview/skins/default/xui/en/floater_spellcheck.xml
@@ -3,10 +3,10 @@
  border="true"
  can_close="true"
  can_minimize="true"
- bottom="300"
- left="300"
+ save_rect="true"
+ help_topic="spelling_settings"
  can_resize="false"
- height="355"
+ height="315"
  width="490"
  name="spellcheck_floater"
  title="Spell Checker Settings">
@@ -157,38 +157,4 @@
    name="spellcheck_import_btn"
    top_delta="0"
    width="80" />
-  <view_border
-   top_pad="10"
-   left="2"
-   height="0"
-   width="491"
-   follows="left|top"
-   bevel_style="none"
-   border_thickness="1"
-   mouse_opaque="false"
-   name="divisor4"/>
-  <button
-   top_pad="8"
-   right="380"
-   height="22"
-   width="90"
-   enabled="true"
-   follows="left|top"
-   mouse_opaque="true"
-   halign="center"
-   scale_image="true"
-   name="spellcheck_ok"
-   label="OK" />
-  <button
-   top_delta="0"
-   right="480"
-   height="22"
-   width="90"
-   enabled="true"
-   follows="left|top"
-   mouse_opaque="true"
-   halign="center"
-   scale_image="true"
-   name="spellcheck_cancel"
-   label="Cancel" />
 </floater>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
index 4297c75d65b..27193a984f0 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
@@ -207,7 +207,7 @@
   <button
    follows="left|top"
    height="23"
-   label="Chat Translation Settings"
+   label="Translation..."
    layout="topleft"
    left="30"
    name="ok_btn"
@@ -224,7 +224,7 @@
    left_pad="5"
    name="autoreplace_showgui"
    commit_callback.function="Pref.AutoReplace"
-   label="AutoReplace Settings"
+   label="Auto-Replace..."
    width="150">
   </button>
   <button
@@ -235,7 +235,7 @@
    left_pad="5"
    name="spellcheck_showgui"
    commit_callback.function="Pref.SpellChecker"
-   label="Spell Checker Settings"
+   label="Spell Checking..."
    width="150">
   </button>
 
-- 
GitLab