From 4ac17041d34e54323e91ed705065a054e1dae2d8 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 16 Oct 2010 23:11:23 -0700 Subject: Added 'Clear History' button to the Teleport History from Phoenix --- linden/indra/newview/llfloaterteleporthistory.cpp | 16 +++++++++++++++- linden/indra/newview/llfloaterteleporthistory.h | 3 +++ .../skins/default/xui/en-us/floater_teleport_history.xml | 6 +++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/linden/indra/newview/llfloaterteleporthistory.cpp b/linden/indra/newview/llfloaterteleporthistory.cpp index 65675fa..c901029 100644 --- a/linden/indra/newview/llfloaterteleporthistory.cpp +++ b/linden/indra/newview/llfloaterteleporthistory.cpp @@ -108,6 +108,7 @@ BOOL LLFloaterTeleportHistory::postBuild() childSetAction("teleport", onTeleport, this); childSetAction("show_on_map", onShowOnMap, this); childSetAction("copy_slurl", onCopySLURL, this); + childSetAction("clear_history", onClearHistory,this); loadEntrys(); return TRUE; @@ -121,7 +122,13 @@ void LLFloaterTeleportHistory::saveEntry(LLSD toSave) LLSDSerialize::toPrettyXML(tpList, file); file.close(); } - +void LLFloaterTeleportHistory::clearHistory() +{ + tpList.clear(); + saveEntry(tpList); + mPlacesOutList->clearRows(); + mPlacesInList->clearRows(); +} std::string LLFloaterTeleportHistory::getFileName() { std::string path=gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, ""); @@ -303,6 +310,13 @@ void LLFloaterTeleportHistory::onTeleport(void* data) } // static +void LLFloaterTeleportHistory::onClearHistory(void* data) +{ + LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data; + self->clearHistory(); +} + +// static void LLFloaterTeleportHistory::onShowOnMap(void* data) { LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data; diff --git a/linden/indra/newview/llfloaterteleporthistory.h b/linden/indra/newview/llfloaterteleporthistory.h index e458259..702daf5 100644 --- a/linden/indra/newview/llfloaterteleporthistory.h +++ b/linden/indra/newview/llfloaterteleporthistory.h @@ -63,9 +63,12 @@ class LLFloaterTeleportHistory : public LLFloater /// @brief: adds a teleport destination to the list of visited places void addEntry(std::string regionName, S16 x, S16 y, S16 z,bool outList); + void clearHistory(); + protected: static void onInPlacesSelected(LLUICtrl* ctrl, void* data); static void onOutPlacesSelected(LLUICtrl* ctrl, void* data); + static void onClearHistory(void* data); static void onTeleport(void* data); static void onShowOnMap(void* data); static void onCopySLURL(void* data); diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml b/linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml index db36df5..13956e2 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml @@ -1,6 +1,6 @@ @@ -39,6 +39,10 @@ height="20" label="Show On Map" label_selected="Show On Map" left_delta="100" mouse_opaque="true" name="show_on_map" tool_tip="Center map on this location" width="125" /> +