|
40 | 40 | #include "llagent.h" |
41 | 41 | #include "llagentcamera.h" |
42 | 42 | #include "llcheckboxctrl.h" |
| 43 | +#include "llclipboard.h" |
43 | 44 | #include "llcolorswatch.h" |
44 | 45 | #include "llcombobox.h" |
45 | 46 | #include "llcommandhandler.h" |
|
74 | 75 | #include "llsliderctrl.h" |
75 | 76 | #include "lltabcontainer.h" |
76 | 77 | #include "lltrans.h" |
| 78 | +#include "lluri.h" |
77 | 79 | #include "llviewercontrol.h" |
78 | 80 | #include "llviewercamera.h" |
79 | 81 | #include "llviewereventrecorder.h" |
@@ -396,6 +398,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) |
396 | 398 | mCommitCallbackRegistrar.add("Pref.ClearLog", boost::bind(&LLConversationLog::onClearLog, &LLConversationLog::instance())); |
397 | 399 | mCommitCallbackRegistrar.add("Pref.DeleteTranscripts", boost::bind(&LLFloaterPreference::onDeleteTranscripts, this)); |
398 | 400 | mCommitCallbackRegistrar.add("UpdateFilter", boost::bind(&LLFloaterPreference::onUpdateFilterTerm, this, false)); // <FS:ND/> Hook up for filtering |
| 401 | + mCommitCallbackRegistrar.add("Pref.CopySearchAsSLURL", boost::bind(&LLFloaterPreference::onCopySearch, this)); |
399 | 402 | #ifdef LL_DISCORD |
400 | 403 | gSavedSettings.getControl("EnableDiscord")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); |
401 | 404 | gSavedSettings.getControl("ShowDiscordActivityDetails")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); |
@@ -1411,7 +1414,12 @@ void LLFloaterPreference::onOpen(const LLSD& key) |
1411 | 1414 | } |
1412 | 1415 |
|
1413 | 1416 | collectSearchableItems(); |
1414 | | - if (!mFilterEdit->getText().empty()) |
| 1417 | + if (key.has("search")) |
| 1418 | + { |
| 1419 | + mFilterEdit->setText(key["search"].asString()); |
| 1420 | + onUpdateFilterTerm(true); |
| 1421 | + } |
| 1422 | + else if (!mFilterEdit->getText().empty()) |
1415 | 1423 | { |
1416 | 1424 | mFilterEdit->setText(LLStringExplicit("")); |
1417 | 1425 | onUpdateFilterTerm(true); |
@@ -4269,6 +4277,12 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force) |
4269 | 4277 | pRoot->selectFirstTab(); |
4270 | 4278 | } |
4271 | 4279 |
|
| 4280 | +void LLFloaterPreference::onCopySearch() |
| 4281 | +{ |
| 4282 | + std::string search_query = "secondlife:///app/openfloater/preferences?search=" + LLURI::escape(mFilterEdit->getText()); |
| 4283 | + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(search_query), 0, static_cast<S32>(search_query.size())); |
| 4284 | +} |
| 4285 | + |
4272 | 4286 | void LLFloaterPreference::filterIgnorableNotifications() |
4273 | 4287 | { |
4274 | 4288 | bool visible = mEnabledPopups->highlightMatchingItems(mFilterEdit->getValue()); |
|
0 commit comments