FIRE-15671: Override FSComboboxSubstringSearch setting for username selection on login panel to avoid confusion

Ansariel 2015-03-06 13:15:05 +01:00
parent c67dacc72a
commit 6f24db9789
3 changed files with 11 additions and 6 deletions

View File

@ -72,6 +72,7 @@ LLComboBox::Params::Params()
: allow_text_entry("allow_text_entry", false),
allow_new_values("allow_new_values", false),
show_text_as_tentative("show_text_as_tentative", true),
force_disable_fulltext_search("force_disable_fulltext_search", false), // <FS:Ansariel> Allow fulltext search in comboboxes
max_chars("max_chars", 20),
list_position("list_position", BELOW),
items("item"),
@ -88,6 +89,7 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p)
: LLUICtrl(p),
mTextEntry(NULL),
mTextEntryTentative(p.show_text_as_tentative),
mForceDisableFulltextSearch(p.force_disable_fulltext_search), // <FS:Ansariel> Allow fulltext search in comboboxes
mHasAutocompletedText(false),
mAllowTextEntry(p.allow_text_entry),
mAllowNewValues(p.allow_new_values),
@ -939,7 +941,7 @@ void LLComboBox::updateSelection()
}
// <FS:Ansariel> Allow fulltext search in comboboxes
//else if (mList->selectItemByPrefix(left_wstring, FALSE))
else if (!LLControlGroup::getInstance("Global")->getBOOL("FSComboboxSubstringSearch") && mList->selectItemByPrefix(left_wstring, FALSE))
else if ((!LLUI::sSettingGroups["config"]->getBOOL("FSComboboxSubstringSearch") || mForceDisableFulltextSearch) && mList->selectItemByPrefix(left_wstring, FALSE))
// </FS:Ansariel>
{
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
@ -952,7 +954,7 @@ void LLComboBox::updateSelection()
mLastSelectedIndex = mList->getFirstSelectedIndex();
}
// <FS:Ansariel> Allow fulltext search in comboboxes
else if (LLControlGroup::getInstance("Global")->getBOOL("FSComboboxSubstringSearch") && mList->selectItemBySubstring(left_wstring, FALSE))
else if (LLUI::sSettingGroups["config"]->getBOOL("FSComboboxSubstringSearch") && !mForceDisableFulltextSearch && mList->selectItemBySubstring(left_wstring, FALSE))
{
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
mTextEntry->setText(wstring_to_utf8str(left_wstring) + " (" + getSelectedItemLabel() + ")");

View File

@ -70,6 +70,7 @@ public:
{
Optional<bool> allow_text_entry,
show_text_as_tentative,
force_disable_fulltext_search, // <FS:Ansariel> Allow fulltext search in comboboxes
allow_new_values;
Optional<S32> max_chars;
Optional<commit_callback_t> prearrange_callback,
@ -232,6 +233,7 @@ private:
commit_callback_t mSelectionCallback;
boost::signals2::connection mTopLostSignalConnection;
S32 mLastSelectedIndex;
bool mForceDisableFulltextSearch; // <FS:Ansariel> Allow fulltext search in comboboxes
};
// A combo box with icons for the list of items.

View File

@ -92,9 +92,10 @@
height="22"
left="15"
max_chars="128"
force_disable_fulltext_search="true"
combo_editor.commit_on_focus_lost="false"
combo_editor.prevalidate_callback="ascii"
tool_tip="The account name you chose when you registered, like bobsmith420 or Steller Sunshine"
tool_tip="The account name you chose when you registered, like bobsmith420 or Steller Sunshine"
top_delta="0"
name="username_combo"
width="178">
@ -155,16 +156,16 @@ tool_tip="The account name you chose when you registered, like bobsmith420 or St
name="start_location_combo"
width="165">
<combo_box.item
label="Last location"
label="Last location"
name="MyLastLocation"
value="last" />
<combo_box.item
label="Home"
label="Home"
name="MyHome"
value="home" />
<combo_box.item
label="&lt;Type region name&gt;"
name="Typeregionname" value="" />
name="Typeregionname" value="" />
</combo_box>
</layout_panel>
<layout_panel