From 153555833f57f0fa979f7dc01b0da37b92ce6b45 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 30 Jun 2015 14:37:15 +0200 Subject: [PATCH] Legacy profiles: Update the tab label on the fly while typing --- indra/newview/fspanelprofile.cpp | 15 +++++++++++++++ indra/newview/fspanelprofile.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/indra/newview/fspanelprofile.cpp b/indra/newview/fspanelprofile.cpp index be2c3c0f9b..31beea3628 100644 --- a/indra/newview/fspanelprofile.cpp +++ b/indra/newview/fspanelprofile.cpp @@ -1364,6 +1364,7 @@ void FSPanelPick::setSnapshotId(const LLUUID& id) void FSPanelPick::setPickName(const std::string& name) { mPickName->setValue(name); + updateTabLabel(name); } const std::string FSPanelPick::getPickName() @@ -1409,6 +1410,11 @@ void FSPanelPick::onSnapshotChanged() void FSPanelPick::onPickChanged(LLUICtrl* ctrl) { + if (ctrl && ctrl == mPickName) + { + updateTabLabel(mPickName->getText()); + } + enableSaveButton(isDirty()); } @@ -1586,6 +1592,15 @@ std::string FSPanelPick::createLocationText(const std::string& owner_name, const return location_text; } +void FSPanelPick::updateTabLabel(const std::string& title) +{ + setLabel(title); + LLTabContainer* parent = dynamic_cast(getParent()); + if (parent) + { + parent->setCurrentTabName(title); + } +} ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/fspanelprofile.h b/indra/newview/fspanelprofile.h index e6e9f7eecb..9778061fcc 100644 --- a/indra/newview/fspanelprofile.h +++ b/indra/newview/fspanelprofile.h @@ -399,6 +399,8 @@ public: */ virtual void apply(); + void updateTabLabel(const std::string& title); + //This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; }