Hooked LLTrans into LLNotification stuffs. Also, fixed [CURRENCY] showing up in several places on the buy land window.

This commit is contained in:
Shyotl
2012-01-11 00:49:14 -06:00
parent e847b105f2
commit 68bc6749e5
24 changed files with 363 additions and 302 deletions

View File

@@ -217,6 +217,9 @@ public:
// appends form elements from another form serialized as LLSD
void append(const LLSD& sub_form);
std::string getDefaultOption();
LLPointer<class LLControlVariable> getIgnoreSetting();
bool getIgnored();
void setIgnored(bool ignored);
EIgnoreType getIgnoreType() { return mIgnore; }
std::string getIgnoreMessage() { return mIgnoreMsg; }
@@ -224,80 +227,15 @@ public:
private:
LLSD mFormData;
EIgnoreType mIgnore;
std::string mIgnoreMsg;
std::string mIgnoreMsg;
LLPointer<class LLControlVariable> mIgnoreSetting;
bool mInvertSetting;
};
typedef boost::shared_ptr<LLNotificationForm> LLNotificationFormPtr;
// This is the class of object read from the XML file (notifications.xml,
// from the appropriate local language directory).
struct LLNotificationTemplate
{
LLNotificationTemplate();
// the name of the notification -- the key used to identify it
// Ideally, the key should follow variable naming rules
// (no spaces or punctuation).
std::string mName;
// The type of the notification
// used to control which queue it's stored in
std::string mType;
// The text used to display the notification. Replaceable parameters
// are enclosed in square brackets like this [].
std::string mMessage;
// The label for the notification; used for
// certain classes of notification (those with a window and a window title).
// Also used when a notification pops up underneath the current one.
// Replaceable parameters can be used in the label.
std::string mLabel;
// The name of the icon image. This should include an extension.
std::string mIcon;
// This is the Highlander bit -- "There Can Be Only One"
// An outstanding notification with this bit set
// is updated by an incoming notification with the same name,
// rather than creating a new entry in the queue.
// (used for things like progress indications, or repeating warnings
// like "the grid is going down in N minutes")
bool mUnique;
// if we want to be unique only if a certain part of the payload is constant
// specify the field names for the payload. The notification will only be
// combined if all of the fields named in the context are identical in the
// new and the old notification; otherwise, the notification will be
// duplicated. This is to support suppressing duplicate offers from the same
// sender but still differentiating different offers. Example: Invitation to
// conference chat.
std::vector<std::string> mUniqueContext;
// If this notification expires automatically, this value will be
// nonzero, and indicates the number of seconds for which the notification
// will be valid (a teleport offer, for example, might be valid for
// 300 seconds).
U32 mExpireSeconds;
// if the offer expires, one of the options is chosen automatically
// based on its "value" parameter. This controls which one.
// If expireSeconds is specified, expireOption should also be specified.
U32 mExpireOption;
// if the notification contains a url, it's stored here (and replaced
// into the message where [_URL] is found)
std::string mURL;
// if there's a URL in the message, this controls which option visits
// that URL. Obsolete this and eliminate the buttons for affected
// messages when we allow clickable URLs in the UI
U32 mURLOption;
// does this notification persist across sessions? if so, it will be
// serialized to disk on first receipt and read on startup
bool mPersist;
// This is the name of the default functor, if present, to be
// used for the notification's callback. It is optional, and used only if
// the notification is constructed without an identified functor.
std::string mDefaultFunctor;
// The form data associated with a given notification (buttons, text boxes, etc)
LLNotificationFormPtr mForm;
// default priority for notifications of this type
ENotificationPriority mPriority;
// UUID of the audio file to be played when this notification arrives
// this is loaded as a name, but looked up to get the UUID upon template load.
// If null, it wasn't specified.
LLUUID mSoundEffect;
};
struct LLNotificationTemplate;
// we want to keep a map of these by name, and it's best to manage them
// with smart pointers
@@ -401,21 +339,15 @@ private:
// this is just for making it easy to look things up in a set organized by UUID -- DON'T USE IT
// for anything real!
LLNotification(LLUUID uuid) : mId(uuid) {}
LLNotification(LLUUID uuid) : mId(uuid), mCancelled(false), mRespondedTo(false), mIgnored(false), mPriority(NOTIFICATION_PRIORITY_UNSPECIFIED), mTemporaryResponder(false) {}
void cancel();
bool payloadContainsAll(const std::vector<std::string>& required_fields) const;
public:
// constructor from a saved notification
LLNotification(const LLSD& sd);
// This is a string formatter for substituting into the message directly
// from LLSD without going through the hopefully-to-be-obsoleted LLString
static std::string format(const std::string& text, const LLSD& substitutions);
void setResponseFunctor(std::string const &responseFunctorName);
typedef enum e_response_template_type
@@ -474,11 +406,12 @@ public:
return mIgnored;
}
const std::string& getName() const
{
return mTemplatep->mName;
}
const std::string& getName() const;
const std::string& getIcon() const;
bool isPersistent() const;
const LLUUID& id() const
{
return mId;
@@ -499,23 +432,11 @@ public:
return mTimestamp;
}
std::string getType() const
{
return (mTemplatep ? mTemplatep->mType : "");
}
std::string getType() const;
std::string getMessage() const;
std::string getLabel() const;
std::string getURL() const
{
return (mTemplatep ? mTemplatep->mURL : "");
}
S32 getURLOption() const
{
return (mTemplatep ? mTemplatep->mURLOption : -1);
}
std::string getURL() const;
S32 getURLOption() const;
const LLNotificationFormPtr getForm();
@@ -581,7 +502,7 @@ public:
std::string summarize() const;
bool hasUniquenessConstraints() const { return (mTemplatep ? mTemplatep->mUnique : false);}
bool hasUniquenessConstraints() const;
virtual ~LLNotification() {}
};
@@ -650,7 +571,7 @@ namespace LLNotificationComparators
struct orderBy
{
typedef boost::function<T (LLNotificationPtr)> field_t;
orderBy(field_t field, EDirection = ORDER_INCREASING) : mField(field) {}
orderBy(field_t field, EDirection direction = ORDER_INCREASING) : mField(field), mDirection(direction) {}
bool operator()(LLNotificationPtr lhs, LLNotificationPtr rhs)
{
if (mDirection == ORDER_DECREASING)