Preferences search: Store last tab only if preferences are not filtered and fix restoring last tab on open

Ansariel 2014-10-07 02:47:08 +02:00
parent 0603b75dde
commit 75c45f0c7d
1 changed files with 15 additions and 4 deletions

View File

@ -611,9 +611,11 @@ BOOL LLFloaterPreference::postBuild()
gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeMaturity, this));
LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
tabcontainer->selectFirstTab();
// <FS:Ansariel> Preferences search
//LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
//if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
// tabcontainer->selectFirstTab();
// </FS:Ansariel>
getChild<LLUICtrl>("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227)
getChildView("log_path_string")->setEnabled(FALSE);// do the same for chat logs path
@ -1092,6 +1094,9 @@ void LLFloaterPreference::onOpen(const LLSD& key)
mFilterEdit->setText(LLStringExplicit(""));
collectSearchableItems();
onUpdateFilterTerm(true);
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
tabcontainer->selectFirstTab();
// </FS:ND>
}
@ -1167,7 +1172,13 @@ void LLFloaterPreference::setHardwareDefaults()
//virtual
void LLFloaterPreference::onClose(bool app_quitting)
{
gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex());
// <FS:Ansariel> Preferences search
//gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex());
if (mFilterEdit->getText().empty())
{
gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex());
}
// </FS:Ansariel>
LLPanelLogin::setAlwaysRefresh(false);
if (!app_quitting)
{