diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1d3003df35..bbf6944f55 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14225,6 +14225,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value Wood + PhoenixCopyObjKeySeparator + + Comment + This chunk of text goes between keys when you use the Copy Key button with multiple objects selected. + Persist + 1 + Type + String + Value + , + diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 1698711d55..d9b0c6cd66 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -384,6 +384,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mCommitCallbackRegistrar.add("BuildTool.LinkObjects", boost::bind(&LLSelectMgr::linkObjects, LLSelectMgr::getInstance())); mCommitCallbackRegistrar.add("BuildTool.UnlinkObjects", boost::bind(&LLSelectMgr::unlinkObjects, LLSelectMgr::getInstance())); + mCommitCallbackRegistrar.add("BuildTool.CopyKeys", boost::bind(&LLFloaterTools::onClickBtnCopyKeys,this)); } LLFloaterTools::~LLFloaterTools() @@ -1938,3 +1939,31 @@ void LLFloaterTools::updateMediaSettings() mMediaSettings[ base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX ) ] = ! identical; } +struct LLFloaterToolsCopyKeysFunctor : public LLSelectedObjectFunctor +{ + LLFloaterToolsCopyKeysFunctor(std::string& strOut, std::string& strSep) : mOutput(strOut), mSep(strSep) {} + virtual bool apply(LLViewerObject* object) + { + if (!mOutput.empty()) + mOutput.append(mSep); + + mOutput.append(object->getID().asString()); + + return true; + } +private: + std::string& mOutput; + std::string& mSep; +}; + +void LLFloaterTools::onClickBtnCopyKeys() +{ + std::string separator = gSavedSettings.getString("PhoenixCopyObjKeySeparator"); + std::string stringKeys; + LLFloaterToolsCopyKeysFunctor copy_keys(stringKeys, separator); + bool copied = LLSelectMgr::getInstance()->getSelection()->applyToObjects(©_keys); + if (copied) + { + LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(stringKeys)); + } +} diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index 23b0be589b..84608f4776 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -105,6 +105,8 @@ public: void navigateToTitleMedia( const std::string url ); bool selectedMediaEditable(); + void onClickBtnCopyKeys(); + private: void refresh(); void refreshMedia(); diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 4fabe35e32..3fac1030c0 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1124,13 +1124,24 @@ even though the user gets a free copy. min_val="0" height="20" max_val="999999999" /> +