Add Firestorm help SLUrl

meow-7.2.2
Ansariel 2016-11-29 19:09:43 +01:00
parent 8ef2d26d8f
commit cf9528018e
8 changed files with 75 additions and 0 deletions

View File

@ -1349,6 +1349,26 @@ std::string LLUrlEntrySL::getLabel(const std::string &url, const LLUrlLabelCallb
return unescapeUrl(url);
}
// <FS:Ansariel> FS Help SLUrl
///
/// FSHelpDebugUrlEntrySL Describes a Firestorm Help SLURL, e.g.
/// secondlife://app/fshelp/showdebug/DisplayIM
///
FSHelpDebugUrlEntrySL::FSHelpDebugUrlEntrySL()
{
mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/fshelp/showdebug/\\S+",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_slapp.xml";
mTooltip = LLTrans::getString("TooltipFSHelpDebugSLUrl");
}
std::string FSHelpDebugUrlEntrySL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
std::string::size_type pos = url.find("showdebug/") + 10;
return url.substr(pos);
}
// </FS:Ansariel>
//
// LLUrlEntrySLLabel Describes a generic SLURL, e.g., a Url that starts
/// with secondlife:// with the ability to specify a custom label.

View File

@ -490,6 +490,19 @@ public:
/*virtual*/ std::string getLocation(const std::string &url) const;
};
// <FS:Ansariel> FS Help SLUrl
///
/// FSHelpDebugUrlEntrySL Describes a Firestorm Help SLURL, e.g.
/// secondlife://app/fshelp/showdebug/DisplayIM
///
class FSHelpDebugUrlEntrySL : public LLUrlEntryBase
{
public:
FSHelpDebugUrlEntrySL();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
};
// </FS:Ansariel>
///
/// LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts
/// with secondlife:// (used as a catch-all for cases not matched above)

View File

@ -82,6 +82,7 @@ LLUrlRegistry::LLUrlRegistry()
registerUrl(new LLUrlEntryPlace());
registerUrl(new LLUrlEntryInventory());
registerUrl(new LLUrlEntryExperienceProfile());
registerUrl(new FSHelpDebugUrlEntrySL()); // <FS:Ansariel> FS Help SLUrl
//LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern,
//so it should be registered in the end of list
registerUrl(new LLUrlEntrySL());

View File

@ -30,6 +30,7 @@
#include "llagent.h"
#include "llavataractions.h"
#include "llcommandhandler.h"
#include "llfloatersettingsdebug.h"
#include "lllogchat.h"
#include "llnotificationsutil.h"
@ -140,3 +141,30 @@ public:
// Creating the object registers with the dispatcher.
FSSlurlCommandHandler gFSSlurlHandler;
class FSHelpSlurlCommandHandler : public LLCommandHandler
{
public:
// not allowed from outside the app
FSHelpSlurlCommandHandler() : LLCommandHandler("fshelp", UNTRUSTED_THROTTLE) { }
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
{
if (params.size() < 2)
{
return false;
}
if (params[0].asString() == "showdebug")
{
std::string setting_name = params[1].asString();
LLFloaterSettingsDebug::showControl(setting_name);
return true;
}
return false;
}
};
// Creating the object registers with the dispatcher.
FSHelpSlurlCommandHandler gFSHelpSlurlCommandHandler;

View File

@ -49,6 +49,7 @@
// [/RLVa:KB]
#include "llnotificationsutil.h"
#include "llwindow.h"
#include "llfloaterreg.h"
LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key)
: LLFloater(key)
@ -598,3 +599,10 @@ void LLFloaterSettingsDebug::updateControl()
}
}
}
void LLFloaterSettingsDebug::showControl(const std::string& control)
{
LLFloaterSettingsDebug* instance = LLFloaterReg::showTypedInstance<LLFloaterSettingsDebug>("settings_debug", "all", TRUE);
instance->mSearchSettingsInput->setText(control);
instance->onUpdateFilter();
}

View File

@ -60,6 +60,7 @@ public:
void onClickDefault();
void onCopyToClipboard();
void onSanityCheck();
static void showControl(const std::string& control);
private:
// key - selects which settings to show, one of:

View File

@ -697,6 +697,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
<string name="TooltipSLAPP">
Anklicken, um Befehl secondlife:// auszuführen
</string>
<string name="TooltipFSHelpDebugSLUrl">
Anklicken, um das Fenster mit Debug-Einstellungen für diese Einstellung zu öffnen
</string>
<string name="CurrentURL" value=" CurrentURL: [CurrentURL]"/>
<string name="TooltipEmail">
Klicken, um eine E-Mail zu verfassen

View File

@ -339,6 +339,7 @@ Please try logging in again in a minute.</string>
<string name="TooltipObjectIMUrl">Click to view this object's description</string>
<string name="TooltipMapUrl">Click to view this location on a map</string>
<string name="TooltipSLAPP">Click to run the secondlife:// command</string>
<string name="TooltipFSHelpDebugSLUrl">Click to open the debug settings window for this setting</string>
<string name="CurrentURL" value=" CurrentURL: [CurrentURL]" />
<string name="TooltipEmail">Click to compose an email</string>