FIRE-10034: Fix filter being shared between places panel and standalone TP history
parent
d1e572cbc2
commit
c48332202b
|
|
@ -51,6 +51,8 @@ BOOL FSFloaterTeleportHistory::postBuild()
|
|||
|
||||
if (mHistoryPanel)
|
||||
{
|
||||
mHistoryPanel->setIsStandAlone(true);
|
||||
|
||||
mHistoryPanel->mTeleportBtn = getChild<LLButton>("teleport_btn");
|
||||
mHistoryPanel->mShowOnMapBtn = getChild<LLButton>("map_btn");
|
||||
mHistoryPanel->mShowProfile = getChild<LLButton>("profile_btn");
|
||||
|
|
@ -88,7 +90,7 @@ void FSFloaterTeleportHistory::onFilterEdit(const std::string& search_string, bo
|
|||
return;
|
||||
}
|
||||
|
||||
if (force_filter || mHistoryPanel->getFilterSubString() != search_string)
|
||||
if (force_filter || mHistoryPanel->getFilterString() != search_string)
|
||||
{
|
||||
std::string string = search_string;
|
||||
|
||||
|
|
|
|||
|
|
@ -464,7 +464,11 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
|
|||
mHistoryAccordion(NULL),
|
||||
mAccordionTabMenu(NULL),
|
||||
mLastSelectedFlatlList(NULL),
|
||||
mLastSelectedItemIndex(-1)
|
||||
// <FS:Ansariel> Separate search filter for standalone TP history
|
||||
//mLastSelectedItemIndex(-1)
|
||||
mLastSelectedItemIndex(-1),
|
||||
mIsStandAlone(false)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
buildFromFile( "panel_teleport_history.xml");
|
||||
}
|
||||
|
|
@ -563,7 +567,17 @@ void LLTeleportHistoryPanel::draw()
|
|||
// virtual
|
||||
void LLTeleportHistoryPanel::onSearchEdit(const std::string& string)
|
||||
{
|
||||
sFilterSubString = string;
|
||||
// <FS:Ansariel> Separate search filter for standalone TP history
|
||||
//sFilterSubString = string;
|
||||
if (mIsStandAlone)
|
||||
{
|
||||
mFilterString = string;
|
||||
}
|
||||
else
|
||||
{
|
||||
sFilterSubString = string;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
showTeleportHistory();
|
||||
}
|
||||
|
||||
|
|
@ -740,6 +754,13 @@ void LLTeleportHistoryPanel::refresh()
|
|||
|
||||
LLFlatListView* curr_flat_view = NULL;
|
||||
std::string filter_string = sFilterSubString;
|
||||
// <FS:Ansariel> Separate search filter for standalone TP history
|
||||
if (mIsStandAlone)
|
||||
{
|
||||
filter_string = mFilterString;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
LLStringUtil::toUpper(filter_string);
|
||||
|
||||
U32 added_items = 0;
|
||||
|
|
@ -774,7 +795,15 @@ void LLTeleportHistoryPanel::refresh()
|
|||
tab->setVisible(true);
|
||||
|
||||
// Expand all accordion tabs when filtering
|
||||
if(!sFilterSubString.empty())
|
||||
// <FS:Ansariel> Separate search filter for standalone TP history
|
||||
//if(!sFilterSubString.empty())
|
||||
std::string str_filter = sFilterSubString;
|
||||
if (mIsStandAlone)
|
||||
{
|
||||
str_filter = mFilterString;
|
||||
}
|
||||
if (!str_filter.empty())
|
||||
// <FS:Ansariel>
|
||||
{
|
||||
//store accordion tab state when filter is not empty
|
||||
tab->notifyChildren(LLSD().with("action","store_state"));
|
||||
|
|
@ -825,7 +854,17 @@ void LLTeleportHistoryPanel::refresh()
|
|||
}
|
||||
}
|
||||
|
||||
mHistoryAccordion->setFilterSubString(sFilterSubString);
|
||||
// <FS:Ansariel> Separate search filter for standalone TP history
|
||||
//mHistoryAccordion->setFilterSubString(sFilterSubString);
|
||||
if (mIsStandAlone)
|
||||
{
|
||||
mHistoryAccordion->setFilterSubString(mFilterString);
|
||||
}
|
||||
else
|
||||
{
|
||||
mHistoryAccordion->setFilterSubString(sFilterSubString);
|
||||
}
|
||||
// <FS:Ansariel>
|
||||
|
||||
mHistoryAccordion->arrange();
|
||||
|
||||
|
|
@ -871,7 +910,10 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index)
|
|||
.getFlatItemForPersistentItem(&mContextMenu,
|
||||
history_items[history_items.size() - 1], // Most recent item, it was added instead of removed
|
||||
history_items.size(), // index will be decremented inside loop below
|
||||
sFilterSubString);
|
||||
// <FS:Ansariel> Separate search filter for standalone TP history
|
||||
//sFilterSubString);
|
||||
(mIsStandAlone ? mFilterString : sFilterSubString));
|
||||
// </FS:Ansariel>
|
||||
|
||||
fv->addItem(item, LLUUID::null, ADD_TOP);
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ public:
|
|||
/*virtual*/ void updateVerbs();
|
||||
/*virtual*/ bool isSingleItemSelected();
|
||||
|
||||
// <FS:Ansariel> Separate search filter for standalone TP history
|
||||
void setIsStandAlone(bool standalone) { mIsStandAlone = standalone; }
|
||||
std::string getFilterString() { return mFilterString; }
|
||||
// </FS:Ansariel>
|
||||
|
||||
private:
|
||||
|
||||
void onDoubleClickItem();
|
||||
|
|
@ -123,6 +128,11 @@ private:
|
|||
LLHandle<LLView> mGearMenuHandle;
|
||||
|
||||
boost::signals2::connection mTeleportHistoryChangedConnection;
|
||||
|
||||
// </FS:Ansariel> Separate search filter for standalone TP history
|
||||
bool mIsStandAlone;
|
||||
std::string mFilterString;
|
||||
// </FS:Ansariel>
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue