Merge branch 'master' into DRTVWR-527-maint
# Conflicts: # indra/newview/llinventorypanel.cppmaster
commit
0ca16a1f95
|
|
@ -360,6 +360,8 @@ Chaser Zaks
|
|||
BUG-227485
|
||||
Cherry Cheevers
|
||||
ChickyBabes Zuzu
|
||||
Chorazin Allen
|
||||
BUG-229753
|
||||
Christopher Organiser
|
||||
Ciaran Laval
|
||||
Cinder Roxley
|
||||
|
|
|
|||
|
|
@ -295,7 +295,6 @@ public:
|
|||
void setAllowTerraform(BOOL b){setParcelFlag(PF_ALLOW_TERRAFORM, b); }
|
||||
void setAllowDamage(BOOL b) { setParcelFlag(PF_ALLOW_DAMAGE, b); }
|
||||
void setAllowFly(BOOL b) { setParcelFlag(PF_ALLOW_FLY, b); }
|
||||
void setAllowLandmark(BOOL b){ setParcelFlag(PF_ALLOW_LANDMARK, b); }
|
||||
void setAllowGroupScripts(BOOL b) { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); }
|
||||
void setAllowOtherScripts(BOOL b) { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); }
|
||||
void setAllowDeedToGroup(BOOL b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); }
|
||||
|
|
@ -476,11 +475,6 @@ public:
|
|||
BOOL getAllowFly() const
|
||||
{ return (mParcelFlags & PF_ALLOW_FLY) ? TRUE : FALSE; }
|
||||
|
||||
// Remove permission restrictions for creating landmarks.
|
||||
// We should eventually remove this flag completely.
|
||||
BOOL getAllowLandmark() const
|
||||
{ return TRUE; }
|
||||
|
||||
BOOL getAllowGroupScripts() const
|
||||
{ return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? TRUE : FALSE; }
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const U32 PF_ALLOW_FLY = 1 << 0;// Can start flying
|
|||
const U32 PF_ALLOW_OTHER_SCRIPTS= 1 << 1;// Scripts by others can run.
|
||||
const U32 PF_FOR_SALE = 1 << 2;// Can buy this land
|
||||
const U32 PF_FOR_SALE_OBJECTS = 1 << 7;// Can buy all objects on this land
|
||||
const U32 PF_ALLOW_LANDMARK = 1 << 3;
|
||||
const U32 PF_ALLOW_LANDMARK = 1 << 3;// Always true/deprecated
|
||||
const U32 PF_ALLOW_TERRAFORM = 1 << 4;
|
||||
const U32 PF_ALLOW_DAMAGE = 1 << 5;
|
||||
const U32 PF_CREATE_OBJECTS = 1 << 6;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ typedef enum e_chat_source_type
|
|||
CHAT_SOURCE_SYSTEM = 0,
|
||||
CHAT_SOURCE_AGENT = 1,
|
||||
CHAT_SOURCE_OBJECT = 2,
|
||||
CHAT_SOURCE_UNKNOWN = 3
|
||||
CHAT_SOURCE_TELEPORT = 3,
|
||||
CHAT_SOURCE_UNKNOWN = 4
|
||||
} EChatSourceType;
|
||||
|
||||
typedef enum e_chat_type
|
||||
|
|
@ -64,7 +65,8 @@ typedef enum e_chat_style
|
|||
{
|
||||
CHAT_STYLE_NORMAL,
|
||||
CHAT_STYLE_IRC,
|
||||
CHAT_STYLE_HISTORY
|
||||
CHAT_STYLE_HISTORY,
|
||||
CHAT_STYLE_TELEPORT_SEP
|
||||
}EChatStyle;
|
||||
|
||||
// A piece of chat
|
||||
|
|
|
|||
|
|
@ -199,7 +199,9 @@ LLFloater::Params::Params()
|
|||
help_pressed_image("help_pressed_image"),
|
||||
open_callback("open_callback"),
|
||||
close_callback("close_callback"),
|
||||
follows("follows")
|
||||
follows("follows"),
|
||||
rel_x("rel_x", 0),
|
||||
rel_y("rel_y", 0)
|
||||
{
|
||||
changeDefault(visible, false);
|
||||
}
|
||||
|
|
@ -268,6 +270,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
|
|||
mHasBeenDraggedWhileMinimized(FALSE),
|
||||
mPreviousMinimizedBottom(0),
|
||||
mPreviousMinimizedLeft(0),
|
||||
mDefaultRelativeX(p.rel_x),
|
||||
mDefaultRelativeY(p.rel_y),
|
||||
mMinimizeSignal(NULL)
|
||||
// mNotificationContext(NULL)
|
||||
{
|
||||
|
|
@ -506,7 +510,12 @@ void LLFloater::destroy()
|
|||
// virtual
|
||||
LLFloater::~LLFloater()
|
||||
{
|
||||
LLFloaterReg::removeInstance(mInstanceName, mKey);
|
||||
if (!isDead())
|
||||
{
|
||||
// If it's dead, instance is supposed to be already removed, and
|
||||
// in case of single instance we can remove new one by accident
|
||||
LLFloaterReg::removeInstance(mInstanceName, mKey);
|
||||
}
|
||||
|
||||
if( gFocusMgr.childHasKeyboardFocus(this))
|
||||
{
|
||||
|
|
@ -935,6 +944,15 @@ bool LLFloater::applyRectControl()
|
|||
|
||||
saved_rect = true;
|
||||
}
|
||||
else if ((mDefaultRelativeX != 0) && (mDefaultRelativeY != 0))
|
||||
{
|
||||
mPosition.mX = mDefaultRelativeX;
|
||||
mPosition.mY = mDefaultRelativeY;
|
||||
mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
|
||||
applyRelativePosition();
|
||||
|
||||
saved_rect = true;
|
||||
}
|
||||
|
||||
// remember updated position
|
||||
if (rect_specified)
|
||||
|
|
@ -3200,6 +3218,9 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
|
|||
mSingleInstance = p.single_instance;
|
||||
mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance;
|
||||
|
||||
mDefaultRelativeX = p.rel_x;
|
||||
mDefaultRelativeY = p.rel_y;
|
||||
|
||||
mPositioning = p.positioning;
|
||||
|
||||
mSaveRect = p.save_rect;
|
||||
|
|
|
|||
|
|
@ -172,6 +172,9 @@ public:
|
|||
Optional<S32> header_height,
|
||||
legacy_header_height; // HACK see initFromXML()
|
||||
|
||||
Optional<F32> rel_x,
|
||||
rel_y;
|
||||
|
||||
// Images for top-right controls
|
||||
Optional<LLUIImage*> close_image,
|
||||
restore_image,
|
||||
|
|
@ -521,6 +524,9 @@ private:
|
|||
BOOL mHasBeenDraggedWhileMinimized;
|
||||
S32 mPreviousMinimizedBottom;
|
||||
S32 mPreviousMinimizedLeft;
|
||||
|
||||
F32 mDefaultRelativeX;
|
||||
F32 mDefaultRelativeY;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,12 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con
|
|||
sGroupMap[groupname] = groupname; // for referencing directly by group name
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLFloaterReg::isRegistered(const std::string& name)
|
||||
{
|
||||
return sBuildMap.find(name) != sBuildMap.end();
|
||||
}
|
||||
|
||||
//static
|
||||
LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ public:
|
|||
|
||||
static void add(const std::string& name, const std::string& file, const LLFloaterBuildFunc& func,
|
||||
const std::string& groupname = LLStringUtil::null);
|
||||
static bool isRegistered(const std::string& name);
|
||||
|
||||
// Helpers
|
||||
static LLFloater* getLastFloaterInGroup(const std::string& name);
|
||||
|
|
|
|||
|
|
@ -283,6 +283,9 @@ public:
|
|||
|
||||
void resetContextMenu() { setContextMenu(NULL); };
|
||||
|
||||
void setBgImage(LLPointer<LLUIImage> image) { mBgImage = image; }
|
||||
void setBgImageFocused(LLPointer<LLUIImage> image) { mBgImageFocused = image; }
|
||||
|
||||
private:
|
||||
// private helper methods
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ const U32 LEFT_PAD_PIXELS = 3;
|
|||
const U32 LEFT_WIDTH_PIXELS = 15;
|
||||
const U32 LEFT_PLAIN_PIXELS = LEFT_PAD_PIXELS + LEFT_WIDTH_PIXELS;
|
||||
|
||||
const U32 RIGHT_PAD_PIXELS = 2;
|
||||
const U32 RIGHT_PAD_PIXELS = 7;
|
||||
const U32 RIGHT_WIDTH_PIXELS = 15;
|
||||
const U32 RIGHT_PLAIN_PIXELS = RIGHT_PAD_PIXELS + RIGHT_WIDTH_PIXELS;
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ const std::string SEPARATOR_NAME("separator");
|
|||
const std::string VERTICAL_SEPARATOR_LABEL( "|" );
|
||||
|
||||
const std::string LLMenuGL::BOOLEAN_TRUE_PREFIX( "\xE2\x9C\x94" ); // U+2714 HEAVY CHECK MARK
|
||||
const std::string LLMenuGL::BRANCH_SUFFIX( "\xE2\x96\xB6" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE
|
||||
const std::string LLMenuGL::BRANCH_SUFFIX( "\xe2\x96\xb8" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE
|
||||
const std::string LLMenuGL::ARROW_UP ("^^^^^^^");
|
||||
const std::string LLMenuGL::ARROW_DOWN("vvvvvvv");
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ LLNotificationForm::FormButton::FormButton()
|
|||
text("text"),
|
||||
ignore("ignore"),
|
||||
is_default("default"),
|
||||
width("width", 0),
|
||||
type("type")
|
||||
{
|
||||
// set type here so it gets serialized
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ public:
|
|||
Mandatory<std::string> text;
|
||||
Optional<std::string> ignore;
|
||||
Optional<bool> is_default;
|
||||
Optional<S32> width;
|
||||
|
||||
Mandatory<std::string> type;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@
|
|||
LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
|
||||
: LLUICtrl(p),
|
||||
mSearchButton(NULL),
|
||||
mClearButton(NULL)
|
||||
mClearButton(NULL),
|
||||
mEditorImage(p.background_image),
|
||||
mEditorImageFocused(p.background_image_focused),
|
||||
mEditorSearchImage(p.background_image_highlight),
|
||||
mHighlightTextField(p.highlight_text_field)
|
||||
{
|
||||
S32 srch_btn_top = p.search_button.top_pad + p.search_button.rect.height;
|
||||
S32 srch_btn_right = p.search_button.rect.width + p.search_button.left_pad;
|
||||
|
|
@ -57,6 +61,8 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
|
|||
// Set up line editor.
|
||||
LLLineEditor::Params line_editor_params(p);
|
||||
line_editor_params.name("filter edit box");
|
||||
line_editor_params.background_image(p.background_image);
|
||||
line_editor_params.background_image_focused(p.background_image_focused);
|
||||
line_editor_params.rect(getLocalRect());
|
||||
line_editor_params.follows.flags(FOLLOWS_ALL);
|
||||
line_editor_params.text_pad_left(text_pad_left);
|
||||
|
|
@ -104,6 +110,20 @@ void LLSearchEditor::draw()
|
|||
if (mClearButton)
|
||||
mClearButton->setVisible(!mSearchEditor->getWText().empty());
|
||||
|
||||
if (mHighlightTextField)
|
||||
{
|
||||
if (!mSearchEditor->getWText().empty())
|
||||
{
|
||||
mSearchEditor->setBgImage(mEditorSearchImage);
|
||||
mSearchEditor->setBgImageFocused(mEditorSearchImage);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSearchEditor->setBgImage(mEditorImage);
|
||||
mSearchEditor->setBgImageFocused(mEditorImageFocused);
|
||||
}
|
||||
}
|
||||
|
||||
LLUICtrl::draw();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,14 +47,23 @@ public:
|
|||
Optional<LLButton::Params> search_button,
|
||||
clear_button;
|
||||
Optional<bool> search_button_visible,
|
||||
clear_button_visible;
|
||||
clear_button_visible,
|
||||
highlight_text_field;
|
||||
Optional<commit_callback_t> keystroke_callback;
|
||||
|
||||
Optional<LLUIImage*> background_image,
|
||||
background_image_focused,
|
||||
background_image_highlight;
|
||||
|
||||
Params()
|
||||
: search_button("search_button"),
|
||||
search_button_visible("search_button_visible"),
|
||||
clear_button("clear_button"),
|
||||
clear_button_visible("clear_button_visible")
|
||||
clear_button_visible("clear_button_visible"),
|
||||
highlight_text_field("highlight_text_field"),
|
||||
background_image("background_image"),
|
||||
background_image_focused("background_image_focused"),
|
||||
background_image_highlight("background_image_highlight")
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
@ -93,6 +102,13 @@ protected:
|
|||
LLLineEditor* mSearchEditor;
|
||||
LLButton* mSearchButton;
|
||||
LLButton* mClearButton;
|
||||
|
||||
LLPointer<LLUIImage> mEditorImage;
|
||||
LLPointer<LLUIImage> mEditorImageFocused;
|
||||
LLPointer<LLUIImage> mEditorSearchImage;
|
||||
LLPointer<LLUIImage> mEditorSearchImageFocused;
|
||||
|
||||
bool mHighlightTextField;
|
||||
};
|
||||
|
||||
#endif // LL_SEARCHEDITOR_H
|
||||
|
|
|
|||
|
|
@ -348,6 +348,42 @@ LLQuaternion LLVirtualTrackball::getRotation() const
|
|||
return mValue;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation)
|
||||
{
|
||||
// LLQuaternion has own function to get azimuth, but it doesn't appear to return correct values (meant for 2d?)
|
||||
LLVector3 point = VectorZero * quat;
|
||||
|
||||
if (!is_approx_zero(point.mV[VX]) || !is_approx_zero(point.mV[VY]))
|
||||
{
|
||||
azimuth = atan2f(point.mV[VX], point.mV[VY]);
|
||||
}
|
||||
else
|
||||
{
|
||||
azimuth = 0;
|
||||
}
|
||||
|
||||
azimuth -= F_PI_BY_TWO;
|
||||
|
||||
if (azimuth < 0)
|
||||
{
|
||||
azimuth += F_PI * 2;
|
||||
}
|
||||
|
||||
// while vector is '1', F32 is not sufficiently precise and we can get
|
||||
// values like 1.0000012 which will result in -90deg angle instead of 90deg
|
||||
F32 z = llclamp(point.mV[VZ], -1.f, 1.f);
|
||||
elevation = asin(z); // because VectorZero's length is '1'
|
||||
}
|
||||
|
||||
// static
|
||||
void LLVirtualTrackball::getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation)
|
||||
{
|
||||
getAzimuthAndElevation(quat, azimuth, elevation);
|
||||
azimuth *= RAD_TO_DEG;
|
||||
elevation *= RAD_TO_DEG;
|
||||
}
|
||||
|
||||
BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (hasMouseCapture())
|
||||
|
|
@ -409,6 +445,10 @@ BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
|
|||
mValue *= az_quat;
|
||||
}
|
||||
|
||||
// we are doing a lot of F32 mathematical operations with loss of precision,
|
||||
// re-normalize to compensate
|
||||
mValue.normalize();
|
||||
|
||||
mPrevX = x;
|
||||
mPrevY = y;
|
||||
onCommit();
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@ public:
|
|||
void setRotation(const LLQuaternion &value);
|
||||
LLQuaternion getRotation() const;
|
||||
|
||||
static void getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation);
|
||||
static void getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation);
|
||||
|
||||
protected:
|
||||
friend class LLUICtrlFactory;
|
||||
LLVirtualTrackball(const Params&);
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ set(viewer_SOURCE_FILES
|
|||
llflexibleobject.cpp
|
||||
llfloaterabout.cpp
|
||||
llfloaterbvhpreview.cpp
|
||||
llfloateraddpaymentmethod.cpp
|
||||
llfloaterauction.cpp
|
||||
llfloaterautoreplacesettings.cpp
|
||||
llfloateravatar.cpp
|
||||
|
|
@ -232,6 +233,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloatercolorpicker.cpp
|
||||
llfloaterconversationlog.cpp
|
||||
llfloaterconversationpreview.cpp
|
||||
llfloatercreatelandmark.cpp
|
||||
llfloaterdeleteprefpreset.cpp
|
||||
llfloaterdestinations.cpp
|
||||
llfloatereditenvironmentbase.cpp
|
||||
|
|
@ -254,6 +256,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloaterhandler.cpp
|
||||
llfloaterhelpbrowser.cpp
|
||||
llfloaterhoverheight.cpp
|
||||
llfloaterhowto.cpp
|
||||
llfloaterhud.cpp
|
||||
llfloaterimagepreview.cpp
|
||||
llfloaterimsessiontab.cpp
|
||||
|
|
@ -636,6 +639,7 @@ set(viewer_SOURCE_FILES
|
|||
llurl.cpp
|
||||
llurldispatcher.cpp
|
||||
llurldispatcherlistener.cpp
|
||||
llurlfloaterdispatchhandler.cpp
|
||||
llurlhistory.cpp
|
||||
llurllineeditorctrl.cpp
|
||||
llurlwhitelist.cpp
|
||||
|
|
@ -844,6 +848,7 @@ set(viewer_HEADER_FILES
|
|||
llflexibleobject.h
|
||||
llfloaterabout.h
|
||||
llfloaterbvhpreview.h
|
||||
llfloateraddpaymentmethod.h
|
||||
llfloaterauction.h
|
||||
llfloaterautoreplacesettings.h
|
||||
llfloateravatar.h
|
||||
|
|
@ -867,6 +872,7 @@ set(viewer_HEADER_FILES
|
|||
llfloatercolorpicker.h
|
||||
llfloaterconversationlog.h
|
||||
llfloaterconversationpreview.h
|
||||
llfloatercreatelandmark.h
|
||||
llfloaterdeleteprefpreset.h
|
||||
llfloaterdestinations.h
|
||||
llfloatereditenvironmentbase.h
|
||||
|
|
@ -889,6 +895,7 @@ set(viewer_HEADER_FILES
|
|||
llfloaterhandler.h
|
||||
llfloaterhelpbrowser.h
|
||||
llfloaterhoverheight.h
|
||||
llfloaterhowto.h
|
||||
llfloaterhud.h
|
||||
llfloaterimagepreview.h
|
||||
llfloaterimnearbychat.h
|
||||
|
|
@ -1264,6 +1271,7 @@ set(viewer_HEADER_FILES
|
|||
llurl.h
|
||||
llurldispatcher.h
|
||||
llurldispatcherlistener.h
|
||||
llurlfloaterdispatchhandler.h
|
||||
llurlhistory.h
|
||||
llurllineeditorctrl.h
|
||||
llurlwhitelist.h
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6.4.20
|
||||
6.4.21
|
||||
|
|
|
|||
|
|
@ -88,8 +88,10 @@
|
|||
icon="Command_HowTo_Icon"
|
||||
label_ref="Command_HowTo_Label"
|
||||
tooltip_ref="Command_HowTo_Tooltip"
|
||||
execute_function="Help.ToggleHowTo"
|
||||
is_running_function="Help.HowToVisible"
|
||||
execute_function="Floater.ToggleOrBringToFront"
|
||||
execute_parameters="guidebook"
|
||||
is_running_function="Floater.IsOpen"
|
||||
is_running_parameters="guidebook"
|
||||
/>
|
||||
<command name="inventory"
|
||||
available_in_toybox="true"
|
||||
|
|
|
|||
|
|
@ -4725,6 +4725,17 @@
|
|||
<key>Value</key>
|
||||
<string>https://search.[GRID]/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD]</string>
|
||||
</map>
|
||||
<key>GuidebookURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>URL for Guidebook content</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://guidebooks.secondlife.io/welcome/index.html</string>
|
||||
</map>
|
||||
<key>HighResSnapshot</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -14436,7 +14447,53 @@
|
|||
<key>Value</key>
|
||||
<integer>44125</integer>
|
||||
</map>
|
||||
<key>VoiceCallsFriendsOnly</key>
|
||||
|
||||
<key>VivoxVadAuto</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>A flag indicating if the automatic VAD is enabled (1) or disabled (0). The individual settings are ignored if the auto-mode is enabled</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>VivoxVadHangover</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>The time (in milliseconds) that it takes or the VAD to switch back to silence from speech mode after the last speech frame has been detected</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>2000</integer>
|
||||
</map>
|
||||
<key>VivoxVadNoiseFloor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>A dimensionless value between 0 and 20000 (default 576) that controls the maximum level at which the noise floor may be set at by the VAD's noise tracking</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>576</integer>
|
||||
</map>
|
||||
<key>VivoxVadSensitivity</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>
|
||||
A dimensionless value between 0 and 100, indicating the 'sensitivity of the VAD'. Increasing this value corresponds to decreasing the sensitivity of the VAD and 0 is turned off altogether</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>VoiceCallsFriendsOnly</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>(Deprecated) Only accept voice calls from residents on your friends list</string>
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ LLAgent::LLAgent() :
|
|||
mTeleportFinishedSlot(),
|
||||
mTeleportFailedSlot(),
|
||||
mIsMaturityRatingChangingDuringTeleport(false),
|
||||
mTPNeedsNeabyChatSeparator(false),
|
||||
mMaturityRatingChange(0U),
|
||||
mIsDoSendMaturityPreferenceToServer(false),
|
||||
mMaturityPreferenceRequestId(0U),
|
||||
|
|
@ -3934,6 +3935,7 @@ void LLAgent::clearTeleportRequest()
|
|||
LLVoiceClient::getInstance()->setHidden(FALSE);
|
||||
}
|
||||
mTeleportRequest.reset();
|
||||
mTPNeedsNeabyChatSeparator = false;
|
||||
}
|
||||
|
||||
void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange)
|
||||
|
|
@ -3942,6 +3944,12 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange)
|
|||
mMaturityRatingChange = pMaturityRatingChange;
|
||||
}
|
||||
|
||||
void LLAgent::sheduleTeleportIM()
|
||||
{
|
||||
// is supposed to be called during teleport so we are still waiting for parcel
|
||||
mTPNeedsNeabyChatSeparator = true;
|
||||
}
|
||||
|
||||
bool LLAgent::hasPendingTeleportRequest()
|
||||
{
|
||||
return ((mTeleportRequest != NULL) &&
|
||||
|
|
@ -3989,6 +3997,12 @@ void LLAgent::startTeleportRequest()
|
|||
void LLAgent::handleTeleportFinished()
|
||||
{
|
||||
LL_INFOS("Teleport") << "Agent handling teleport finished." << LL_ENDL;
|
||||
if (mTPNeedsNeabyChatSeparator)
|
||||
{
|
||||
// parcel is ready at this point
|
||||
addTPNearbyChatSeparator();
|
||||
mTPNeedsNeabyChatSeparator = false;
|
||||
}
|
||||
clearTeleportRequest();
|
||||
mTeleportCanceled.reset();
|
||||
if (mIsMaturityRatingChangingDuringTeleport)
|
||||
|
|
@ -4051,6 +4065,44 @@ void LLAgent::handleTeleportFailed()
|
|||
LLNotificationsUtil::add("PreferredMaturityChanged", args);
|
||||
mIsMaturityRatingChangingDuringTeleport = false;
|
||||
}
|
||||
|
||||
mTPNeedsNeabyChatSeparator = false;
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void LLAgent::addTPNearbyChatSeparator()
|
||||
{
|
||||
LLViewerRegion* agent_region = gAgent.getRegion();
|
||||
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if (!agent_region || !agent_parcel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
|
||||
if (nearby_chat)
|
||||
{
|
||||
std::string location_name;
|
||||
LLAgentUI::ELocationFormat format = LLAgentUI::LOCATION_FORMAT_NO_MATURITY;
|
||||
|
||||
// Might be better to provide slurl to chat
|
||||
if (!LLAgentUI::buildLocationString(location_name, format))
|
||||
{
|
||||
location_name = "Teleport to new region"; // Shouldn't happen
|
||||
}
|
||||
|
||||
LLChat chat;
|
||||
chat.mFromName = location_name;
|
||||
chat.mMuted = FALSE;
|
||||
chat.mFromID = LLUUID::null;
|
||||
chat.mSourceType = CHAT_SOURCE_TELEPORT;
|
||||
chat.mChatStyle = CHAT_STYLE_TELEPORT_SEP;
|
||||
chat.mText = "";
|
||||
|
||||
LLSD args;
|
||||
args["do_not_log"] = TRUE;
|
||||
nearby_chat->addMessage(chat, true, args);
|
||||
}
|
||||
}
|
||||
|
||||
/*static*/
|
||||
|
|
|
|||
|
|
@ -653,6 +653,7 @@ public:
|
|||
void restartFailedTeleportRequest();
|
||||
void clearTeleportRequest();
|
||||
void setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange);
|
||||
void sheduleTeleportIM();
|
||||
|
||||
private:
|
||||
|
||||
|
|
@ -669,6 +670,7 @@ private:
|
|||
boost::signals2::connection mTeleportFailedSlot;
|
||||
|
||||
bool mIsMaturityRatingChangingDuringTeleport;
|
||||
bool mTPNeedsNeabyChatSeparator;
|
||||
U8 mMaturityRatingChange;
|
||||
|
||||
bool hasPendingTeleportRequest();
|
||||
|
|
@ -685,6 +687,7 @@ private:
|
|||
void handleTeleportFinished();
|
||||
void handleTeleportFailed();
|
||||
|
||||
static void addTPNearbyChatSeparator();
|
||||
static void onCapabilitiesReceivedAfterTeleport();
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
#include "llslurl.h"
|
||||
#include "llstartup.h"
|
||||
#include "llfocusmgr.h"
|
||||
#include "llurlfloaterdispatchhandler.h"
|
||||
#include "llviewerjoystick.h"
|
||||
#include "llallocator.h"
|
||||
#include "llcalc.h"
|
||||
|
|
@ -918,6 +919,7 @@ bool LLAppViewer::init()
|
|||
|
||||
// Load translations for tooltips
|
||||
LLFloater::initClass();
|
||||
LLUrlFloaterDispatchHandler::registerInDispatcher();
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
|
|
|
|||
|
|
@ -253,6 +253,19 @@ std::string LLAvatarPropertiesProcessor::paymentInfo(const LLAvatarData* avatar_
|
|||
return LLTrans::getString(payment_text);
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLAvatarPropertiesProcessor::hasPaymentInfoOnFile(const LLAvatarData* avatar_data)
|
||||
{
|
||||
// Special accounts like M Linden don't have payment info revealed.
|
||||
if (!avatar_data->caption_text.empty()) return true;
|
||||
|
||||
// Linden employees don't have payment info revealed
|
||||
const S32 LINDEN_EMPLOYEE_INDEX = 3;
|
||||
if (avatar_data->caption_index == LINDEN_EMPLOYEE_INDEX) return true;
|
||||
|
||||
return ((avatar_data->flags & AVATAR_TRANSACTED) || (avatar_data->flags & AVATAR_IDENTIFIED));
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* msg, void**)
|
||||
{
|
||||
LLAvatarData avatar_data;
|
||||
|
|
|
|||
|
|
@ -232,6 +232,8 @@ public:
|
|||
// Used for profiles, inspectors.
|
||||
static std::string paymentInfo(const LLAvatarData* avatar_data);
|
||||
|
||||
static bool hasPaymentInfoOnFile(const LLAvatarData* avatar_data);
|
||||
|
||||
static void processAvatarPropertiesReply(LLMessageSystem* msg, void**);
|
||||
|
||||
static void processAvatarInterestsReply(LLMessageSystem* msg, void**);
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ public:
|
|||
mUserNameFont(NULL),
|
||||
mUserNameTextBox(NULL),
|
||||
mTimeBoxTextBox(NULL),
|
||||
mNeedsTimeBox(true),
|
||||
mAvatarNameCacheConnection()
|
||||
{}
|
||||
|
||||
|
|
@ -643,8 +644,19 @@ public:
|
|||
user_name->setReadOnlyColor(style_params.readonly_color());
|
||||
user_name->setColor(style_params.color());
|
||||
|
||||
if (chat.mFromName.empty()
|
||||
|| mSourceType == CHAT_SOURCE_SYSTEM)
|
||||
if (mSourceType == CHAT_SOURCE_TELEPORT
|
||||
&& chat.mChatStyle == CHAT_STYLE_TELEPORT_SEP)
|
||||
{
|
||||
mFrom = chat.mFromName;
|
||||
mNeedsTimeBox = false;
|
||||
user_name->setValue(mFrom);
|
||||
updateMinUserNameWidth();
|
||||
LLColor4 sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor");
|
||||
setTransparentColor(sep_color);
|
||||
mTimeBoxTextBox->setVisible(FALSE);
|
||||
}
|
||||
else if (chat.mFromName.empty()
|
||||
|| mSourceType == CHAT_SOURCE_SYSTEM)
|
||||
{
|
||||
mFrom = LLTrans::getString("SECOND_LIFE");
|
||||
if(!chat.mFromName.empty() && (mFrom != chat.mFromName))
|
||||
|
|
@ -728,6 +740,9 @@ public:
|
|||
case CHAT_SOURCE_SYSTEM:
|
||||
icon->setValue(LLSD("SL_Logo"));
|
||||
break;
|
||||
case CHAT_SOURCE_TELEPORT:
|
||||
icon->setValue(LLSD("Command_Destinations_Icon"));
|
||||
break;
|
||||
case CHAT_SOURCE_UNKNOWN:
|
||||
icon->setValue(LLSD("Unknown_Icon"));
|
||||
}
|
||||
|
|
@ -766,7 +781,7 @@ public:
|
|||
S32 user_name_width = user_name_rect.getWidth();
|
||||
S32 time_box_width = time_box->getRect().getWidth();
|
||||
|
||||
if (!time_box->getVisible() && user_name_width > mMinUserNameWidth)
|
||||
if (mNeedsTimeBox && !time_box->getVisible() && user_name_width > mMinUserNameWidth)
|
||||
{
|
||||
user_name_rect.mRight -= time_box_width;
|
||||
user_name->reshape(user_name_rect.getWidth(), user_name_rect.getHeight());
|
||||
|
|
@ -968,6 +983,8 @@ protected:
|
|||
LLTextBox* mUserNameTextBox;
|
||||
LLTextBox* mTimeBoxTextBox;
|
||||
|
||||
bool mNeedsTimeBox;
|
||||
|
||||
private:
|
||||
boost::signals2::connection mAvatarNameCacheConnection;
|
||||
};
|
||||
|
|
@ -1202,6 +1219,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
|
|||
}
|
||||
|
||||
bool message_from_log = chat.mChatStyle == CHAT_STYLE_HISTORY;
|
||||
bool teleport_separator = chat.mSourceType == CHAT_SOURCE_TELEPORT;
|
||||
// We graying out chat history by graying out messages that contains full date in a time string
|
||||
if (message_from_log)
|
||||
{
|
||||
|
|
@ -1222,14 +1240,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
|
|||
LLStyle::Params timestamp_style(body_message_params);
|
||||
|
||||
// out of the timestamp
|
||||
if (args["show_time"].asBoolean())
|
||||
if (args["show_time"].asBoolean() && !teleport_separator)
|
||||
{
|
||||
if (!message_from_log)
|
||||
{
|
||||
LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
|
||||
timestamp_style.color(timestamp_color);
|
||||
timestamp_style.readonly_color(timestamp_color);
|
||||
}
|
||||
if (!message_from_log)
|
||||
{
|
||||
LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
|
||||
timestamp_style.color(timestamp_color);
|
||||
timestamp_style.readonly_color(timestamp_color);
|
||||
}
|
||||
mEditor->appendText("[" + chat.mTimeStr + "] ", prependNewLineState, timestamp_style);
|
||||
prependNewLineState = false;
|
||||
}
|
||||
|
|
@ -1272,6 +1290,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
|
|||
prependNewLineState, link_params);
|
||||
prependNewLineState = false;
|
||||
}
|
||||
else if (teleport_separator)
|
||||
{
|
||||
std::string tp_text = LLTrans::getString("teleport_preamble_compact_chat");
|
||||
mEditor->appendText(tp_text + " <nolink>" + chat.mFromName + "</nolink>",
|
||||
prependNewLineState, body_message_params);
|
||||
prependNewLineState = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mEditor->appendText("<nolink>" + chat.mFromName + "</nolink>" + delimiter,
|
||||
|
|
@ -1290,8 +1315,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
|
|||
p.right_pad = mRightWidgetPad;
|
||||
|
||||
LLDate new_message_time = LLDate::now();
|
||||
|
||||
if (mLastFromName == chat.mFromName
|
||||
if (!teleport_separator
|
||||
&& mLastFromName == chat.mFromName
|
||||
&& mLastFromID == chat.mFromID
|
||||
&& mLastMessageTime.notNull()
|
||||
&& (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0
|
||||
|
|
@ -1314,7 +1339,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
|
|||
p.top_pad = 0;
|
||||
else
|
||||
p.top_pad = mTopHeaderPad;
|
||||
p.bottom_pad = mBottomHeaderPad;
|
||||
if (teleport_separator)
|
||||
{
|
||||
p.bottom_pad = mBottomSeparatorPad;
|
||||
}
|
||||
else
|
||||
{
|
||||
p.bottom_pad = mBottomHeaderPad;
|
||||
}
|
||||
if (!view)
|
||||
{
|
||||
LL_WARNS() << "Failed to create header from " << mMessageHeaderFilename << ": can't append to history" << LL_ENDL;
|
||||
|
|
@ -1392,9 +1424,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// usual messages showing
|
||||
else
|
||||
else if(!teleport_separator)
|
||||
{
|
||||
std::string message = irc_me ? chat.mText.substr(3) : chat.mText;
|
||||
|
||||
|
|
@ -1427,7 +1458,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
|
|||
if (square_brackets)
|
||||
{
|
||||
message += "]";
|
||||
}
|
||||
}
|
||||
|
||||
mEditor->appendText(message, prependNewLineState, body_message_params);
|
||||
prependNewLineState = false;
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ void LLCurrencyUIManager::Impl::updateUI()
|
|||
|
||||
if (!mUserEnteredCurrencyBuy)
|
||||
{
|
||||
if (!mZeroMessage.empty() && mUserCurrencyBuy == 0)
|
||||
if (mUserCurrencyBuy == 0)
|
||||
{
|
||||
lindenAmount->setText(LLStringUtil::null);
|
||||
}
|
||||
|
|
@ -467,8 +467,9 @@ void LLCurrencyUIManager::Impl::updateUI()
|
|||
}
|
||||
}
|
||||
|
||||
mPanel.getChild<LLUICtrl>("currency_est")->setTextArg("[LOCALAMOUNT]", getLocalEstimate());
|
||||
mPanel.getChildView("currency_est")->setVisible( hasEstimate() && mUserCurrencyBuy > 0);
|
||||
std::string estimated = (mUserCurrencyBuy == 0) ? mPanel.getString("estimated_zero") : getLocalEstimate();
|
||||
mPanel.getChild<LLUICtrl>("currency_est")->setTextArg("[LOCALAMOUNT]", estimated);
|
||||
mPanel.getChildView("currency_est")->setVisible( hasEstimate() || mUserCurrencyBuy == 0);
|
||||
|
||||
mPanel.getChildView("currency_links")->setVisible( mSupportsInternationalBilling);
|
||||
mPanel.getChildView("exchange_rate_note")->setVisible( mSupportsInternationalBilling);
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ namespace
|
|||
std::istringstream llsdData(llsdRaw);
|
||||
if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length()))
|
||||
{
|
||||
LL_WARNS() << "LLExperienceLogDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL;
|
||||
LL_WARNS() << "LLEnvironmentPushDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -785,11 +785,11 @@ namespace
|
|||
}
|
||||
|
||||
//=========================================================================
|
||||
const F32Seconds LLEnvironment::TRANSITION_INSTANT(0.0f);
|
||||
const F32Seconds LLEnvironment::TRANSITION_FAST(1.0f);
|
||||
const F32Seconds LLEnvironment::TRANSITION_DEFAULT(5.0f);
|
||||
const F32Seconds LLEnvironment::TRANSITION_SLOW(10.0f);
|
||||
const F32Seconds LLEnvironment::TRANSITION_ALTITUDE(5.0f);
|
||||
const F64Seconds LLEnvironment::TRANSITION_INSTANT(0.0f);
|
||||
const F64Seconds LLEnvironment::TRANSITION_FAST(1.0f);
|
||||
const F64Seconds LLEnvironment::TRANSITION_DEFAULT(5.0f);
|
||||
const F64Seconds LLEnvironment::TRANSITION_SLOW(10.0f);
|
||||
const F64Seconds LLEnvironment::TRANSITION_ALTITUDE(5.0f);
|
||||
|
||||
const LLUUID LLEnvironment::KNOWN_SKY_SUNRISE("01e41537-ff51-2f1f-8ef7-17e4df760bfb");
|
||||
const LLUUID LLEnvironment::KNOWN_SKY_MIDDAY("6c83e853-e7f8-cad7-8ee6-5f31c453721c");
|
||||
|
|
@ -1217,28 +1217,24 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe
|
|||
|
||||
void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version)
|
||||
{
|
||||
setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET);
|
||||
setEnvironment(env, assetId, TRANSITION_DEFAULT, env_version);
|
||||
}
|
||||
|
||||
|
||||
void LLEnvironment::setEnvironment(EnvSelection_t env,
|
||||
const LLUUID &assetId,
|
||||
LLSettingsDay::Seconds daylength,
|
||||
LLSettingsDay::Seconds dayoffset,
|
||||
LLSettingsBase::Seconds transition,
|
||||
S32 env_version)
|
||||
{
|
||||
LLSettingsVOBase::getSettingsAsset(assetId,
|
||||
[this, env, daylength, dayoffset, env_version](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat)
|
||||
[this, env, env_version, transition](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat)
|
||||
{
|
||||
onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, TRANSITION_DEFAULT, status, env_version);
|
||||
onSetEnvAssetLoaded(env, asset_id, settings, transition, status, env_version);
|
||||
});
|
||||
}
|
||||
|
||||
void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env,
|
||||
LLUUID asset_id,
|
||||
LLSettingsBase::ptr_t settings,
|
||||
LLSettingsDay::Seconds daylength,
|
||||
LLSettingsDay::Seconds dayoffset,
|
||||
LLSettingsBase::Seconds transition,
|
||||
S32 status,
|
||||
S32 env_version)
|
||||
|
|
@ -1685,7 +1681,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI
|
|||
if (!envinfo->mDayCycle)
|
||||
{
|
||||
clearEnvironment(ENV_PARCEL);
|
||||
setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, envinfo->mEnvVersion);
|
||||
setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion);
|
||||
updateEnvironment();
|
||||
}
|
||||
else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER)
|
||||
|
|
@ -1693,7 +1689,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI
|
|||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Invalid day cycle for region" << LL_ENDL;
|
||||
clearEnvironment(ENV_PARCEL);
|
||||
setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, envinfo->mEnvVersion);
|
||||
setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion);
|
||||
updateEnvironment();
|
||||
}
|
||||
else
|
||||
|
|
@ -2939,17 +2935,15 @@ bool LLEnvironment::loadFromSettings()
|
|||
|
||||
if (env_data.has("day_id"))
|
||||
{
|
||||
LLSettingsDay::Seconds length = LLSettingsDay::Seconds(env_data["day_length"].asInteger());
|
||||
LLSettingsDay::Seconds offset = LLSettingsDay::Seconds(env_data["day_offset"].asInteger());
|
||||
LLUUID assetId = env_data["day_id"].asUUID();
|
||||
|
||||
LLSettingsVOBase::getSettingsAsset(assetId,
|
||||
[this, length, offset, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat)
|
||||
[this, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat)
|
||||
{
|
||||
// Day should be always applied first,
|
||||
// otherwise it will override sky or water that was set earlier
|
||||
// so wait for asset to load before applying sky/water
|
||||
onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, length, offset, TRANSITION_DEFAULT, status, NO_VERSION);
|
||||
onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, TRANSITION_DEFAULT, status, NO_VERSION);
|
||||
bool valid = false, has_assets = false;
|
||||
loadSkyWaterFromSettings(env_data, valid, has_assets);
|
||||
if (!has_assets && valid)
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@ class LLEnvironment : public LLSingleton<LLEnvironment>
|
|||
LOG_CLASS(LLEnvironment);
|
||||
|
||||
public:
|
||||
static const F32Seconds TRANSITION_INSTANT;
|
||||
static const F32Seconds TRANSITION_FAST;
|
||||
static const F32Seconds TRANSITION_DEFAULT;
|
||||
static const F32Seconds TRANSITION_SLOW;
|
||||
static const F32Seconds TRANSITION_ALTITUDE;
|
||||
static const F64Seconds TRANSITION_INSTANT;
|
||||
static const F64Seconds TRANSITION_FAST;
|
||||
static const F64Seconds TRANSITION_DEFAULT;
|
||||
static const F64Seconds TRANSITION_SLOW;
|
||||
static const F64Seconds TRANSITION_ALTITUDE;
|
||||
|
||||
static const LLUUID KNOWN_SKY_SUNRISE;
|
||||
static const LLUUID KNOWN_SKY_MIDDAY;
|
||||
|
|
@ -144,8 +144,8 @@ public:
|
|||
void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t()), env_version); }
|
||||
void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed), env_version); }
|
||||
void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw), env_version); }
|
||||
void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 env_version = NO_VERSION);
|
||||
void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version = NO_VERSION);
|
||||
void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version);
|
||||
void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsBase::Seconds transition = TRANSITION_DEFAULT, S32 env_version = NO_VERSION);
|
||||
|
||||
void setSharedEnvironment();
|
||||
void clearEnvironment(EnvSelection_t env);
|
||||
|
|
@ -434,7 +434,7 @@ private:
|
|||
|
||||
void onAgentPositionHasChanged(const LLVector3 &localpos);
|
||||
|
||||
void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version);
|
||||
void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsBase::Seconds transition, S32 status, S32 env_version);
|
||||
void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset, altitudes_vect_t altitudes);
|
||||
|
||||
void handleEnvironmentPushClear(LLUUID experience_id, LLSD &message, F32 transition);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "lltooltip.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentpicksinfo.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llclipboard.h"
|
||||
#include "llinventorybridge.h"
|
||||
|
|
@ -403,6 +404,8 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
|
|||
mMoreTextBox = LLUICtrlFactory::create<LLTextBox> (more_button_params);
|
||||
mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::onMoreTextBoxClicked, this));
|
||||
addChild(mMoreTextBox);
|
||||
LLRect rect = mMoreTextBox->getRect();
|
||||
mMoreTextBox->setRect(LLRect(rect.mLeft - rect.getWidth(), rect.mTop, rect.mRight, rect.mBottom));
|
||||
|
||||
mDropDownItemsCount = 0;
|
||||
|
||||
|
|
@ -1202,6 +1205,10 @@ bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata)
|
|||
{
|
||||
return isClipboardPasteable();
|
||||
}
|
||||
else if (param == "create_pick")
|
||||
{
|
||||
return !LLAgentPicksInfo::getInstance()->isPickLimitReached();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1250,6 +1257,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
|
|||
LLFloaterReg::showInstance("world_map", "center");
|
||||
}
|
||||
}
|
||||
else if (action == "create_pick")
|
||||
{
|
||||
LLSD args;
|
||||
args["type"] = "create_pick";
|
||||
args["item_id"] = item->getUUID();
|
||||
LLFloaterSidePanelContainer::showPanel("places", args);
|
||||
}
|
||||
else if (action == "cut")
|
||||
{
|
||||
}
|
||||
|
|
@ -1265,6 +1279,20 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
|
|||
{
|
||||
gInventory.removeItem(mSelectedItemID);
|
||||
}
|
||||
else if (action == "rename")
|
||||
{
|
||||
LLSD args;
|
||||
args["NAME"] = item->getName();
|
||||
|
||||
LLSD payload;
|
||||
payload["id"] = mSelectedItemID;
|
||||
|
||||
LLNotificationsUtil::add("RenameLandmark", args, payload, boost::bind(onRenameCommit, _1, _2));
|
||||
}
|
||||
else if (action == "move_to_landmarks")
|
||||
{
|
||||
change_item_parent(mSelectedItemID, gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK));
|
||||
}
|
||||
|
||||
// Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item).
|
||||
// See EXT-4217 and STORM-207.
|
||||
|
|
@ -1277,6 +1305,28 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
|
|||
}
|
||||
}
|
||||
|
||||
bool LLFavoritesBarCtrl::onRenameCommit(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if (0 == option)
|
||||
{
|
||||
LLUUID id = notification["payload"]["id"].asUUID();
|
||||
LLInventoryItem *item = gInventory.getItem(id);
|
||||
std::string landmark_name = response["new_name"].asString();
|
||||
LLStringUtil::trim(landmark_name);
|
||||
|
||||
if (!landmark_name.empty() && item && item->getName() != landmark_name)
|
||||
{
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
|
||||
new_item->rename(landmark_name);
|
||||
new_item->updateServer(FALSE);
|
||||
gInventory.updateItem(new_item);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
|
||||
{
|
||||
if (!LLClipboard::instance().hasContents())
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ protected:
|
|||
|
||||
bool enableSelected(const LLSD& userdata);
|
||||
void doToSelected(const LLSD& userdata);
|
||||
static bool onRenameCommit(const LLSD& notification, const LLSD& response);
|
||||
BOOL isClipboardPasteable() const;
|
||||
void pasteFromClipboard() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* @file llfloateraddpaymentmethod.cpp
|
||||
* @brief LLFloaterAddPaymentMethod class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloateraddpaymentmethod.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llweb.h"
|
||||
|
||||
|
||||
LLFloaterAddPaymentMethod::LLFloaterAddPaymentMethod(const LLSD& key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
}
|
||||
|
||||
LLFloaterAddPaymentMethod::~LLFloaterAddPaymentMethod()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLFloaterAddPaymentMethod::postBuild()
|
||||
{
|
||||
setCanDrag(FALSE);
|
||||
getChild<LLButton>("continue_btn")->setCommitCallback(boost::bind(&LLFloaterAddPaymentMethod::onContinueBtn, this));
|
||||
getChild<LLButton>("close_btn")->setCommitCallback(boost::bind(&LLFloaterAddPaymentMethod::onCloseBtn, this));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterAddPaymentMethod::onOpen(const LLSD& key)
|
||||
{
|
||||
centerOnScreen();
|
||||
}
|
||||
|
||||
void LLFloaterAddPaymentMethod::onContinueBtn()
|
||||
{
|
||||
closeFloater();
|
||||
LLNotificationsUtil::add("AddPaymentMethod", LLSD(), LLSD(),
|
||||
[this](const LLSD¬if, const LLSD&resp)
|
||||
{
|
||||
S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
|
||||
if (opt == 0)
|
||||
{
|
||||
LLWeb::loadURL(this->getString("continue_url"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void LLFloaterAddPaymentMethod::onCloseBtn()
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLFloaterAddPaymentMethod::centerOnScreen()
|
||||
{
|
||||
LLVector2 window_size = LLUI::getInstance()->getWindowSize();
|
||||
centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY])));
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* @file llfloateraddpaymentmethod.h
|
||||
* @brief LLFloaterAddPaymentMethod class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_FLOATER_ADDPAYMENTMETHOD_H
|
||||
#define LL_FLOATER_ADDPAYMENTMETHOD_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLFloaterAddPaymentMethod:
|
||||
public LLFloater
|
||||
{
|
||||
friend class LLFloaterReg;
|
||||
public:
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
private:
|
||||
LLFloaterAddPaymentMethod(const LLSD& key);
|
||||
|
||||
void centerOnScreen();
|
||||
|
||||
void onCloseBtn();
|
||||
void onContinueBtn();
|
||||
|
||||
/*virtual*/ ~LLFloaterAddPaymentMethod();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -32,6 +32,8 @@
|
|||
#include "llcurrencyuimanager.h"
|
||||
#include "llfloater.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "lllayoutstack.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llstatusbar.h"
|
||||
#include "lltextbox.h"
|
||||
|
|
@ -42,7 +44,6 @@
|
|||
#include "llwindow.h"
|
||||
#include "llappviewer.h"
|
||||
|
||||
static const S32 STANDARD_BUY_AMOUNT = 2000;
|
||||
static const S32 MINIMUM_BALANCE_AMOUNT = 0;
|
||||
|
||||
class LLFloaterBuyCurrencyUI
|
||||
|
|
@ -58,8 +59,8 @@ public:
|
|||
LLCurrencyUIManager mManager;
|
||||
|
||||
bool mHasTarget;
|
||||
std::string mTargetName;
|
||||
S32 mTargetPrice;
|
||||
S32 mRequiredAmount;
|
||||
|
||||
public:
|
||||
void noTarget();
|
||||
|
|
@ -68,6 +69,7 @@ public:
|
|||
virtual BOOL postBuild();
|
||||
|
||||
void updateUI();
|
||||
void collapsePanels(bool collapse);
|
||||
|
||||
virtual void draw();
|
||||
virtual BOOL canClose();
|
||||
|
|
@ -92,7 +94,9 @@ LLFloater* LLFloaterBuyCurrency::buildFloater(const LLSD& key)
|
|||
LLFloaterBuyCurrencyUI::LLFloaterBuyCurrencyUI(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
mChildren(*this),
|
||||
mManager(*this)
|
||||
mManager(*this),
|
||||
mHasTarget(false),
|
||||
mTargetPrice(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -104,15 +108,20 @@ LLFloaterBuyCurrencyUI::~LLFloaterBuyCurrencyUI()
|
|||
void LLFloaterBuyCurrencyUI::noTarget()
|
||||
{
|
||||
mHasTarget = false;
|
||||
mManager.setAmount(STANDARD_BUY_AMOUNT);
|
||||
mTargetPrice = 0;
|
||||
mManager.setAmount(0);
|
||||
}
|
||||
|
||||
void LLFloaterBuyCurrencyUI::target(const std::string& name, S32 price)
|
||||
{
|
||||
mHasTarget = true;
|
||||
mTargetName = name;
|
||||
mTargetPrice = price;
|
||||
|
||||
if (!name.empty())
|
||||
{
|
||||
getChild<LLUICtrl>("target_price_label")->setValue(name);
|
||||
}
|
||||
|
||||
S32 balance = gStatusBar->getBalance();
|
||||
S32 need = price - balance;
|
||||
if (need < 0)
|
||||
|
|
@ -120,7 +129,8 @@ void LLFloaterBuyCurrencyUI::target(const std::string& name, S32 price)
|
|||
need = 0;
|
||||
}
|
||||
|
||||
mManager.setAmount(need + MINIMUM_BALANCE_AMOUNT);
|
||||
mRequiredAmount = need + MINIMUM_BALANCE_AMOUNT;
|
||||
mManager.setAmount(0);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -175,7 +185,6 @@ void LLFloaterBuyCurrencyUI::updateUI()
|
|||
getChildView("purchase_warning_repurchase")->setVisible(FALSE);
|
||||
getChildView("purchase_warning_notenough")->setVisible(FALSE);
|
||||
getChildView("contacting")->setVisible(FALSE);
|
||||
getChildView("buy_action")->setVisible(FALSE);
|
||||
|
||||
if (hasError)
|
||||
{
|
||||
|
|
@ -209,8 +218,8 @@ void LLFloaterBuyCurrencyUI::updateUI()
|
|||
{
|
||||
if (mHasTarget)
|
||||
{
|
||||
getChildView("buy_action")->setVisible( true);
|
||||
getChild<LLUICtrl>("buy_action")->setTextArg("[ACTION]", mTargetName);
|
||||
getChild<LLUICtrl>("target_price")->setTextArg("[AMT]", llformat("%d", mTargetPrice));
|
||||
getChild<LLUICtrl>("required_amount")->setTextArg("[AMT]", llformat("%d", mRequiredAmount));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -231,18 +240,40 @@ void LLFloaterBuyCurrencyUI::updateUI()
|
|||
|
||||
if (mHasTarget)
|
||||
{
|
||||
if (total >= mTargetPrice)
|
||||
{
|
||||
getChildView("purchase_warning_repurchase")->setVisible( true);
|
||||
}
|
||||
else
|
||||
{
|
||||
getChildView("purchase_warning_notenough")->setVisible( true);
|
||||
}
|
||||
getChildView("purchase_warning_repurchase")->setVisible( !getChildView("currency_links")->getVisible());
|
||||
}
|
||||
}
|
||||
|
||||
getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError);
|
||||
getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError && !getChildView("currency_est")->getVisible());
|
||||
}
|
||||
|
||||
void LLFloaterBuyCurrencyUI::collapsePanels(bool collapse)
|
||||
{
|
||||
LLLayoutPanel* price_panel = getChild<LLLayoutPanel>("layout_panel_price");
|
||||
|
||||
if (price_panel->isCollapsed() == collapse)
|
||||
return;
|
||||
|
||||
LLLayoutStack* outer_stack = getChild<LLLayoutStack>("outer_stack");
|
||||
LLLayoutPanel* required_panel = getChild<LLLayoutPanel>("layout_panel_required");
|
||||
LLLayoutPanel* msg_panel = getChild<LLLayoutPanel>("layout_panel_msg");
|
||||
|
||||
S32 delta_height = price_panel->getRect().getHeight() + required_panel->getRect().getHeight() + msg_panel->getRect().getHeight();
|
||||
delta_height *= (collapse ? -1 : 1);
|
||||
|
||||
LLIconCtrl* icon = getChild<LLIconCtrl>("normal_background");
|
||||
LLRect rect = icon->getRect();
|
||||
icon->setRect(rect.setOriginAndSize(rect.mLeft, rect.mBottom - delta_height, rect.getWidth(), rect.getHeight() + delta_height));
|
||||
|
||||
outer_stack->collapsePanel(price_panel, collapse);
|
||||
outer_stack->collapsePanel(required_panel, collapse);
|
||||
outer_stack->collapsePanel(msg_panel, collapse);
|
||||
|
||||
outer_stack->updateLayout();
|
||||
|
||||
LLRect floater_rect = getRect();
|
||||
floater_rect.mBottom -= delta_height;
|
||||
setShape(floater_rect, false);
|
||||
}
|
||||
|
||||
void LLFloaterBuyCurrencyUI::onClickBuy()
|
||||
|
|
@ -260,20 +291,72 @@ void LLFloaterBuyCurrencyUI::onClickCancel()
|
|||
LLStatusBar::sendMoneyBalanceRequest();
|
||||
}
|
||||
|
||||
LLFetchAvatarPaymentInfo* LLFloaterBuyCurrency::sPropertiesRequest = NULL;
|
||||
|
||||
// static
|
||||
void LLFloaterBuyCurrency::buyCurrency()
|
||||
{
|
||||
LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyCurrencyUI>("buy_currency");
|
||||
ui->noTarget();
|
||||
ui->updateUI();
|
||||
delete sPropertiesRequest;
|
||||
sPropertiesRequest = new LLFetchAvatarPaymentInfo(false);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyCurrency::buyCurrency(const std::string& name, S32 price)
|
||||
{
|
||||
LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyCurrencyUI>("buy_currency");
|
||||
ui->target(name, price);
|
||||
ui->updateUI();
|
||||
delete sPropertiesRequest;
|
||||
sPropertiesRequest = new LLFetchAvatarPaymentInfo(true, name, price);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyCurrency::handleBuyCurrency(bool has_piof, bool has_target, const std::string name, S32 price)
|
||||
{
|
||||
delete sPropertiesRequest;
|
||||
sPropertiesRequest = NULL;
|
||||
|
||||
if (has_piof)
|
||||
{
|
||||
LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyCurrencyUI>("buy_currency");
|
||||
if (has_target)
|
||||
{
|
||||
ui->target(name, price);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->noTarget();
|
||||
}
|
||||
ui->updateUI();
|
||||
ui->collapsePanels(!has_target);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFloaterReg::showInstance("add_payment_method");
|
||||
}
|
||||
}
|
||||
|
||||
LLFetchAvatarPaymentInfo::LLFetchAvatarPaymentInfo(bool has_target, const std::string& name, S32 price)
|
||||
: mAvatarID(gAgent.getID()),
|
||||
mHasTarget(has_target),
|
||||
mPrice(price),
|
||||
mName(name)
|
||||
{
|
||||
LLAvatarPropertiesProcessor* processor = LLAvatarPropertiesProcessor::getInstance();
|
||||
// register ourselves as an observer
|
||||
processor->addObserver(mAvatarID, this);
|
||||
// send a request (duplicates will be suppressed inside the avatar
|
||||
// properties processor)
|
||||
processor->sendAvatarPropertiesRequest(mAvatarID);
|
||||
}
|
||||
|
||||
LLFetchAvatarPaymentInfo::~LLFetchAvatarPaymentInfo()
|
||||
{
|
||||
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarID, this);
|
||||
}
|
||||
|
||||
void LLFetchAvatarPaymentInfo::processProperties(void* data, EAvatarProcessorType type)
|
||||
{
|
||||
if (data && type == APT_PROPERTIES)
|
||||
{
|
||||
LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data);
|
||||
LLFloaterBuyCurrency::handleBuyCurrency(LLAvatarPropertiesProcessor::hasPaymentInfoOnFile(avatar_data), mHasTarget, mName, mPrice);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,15 +27,34 @@
|
|||
#ifndef LL_LLFLOATERBUYCURRENCY_H
|
||||
#define LL_LLFLOATERBUYCURRENCY_H
|
||||
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "stdtypes.h"
|
||||
|
||||
#include "llagent.h"
|
||||
class LLFloater;
|
||||
|
||||
class LLFetchAvatarPaymentInfo : public LLAvatarPropertiesObserver
|
||||
{
|
||||
public:
|
||||
LLFetchAvatarPaymentInfo(bool has_target, const std::string& name = std::string(), S32 price = 0);
|
||||
~LLFetchAvatarPaymentInfo();
|
||||
|
||||
void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
private:
|
||||
LLUUID mAvatarID;
|
||||
bool mHasTarget;
|
||||
std::string mName;
|
||||
S32 mPrice;
|
||||
};
|
||||
|
||||
|
||||
class LLFloaterBuyCurrency
|
||||
{
|
||||
public:
|
||||
static void buyCurrency();
|
||||
static void buyCurrency(const std::string& name, S32 price);
|
||||
|
||||
static void handleBuyCurrency(bool has_piof, bool has_target, const std::string name, S32 price);
|
||||
/* name should be a noun phrase of the object or service being bought:
|
||||
"That object costs"
|
||||
"Trying to give"
|
||||
|
|
@ -44,7 +63,8 @@ public:
|
|||
*/
|
||||
|
||||
static LLFloater* buildFloater(const LLSD& key);
|
||||
|
||||
static LLFetchAvatarPaymentInfo* sPropertiesRequest;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -0,0 +1,323 @@
|
|||
/**
|
||||
* @file llfloatercreatelandmark.cpp
|
||||
* @brief LLFloaterCreateLandmark class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloatercreatelandmark.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentui.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "llinventoryobserver.h"
|
||||
#include "lllandmarkactions.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpanellandmarkinfo.h"
|
||||
#include "llparcel.h"
|
||||
#include "lltextbox.h"
|
||||
#include "lltexteditor.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewermessage.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
typedef std::pair<LLUUID, std::string> folder_pair_t;
|
||||
|
||||
class LLLandmarksInventoryObserver : public LLInventoryAddedObserver
|
||||
{
|
||||
public:
|
||||
LLLandmarksInventoryObserver(LLFloaterCreateLandmark* create_landmark_floater) :
|
||||
mFloater(create_landmark_floater)
|
||||
{}
|
||||
|
||||
protected:
|
||||
/*virtual*/ void done()
|
||||
{
|
||||
mFloater->setItem(gInventory.getAddedIDs());
|
||||
}
|
||||
|
||||
private:
|
||||
LLFloaterCreateLandmark* mFloater;
|
||||
};
|
||||
|
||||
LLFloaterCreateLandmark::LLFloaterCreateLandmark(const LLSD& key)
|
||||
: LLFloater("add_landmark"),
|
||||
mItem(NULL)
|
||||
{
|
||||
mInventoryObserver = new LLLandmarksInventoryObserver(this);
|
||||
}
|
||||
|
||||
LLFloaterCreateLandmark::~LLFloaterCreateLandmark()
|
||||
{
|
||||
removeObserver();
|
||||
}
|
||||
|
||||
BOOL LLFloaterCreateLandmark::postBuild()
|
||||
{
|
||||
mFolderCombo = getChild<LLComboBox>("folder_combo");
|
||||
mLandmarkTitleEditor = getChild<LLLineEditor>("title_editor");
|
||||
mNotesEditor = getChild<LLTextEditor>("notes_editor");
|
||||
|
||||
getChild<LLTextBox>("new_folder_textbox")->setURLClickedCallback(boost::bind(&LLFloaterCreateLandmark::onCreateFolderClicked, this));
|
||||
getChild<LLButton>("ok_btn")->setClickedCallback(boost::bind(&LLFloaterCreateLandmark::onSaveClicked, this));
|
||||
getChild<LLButton>("cancel_btn")->setClickedCallback(boost::bind(&LLFloaterCreateLandmark::onCancelClicked, this));
|
||||
|
||||
mLandmarksID = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::removeObserver()
|
||||
{
|
||||
if (gInventory.containsObserver(mInventoryObserver))
|
||||
gInventory.removeObserver(mInventoryObserver);
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::onOpen(const LLSD& key)
|
||||
{
|
||||
LLUUID dest_folder = LLUUID();
|
||||
if (key.has("dest_folder"))
|
||||
{
|
||||
dest_folder = key["dest_folder"].asUUID();
|
||||
}
|
||||
mItem = NULL;
|
||||
gInventory.addObserver(mInventoryObserver);
|
||||
setLandmarkInfo(dest_folder);
|
||||
populateFoldersList(dest_folder);
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::setLandmarkInfo(const LLUUID &folder_id)
|
||||
{
|
||||
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
|
||||
LLParcel* parcel = parcel_mgr->getAgentParcel();
|
||||
std::string name = parcel->getName();
|
||||
LLVector3 agent_pos = gAgent.getPositionAgent();
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
S32 region_x = ll_round(agent_pos.mV[VX]);
|
||||
S32 region_y = ll_round(agent_pos.mV[VY]);
|
||||
S32 region_z = ll_round(agent_pos.mV[VZ]);
|
||||
|
||||
std::string region_name;
|
||||
LLViewerRegion* region = parcel_mgr->getSelectionRegion();
|
||||
if (region)
|
||||
{
|
||||
region_name = region->getName();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string desc;
|
||||
LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_NORMAL, agent_pos);
|
||||
region_name = desc;
|
||||
}
|
||||
|
||||
mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)",
|
||||
region_name.c_str(), region_x, region_y, region_z));
|
||||
}
|
||||
else
|
||||
{
|
||||
mLandmarkTitleEditor->setText(name);
|
||||
}
|
||||
|
||||
LLLandmarkActions::createLandmarkHere(name, "", folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE));
|
||||
}
|
||||
|
||||
bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right)
|
||||
{
|
||||
return left.second < right.second;
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::populateFoldersList(const LLUUID &folder_id)
|
||||
{
|
||||
// Collect all folders that can contain landmarks.
|
||||
LLInventoryModel::cat_array_t cats;
|
||||
LLPanelLandmarkInfo::collectLandmarkFolders(cats);
|
||||
|
||||
mFolderCombo->removeall();
|
||||
|
||||
// Put the "My Favorites" folder first in list.
|
||||
LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
|
||||
LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id);
|
||||
if (!favorites_cat)
|
||||
{
|
||||
LL_WARNS() << "Cannot find the favorites folder" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
mFolderCombo->add(getString("favorites_bar"), favorites_cat->getUUID());
|
||||
}
|
||||
|
||||
// Add the "Landmarks" category.
|
||||
const LLViewerInventoryCategory* lmcat = gInventory.getCategory(mLandmarksID);
|
||||
if (!lmcat)
|
||||
{
|
||||
LL_WARNS() << "Cannot find the landmarks folder" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string cat_full_name = LLPanelLandmarkInfo::getFullFolderName(lmcat);
|
||||
mFolderCombo->add(cat_full_name, lmcat->getUUID());
|
||||
}
|
||||
|
||||
typedef std::vector<folder_pair_t> folder_vec_t;
|
||||
folder_vec_t folders;
|
||||
// Sort the folders by their full name.
|
||||
for (S32 i = 0; i < cats.size(); i++)
|
||||
{
|
||||
const LLViewerInventoryCategory* cat = cats.at(i);
|
||||
std::string cat_full_name = LLPanelLandmarkInfo::getFullFolderName(cat);
|
||||
folders.push_back(folder_pair_t(cat->getUUID(), cat_full_name));
|
||||
}
|
||||
sort(folders.begin(), folders.end(), cmp_folders);
|
||||
|
||||
// Finally, populate the combobox.
|
||||
for (folder_vec_t::const_iterator it = folders.begin(); it != folders.end(); it++)
|
||||
mFolderCombo->add(it->second, LLSD(it->first));
|
||||
|
||||
if (folder_id.notNull())
|
||||
{
|
||||
mFolderCombo->setCurrentByID(folder_id);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::onCreateFolderClicked()
|
||||
{
|
||||
LLNotificationsUtil::add("CreateLandmarkFolder", LLSD(), LLSD(),
|
||||
[this](const LLSD¬if, const LLSD&resp)
|
||||
{
|
||||
S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
|
||||
if (opt == 0)
|
||||
{
|
||||
std::string folder_name = resp["message"].asString();
|
||||
if (!folder_name.empty())
|
||||
{
|
||||
inventory_func_type func = boost::bind(&LLFloaterCreateLandmark::folderCreatedCallback, this, _1);
|
||||
gInventory.createNewCategory(mLandmarksID, LLFolderType::FT_NONE, folder_name, func);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::folderCreatedCallback(LLUUID folder_id)
|
||||
{
|
||||
populateFoldersList(folder_id);
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::onSaveClicked()
|
||||
{
|
||||
if (mItem.isNull())
|
||||
{
|
||||
closeFloater();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string current_title_value = mLandmarkTitleEditor->getText();
|
||||
std::string item_title_value = mItem->getName();
|
||||
std::string current_notes_value = mNotesEditor->getText();
|
||||
std::string item_notes_value = mItem->getDescription();
|
||||
|
||||
LLStringUtil::trim(current_title_value);
|
||||
LLStringUtil::trim(current_notes_value);
|
||||
|
||||
LLUUID item_id = mItem->getUUID();
|
||||
LLUUID folder_id = mFolderCombo->getValue().asUUID();
|
||||
bool change_parent = folder_id != mItem->getParentUUID();
|
||||
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(mItem);
|
||||
|
||||
if (!current_title_value.empty() &&
|
||||
(item_title_value != current_title_value || item_notes_value != current_notes_value))
|
||||
{
|
||||
new_item->rename(current_title_value);
|
||||
new_item->setDescription(current_notes_value);
|
||||
LLPointer<LLInventoryCallback> cb;
|
||||
if (change_parent)
|
||||
{
|
||||
cb = new LLUpdateLandmarkParent(new_item, folder_id);
|
||||
}
|
||||
LLInventoryModel::LLCategoryUpdate up(mItem->getParentUUID(), 0);
|
||||
gInventory.accountForUpdate(up);
|
||||
update_inventory_item(new_item, cb);
|
||||
}
|
||||
else if (change_parent)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
LLInventoryModel::LLCategoryUpdate old_folder(mItem->getParentUUID(),-1);
|
||||
update.push_back(old_folder);
|
||||
LLInventoryModel::LLCategoryUpdate new_folder(folder_id, 1);
|
||||
update.push_back(new_folder);
|
||||
gInventory.accountForUpdate(update);
|
||||
|
||||
new_item->setParent(folder_id);
|
||||
new_item->updateParentOnServer(FALSE);
|
||||
}
|
||||
|
||||
gInventory.updateItem(new_item);
|
||||
gInventory.notifyObservers();
|
||||
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLFloaterCreateLandmark::onCancelClicked()
|
||||
{
|
||||
if (!mItem.isNull())
|
||||
{
|
||||
LLUUID item_id = mItem->getUUID();
|
||||
remove_inventory_item(item_id, NULL);
|
||||
}
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterCreateLandmark::setItem(const uuid_set_t& items)
|
||||
{
|
||||
for (uuid_set_t::const_iterator item_iter = items.begin();
|
||||
item_iter != items.end();
|
||||
++item_iter)
|
||||
{
|
||||
const LLUUID& item_id = (*item_iter);
|
||||
if(!highlight_offered_object(item_id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
LLInventoryItem* item = gInventory.getItem(item_id);
|
||||
|
||||
llassert(item);
|
||||
if (item && (LLAssetType::AT_LANDMARK == item->getType()) )
|
||||
{
|
||||
if(!getItem())
|
||||
{
|
||||
removeObserver();
|
||||
mItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* @file llfloatercreatelandmark.h
|
||||
* @brief LLFloaterCreateLandmark class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERCREATELANDMARK_H
|
||||
#define LL_LLFLOATERCREATELANDMARK_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLComboBox;
|
||||
class LLInventoryItem;
|
||||
class LLLineEditor;
|
||||
class LLTextEditor;
|
||||
class LLLandmarksInventoryObserver;
|
||||
|
||||
class LLFloaterCreateLandmark:
|
||||
public LLFloater
|
||||
{
|
||||
friend class LLFloaterReg;
|
||||
|
||||
public:
|
||||
|
||||
LLFloaterCreateLandmark(const LLSD& key);
|
||||
~LLFloaterCreateLandmark();
|
||||
|
||||
BOOL postBuild();
|
||||
void onOpen(const LLSD& key);
|
||||
|
||||
void setItem(const uuid_set_t& items);
|
||||
|
||||
LLInventoryItem* getItem() { return mItem; }
|
||||
|
||||
private:
|
||||
void setLandmarkInfo(const LLUUID &folder_id);
|
||||
void removeObserver();
|
||||
void populateFoldersList(const LLUUID &folder_id = LLUUID::null);
|
||||
void onCreateFolderClicked();
|
||||
void onSaveClicked();
|
||||
void onCancelClicked();
|
||||
|
||||
void folderCreatedCallback(LLUUID folder_id);
|
||||
|
||||
LLComboBox* mFolderCombo;
|
||||
LLLineEditor* mLandmarkTitleEditor;
|
||||
LLTextEditor* mNotesEditor;
|
||||
LLUUID mLandmarksID;
|
||||
|
||||
LLLandmarksInventoryObserver* mInventoryObserver;
|
||||
LLPointer<LLInventoryItem> mItem;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -53,11 +53,15 @@ namespace
|
|||
const std::string FIELD_SKY_CLOUD_SCALE("cloud_scale");
|
||||
const std::string FIELD_SKY_SCENE_GAMMA("scene_gamma");
|
||||
const std::string FIELD_SKY_SUN_ROTATION("sun_rotation");
|
||||
const std::string FIELD_SKY_SUN_AZIMUTH("sun_azimuth");
|
||||
const std::string FIELD_SKY_SUN_ELEVATION("sun_elevation");
|
||||
const std::string FIELD_SKY_SUN_SCALE("sun_scale");
|
||||
const std::string FIELD_SKY_GLOW_FOCUS("glow_focus");
|
||||
const std::string FIELD_SKY_GLOW_SIZE("glow_size");
|
||||
const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness");
|
||||
const std::string FIELD_SKY_MOON_ROTATION("moon_rotation");
|
||||
const std::string FIELD_SKY_MOON_AZIMUTH("moon_azimuth");
|
||||
const std::string FIELD_SKY_MOON_ELEVATION("moon_elevation");
|
||||
const std::string BTN_RESET("btn_reset");
|
||||
|
||||
const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f);
|
||||
|
|
@ -96,9 +100,13 @@ BOOL LLFloaterEnvironmentAdjust::postBuild()
|
|||
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); });
|
||||
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(BTN_RESET)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onButtonReset(); });
|
||||
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); });
|
||||
|
|
@ -169,10 +177,25 @@ void LLFloaterEnvironmentAdjust::refresh()
|
|||
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setValue(2.0 - (glow.mV[0] / SLIDER_SCALE_GLOW_R));
|
||||
getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B);
|
||||
getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mLiveSky->getStarBrightness());
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(mLiveSky->getSunRotation());
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setValue(mLiveSky->getSunScale());
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(mLiveSky->getMoonRotation());
|
||||
|
||||
// Sun rotation
|
||||
LLQuaternion quat = mLiveSky->getSunRotation();
|
||||
F32 azimuth;
|
||||
F32 elevation;
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->setValue(elevation);
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(quat);
|
||||
|
||||
// Moon rotation
|
||||
quat = mLiveSky->getMoonRotation();
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->setValue(elevation);
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(quat);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -325,10 +348,45 @@ void LLFloaterEnvironmentAdjust::onStarBrightnessChanged()
|
|||
|
||||
void LLFloaterEnvironmentAdjust::onSunRotationChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setSunRotation(getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->getRotation());
|
||||
mLiveSky->update();
|
||||
LLQuaternion quat = getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->getRotation();
|
||||
F32 azimuth;
|
||||
F32 elevation;
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->setValue(elevation);
|
||||
if (mLiveSky)
|
||||
{
|
||||
mLiveSky->setSunRotation(quat);
|
||||
mLiveSky->update();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onSunAzimElevChanged()
|
||||
{
|
||||
F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal();
|
||||
F32 elevation = getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->getValue().asReal();
|
||||
LLQuaternion quat;
|
||||
|
||||
azimuth *= DEG_TO_RAD;
|
||||
elevation *= DEG_TO_RAD;
|
||||
|
||||
if (is_approx_zero(elevation))
|
||||
{
|
||||
elevation = F_APPROXIMATELY_ZERO;
|
||||
}
|
||||
|
||||
quat.setAngleAxis(-elevation, 0, 1, 0);
|
||||
LLQuaternion az_quat;
|
||||
az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1);
|
||||
quat *= az_quat;
|
||||
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(quat);
|
||||
|
||||
if (mLiveSky)
|
||||
{
|
||||
mLiveSky->setSunRotation(quat);
|
||||
mLiveSky->update();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onSunScaleChanged()
|
||||
|
|
@ -341,10 +399,45 @@ void LLFloaterEnvironmentAdjust::onSunScaleChanged()
|
|||
|
||||
void LLFloaterEnvironmentAdjust::onMoonRotationChanged()
|
||||
{
|
||||
if (!mLiveSky)
|
||||
return;
|
||||
mLiveSky->setMoonRotation(getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->getRotation());
|
||||
mLiveSky->update();
|
||||
LLQuaternion quat = getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->getRotation();
|
||||
F32 azimuth;
|
||||
F32 elevation;
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->setValue(elevation);
|
||||
if (mLiveSky)
|
||||
{
|
||||
mLiveSky->setMoonRotation(quat);
|
||||
mLiveSky->update();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onMoonAzimElevChanged()
|
||||
{
|
||||
F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal();
|
||||
F32 elevation = getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->getValue().asReal();
|
||||
LLQuaternion quat;
|
||||
|
||||
azimuth *= DEG_TO_RAD;
|
||||
elevation *= DEG_TO_RAD;
|
||||
|
||||
if (is_approx_zero(elevation))
|
||||
{
|
||||
elevation = F_APPROXIMATELY_ZERO;
|
||||
}
|
||||
|
||||
quat.setAngleAxis(-elevation, 0, 1, 0);
|
||||
LLQuaternion az_quat;
|
||||
az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1);
|
||||
quat *= az_quat;
|
||||
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(quat);
|
||||
|
||||
if (mLiveSky)
|
||||
{
|
||||
mLiveSky->setMoonRotation(quat);
|
||||
mLiveSky->update();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterEnvironmentAdjust::onCloudMapChanged()
|
||||
|
|
|
|||
|
|
@ -73,9 +73,11 @@ private:
|
|||
void onGlowChanged();
|
||||
void onStarBrightnessChanged();
|
||||
void onSunRotationChanged();
|
||||
void onSunAzimElevChanged();
|
||||
void onSunScaleChanged();
|
||||
|
||||
void onMoonRotationChanged();
|
||||
void onMoonAzimElevChanged();
|
||||
|
||||
void onCloudMapChanged();
|
||||
void onWaterMapChanged();
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ void LLFloaterFixedEnvironment::onOpen(const LLSD& key)
|
|||
updateEditEnvironment();
|
||||
syncronizeTabs();
|
||||
refresh();
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_INSTANT);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ void LLFloaterFixedEnvironment::setEditSettingsAndUpdate(const LLSettingsBase::p
|
|||
updateEditEnvironment();
|
||||
syncronizeTabs();
|
||||
refresh();
|
||||
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST);
|
||||
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT);
|
||||
}
|
||||
|
||||
void LLFloaterFixedEnvironment::syncronizeTabs()
|
||||
|
|
@ -460,7 +460,7 @@ void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector<
|
|||
setDirtyFlag();
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater);
|
||||
setEditSettings(legacywater);
|
||||
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true);
|
||||
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT, true);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
|
|
@ -548,7 +548,7 @@ void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector<std:
|
|||
setDirtyFlag();
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky);
|
||||
setEditSettings(legacysky);
|
||||
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true);
|
||||
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT, true);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "llfloater.h"
|
||||
#include "llmediactrl.h"
|
||||
#include "llfloaterreg.h"
|
||||
|
||||
// register with dispatch via global object
|
||||
LLFloaterHandler gFloaterHandler;
|
||||
|
|
@ -50,9 +51,15 @@ LLFloater* get_parent_floater(LLView* view)
|
|||
|
||||
bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, LLMediaCtrl *web)
|
||||
{
|
||||
if (params.size() < 2) return false;
|
||||
if (params.size() < 1) return false;
|
||||
LLFloater* floater = NULL;
|
||||
// *TODO: implement floater lookup by name
|
||||
|
||||
if (params[0].asString() == "destinations")
|
||||
{
|
||||
LLFloaterReg::toggleInstanceOrBringToFront("destinations");
|
||||
return true;
|
||||
}
|
||||
if (params[0].asString() == "self")
|
||||
{
|
||||
if (web)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
/**
|
||||
* @file llfloaterhowto.cpp
|
||||
* @brief A variant of web floater meant to open guidebook
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloaterhowto.h"
|
||||
|
||||
#include "llfloaterreg.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llweb.h"
|
||||
|
||||
|
||||
const S32 STACK_WIDTH = 300;
|
||||
const S32 STACK_HEIGHT = 505; // content will be 500
|
||||
|
||||
LLFloaterHowTo::LLFloaterHowTo(const Params& key) :
|
||||
LLFloaterWebContent(key)
|
||||
{
|
||||
mShowPageTitle = false;
|
||||
}
|
||||
|
||||
BOOL LLFloaterHowTo::postBuild()
|
||||
{
|
||||
LLFloaterWebContent::postBuild();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterHowTo::onOpen(const LLSD& key)
|
||||
{
|
||||
LLFloaterWebContent::Params p(key);
|
||||
if (!p.url.isProvided() || p.url.getValue().empty())
|
||||
{
|
||||
std::string url = gSavedSettings.getString("GuidebookURL");
|
||||
p.url = LLWeb::expandURLSubstitutions(url, LLSD());
|
||||
}
|
||||
p.show_chrome = false;
|
||||
|
||||
LLFloaterWebContent::onOpen(p);
|
||||
|
||||
if (p.preferred_media_size().isEmpty())
|
||||
{
|
||||
// Elements from LLFloaterWebContent did not pick up restored size (save_rect) of LLFloaterHowTo
|
||||
// set the stack size and position (alternative to preferred_media_size)
|
||||
LLLayoutStack *stack = getChild<LLLayoutStack>("stack1");
|
||||
LLRect stack_rect = stack->getRect();
|
||||
stack->reshape(STACK_WIDTH, STACK_HEIGHT);
|
||||
stack->setOrigin(stack_rect.mLeft, stack_rect.mTop - STACK_HEIGHT);
|
||||
stack->updateLayout();
|
||||
}
|
||||
}
|
||||
|
||||
LLFloaterHowTo* LLFloaterHowTo::getInstance()
|
||||
{
|
||||
return LLFloaterReg::getTypedInstance<LLFloaterHowTo>("guidebook");
|
||||
}
|
||||
|
||||
BOOL LLFloaterHowTo::handleKeyHere(KEY key, MASK mask)
|
||||
{
|
||||
BOOL handled = FALSE;
|
||||
|
||||
if (KEY_F1 == key )
|
||||
{
|
||||
closeFloater();
|
||||
handled = TRUE;
|
||||
}
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* @file llfloaterhowto.h
|
||||
* @brief A variant of web floater meant to open guidebook
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERHOWTO_H
|
||||
#define LL_LLFLOATERHOWTO_H
|
||||
|
||||
#include "llfloaterwebcontent.h"
|
||||
|
||||
class LLMediaCtrl;
|
||||
|
||||
|
||||
class LLFloaterHowTo :
|
||||
public LLFloaterWebContent
|
||||
{
|
||||
public:
|
||||
LOG_CLASS(LLFloaterHowTo);
|
||||
|
||||
typedef LLFloaterWebContent::Params Params;
|
||||
|
||||
LLFloaterHowTo(const Params& key);
|
||||
|
||||
void onOpen(const LLSD& key) override;
|
||||
|
||||
BOOL handleKeyHere(KEY key, MASK mask) override;
|
||||
|
||||
static LLFloaterHowTo* getInstance();
|
||||
|
||||
bool matchesKey(const LLSD& key) override { return true; /*single instance*/ };
|
||||
|
||||
private:
|
||||
BOOL postBuild() override;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERHOWTO_H
|
||||
|
||||
|
|
@ -51,6 +51,9 @@
|
|||
|
||||
#include "llgroupactions.h"
|
||||
|
||||
const std::string LINDEN_HOMES_SKU = "131";
|
||||
bool LLFloaterLandHoldings::sHasLindenHome = false;
|
||||
|
||||
// protected
|
||||
LLFloaterLandHoldings::LLFloaterLandHoldings(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
|
|
@ -148,10 +151,24 @@ void LLFloaterLandHoldings::refresh()
|
|||
void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
|
||||
{
|
||||
LLFloaterLandHoldings* self = LLFloaterReg::findTypedInstance<LLFloaterLandHoldings>("land_holdings");
|
||||
|
||||
// Is this packet from an old, closed window?
|
||||
S32 count = msg->getNumberOfBlocks("QueryData");
|
||||
std::string land_sku;
|
||||
sHasLindenHome = false;
|
||||
if (!self)
|
||||
{
|
||||
for (S32 i = 0; i < count; i++)
|
||||
{
|
||||
if ( msg->getSizeFast(_PREHASH_QueryData, i, _PREHASH_ProductSKU) > 0 )
|
||||
{
|
||||
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
|
||||
|
||||
if (LINDEN_HOMES_SKU == land_sku)
|
||||
{
|
||||
sHasLindenHome = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -174,12 +191,9 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
|
|||
F32 global_x;
|
||||
F32 global_y;
|
||||
std::string sim_name;
|
||||
std::string land_sku;
|
||||
std::string land_type;
|
||||
|
||||
S32 i;
|
||||
S32 count = msg->getNumberOfBlocks("QueryData");
|
||||
for (i = 0; i < count; i++)
|
||||
for (S32 i = 0; i < count; i++)
|
||||
{
|
||||
msg->getUUID("QueryData", "OwnerID", owner_id, i);
|
||||
msg->getString("QueryData", "Name", name, i);
|
||||
|
|
@ -196,6 +210,10 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
|
|||
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
|
||||
LL_INFOS() << "Land sku: " << land_sku << LL_ENDL;
|
||||
land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku);
|
||||
if (LINDEN_HOMES_SKU == land_sku)
|
||||
{
|
||||
sHasLindenHome = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ public:
|
|||
|
||||
static void onGrantList(void* data);
|
||||
|
||||
static bool sHasLindenHome;
|
||||
|
||||
protected:
|
||||
void refreshAggregates();
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public:
|
|||
virtual LLFolderType::EType getPreferredType() const = 0;
|
||||
virtual void showProperties(void) = 0;
|
||||
virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual.
|
||||
virtual BOOL isAgentInventory() const { return FALSE; }
|
||||
virtual BOOL isUpToDate() const = 0;
|
||||
virtual void addChild(LLFolderViewModelItem* child);
|
||||
virtual bool hasChildren() const = 0;
|
||||
|
|
|
|||
|
|
@ -1835,28 +1835,11 @@ void LLItemBridge::restoreToWorld()
|
|||
|
||||
void LLItemBridge::gotoItem()
|
||||
{
|
||||
LLInventoryObject *obj = getInventoryObject();
|
||||
if (obj && obj->getIsLinkType())
|
||||
{
|
||||
const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX);
|
||||
if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id))
|
||||
{
|
||||
LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
|
||||
if (sidepanel_inventory && sidepanel_inventory->getInboxPanel())
|
||||
{
|
||||
sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
|
||||
if (active_panel)
|
||||
{
|
||||
active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
LLInventoryObject *obj = getInventoryObject();
|
||||
if (obj && obj->getIsLinkType())
|
||||
{
|
||||
show_item_original(obj->getUUID());
|
||||
}
|
||||
}
|
||||
|
||||
LLUIImagePtr LLItemBridge::getIcon() const
|
||||
|
|
@ -4116,6 +4099,12 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
|
|||
items.push_back(std::string("New Body Parts"));
|
||||
items.push_back(std::string("New Settings"));
|
||||
items.push_back(std::string("upload_def"));
|
||||
|
||||
if (!LLEnvironment::instance().isInventoryEnabled())
|
||||
{
|
||||
disabled_items.push_back("New Settings");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
getClipboardEntries(false, items, disabled_items, flags);
|
||||
|
|
@ -7052,8 +7041,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action
|
|||
if (!item)
|
||||
return;
|
||||
LLUUID asset_id = item->getAssetUUID();
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_INSTANT);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
|
||||
}
|
||||
else if ("apply_settings_parcel" == action)
|
||||
{
|
||||
|
|
@ -7227,21 +7216,17 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti
|
|||
}
|
||||
void LLLinkFolderBridge::gotoItem()
|
||||
{
|
||||
const LLUUID &cat_uuid = getFolderID();
|
||||
if (!cat_uuid.isNull())
|
||||
{
|
||||
LLFolderViewItem *base_folder = mInventoryPanel.get()->getItemByID(cat_uuid);
|
||||
if (base_folder)
|
||||
{
|
||||
if (LLInventoryModel* model = getInventoryModel())
|
||||
{
|
||||
model->fetchDescendentsOf(cat_uuid);
|
||||
}
|
||||
base_folder->setOpen(TRUE);
|
||||
mRoot->setSelection(base_folder,TRUE);
|
||||
mRoot->scrollToShowSelection();
|
||||
}
|
||||
}
|
||||
LLItemBridge::gotoItem();
|
||||
|
||||
const LLUUID &cat_uuid = getFolderID();
|
||||
if (!cat_uuid.isNull())
|
||||
{
|
||||
LLFolderViewItem *base_folder = LLInventoryPanel::getActiveInventoryPanel()->getItemByID(cat_uuid);
|
||||
if (base_folder)
|
||||
{
|
||||
base_folder->setOpen(TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
const LLUUID &LLLinkFolderBridge::getFolderID() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p)
|
|||
mPermissions(p.permissions),
|
||||
mFilterTypes(p.types),
|
||||
mFilterUUID(p.uuid),
|
||||
mFilterLinks(p.links)
|
||||
mFilterLinks(p.links),
|
||||
mSearchVisibility(p.search_visibility)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -155,6 +156,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
|
|||
passed = passed && checkAgainstPermissions(listener);
|
||||
passed = passed && checkAgainstFilterLinks(listener);
|
||||
passed = passed && checkAgainstCreator(listener);
|
||||
passed = passed && checkAgainstSearchVisibility(listener);
|
||||
|
||||
return passed;
|
||||
}
|
||||
|
|
@ -583,6 +585,27 @@ bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory
|
|||
}
|
||||
}
|
||||
|
||||
bool LLInventoryFilter::checkAgainstSearchVisibility(const LLFolderViewModelItemInventory* listener) const
|
||||
{
|
||||
if (!listener || !hasFilterString()) return TRUE;
|
||||
|
||||
const LLUUID object_id = listener->getUUID();
|
||||
const LLInventoryObject *object = gInventory.getObject(object_id);
|
||||
if (!object) return TRUE;
|
||||
|
||||
const BOOL is_link = object->getIsLinkType();
|
||||
if (is_link && ((mFilterOps.mSearchVisibility & VISIBILITY_LINKS) == 0))
|
||||
return FALSE;
|
||||
|
||||
if (listener->isItemInTrash() && ((mFilterOps.mSearchVisibility & VISIBILITY_TRASH) == 0))
|
||||
return FALSE;
|
||||
|
||||
if (!listener->isAgentInventory() && ((mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY) == 0))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const
|
||||
{
|
||||
return mFilterSubString;
|
||||
|
|
@ -751,6 +774,61 @@ void LLInventoryFilter::setFilterMarketplaceListingFolders(bool select_only_list
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void LLInventoryFilter::toggleSearchVisibilityLinks()
|
||||
{
|
||||
bool hide_links = mFilterOps.mSearchVisibility & VISIBILITY_LINKS;
|
||||
if (hide_links)
|
||||
{
|
||||
mFilterOps.mSearchVisibility &= ~VISIBILITY_LINKS;
|
||||
}
|
||||
else
|
||||
{
|
||||
mFilterOps.mSearchVisibility |= VISIBILITY_LINKS;
|
||||
}
|
||||
|
||||
if (hasFilterString())
|
||||
{
|
||||
setModified(hide_links ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLInventoryFilter::toggleSearchVisibilityTrash()
|
||||
{
|
||||
bool hide_trash = mFilterOps.mSearchVisibility & VISIBILITY_TRASH;
|
||||
if (hide_trash)
|
||||
{
|
||||
mFilterOps.mSearchVisibility &= ~VISIBILITY_TRASH;
|
||||
}
|
||||
else
|
||||
{
|
||||
mFilterOps.mSearchVisibility |= VISIBILITY_TRASH;
|
||||
}
|
||||
|
||||
if (hasFilterString())
|
||||
{
|
||||
setModified(hide_trash ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLInventoryFilter::toggleSearchVisibilityLibrary()
|
||||
{
|
||||
bool hide_library = mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY;
|
||||
if (hide_library)
|
||||
{
|
||||
mFilterOps.mSearchVisibility &= ~VISIBILITY_LIBRARY;
|
||||
}
|
||||
else
|
||||
{
|
||||
mFilterOps.mSearchVisibility |= VISIBILITY_LIBRARY;
|
||||
}
|
||||
|
||||
if (hasFilterString())
|
||||
{
|
||||
setModified(hide_library ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLInventoryFilter::setFilterNoMarketplaceFolder()
|
||||
{
|
||||
mFilterOps.mFilterTypes |= FILTERTYPE_NO_MARKETPLACE_ITEMS;
|
||||
|
|
@ -862,6 +940,44 @@ void LLInventoryFilter::setFilterSubString(const std::string& string)
|
|||
}
|
||||
}
|
||||
|
||||
void LLInventoryFilter::setSearchVisibilityTypes(U32 types)
|
||||
{
|
||||
if (mFilterOps.mSearchVisibility != types)
|
||||
{
|
||||
// keep current items only if no perm bits getting turned off
|
||||
BOOL fewer_bits_set = (mFilterOps.mSearchVisibility & ~types);
|
||||
BOOL more_bits_set = (~mFilterOps.mSearchVisibility & types);
|
||||
mFilterOps.mSearchVisibility = types;
|
||||
|
||||
if (more_bits_set && fewer_bits_set)
|
||||
{
|
||||
setModified(FILTER_RESTART);
|
||||
}
|
||||
else if (more_bits_set)
|
||||
{
|
||||
// target must have all requested permission bits, so more bits == more restrictive
|
||||
setModified(FILTER_MORE_RESTRICTIVE);
|
||||
}
|
||||
else if (fewer_bits_set)
|
||||
{
|
||||
setModified(FILTER_LESS_RESTRICTIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLInventoryFilter::setSearchVisibilityTypes(const Params& params)
|
||||
{
|
||||
if (!params.validateBlock())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.filter_ops.search_visibility.isProvided())
|
||||
{
|
||||
setSearchVisibilityTypes(params.filter_ops.search_visibility);
|
||||
}
|
||||
}
|
||||
|
||||
void LLInventoryFilter::setFilterPermissions(PermissionMask perms)
|
||||
{
|
||||
if (mFilterOps.mPermissions != perms)
|
||||
|
|
@ -1263,6 +1379,18 @@ const std::string& LLInventoryFilter::getFilterText()
|
|||
filtered_by_all_types = FALSE;
|
||||
}
|
||||
|
||||
if (isFilterObjectTypesWith(LLInventoryType::IT_SETTINGS))
|
||||
{
|
||||
filtered_types += LLTrans::getString("Settings");
|
||||
filtered_by_type = TRUE;
|
||||
num_filter_types++;
|
||||
}
|
||||
else
|
||||
{
|
||||
not_filtered_types += LLTrans::getString("Settings");
|
||||
filtered_by_all_types = FALSE;
|
||||
}
|
||||
|
||||
if (!LLInventoryModelBackgroundFetch::instance().folderFetchActive()
|
||||
&& filtered_by_type
|
||||
&& !filtered_by_all_types)
|
||||
|
|
@ -1318,6 +1446,7 @@ void LLInventoryFilter::toParams(Params& params) const
|
|||
params.filter_ops.show_folder_state = getShowFolderState();
|
||||
params.filter_ops.creator_type = getFilterCreatorType();
|
||||
params.filter_ops.permissions = getFilterPermissions();
|
||||
params.filter_ops.search_visibility = getSearchVisibilityTypes();
|
||||
params.substring = getFilterSubString();
|
||||
params.since_logoff = isSinceLogoff();
|
||||
}
|
||||
|
|
@ -1341,6 +1470,7 @@ void LLInventoryFilter::fromParams(const Params& params)
|
|||
setShowFolderState(params.filter_ops.show_folder_state);
|
||||
setFilterCreator(params.filter_ops.creator_type);
|
||||
setFilterPermissions(params.filter_ops.permissions);
|
||||
setSearchVisibilityTypes(params.filter_ops.search_visibility);
|
||||
setFilterSubString(params.substring);
|
||||
setDateRangeLastLogoff(params.since_logoff);
|
||||
}
|
||||
|
|
@ -1370,6 +1500,11 @@ U64 LLInventoryFilter::getFilterSettingsTypes() const
|
|||
return mFilterOps.mFilterSettingsTypes;
|
||||
}
|
||||
|
||||
U64 LLInventoryFilter::getSearchVisibilityTypes() const
|
||||
{
|
||||
return mFilterOps.mSearchVisibility;
|
||||
}
|
||||
|
||||
bool LLInventoryFilter::hasFilterString() const
|
||||
{
|
||||
return mFilterSubString.size() > 0;
|
||||
|
|
|
|||
|
|
@ -99,6 +99,14 @@ public:
|
|||
FILTERCREATOR_OTHERS
|
||||
};
|
||||
|
||||
enum ESearchVisibility
|
||||
{
|
||||
VISIBILITY_NONE = 0,
|
||||
VISIBILITY_TRASH = 0x1 << 0,
|
||||
VISIBILITY_LIBRARY = 0x1 << 1,
|
||||
VISIBILITY_LINKS = 0x1 << 2
|
||||
};
|
||||
|
||||
struct FilterOps
|
||||
{
|
||||
struct DateRange : public LLInitParam::Block<DateRange>
|
||||
|
|
@ -116,11 +124,13 @@ public:
|
|||
|
||||
struct Params : public LLInitParam::Block<Params>
|
||||
{
|
||||
Optional<U32> types;
|
||||
Optional<U32> types,
|
||||
search_visibility;
|
||||
Optional<U64> object_types,
|
||||
wearable_types,
|
||||
settings_types,
|
||||
category_types;
|
||||
|
||||
Optional<EFilterLink> links;
|
||||
Optional<LLUUID> uuid;
|
||||
Optional<DateRange> date_range;
|
||||
|
|
@ -137,6 +147,7 @@ public:
|
|||
settings_types("settings_types", 0xffffFFFFffffFFFFULL),
|
||||
category_types("category_types", 0xffffFFFFffffFFFFULL),
|
||||
links("links", FILTERLINK_INCLUDE_LINKS),
|
||||
search_visibility("search_visibility", 0xFFFFFFFF),
|
||||
uuid("uuid"),
|
||||
date_range("date_range"),
|
||||
hours_ago("hours_ago", 0),
|
||||
|
|
@ -149,7 +160,8 @@ public:
|
|||
|
||||
FilterOps(const Params& = Params());
|
||||
|
||||
U32 mFilterTypes;
|
||||
U32 mFilterTypes,
|
||||
mSearchVisibility;
|
||||
U64 mFilterObjectTypes, // For _OBJECT
|
||||
mFilterWearableTypes,
|
||||
mFilterSettingsTypes, // for _SETTINGS
|
||||
|
|
@ -193,7 +205,8 @@ public:
|
|||
U64 getFilterObjectTypes() const;
|
||||
U64 getFilterCategoryTypes() const;
|
||||
U64 getFilterWearableTypes() const;
|
||||
U64 getFilterSettingsTypes() const;
|
||||
U64 getFilterSettingsTypes() const;
|
||||
U64 getSearchVisibilityTypes() const;
|
||||
|
||||
bool isFilterObjectTypesWith(LLInventoryType::EType t) const;
|
||||
void setFilterObjectTypes(U64 types);
|
||||
|
|
@ -213,6 +226,12 @@ public:
|
|||
ESearchType getSearchType() { return mSearchType; }
|
||||
void setFilterCreator(EFilterCreatorType type);
|
||||
|
||||
void toggleSearchVisibilityLinks();
|
||||
void toggleSearchVisibilityTrash();
|
||||
void toggleSearchVisibilityLibrary();
|
||||
void setSearchVisibilityTypes(U32 types);
|
||||
void setSearchVisibilityTypes(const Params& params);
|
||||
|
||||
void setFilterSubString(const std::string& string);
|
||||
const std::string& getFilterSubString(BOOL trim = FALSE) const;
|
||||
const std::string& getFilterSubStringOrig() const { return mFilterSubStringOrig; }
|
||||
|
|
@ -310,6 +329,7 @@ private:
|
|||
bool checkAgainstPermissions(const LLInventoryItem* item) const;
|
||||
bool checkAgainstFilterLinks(const class LLFolderViewModelItemInventory* listener) const;
|
||||
bool checkAgainstCreator(const class LLFolderViewModelItemInventory* listener) const;
|
||||
bool checkAgainstSearchVisibility(const class LLFolderViewModelItemInventory* listener) const;
|
||||
bool checkAgainstClipboard(const LLUUID& object_id) const;
|
||||
|
||||
FilterOps mFilterOps;
|
||||
|
|
|
|||
|
|
@ -774,40 +774,45 @@ void show_item_profile(const LLUUID& item_uuid)
|
|||
|
||||
void show_item_original(const LLUUID& item_uuid)
|
||||
{
|
||||
LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory");
|
||||
if (!floater_inventory)
|
||||
{
|
||||
LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory");
|
||||
if (!floater_inventory)
|
||||
{
|
||||
LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
|
||||
if (sidepanel_inventory)
|
||||
{
|
||||
LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
|
||||
if (main_inventory)
|
||||
{
|
||||
main_inventory->resetFilters();
|
||||
}
|
||||
reset_inventory_filter();
|
||||
|
||||
//sidetray inventory panel
|
||||
LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
|
||||
if (!LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>("inventory")->isInVisibleChain())
|
||||
{
|
||||
LLFloaterReg::toggleInstanceOrBringToFront("inventory");
|
||||
}
|
||||
|
||||
bool do_reset_inventory_filter = !floater_inventory->isInVisibleChain();
|
||||
|
||||
LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel();
|
||||
if (!active_panel)
|
||||
{
|
||||
//this may happen when there is no floatera and other panel is active in inventory tab
|
||||
|
||||
if (sidepanel_inventory)
|
||||
{
|
||||
sidepanel_inventory->showInventoryPanel();
|
||||
}
|
||||
}
|
||||
|
||||
active_panel = LLInventoryPanel::getActiveInventoryPanel();
|
||||
if (!active_panel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES);
|
||||
|
||||
if(do_reset_inventory_filter)
|
||||
{
|
||||
reset_inventory_filter();
|
||||
}
|
||||
const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX);
|
||||
if (gInventory.isObjectDescendentOf(gInventory.getLinkedItemID(item_uuid), inbox_id))
|
||||
{
|
||||
if (sidepanel_inventory->getInboxPanel())
|
||||
{
|
||||
sidepanel_inventory->openInbox();
|
||||
sidepanel_inventory->getInboxPanel()->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sidepanel_inventory->selectAllItemsPanel();
|
||||
if (sidepanel_inventory->getActivePanel())
|
||||
{
|
||||
sidepanel_inventory->getActivePanel()->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1842,6 +1847,26 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
|
|||
return result && !has_bad_items;
|
||||
}
|
||||
|
||||
void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id)
|
||||
{
|
||||
LLInventoryItem* inv_item = gInventory.getItem(item_id);
|
||||
if (inv_item)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1);
|
||||
update.push_back(old_folder);
|
||||
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
||||
update.push_back(new_folder);
|
||||
gInventory.accountForUpdate(update);
|
||||
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item);
|
||||
new_item->setParent(new_parent_id);
|
||||
new_item->updateParentOnServer(FALSE);
|
||||
gInventory.updateItem(new_item);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// LLInventoryCollectFunctor implementations
|
||||
///----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ S32 depth_nesting_in_marketplace(LLUUID cur_uuid);
|
|||
LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth);
|
||||
S32 compute_stock_count(LLUUID cat_uuid, bool force_count = false);
|
||||
|
||||
void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id);
|
||||
|
||||
/** Miscellaneous global functions
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
|
|
|||
|
|
@ -158,7 +158,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
|
|||
mViewsInitialized(VIEWS_UNINITIALIZED),
|
||||
mInvFVBridgeBuilder(NULL),
|
||||
mInventoryViewModel(p.name),
|
||||
mGroupedItemBridge(new LLFolderViewGroupedItemBridge)
|
||||
mGroupedItemBridge(new LLFolderViewGroupedItemBridge),
|
||||
mFocusSelection(false)
|
||||
{
|
||||
mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER;
|
||||
|
||||
|
|
@ -1377,6 +1378,7 @@ void LLInventoryPanel::setSelectCallback(const boost::function<void (const std::
|
|||
void LLInventoryPanel::clearSelection()
|
||||
{
|
||||
mSelectThisID.setNull();
|
||||
mFocusSelection = false;
|
||||
}
|
||||
|
||||
LLInventoryPanel::selected_items_t LLInventoryPanel::getSelectedItems() const
|
||||
|
|
@ -1871,11 +1873,13 @@ void LLInventoryPanel::setSelectionByID( const LLUUID& obj_id, BOOL take_keyb
|
|||
{
|
||||
itemp->arrangeAndSet(TRUE, take_keyboard_focus);
|
||||
mSelectThisID.setNull();
|
||||
mFocusSelection = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// save the desired item to be selected later (if/when ready)
|
||||
mFocusSelection = take_keyboard_focus;
|
||||
mSelectThisID = obj_id;
|
||||
}
|
||||
}
|
||||
|
|
@ -1884,7 +1888,7 @@ void LLInventoryPanel::updateSelection()
|
|||
{
|
||||
if (mSelectThisID.notNull())
|
||||
{
|
||||
setSelectionByID(mSelectThisID, false);
|
||||
setSelectionByID(mSelectThisID, mFocusSelection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ protected:
|
|||
LLInventoryModel* mInventory;
|
||||
LLInventoryObserver* mInventoryObserver;
|
||||
LLInvPanelComplObserver* mCompletionObserver;
|
||||
bool mFocusSelection;
|
||||
bool mAcceptsDragAndDrop;
|
||||
bool mAllowMultiSelect;
|
||||
bool mAllowDrag;
|
||||
|
|
@ -380,27 +381,6 @@ private:
|
|||
std::deque<LLUUID> mBuildViewsQueue;
|
||||
};
|
||||
|
||||
|
||||
class LLInventoryFavoriteItemsPanel : public LLInventoryPanel
|
||||
{
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
|
||||
{};
|
||||
|
||||
void initFromParams(const Params& p);
|
||||
bool isSelectionRemovable() { return false; }
|
||||
void setSelectCallback(const boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb);
|
||||
|
||||
protected:
|
||||
LLInventoryFavoriteItemsPanel(const Params& params);
|
||||
~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); }
|
||||
void updateFavoritesRootFolder();
|
||||
|
||||
boost::signals2::connection mFolderChangedSignal;
|
||||
boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback;
|
||||
friend class LLUICtrlFactory;
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
/* Asset Pre-Filtered Inventory Panel related class */
|
||||
/* Exchanges filter's flexibility for speed of generation and */
|
||||
|
|
|
|||
|
|
@ -228,23 +228,6 @@ LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentPos()
|
|||
return findLandmarkForGlobalPos(gAgent.getPositionGlobal());
|
||||
}
|
||||
|
||||
bool LLLandmarkActions::canCreateLandmarkHere()
|
||||
{
|
||||
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if(!agent_parcel)
|
||||
{
|
||||
LL_WARNS() << "No agent region" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
if (agent_parcel->getAllowLandmark()
|
||||
|| LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLLandmarkActions::createLandmarkHere(
|
||||
const std::string& name,
|
||||
const std::string& desc,
|
||||
|
|
@ -261,11 +244,6 @@ void LLLandmarkActions::createLandmarkHere(
|
|||
LL_WARNS() << "No agent parcel" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
if (!canCreateLandmarkHere())
|
||||
{
|
||||
LLNotificationsUtil::add("CannotCreateLandmarkNotOwner");
|
||||
return;
|
||||
}
|
||||
|
||||
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
|
||||
folder_id, LLTransactionID::tnull,
|
||||
|
|
|
|||
|
|
@ -72,12 +72,6 @@ public:
|
|||
*/
|
||||
static LLViewerInventoryItem* findLandmarkForAgentPos();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Checks whether agent has rights to create landmark for current parcel.
|
||||
*/
|
||||
static bool canCreateLandmarkHere();
|
||||
|
||||
/**
|
||||
* @brief Creates landmark for current parcel.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
// newview includes
|
||||
#include "llagent.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloatersidepanelcontainer.h"
|
||||
#include "llinventoryobserver.h"
|
||||
#include "lllandmarkactions.h"
|
||||
|
|
@ -653,7 +654,7 @@ void LLLocationInputCtrl::onAddLandmarkButtonClicked()
|
|||
}
|
||||
else
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark"));
|
||||
LLFloaterReg::showInstance("add_landmark");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1126,7 +1127,7 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata)
|
|||
|
||||
if(!landmark)
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark"));
|
||||
LLFloaterReg::showInstance("add_landmark");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -726,7 +726,20 @@ void LLMuteList::requestFromServer(const LLUUID& agent_id)
|
|||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->nextBlockFast(_PREHASH_MuteData);
|
||||
msg->addU32Fast(_PREHASH_MuteCRC, crc.getCRC());
|
||||
gAgent.sendReliableMessage();
|
||||
|
||||
if (gDisconnected)
|
||||
{
|
||||
LL_WARNS() << "Trying to request mute list when disconnected!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
if (!gAgent.getRegion())
|
||||
{
|
||||
LL_WARNS() << "No region for agent yet, skipping mute list request!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
// Double amount of retries due to this request happening during busy stage
|
||||
// Ideally this should be turned into a capability
|
||||
gMessageSystem->sendReliable(gAgent.getRegionHost(), LL_DEFAULT_RELIABLE_RETRIES * 2, TRUE, LL_PING_BASED_TIMEOUT_DUMMY, NULL, NULL);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
#include "llweb.h"
|
||||
#include "llhints.h"
|
||||
|
||||
#include "llfloatersidepanelcontainer.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "lllandmarkactions.h"
|
||||
|
||||
|
|
@ -290,6 +291,7 @@ BOOL LLNavigationBar::postBuild()
|
|||
mBtnBack = getChild<LLPullButton>("back_btn");
|
||||
mBtnForward = getChild<LLPullButton>("forward_btn");
|
||||
mBtnHome = getChild<LLButton>("home_btn");
|
||||
mBtnLandmarks = getChild<LLButton>("landmarks_btn");
|
||||
|
||||
mCmbLocation= getChild<LLLocationInputCtrl>("location_combo");
|
||||
|
||||
|
|
@ -305,6 +307,8 @@ BOOL LLNavigationBar::postBuild()
|
|||
|
||||
mBtnHome->setClickedCallback(boost::bind(&LLNavigationBar::onHomeButtonClicked, this));
|
||||
|
||||
mBtnLandmarks->setClickedCallback(boost::bind(&LLNavigationBar::onLandmarksButtonClicked, this));
|
||||
|
||||
mCmbLocation->setCommitCallback(boost::bind(&LLNavigationBar::onLocationSelection, this));
|
||||
|
||||
mTeleportFinishConnection = LLViewerParcelMgr::getInstance()->
|
||||
|
|
@ -401,6 +405,12 @@ void LLNavigationBar::onHomeButtonClicked()
|
|||
gAgent.teleportHome();
|
||||
}
|
||||
|
||||
void LLNavigationBar::onLandmarksButtonClicked()
|
||||
{
|
||||
LLFloaterReg::toggleInstanceOrBringToFront("places");
|
||||
LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "open_landmark_tab"));
|
||||
}
|
||||
|
||||
void LLNavigationBar::onTeleportHistoryMenuItemClicked(const LLSD& userdata)
|
||||
{
|
||||
int idx = userdata.asInteger();
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ private:
|
|||
void onNavigationButtonHeldUp(LLButton* nav_button);
|
||||
void onForwardButtonClicked();
|
||||
void onHomeButtonClicked();
|
||||
void onLandmarksButtonClicked();
|
||||
void onLocationSelection();
|
||||
void onLocationPrearrange(const LLSD& data);
|
||||
void onTeleportFinished(const LLVector3d& global_agent_pos);
|
||||
|
|
@ -144,6 +145,7 @@ private:
|
|||
LLPullButton* mBtnBack;
|
||||
LLPullButton* mBtnForward;
|
||||
LLButton* mBtnHome;
|
||||
LLButton* mBtnLandmarks;
|
||||
LLLocationInputCtrl* mCmbLocation;
|
||||
LLRect mDefaultNbRect;
|
||||
LLRect mDefaultFpRect;
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@ namespace
|
|||
const std::string FIELD_SKY_GLOW_SIZE("glow_size");
|
||||
const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness");
|
||||
const std::string FIELD_SKY_SUN_ROTATION("sun_rotation");
|
||||
const std::string FIELD_SKY_SUN_AZIMUTH("sun_azimuth");
|
||||
const std::string FIELD_SKY_SUN_ELEVATION("sun_elevation");
|
||||
const std::string FIELD_SKY_SUN_IMAGE("sun_image");
|
||||
const std::string FIELD_SKY_SUN_SCALE("sun_scale");
|
||||
const std::string FIELD_SKY_SUN_BEACON("sunbeacon");
|
||||
const std::string FIELD_SKY_MOON_BEACON("moonbeacon");
|
||||
const std::string FIELD_SKY_MOON_ROTATION("moon_rotation");
|
||||
const std::string FIELD_SKY_MOON_AZIMUTH("moon_azimuth");
|
||||
const std::string FIELD_SKY_MOON_ELEVATION("moon_elevation");
|
||||
const std::string FIELD_SKY_MOON_IMAGE("moon_image");
|
||||
const std::string FIELD_SKY_MOON_SCALE("moon_scale");
|
||||
const std::string FIELD_SKY_MOON_BRIGHTNESS("moon_brightness");
|
||||
|
|
@ -473,12 +477,16 @@ BOOL LLPanelSettingsSkySunMoonTab::postBuild()
|
|||
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunImageChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); });
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId());
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetBlankSunTextureId());
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setAllowNoTexture(TRUE);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); });
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonImageChanged(); });
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetDefaultMoonTextureId());
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetDefaultMoonTextureId());
|
||||
|
|
@ -537,13 +545,29 @@ void LLPanelSettingsSkySunMoonTab::refresh()
|
|||
getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B);
|
||||
|
||||
getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mSkySettings->getStarBrightness());
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(mSkySettings->getSunRotation());
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setValue(mSkySettings->getSunTextureId());
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setValue(mSkySettings->getSunScale());
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(mSkySettings->getMoonRotation());
|
||||
getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setValue(mSkySettings->getMoonTextureId());
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_SCALE)->setValue(mSkySettings->getMoonScale());
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_BRIGHTNESS)->setValue(mSkySettings->getMoonBrightness());
|
||||
|
||||
// Sun rotation values
|
||||
F32 azimuth, elevation;
|
||||
LLQuaternion quat = mSkySettings->getSunRotation();
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(quat);
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->setValue(elevation);
|
||||
|
||||
// Moon rotation values
|
||||
quat = mSkySettings->getMoonRotation();
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(quat);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->setValue(elevation);
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
@ -583,10 +607,47 @@ void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged()
|
|||
|
||||
void LLPanelSettingsSkySunMoonTab::onSunRotationChanged()
|
||||
{
|
||||
if (!mSkySettings) return;
|
||||
mSkySettings->setSunRotation(getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->getRotation());
|
||||
mSkySettings->update();
|
||||
setIsDirty();
|
||||
LLQuaternion quat = getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->getRotation();
|
||||
|
||||
F32 azimuth, elevation;
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->setValue(elevation);
|
||||
if (mSkySettings)
|
||||
{
|
||||
mSkySettings->setSunRotation(quat);
|
||||
mSkySettings->update();
|
||||
setIsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelSettingsSkySunMoonTab::onSunAzimElevChanged()
|
||||
{
|
||||
F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal();
|
||||
F32 elevation = getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->getValue().asReal();
|
||||
LLQuaternion quat;
|
||||
|
||||
azimuth *= DEG_TO_RAD;
|
||||
elevation *= DEG_TO_RAD;
|
||||
|
||||
if (is_approx_zero(elevation))
|
||||
{
|
||||
elevation = F_APPROXIMATELY_ZERO;
|
||||
}
|
||||
|
||||
quat.setAngleAxis(-elevation, 0, 1, 0);
|
||||
LLQuaternion az_quat;
|
||||
az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1);
|
||||
quat *= az_quat;
|
||||
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(quat);
|
||||
|
||||
if (mSkySettings)
|
||||
{
|
||||
mSkySettings->setSunRotation(quat);
|
||||
mSkySettings->update();
|
||||
setIsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelSettingsSkySunMoonTab::onSunScaleChanged()
|
||||
|
|
@ -607,10 +668,48 @@ void LLPanelSettingsSkySunMoonTab::onSunImageChanged()
|
|||
|
||||
void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged()
|
||||
{
|
||||
if (!mSkySettings) return;
|
||||
mSkySettings->setMoonRotation(getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->getRotation());
|
||||
mSkySettings->update();
|
||||
setIsDirty();
|
||||
LLQuaternion quat = getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->getRotation();
|
||||
|
||||
F32 azimuth, elevation;
|
||||
LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->setValue(elevation);
|
||||
|
||||
if (mSkySettings)
|
||||
{
|
||||
mSkySettings->setMoonRotation(quat);
|
||||
mSkySettings->update();
|
||||
setIsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelSettingsSkySunMoonTab::onMoonAzimElevChanged()
|
||||
{
|
||||
F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal();
|
||||
F32 elevation = getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->getValue().asReal();
|
||||
LLQuaternion quat;
|
||||
|
||||
azimuth *= DEG_TO_RAD;
|
||||
elevation *= DEG_TO_RAD;
|
||||
|
||||
if (is_approx_zero(elevation))
|
||||
{
|
||||
elevation = F_APPROXIMATELY_ZERO;
|
||||
}
|
||||
|
||||
quat.setAngleAxis(-elevation, 0, 1, 0);
|
||||
LLQuaternion az_quat;
|
||||
az_quat.setAngleAxis(F_TWO_PI- azimuth, 0, 0, 1);
|
||||
quat *= az_quat;
|
||||
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(quat);
|
||||
|
||||
if (mSkySettings)
|
||||
{
|
||||
mSkySettings->setMoonRotation(quat);
|
||||
mSkySettings->update();
|
||||
setIsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelSettingsSkySunMoonTab::onMoonImageChanged()
|
||||
|
|
|
|||
|
|
@ -124,9 +124,11 @@ private:
|
|||
void onGlowChanged();
|
||||
void onStarBrightnessChanged();
|
||||
void onSunRotationChanged();
|
||||
void onSunAzimElevChanged();
|
||||
void onSunScaleChanged();
|
||||
void onSunImageChanged();
|
||||
void onMoonRotationChanged();
|
||||
void onMoonAzimElevChanged();
|
||||
void onMoonScaleChanged();
|
||||
void onMoonBrightnessChanged();
|
||||
void onMoonImageChanged();
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@
|
|||
typedef std::pair<LLUUID, std::string> folder_pair_t;
|
||||
|
||||
static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right);
|
||||
static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats);
|
||||
|
||||
static LLPanelInjector<LLPanelLandmarkInfo> t_landmark_info("panel_landmark_info");
|
||||
|
||||
|
|
@ -106,6 +105,18 @@ void LLPanelLandmarkInfo::resetLocation()
|
|||
|
||||
// virtual
|
||||
void LLPanelLandmarkInfo::setInfoType(EInfoType type)
|
||||
{
|
||||
LLUUID dest_folder;
|
||||
setInfoType(type, dest_folder);
|
||||
}
|
||||
|
||||
// Sets CREATE_LANDMARK infotype and creates landmark at desired folder
|
||||
void LLPanelLandmarkInfo::setInfoAndCreateLandmark(const LLUUID& fodler_id)
|
||||
{
|
||||
setInfoType(CREATE_LANDMARK, fodler_id);
|
||||
}
|
||||
|
||||
void LLPanelLandmarkInfo::setInfoType(EInfoType type, const LLUUID &folder_id)
|
||||
{
|
||||
LLPanel* landmark_info_panel = getChild<LLPanel>("landmark_info_panel");
|
||||
|
||||
|
|
@ -183,7 +194,7 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type)
|
|||
// remote parcel request to complete.
|
||||
if (!LLLandmarkActions::landmarkAlreadyExists())
|
||||
{
|
||||
createLandmark(LLUUID());
|
||||
createLandmark(folder_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -509,7 +520,7 @@ static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right)
|
|||
return left.second < right.second;
|
||||
}
|
||||
|
||||
static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats)
|
||||
void LLPanelLandmarkInfo::collectLandmarkFolders(LLInventoryModel::cat_array_t& cats)
|
||||
{
|
||||
LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
|
||||
|
||||
|
|
@ -522,16 +533,20 @@ static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats)
|
|||
items,
|
||||
LLInventoryModel::EXCLUDE_TRASH,
|
||||
is_category);
|
||||
|
||||
// Add the "My Favorites" category.
|
||||
LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
|
||||
LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id);
|
||||
if (!favorites_cat)
|
||||
{
|
||||
LL_WARNS() << "Cannot find the favorites folder" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
cats.push_back(favorites_cat);
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ void LLUpdateLandmarkParent::fire(const LLUUID& inv_item_id)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
LLInventoryModel::LLCategoryUpdate old_folder(mItem->getParentUUID(), -1);
|
||||
update.push_back(old_folder);
|
||||
LLInventoryModel::LLCategoryUpdate new_folder(mNewParentId, 1);
|
||||
update.push_back(new_folder);
|
||||
gInventory.accountForUpdate(update);
|
||||
|
||||
mItem->setParent(mNewParentId);
|
||||
mItem->updateParentOnServer(FALSE);
|
||||
|
||||
gInventory.updateItem(mItem);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#define LL_LLPANELLANDMARKINFO_H
|
||||
|
||||
#include "llpanelplaceinfo.h"
|
||||
#include "llinventorymodel.h"
|
||||
|
||||
class LLComboBox;
|
||||
class LLLineEditor;
|
||||
|
|
@ -43,8 +44,12 @@ public:
|
|||
|
||||
/*virtual*/ void resetLocation();
|
||||
|
||||
// If landmark doesn't exists, will create it at default folder
|
||||
/*virtual*/ void setInfoType(EInfoType type);
|
||||
|
||||
// Sets CREATE_LANDMARK infotype and creates landmark at desired folder
|
||||
void setInfoAndCreateLandmark(const LLUUID& fodler_id);
|
||||
|
||||
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
|
||||
|
||||
// Displays landmark owner, creator and creation date info.
|
||||
|
|
@ -60,13 +65,19 @@ public:
|
|||
// Select current landmark folder in combobox.
|
||||
BOOL setLandmarkFolder(const LLUUID& id);
|
||||
|
||||
// Create a landmark for the current location
|
||||
// in a folder specified by folder_id.
|
||||
void createLandmark(const LLUUID& folder_id);
|
||||
|
||||
typedef std::vector<LLPointer<LLViewerInventoryCategory> > cat_array_t;
|
||||
static std::string getFullFolderName(const LLViewerInventoryCategory* cat);
|
||||
static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats);
|
||||
|
||||
private:
|
||||
// Create a landmark for the current location
|
||||
// in a folder specified by folder_id.
|
||||
// Expects title and description to be initialized
|
||||
void createLandmark(const LLUUID& folder_id);
|
||||
|
||||
// If landmark doesn't exists, will create it at specified folder
|
||||
void setInfoType(EInfoType type, const LLUUID &folder_id);
|
||||
|
||||
void populateFoldersList();
|
||||
|
||||
LLTextBox* mOwner;
|
||||
|
|
@ -78,4 +89,17 @@ private:
|
|||
LLComboBox* mFolderCombo;
|
||||
};
|
||||
|
||||
class LLUpdateLandmarkParent : public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
LLUpdateLandmarkParent(LLPointer<LLViewerInventoryItem> item, LLUUID new_parent) :
|
||||
mItem(item),
|
||||
mNewParentId(new_parent)
|
||||
{};
|
||||
/* virtual */ void fire(const LLUUID& inv_item_id);
|
||||
|
||||
private:
|
||||
LLPointer<LLViewerInventoryItem> mItem;
|
||||
LLUUID mNewParentId;
|
||||
};
|
||||
#endif // LL_LLPANELLANDMARKINFO_H
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -50,81 +50,69 @@ class LLLandmarksPanel : public LLPanelPlacesTab, LLRemoteParcelInfoObserver
|
|||
{
|
||||
public:
|
||||
LLLandmarksPanel();
|
||||
LLLandmarksPanel(bool is_landmark_panel);
|
||||
virtual ~LLLandmarksPanel();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onSearchEdit(const std::string& string);
|
||||
/*virtual*/ void onShowOnMap();
|
||||
/*virtual*/ void onShowProfile();
|
||||
/*virtual*/ void onTeleport();
|
||||
/*virtual*/ void updateVerbs();
|
||||
/*virtual*/ bool isSingleItemSelected();
|
||||
BOOL postBuild() override;
|
||||
void onSearchEdit(const std::string& string) override;
|
||||
void onShowOnMap() override;
|
||||
void onShowProfile() override;
|
||||
void onTeleport() override;
|
||||
void onRemoveSelected() override;
|
||||
void updateVerbs() override;
|
||||
bool isSingleItemSelected() override;
|
||||
|
||||
LLToggleableMenu* getSelectionMenu() override;
|
||||
LLToggleableMenu* getSortingMenu() override;
|
||||
LLToggleableMenu* getCreateMenu() override;
|
||||
|
||||
/**
|
||||
* Processes drag-n-drop of the Landmarks and folders into trash button.
|
||||
*/
|
||||
bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) override;
|
||||
|
||||
void onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque<LLFolderViewItem*> &items, BOOL user_action);
|
||||
void onSelectorButtonClicked();
|
||||
void setCurrentSelectedList(LLPlacesInventoryPanel* inventory_list)
|
||||
{
|
||||
mCurrentSelectedList = inventory_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update filter ShowFolderState setting to show empty folder message
|
||||
* if Landmarks inventory folder is empty.
|
||||
*/
|
||||
void updateShowFolderState();
|
||||
|
||||
/**
|
||||
* Selects item with "obj_id" in one of accordion tabs.
|
||||
*/
|
||||
void setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus);
|
||||
|
||||
LLPlacesInventoryPanel* getLibraryInventoryPanel() { return mLibraryInventoryPanel; }
|
||||
|
||||
void updateMenuVisibility(LLUICtrl* menu);
|
||||
|
||||
void doCreatePick(LLLandmark* landmark, const LLUUID &item_id );
|
||||
|
||||
void resetSelection();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @return true - if current selected panel is not null and selected item is a landmark
|
||||
*/
|
||||
bool isLandmarkSelected() const;
|
||||
bool isFolderSelected() const;
|
||||
bool isReceivedFolderSelected() const;
|
||||
void doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb);
|
||||
LLFolderViewItem* getCurSelectedItem() const;
|
||||
LLFolderViewModelItemInventory* getCurSelectedViewModelItem() const;
|
||||
|
||||
/**
|
||||
* Selects item with "obj_id" in "inventory_list" and scrolls accordion
|
||||
* scrollbar to show the item.
|
||||
* Returns pointer to the item if it is found in "inventory_list", otherwise NULL.
|
||||
*/
|
||||
LLFolderViewItem* selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list,
|
||||
const std::string& tab_name,
|
||||
const LLUUID& obj_id,
|
||||
BOOL take_keyboard_focus) const;
|
||||
|
||||
void updateSortOrder(LLInventoryPanel* panel, bool byDate);
|
||||
|
||||
//LLRemoteParcelInfoObserver interface
|
||||
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
|
||||
/*virtual*/ void setParcelID(const LLUUID& parcel_id);
|
||||
/*virtual*/ void setErrorStatus(S32 status, const std::string& reason);
|
||||
|
||||
private:
|
||||
void initFavoritesInventoryPanel();
|
||||
void initLandmarksInventoryPanel();
|
||||
void initMyInventoryPanel();
|
||||
void initLibraryInventoryPanel();
|
||||
void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list);
|
||||
LLAccordionCtrlTab* initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab);
|
||||
void onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list);
|
||||
void deselectOtherThan(const LLPlacesInventoryPanel* inventory_list);
|
||||
void processParcelInfo(const LLParcelData& parcel_data) override;
|
||||
void setParcelID(const LLUUID& parcel_id) override;
|
||||
void setErrorStatus(S32 status, const std::string& reason) override;
|
||||
|
||||
// List Commands Handlers
|
||||
void initListCommandsHandlers();
|
||||
void updateListCommands();
|
||||
void onActionsButtonClick();
|
||||
void showActionMenu(LLMenuGL* menu, std::string spawning_view_name);
|
||||
void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list);
|
||||
|
||||
LLPlacesInventoryPanel* mCurrentSelectedList;
|
||||
|
||||
private:
|
||||
void initLandmarksInventoryPanel();
|
||||
|
||||
void onTrashButtonClick() const;
|
||||
void onAddAction(const LLSD& command_name) const;
|
||||
void onClipboardAction(const LLSD& command_name) const;
|
||||
|
|
@ -150,39 +138,34 @@ private:
|
|||
bool canItemBeModified(const std::string& command_name, LLFolderViewItem* item) const;
|
||||
void onPickPanelExit( LLPanelPickEdit* pick_panel, LLView* owner, const LLSD& params);
|
||||
|
||||
/**
|
||||
* Processes drag-n-drop of the Landmarks and folders into trash button.
|
||||
*/
|
||||
bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept);
|
||||
|
||||
/**
|
||||
* Landmark actions callbacks. Fire when a landmark is loaded from the list.
|
||||
*/
|
||||
void doShowOnMap(LLLandmark* landmark);
|
||||
void doProcessParcelInfo(LLLandmark* landmark,
|
||||
LLFolderViewItem* cur_item,
|
||||
LLInventoryItem* inv_item,
|
||||
const LLParcelData& parcel_data);
|
||||
void doCreatePick(LLLandmark* landmark);
|
||||
|
||||
private:
|
||||
LLPlacesInventoryPanel* mFavoritesInventoryPanel;
|
||||
LLPlacesInventoryPanel* mLandmarksInventoryPanel;
|
||||
LLPlacesInventoryPanel* mMyInventoryPanel;
|
||||
LLPlacesInventoryPanel* mLibraryInventoryPanel;
|
||||
LLMenuButton* mGearButton;
|
||||
LLToggleableMenu* mGearLandmarkMenu;
|
||||
LLToggleableMenu* mGearFolderMenu;
|
||||
LLMenuGL* mMenuAdd;
|
||||
LLPlacesInventoryPanel* mCurrentSelectedList;
|
||||
LLInventoryObserver* mInventoryObserver;
|
||||
LLToggleableMenu* mSortingMenu;
|
||||
LLToggleableMenu* mAddMenu;
|
||||
|
||||
LLPanel* mListCommands;
|
||||
bool isLandmarksPanel;
|
||||
|
||||
typedef std::vector<LLAccordionCtrlTab*> accordion_tabs_t;
|
||||
accordion_tabs_t mAccordionTabs;
|
||||
LLUUID mCreatePickItemId; // item we requested a pick for
|
||||
};
|
||||
|
||||
LLAccordionCtrlTab* mMyLandmarksAccordionTab;
|
||||
|
||||
class LLFavoritesPanel : public LLLandmarksPanel
|
||||
{
|
||||
public:
|
||||
LLFavoritesPanel();
|
||||
|
||||
BOOL postBuild() override;
|
||||
void initFavoritesInventoryPanel();
|
||||
};
|
||||
|
||||
#endif //LL_LLPANELLANDMARKS_H
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
|
|||
mSavedFolderState(NULL),
|
||||
mFilterText(""),
|
||||
mMenuGearDefault(NULL),
|
||||
mMenuVisibility(NULL),
|
||||
mMenuAddHandle(),
|
||||
mNeedUploadCost(true)
|
||||
{
|
||||
|
|
@ -219,6 +220,17 @@ BOOL LLPanelMainInventory::postBuild()
|
|||
recent_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
|
||||
}
|
||||
}
|
||||
if(mActivePanel)
|
||||
{
|
||||
if(savedFilterState.has(mActivePanel->getFilter().getName()))
|
||||
{
|
||||
LLSD items = savedFilterState.get(mActivePanel->getFilter().getName());
|
||||
LLInventoryFilter::Params p;
|
||||
LLParamSDParser parser;
|
||||
parser.readSD(items, p);
|
||||
mActivePanel->getFilter().setSearchVisibilityTypes(p);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -229,6 +241,7 @@ BOOL LLPanelMainInventory::postBuild()
|
|||
}
|
||||
|
||||
mGearMenuButton = getChild<LLMenuButton>("options_gear_btn");
|
||||
mVisibilityMenuButton = getChild<LLMenuButton>("options_visibility_btn");
|
||||
|
||||
initListCommandsHandlers();
|
||||
|
||||
|
|
@ -254,6 +267,9 @@ BOOL LLPanelMainInventory::postBuild()
|
|||
LLPanelMainInventory::~LLPanelMainInventory( void )
|
||||
{
|
||||
// Save the filters state.
|
||||
// Some params types cannot be saved this way
|
||||
// for example, LLParamSDParser doesn't know about U64,
|
||||
// so some FilterOps params should be revised.
|
||||
LLSD filterRoot;
|
||||
LLInventoryPanel* all_items_panel = getChild<LLInventoryPanel>("All Items");
|
||||
if (all_items_panel)
|
||||
|
|
@ -1165,6 +1181,10 @@ void LLPanelMainInventory::initListCommandsHandlers()
|
|||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
mMenuAddHandle = menu->getHandle();
|
||||
|
||||
mMenuVisibility = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_inventory_search_visibility.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
mVisibilityMenuButton->setMenu(mMenuVisibility);
|
||||
mVisibilityMenuButton->setMenuPosition(LLMenuButton::MP_BOTTOM_LEFT);
|
||||
|
||||
// Update the trash button when selected item(s) get worn or taken off.
|
||||
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this));
|
||||
}
|
||||
|
|
@ -1354,6 +1374,21 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
|
|||
}
|
||||
LLFloaterReg::showInstance("linkreplace", params);
|
||||
}
|
||||
|
||||
if (command_name == "toggle_search_trash")
|
||||
{
|
||||
mActivePanel->getFilter().toggleSearchVisibilityTrash();
|
||||
}
|
||||
|
||||
if (command_name == "toggle_search_library")
|
||||
{
|
||||
mActivePanel->getFilter().toggleSearchVisibilityLibrary();
|
||||
}
|
||||
|
||||
if (command_name == "include_links")
|
||||
{
|
||||
mActivePanel->getFilter().toggleSearchVisibilityLinks();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility )
|
||||
|
|
@ -1499,6 +1534,21 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata)
|
|||
return sort_order_mask & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP;
|
||||
}
|
||||
|
||||
if (command_name == "toggle_search_trash")
|
||||
{
|
||||
return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_TRASH) != 0;
|
||||
}
|
||||
|
||||
if (command_name == "toggle_search_library")
|
||||
{
|
||||
return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LIBRARY) != 0;
|
||||
}
|
||||
|
||||
if (command_name == "include_links")
|
||||
{
|
||||
return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ public:
|
|||
|
||||
void toggleFindOptions();
|
||||
|
||||
void resetFilters();
|
||||
|
||||
protected:
|
||||
//
|
||||
// Misc functions
|
||||
|
|
@ -117,7 +119,6 @@ protected:
|
|||
void doToSelected(const LLSD& userdata);
|
||||
void closeAllFolders();
|
||||
void doCreate(const LLSD& userdata);
|
||||
void resetFilters();
|
||||
void setSortBy(const LLSD& userdata);
|
||||
void saveTexture(const LLSD& userdata);
|
||||
bool isSaveTextureEnabled(const LLSD& userdata);
|
||||
|
|
@ -169,7 +170,9 @@ protected:
|
|||
private:
|
||||
LLDragAndDropButton* mTrashButton;
|
||||
LLToggleableMenu* mMenuGearDefault;
|
||||
LLToggleableMenu* mMenuVisibility;
|
||||
LLMenuButton* mGearMenuButton;
|
||||
LLMenuButton* mVisibilityMenuButton;
|
||||
LLHandle<LLView> mMenuAddHandle;
|
||||
|
||||
bool mNeedUploadCost;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@
|
|||
#include "llmenubutton.h"
|
||||
#include "llpaneloutfitsinventory.h"
|
||||
#include "lluiconstants.h"
|
||||
#include "llsaveoutfitcombobtn.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "lltextbox.h"
|
||||
#include "lltoggleablemenu.h"
|
||||
|
|
@ -80,6 +79,8 @@ const U64 ATTACHMENT_MASK = (1LL << LLInventoryType::IT_ATTACHMENT) | (1LL << LL
|
|||
const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK;
|
||||
|
||||
static const std::string REVERT_BTN("revert_btn");
|
||||
static const std::string SAVE_AS_BTN("save_as_btn");
|
||||
static const std::string SAVE_BTN("save_btn");
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -562,7 +563,8 @@ BOOL LLPanelOutfitEdit::postBuild()
|
|||
mGearMenu = LLPanelOutfitEditGearMenu::create();
|
||||
mGearMenuBtn->setMenu(mGearMenu);
|
||||
|
||||
mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this));
|
||||
getChild<LLButton>(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false));
|
||||
getChild<LLButton>(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true));
|
||||
|
||||
onOutfitChanging(gAgentWearables.isCOFChangeInProgress());
|
||||
return TRUE;
|
||||
|
|
@ -1239,11 +1241,9 @@ void LLPanelOutfitEdit::updateVerbs()
|
|||
bool outfit_locked = LLAppearanceMgr::getInstance()->isOutfitLocked();
|
||||
bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull();
|
||||
|
||||
mSaveComboBtn->setSaveBtnEnabled(!outfit_locked && outfit_is_dirty);
|
||||
getChildView(SAVE_BTN)->setEnabled(!outfit_locked && outfit_is_dirty);
|
||||
getChildView(REVERT_BTN)->setEnabled(outfit_is_dirty && has_baseoutfit);
|
||||
|
||||
mSaveComboBtn->setMenuItemEnabled("save_outfit", !outfit_locked && outfit_is_dirty);
|
||||
|
||||
mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing"));
|
||||
|
||||
updateCurrentOutfitName();
|
||||
|
|
@ -1429,4 +1429,13 @@ void LLPanelOutfitEdit::saveListSelection()
|
|||
}
|
||||
}
|
||||
|
||||
void LLPanelOutfitEdit::saveOutfit(bool as_new)
|
||||
{
|
||||
LLPanelOutfitsInventory* panel_outfits_inventory = LLPanelOutfitsInventory::findInstance();
|
||||
if (panel_outfits_inventory)
|
||||
{
|
||||
panel_outfits_inventory->saveOutfit(as_new);
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ class LLMenuButton;
|
|||
class LLMenuGL;
|
||||
class LLFindNonLinksByMask;
|
||||
class LLFindWearablesOfType;
|
||||
class LLSaveOutfitComboBtn;
|
||||
class LLWearableItemTypeNameComparator;
|
||||
|
||||
class LLPanelOutfitEdit : public LLPanel
|
||||
|
|
@ -195,6 +194,7 @@ private:
|
|||
void getSelectedItemsUUID(uuid_vec_t& uuid_list);
|
||||
void getCurrentItemUUID(LLUUID& selected_id);
|
||||
void onCOFChanged();
|
||||
void saveOutfit(bool as_new = false);
|
||||
|
||||
/**
|
||||
* Method preserves selection while switching between folder/list view modes
|
||||
|
|
@ -237,7 +237,6 @@ private:
|
|||
LLToggleableMenu* mGearMenu;
|
||||
LLToggleableMenu* mAddWearablesGearMenu;
|
||||
bool mInitialized;
|
||||
std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
|
||||
LLMenuButton* mWearablesGearMenuBtn;
|
||||
LLMenuButton* mGearMenuBtn;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@
|
|||
#include "lloutfitgallery.h"
|
||||
#include "lloutfitslist.h"
|
||||
#include "llpanelwearing.h"
|
||||
#include "llsaveoutfitcombobtn.h"
|
||||
#include "llsidepanelappearance.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerfoldertype.h"
|
||||
|
|
@ -49,6 +48,9 @@ static const std::string OUTFITS_TAB_NAME = "outfitslist_tab";
|
|||
static const std::string OUTFIT_GALLERY_TAB_NAME = "outfit_gallery_tab";
|
||||
static const std::string COF_TAB_NAME = "cof_tab";
|
||||
|
||||
static const std::string SAVE_AS_BTN("save_as_btn");
|
||||
static const std::string SAVE_BTN("save_btn");
|
||||
|
||||
static LLPanelInjector<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory");
|
||||
|
||||
LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
|
||||
|
|
@ -90,8 +92,9 @@ BOOL LLPanelOutfitsInventory::postBuild()
|
|||
{
|
||||
LLInventoryModelBackgroundFetch::instance().start(outfits_cat);
|
||||
}
|
||||
|
||||
mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this, true));
|
||||
|
||||
getChild<LLButton>(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, false));
|
||||
getChild<LLButton>(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, true));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -246,6 +249,12 @@ LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance()
|
|||
return dynamic_cast<LLPanelOutfitsInventory*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfits_inventory"));
|
||||
}
|
||||
|
||||
void LLPanelOutfitsInventory::openApearanceTab(const std::string& tab_name)
|
||||
{
|
||||
if (!mAppearanceTabs) return;
|
||||
mAppearanceTabs->selectTabByName(tab_name);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// List Commands //
|
||||
|
||||
|
|
@ -269,7 +278,7 @@ void LLPanelOutfitsInventory::updateListCommands()
|
|||
mOutfitGalleryPanel->childSetEnabled("trash_btn", trash_enabled);
|
||||
wear_btn->setEnabled(wear_enabled);
|
||||
wear_btn->setVisible(wear_visible);
|
||||
mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled);
|
||||
getChild<LLButton>(SAVE_BTN)->setEnabled(make_outfit_enabled);
|
||||
wear_btn->setToolTip(getString((!isOutfitsGalleryPanelActive() && mMyOutfitsPanel->hasItemSelected()) ? "wear_items_tooltip" : "wear_outfit_tooltip"));
|
||||
}
|
||||
|
||||
|
|
@ -368,3 +377,15 @@ LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP()
|
|||
dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::getPanel("appearance"));
|
||||
return panel_appearance;
|
||||
}
|
||||
|
||||
void LLPanelOutfitsInventory::saveOutfit(bool as_new)
|
||||
{
|
||||
if (!as_new && LLAppearanceMgr::getInstance()->updateBaseOutfit())
|
||||
{
|
||||
// we don't need to ask for an outfit name, and updateBaseOutfit() successfully saved.
|
||||
// If updateBaseOutfit fails, ask for an outfit name anyways
|
||||
return;
|
||||
}
|
||||
|
||||
onSave();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ class LLPanelWearing;
|
|||
class LLMenuGL;
|
||||
class LLSidepanelAppearance;
|
||||
class LLTabContainer;
|
||||
class LLSaveOutfitComboBtn;
|
||||
|
||||
class LLPanelOutfitsInventory : public LLPanel
|
||||
{
|
||||
|
|
@ -52,6 +51,7 @@ public:
|
|||
|
||||
void onSearchEdit(const std::string& string);
|
||||
void onSave();
|
||||
void saveOutfit(bool as_new = false);
|
||||
|
||||
bool onSaveCommit(const LLSD& notification, const LLSD& response);
|
||||
|
||||
|
|
@ -59,13 +59,14 @@ public:
|
|||
|
||||
static LLPanelOutfitsInventory* findInstance();
|
||||
|
||||
void openApearanceTab(const std::string& tab_name);
|
||||
|
||||
protected:
|
||||
void updateVerbs();
|
||||
|
||||
private:
|
||||
LLTabContainer* mAppearanceTabs;
|
||||
std::string mFilterSubString;
|
||||
std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// tab panels //
|
||||
|
|
|
|||
|
|
@ -661,6 +661,7 @@ BOOL LLPanelPeople::postBuild()
|
|||
mRecentList->setShowIcons("RecentListShowIcons");
|
||||
|
||||
mGroupList = getChild<LLGroupList>("group_list");
|
||||
mGroupList->setNoItemsCommentText(getString("no_groups_msg"));
|
||||
mGroupList->setNoItemsMsg(getString("no_groups_msg"));
|
||||
mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg"));
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#include "llagentpicksinfo.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llcommandhandler.h"
|
||||
#include "lldndbutton.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "llinventorybridge.h"
|
||||
#include "llinventoryobserver.h"
|
||||
|
|
@ -79,6 +80,7 @@
|
|||
static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0;
|
||||
static const std::string AGENT_INFO_TYPE = "agent";
|
||||
static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark";
|
||||
static const std::string CREATE_PICK_TYPE = "create_pick";
|
||||
static const std::string LANDMARK_INFO_TYPE = "landmark";
|
||||
static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place";
|
||||
static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history";
|
||||
|
|
@ -293,8 +295,25 @@ BOOL LLPanelPlaces::postBuild()
|
|||
mOverflowBtn = getChild<LLMenuButton>("overflow_btn");
|
||||
mOverflowBtn->setMouseDownCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this));
|
||||
|
||||
mPlaceInfoBtn = getChild<LLButton>("profile_btn");
|
||||
mPlaceInfoBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onProfileButtonClicked, this));
|
||||
mGearMenuButton = getChild<LLMenuButton>("options_gear_btn");
|
||||
mGearMenuButton->setMouseDownCallback(boost::bind(&LLPanelPlaces::onGearMenuClick, this));
|
||||
|
||||
mSortingMenuButton = getChild<LLMenuButton>("sorting_menu_btn");
|
||||
mSortingMenuButton->setMouseDownCallback(boost::bind(&LLPanelPlaces::onSortingMenuClick, this));
|
||||
|
||||
mAddMenuButton = getChild<LLMenuButton>("add_menu_btn");
|
||||
mAddMenuButton->setMouseDownCallback(boost::bind(&LLPanelPlaces::onAddMenuClick, this));
|
||||
|
||||
mRemoveSelectedBtn = getChild<LLButton>("trash_btn");
|
||||
mRemoveSelectedBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onRemoveButtonClicked, this));
|
||||
|
||||
LLDragAndDropButton* trash_btn = (LLDragAndDropButton*)mRemoveSelectedBtn;
|
||||
trash_btn->setDragAndDropHandler(boost::bind(&LLPanelPlaces::handleDragAndDropToTrash, this
|
||||
, _4 // BOOL drop
|
||||
, _5 // EDragAndDropType cargo_type
|
||||
, _6 // void* cargo_data
|
||||
, _7 // EAcceptance* accept
|
||||
));
|
||||
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
registrar.add("Places.OverflowMenu.Action", boost::bind(&LLPanelPlaces::onOverflowMenuItemClicked, this, _2));
|
||||
|
|
@ -323,6 +342,10 @@ BOOL LLPanelPlaces::postBuild()
|
|||
mTabContainer->setCommitCallback(boost::bind(&LLPanelPlaces::onTabSelected, this));
|
||||
}
|
||||
|
||||
mButtonsContainer = getChild<LLPanel>("button_layout_panel");
|
||||
mButtonsContainer->setVisible(FALSE);
|
||||
mFilterContainer = getChild<LLLayoutStack>("top_menu_panel");
|
||||
|
||||
mFilterEditor = getChild<LLFilterEditor>("Filter");
|
||||
if (mFilterEditor)
|
||||
{
|
||||
|
|
@ -388,7 +411,22 @@ void LLPanelPlaces::onOpen(const LLSD& key)
|
|||
// Update the buttons at the bottom of the panel
|
||||
updateVerbs();
|
||||
}
|
||||
else
|
||||
else if (key_type == CREATE_PICK_TYPE)
|
||||
{
|
||||
LLUUID item_id = key["item_id"];
|
||||
|
||||
LLLandmarksPanel* landmarks_panel =
|
||||
dynamic_cast<LLLandmarksPanel*>(mTabContainer->getPanelByName("Landmarks"));
|
||||
if (landmarks_panel && item_id.notNull())
|
||||
{
|
||||
LLLandmark* landmark = LLLandmarkActions::getLandmark(item_id, boost::bind(&LLLandmarksPanel::doCreatePick, landmarks_panel, _1, item_id));
|
||||
if (landmark)
|
||||
{
|
||||
landmarks_panel->doCreatePick(landmark, item_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // "create_landmark"
|
||||
{
|
||||
mFilterEditor->clear();
|
||||
onFilterEdit("", false);
|
||||
|
|
@ -409,7 +447,8 @@ void LLPanelPlaces::onOpen(const LLSD& key)
|
|||
}
|
||||
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
|
||||
{
|
||||
mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK);
|
||||
LLUUID dest_folder = key["dest_folder"];
|
||||
mLandmarkInfo->setInfoAndCreateLandmark(dest_folder);
|
||||
|
||||
if (key.has("x") && key.has("y") && key.has("z"))
|
||||
{
|
||||
|
|
@ -617,6 +656,23 @@ void LLPanelPlaces::onTabSelected()
|
|||
|
||||
onFilterEdit(mActivePanel->getFilterSubString(), true);
|
||||
mActivePanel->updateVerbs();
|
||||
|
||||
// History panel does not support deletion nor creation
|
||||
// Hide menus
|
||||
bool supports_create = mActivePanel->getCreateMenu() != NULL;
|
||||
childSetVisible("add_btn_panel", supports_create);
|
||||
|
||||
// favorites and inventory can remove items, history can clear history
|
||||
childSetVisible("trash_btn_panel", TRUE);
|
||||
|
||||
if (supports_create)
|
||||
{
|
||||
mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items"));
|
||||
}
|
||||
else
|
||||
{
|
||||
mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history"));
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPlaces::onTeleportButtonClicked()
|
||||
|
|
@ -733,34 +789,6 @@ void LLPanelPlaces::onEditButtonClicked()
|
|||
updateVerbs();
|
||||
}
|
||||
|
||||
class LLUpdateLandmarkParent : public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
LLUpdateLandmarkParent(LLPointer<LLViewerInventoryItem> item, LLUUID new_parent) :
|
||||
mItem(item),
|
||||
mNewParentId(new_parent)
|
||||
{};
|
||||
/* virtual */ void fire(const LLUUID& inv_item_id)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
LLInventoryModel::LLCategoryUpdate old_folder(mItem->getParentUUID(), -1);
|
||||
update.push_back(old_folder);
|
||||
LLInventoryModel::LLCategoryUpdate new_folder(mNewParentId, 1);
|
||||
update.push_back(new_folder);
|
||||
gInventory.accountForUpdate(update);
|
||||
|
||||
mItem->setParent(mNewParentId);
|
||||
mItem->updateParentOnServer(FALSE);
|
||||
|
||||
gInventory.updateItem(mItem);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
|
||||
private:
|
||||
LLPointer<LLViewerInventoryItem> mItem;
|
||||
LLUUID mNewParentId;
|
||||
};
|
||||
|
||||
void LLPanelPlaces::onSaveButtonClicked()
|
||||
{
|
||||
if (!mLandmarkInfo || mItem.isNull())
|
||||
|
|
@ -890,14 +918,6 @@ void LLPanelPlaces::onOverflowButtonClicked()
|
|||
mOverflowBtn->setMenu(menu, LLMenuButton::MP_TOP_RIGHT);
|
||||
}
|
||||
|
||||
void LLPanelPlaces::onProfileButtonClicked()
|
||||
{
|
||||
if (!mActivePanel)
|
||||
return;
|
||||
|
||||
mActivePanel->onShowProfile();
|
||||
}
|
||||
|
||||
bool LLPanelPlaces::onOverflowMenuItemEnable(const LLSD& param)
|
||||
{
|
||||
std::string value = param.asString();
|
||||
|
|
@ -986,6 +1006,50 @@ void LLPanelPlaces::onBackButtonClicked()
|
|||
updateVerbs();
|
||||
}
|
||||
|
||||
void LLPanelPlaces::onGearMenuClick()
|
||||
{
|
||||
if (mActivePanel)
|
||||
{
|
||||
LLToggleableMenu* menu = mActivePanel->getSelectionMenu();
|
||||
mGearMenuButton->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPlaces::onSortingMenuClick()
|
||||
{
|
||||
if (mActivePanel)
|
||||
{
|
||||
LLToggleableMenu* menu = mActivePanel->getSortingMenu();
|
||||
mSortingMenuButton->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPlaces::onAddMenuClick()
|
||||
{
|
||||
if (mActivePanel)
|
||||
{
|
||||
LLToggleableMenu* menu = mActivePanel->getCreateMenu();
|
||||
mAddMenuButton->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPlaces::onRemoveButtonClicked()
|
||||
{
|
||||
if (mActivePanel)
|
||||
{
|
||||
mActivePanel->onRemoveSelected();
|
||||
}
|
||||
}
|
||||
|
||||
bool LLPanelPlaces::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept)
|
||||
{
|
||||
if (mActivePanel)
|
||||
{
|
||||
return mActivePanel->handleDragAndDropToTrash(drop, cargo_type, cargo_data, accept);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLPanelPlaces::togglePickPanel(BOOL visible)
|
||||
{
|
||||
if (mPickPanel)
|
||||
|
|
@ -1002,8 +1066,9 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
|
|||
if (!mPlaceProfile || !mLandmarkInfo)
|
||||
return;
|
||||
|
||||
mFilterEditor->setVisible(!visible);
|
||||
mTabContainer->setVisible(!visible);
|
||||
mButtonsContainer->setVisible(visible);
|
||||
mFilterContainer->setVisible(!visible);
|
||||
|
||||
if (mPlaceInfoType == AGENT_INFO_TYPE ||
|
||||
mPlaceInfoType == REMOTE_PLACE_INFO_TYPE ||
|
||||
|
|
@ -1019,10 +1084,6 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
|
|||
// to avoid text blinking.
|
||||
mResetInfoTimer.setTimerExpirySec(PLACE_INFO_UPDATE_INTERVAL);
|
||||
|
||||
LLRect rect = getRect();
|
||||
LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom);
|
||||
mPlaceProfile->reshape(new_rect.getWidth(), new_rect.getHeight());
|
||||
|
||||
mLandmarkInfo->setVisible(FALSE);
|
||||
}
|
||||
else if (mPlaceInfoType == AGENT_INFO_TYPE)
|
||||
|
|
@ -1043,15 +1104,19 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
|
|||
if (visible)
|
||||
{
|
||||
mLandmarkInfo->resetLocation();
|
||||
|
||||
LLRect rect = getRect();
|
||||
LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom);
|
||||
mLandmarkInfo->reshape(new_rect.getWidth(), new_rect.getHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
LLLandmarksPanel* landmarks_panel =
|
||||
dynamic_cast<LLLandmarksPanel*>(mTabContainer->getPanelByName("Landmarks"));
|
||||
std::string tab_panel_name("Landmarks");
|
||||
if (mItem.notNull())
|
||||
{
|
||||
if (gInventory.isObjectDescendentOf(mItem->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)))
|
||||
{
|
||||
tab_panel_name = "Favorites";
|
||||
}
|
||||
}
|
||||
|
||||
LLLandmarksPanel* landmarks_panel = dynamic_cast<LLLandmarksPanel*>(mTabContainer->getPanelByName(tab_panel_name));
|
||||
if (landmarks_panel)
|
||||
{
|
||||
// If a landmark info is being closed we open the landmarks tab
|
||||
|
|
@ -1061,6 +1126,10 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
|
|||
{
|
||||
landmarks_panel->setItemSelected(mItem->getUUID(), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
landmarks_panel->resetSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1128,11 +1197,19 @@ void LLPanelPlaces::createTabs()
|
|||
if (!(gInventory.isInventoryUsable() && LLTeleportHistory::getInstance() && !mTabsCreated))
|
||||
return;
|
||||
|
||||
LLFavoritesPanel* favorites_panel = new LLFavoritesPanel();
|
||||
if (favorites_panel)
|
||||
{
|
||||
mTabContainer->addTabPanel(
|
||||
LLTabContainer::TabPanelParams().
|
||||
panel(favorites_panel).
|
||||
label(getString("favorites_tab_title")).
|
||||
insert_at(LLTabContainer::END));
|
||||
}
|
||||
|
||||
LLLandmarksPanel* landmarks_panel = new LLLandmarksPanel();
|
||||
if (landmarks_panel)
|
||||
{
|
||||
landmarks_panel->setPanelPlacesButtons(this);
|
||||
|
||||
mTabContainer->addTabPanel(
|
||||
LLTabContainer::TabPanelParams().
|
||||
panel(landmarks_panel).
|
||||
|
|
@ -1143,8 +1220,6 @@ void LLPanelPlaces::createTabs()
|
|||
LLTeleportHistoryPanel* teleport_history_panel = new LLTeleportHistoryPanel();
|
||||
if (teleport_history_panel)
|
||||
{
|
||||
teleport_history_panel->setPanelPlacesButtons(this);
|
||||
|
||||
mTabContainer->addTabPanel(
|
||||
LLTabContainer::TabPanelParams().
|
||||
panel(teleport_history_panel).
|
||||
|
|
@ -1156,9 +1231,31 @@ void LLPanelPlaces::createTabs()
|
|||
|
||||
mActivePanel = dynamic_cast<LLPanelPlacesTab*>(mTabContainer->getCurrentPanel());
|
||||
|
||||
// Filter applied to show all items.
|
||||
if (mActivePanel)
|
||||
mActivePanel->onSearchEdit(mActivePanel->getFilterSubString());
|
||||
if (mActivePanel)
|
||||
{
|
||||
// Filter applied to show all items.
|
||||
mActivePanel->onSearchEdit(mActivePanel->getFilterSubString());
|
||||
|
||||
// History panel does not support deletion nor creation
|
||||
// Hide menus
|
||||
bool supports_create = mActivePanel->getCreateMenu() != NULL;
|
||||
childSetVisible("add_btn_panel", supports_create);
|
||||
|
||||
// favorites and inventory can remove items, history can clear history
|
||||
childSetVisible("trash_btn_panel", TRUE);
|
||||
|
||||
if (supports_create)
|
||||
{
|
||||
mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items"));
|
||||
}
|
||||
else
|
||||
{
|
||||
mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history"));
|
||||
}
|
||||
|
||||
mActivePanel->setRemoveBtn(mRemoveSelectedBtn);
|
||||
mActivePanel->updateVerbs();
|
||||
}
|
||||
|
||||
mTabsCreated = true;
|
||||
}
|
||||
|
|
@ -1224,15 +1321,12 @@ void LLPanelPlaces::updateVerbs()
|
|||
mSaveBtn->setVisible(isLandmarkEditModeOn);
|
||||
mCancelBtn->setVisible(isLandmarkEditModeOn);
|
||||
mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn);
|
||||
mPlaceInfoBtn->setVisible(!is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible);
|
||||
|
||||
bool show_options_btn = is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn;
|
||||
mOverflowBtn->setVisible(show_options_btn);
|
||||
getChild<LLLayoutPanel>("lp_options")->setVisible(show_options_btn);
|
||||
getChild<LLLayoutPanel>("lp2")->setVisible(!show_options_btn);
|
||||
|
||||
mPlaceInfoBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos);
|
||||
|
||||
if (is_place_info_visible)
|
||||
{
|
||||
mShowOnMapBtn->setEnabled(have_3d_pos);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ class LLRemoteParcelInfoObserver;
|
|||
class LLTabContainer;
|
||||
class LLToggleableMenu;
|
||||
class LLMenuButton;
|
||||
class LLLayoutStack;
|
||||
|
||||
typedef std::pair<LLUUID, std::string> folder_pair_t;
|
||||
|
||||
|
|
@ -96,7 +97,12 @@ private:
|
|||
bool onOverflowMenuItemEnable(const LLSD& param);
|
||||
void onCreateLandmarkButtonClicked(const LLUUID& folder_id);
|
||||
void onBackButtonClicked();
|
||||
void onProfileButtonClicked();
|
||||
void onGearMenuClick();
|
||||
void onSortingMenuClick();
|
||||
void onAddMenuClick();
|
||||
void onRemoveButtonClicked();
|
||||
bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept);
|
||||
|
||||
|
||||
void toggleMediaPanel();
|
||||
void togglePickPanel(BOOL visible);
|
||||
|
|
@ -111,6 +117,8 @@ private:
|
|||
LLFilterEditor* mFilterEditor;
|
||||
LLPanelPlacesTab* mActivePanel;
|
||||
LLTabContainer* mTabContainer;
|
||||
LLPanel* mButtonsContainer;
|
||||
LLLayoutStack* mFilterContainer;
|
||||
LLPanelPlaceProfile* mPlaceProfile;
|
||||
LLPanelLandmarkInfo* mLandmarkInfo;
|
||||
|
||||
|
|
@ -125,7 +133,12 @@ private:
|
|||
LLButton* mCancelBtn;
|
||||
LLButton* mCloseBtn;
|
||||
LLMenuButton* mOverflowBtn;
|
||||
LLButton* mPlaceInfoBtn;
|
||||
|
||||
// Top menu
|
||||
LLMenuButton* mGearMenuButton;
|
||||
LLMenuButton* mSortingMenuButton;
|
||||
LLMenuButton* mAddMenuButton;
|
||||
LLButton* mRemoveSelectedBtn;
|
||||
|
||||
LLPlacesInventoryObserver* mInventoryObserver;
|
||||
LLPlacesParcelObserver* mParcelObserver;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "llworldmap.h"
|
||||
|
||||
std::string LLPanelPlacesTab::sFilterSubString = LLStringUtil::null;
|
||||
LLButton* LLPanelPlacesTab::sRemoveBtn = NULL;
|
||||
|
||||
bool LLPanelPlacesTab::isTabVisible()
|
||||
{
|
||||
|
|
@ -47,13 +48,6 @@ bool LLPanelPlacesTab::isTabVisible()
|
|||
return true;
|
||||
}
|
||||
|
||||
void LLPanelPlacesTab::setPanelPlacesButtons(LLPanelPlaces* panel)
|
||||
{
|
||||
mTeleportBtn = panel->getChild<LLButton>("teleport_btn");
|
||||
mShowOnMapBtn = panel->getChild<LLButton>("map_btn");
|
||||
mShowProfile = panel->getChild<LLButton>("profile_btn");
|
||||
}
|
||||
|
||||
void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos,
|
||||
U64 region_handle,
|
||||
const std::string& url,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "llpanel.h"
|
||||
|
||||
class LLPanelPlaces;
|
||||
class LLToggleableMenu;
|
||||
|
||||
class LLPanelPlacesTab : public LLPanel
|
||||
{
|
||||
|
|
@ -42,11 +43,21 @@ public:
|
|||
virtual void onShowOnMap() = 0;
|
||||
virtual void onShowProfile() = 0;
|
||||
virtual void onTeleport() = 0;
|
||||
virtual void onRemoveSelected() = 0;
|
||||
virtual bool isSingleItemSelected() = 0;
|
||||
|
||||
// returns menu for current selection
|
||||
virtual LLToggleableMenu* getSelectionMenu() = 0;
|
||||
virtual LLToggleableMenu* getSortingMenu() = 0;
|
||||
virtual LLToggleableMenu* getCreateMenu() = 0;
|
||||
|
||||
/**
|
||||
* Processes drag-n-drop of the Landmarks and folders into trash button.
|
||||
*/
|
||||
virtual bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) = 0;
|
||||
|
||||
bool isTabVisible(); // Check if parent TabContainer is visible.
|
||||
|
||||
void setPanelPlacesButtons(LLPanelPlaces* panel);
|
||||
void onRegionResponse(const LLVector3d& landmark_global_pos,
|
||||
U64 region_handle,
|
||||
const std::string& url,
|
||||
|
|
@ -56,13 +67,12 @@ public:
|
|||
const std::string& getFilterSubString() { return sFilterSubString; }
|
||||
void setFilterSubString(const std::string& string) { sFilterSubString = string; }
|
||||
|
||||
protected:
|
||||
LLButton* mTeleportBtn;
|
||||
LLButton* mShowOnMapBtn;
|
||||
LLButton* mShowProfile;
|
||||
void setRemoveBtn(LLButton* trash_btn) { sRemoveBtn = trash_btn; }
|
||||
|
||||
protected:
|
||||
// Search string for filtering landmarks and teleport history locations
|
||||
static std::string sFilterSubString;
|
||||
static LLButton* sRemoveBtn;
|
||||
};
|
||||
|
||||
#endif //LL_LLPANELPLACESTAB_H
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user";
|
|||
class LLTeleportHistoryFlatItem : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name,
|
||||
LLTeleportHistoryFlatItem(S32 index, LLToggleableMenu *menu, const std::string ®ion_name,
|
||||
LLDate date, const std::string &hl);
|
||||
virtual ~LLTeleportHistoryFlatItem();
|
||||
|
||||
|
|
@ -86,12 +86,13 @@ public:
|
|||
|
||||
private:
|
||||
void onProfileBtnClick();
|
||||
void showMenu(S32 x, S32 y);
|
||||
|
||||
LLButton* mProfileBtn;
|
||||
LLTextBox* mTitle;
|
||||
LLTextBox* mTimeTextBox;
|
||||
|
||||
LLTeleportHistoryPanel::ContextMenu *mContextMenu;
|
||||
LLToggleableMenu *mMenu;
|
||||
|
||||
S32 mIndex;
|
||||
std::string mRegionName;
|
||||
|
|
@ -112,7 +113,7 @@ protected:
|
|||
|
||||
public:
|
||||
LLTeleportHistoryFlatItem* getFlatItemForPersistentItem (
|
||||
LLTeleportHistoryPanel::ContextMenu *context_menu,
|
||||
LLToggleableMenu *menu,
|
||||
const LLTeleportHistoryPersistentItem& persistent_item,
|
||||
const S32 cur_item_index,
|
||||
const std::string &hl);
|
||||
|
|
@ -130,16 +131,16 @@ private:
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name,
|
||||
LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLToggleableMenu *menu, const std::string ®ion_name,
|
||||
LLDate date, const std::string &hl)
|
||||
: LLPanel(),
|
||||
mIndex(index),
|
||||
mContextMenu(context_menu),
|
||||
mMenu(menu),
|
||||
mRegionName(region_name),
|
||||
mDate(date),
|
||||
mHighlight(hl)
|
||||
{
|
||||
buildFromFile( "panel_teleport_history_item.xml");
|
||||
buildFromFile("panel_teleport_history_item.xml");
|
||||
}
|
||||
|
||||
LLTeleportHistoryFlatItem::~LLTeleportHistoryFlatItem()
|
||||
|
|
@ -266,10 +267,9 @@ void LLTeleportHistoryFlatItem::onMouseLeave(S32 x, S32 y, MASK mask)
|
|||
// virtual
|
||||
BOOL LLTeleportHistoryFlatItem::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (mContextMenu)
|
||||
mContextMenu->show(this, mIndex, x, y);
|
||||
|
||||
return LLPanel::handleRightMouseDown(x, y, mask);
|
||||
LLPanel::handleRightMouseDown(x, y, mask);
|
||||
showMenu(x, y);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLTeleportHistoryFlatItem::showPlaceInfoPanel(S32 index)
|
||||
|
|
@ -286,13 +286,23 @@ void LLTeleportHistoryFlatItem::onProfileBtnClick()
|
|||
LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex);
|
||||
}
|
||||
|
||||
void LLTeleportHistoryFlatItem::showMenu(S32 x, S32 y)
|
||||
{
|
||||
mMenu->setButtonRect(this);
|
||||
mMenu->buildDrawLabels();
|
||||
mMenu->arrangeAndClear();
|
||||
mMenu->updateParent(LLMenuGL::sMenuContainer);
|
||||
|
||||
LLMenuGL::showPopup(this, mMenu, x, y);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLTeleportHistoryFlatItem*
|
||||
LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem (
|
||||
LLTeleportHistoryPanel::ContextMenu *context_menu,
|
||||
LLToggleableMenu *menu,
|
||||
const LLTeleportHistoryPersistentItem& persistent_item,
|
||||
const S32 cur_item_index,
|
||||
const std::string &hl)
|
||||
|
|
@ -321,7 +331,7 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem (
|
|||
if ( !item )
|
||||
{
|
||||
item = new LLTeleportHistoryFlatItem(cur_item_index,
|
||||
context_menu,
|
||||
menu,
|
||||
persistent_item.mTitle,
|
||||
persistent_item.mDate,
|
||||
hl);
|
||||
|
|
@ -365,74 +375,6 @@ void LLTeleportHistoryFlatItemStorage::purge()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLTeleportHistoryPanel::ContextMenu::ContextMenu() :
|
||||
mMenu(NULL), mIndex(0)
|
||||
{
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::ContextMenu::show(LLView* spawning_view, S32 index, S32 x, S32 y)
|
||||
{
|
||||
if (mMenu)
|
||||
{
|
||||
//preventing parent (menu holder) from deleting already "dead" context menus on exit
|
||||
LLView* parent = mMenu->getParent();
|
||||
if (parent)
|
||||
{
|
||||
parent->removeChild(mMenu);
|
||||
}
|
||||
delete mMenu;
|
||||
}
|
||||
|
||||
mIndex = index;
|
||||
mMenu = createMenu();
|
||||
|
||||
mMenu->show(x, y);
|
||||
LLMenuGL::showPopup(spawning_view, mMenu, x, y);
|
||||
}
|
||||
|
||||
LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu()
|
||||
{
|
||||
// set up the callbacks for all of the avatar menu items
|
||||
// (N.B. callbacks don't take const refs as mID is local scope)
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
|
||||
registrar.add("TeleportHistory.Teleport", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onTeleport, this));
|
||||
registrar.add("TeleportHistory.MoreInformation",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onInfo, this));
|
||||
registrar.add("TeleportHistory.CopyToClipboard",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard, this));
|
||||
|
||||
// create the context menu from the XUI
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
|
||||
"menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::ContextMenu::onTeleport()
|
||||
{
|
||||
confirmTeleport(mIndex);
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::ContextMenu::onInfo()
|
||||
{
|
||||
LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex);
|
||||
}
|
||||
|
||||
//static
|
||||
void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& slurl)
|
||||
{
|
||||
LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
|
||||
|
||||
LLSD args;
|
||||
args["SLURL"] = slurl;
|
||||
|
||||
LLNotificationsUtil::add("CopySLURL", args);
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard()
|
||||
{
|
||||
LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos;
|
||||
LLLandmarkActions::getSLURLfromPosGlobal(globalPos,
|
||||
boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1));
|
||||
}
|
||||
|
||||
// Not yet implemented; need to remove buildPanel() from constructor when we switch
|
||||
//static LLRegisterPanelClassWrapper<LLTeleportHistoryPanel> t_teleport_history("panel_teleport_history");
|
||||
|
|
@ -446,7 +388,8 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
|
|||
mAccordionTabMenu(NULL),
|
||||
mLastSelectedFlatlList(NULL),
|
||||
mLastSelectedItemIndex(-1),
|
||||
mMenuGearButton(NULL)
|
||||
mGearItemMenu(NULL),
|
||||
mSortingMenu(NULL)
|
||||
{
|
||||
buildFromFile( "panel_teleport_history.xml");
|
||||
}
|
||||
|
|
@ -454,12 +397,19 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
|
|||
LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
|
||||
{
|
||||
LLTeleportHistoryFlatItemStorage::instance().purge();
|
||||
if (mGearMenuHandle.get()) mGearMenuHandle.get()->die();
|
||||
mTeleportHistoryChangedConnection.disconnect();
|
||||
}
|
||||
|
||||
BOOL LLTeleportHistoryPanel::postBuild()
|
||||
{
|
||||
mCommitCallbackRegistrar.add("TeleportHistory.GearMenu.Action", boost::bind(&LLTeleportHistoryPanel::onGearMenuAction, this, _2));
|
||||
mEnableCallbackRegistrar.add("TeleportHistory.GearMenu.Enable", boost::bind(&LLTeleportHistoryPanel::isActionEnabled, this, _2));
|
||||
|
||||
// init menus before list, since menus are passed to list
|
||||
mGearItemMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_teleport_history_item.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
mGearItemMenu->setAlwaysShowMenu(TRUE); // all items can be disabled if nothing is selected, show anyway
|
||||
mSortingMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_teleport_history_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
|
||||
mTeleportHistory = LLTeleportHistoryStorage::getInstance();
|
||||
if (mTeleportHistory)
|
||||
{
|
||||
|
|
@ -511,22 +461,6 @@ BOOL LLTeleportHistoryPanel::postBuild()
|
|||
}
|
||||
}
|
||||
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
|
||||
registrar.add("TeleportHistory.ExpandAllFolders", boost::bind(&LLTeleportHistoryPanel::onExpandAllFolders, this));
|
||||
registrar.add("TeleportHistory.CollapseAllFolders", boost::bind(&LLTeleportHistoryPanel::onCollapseAllFolders, this));
|
||||
registrar.add("TeleportHistory.ClearTeleportHistory", boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistory, this));
|
||||
mEnableCallbackRegistrar.add("TeleportHistory.GearMenu.Enable", boost::bind(&LLTeleportHistoryPanel::isActionEnabled, this, _2));
|
||||
|
||||
mMenuGearButton = getChild<LLMenuButton>("gear_btn");
|
||||
|
||||
LLToggleableMenu* gear_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_teleport_history_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());;
|
||||
if(gear_menu)
|
||||
{
|
||||
mGearMenuHandle = gear_menu->getHandle();
|
||||
mMenuGearButton->setMenu(gear_menu);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -600,6 +534,12 @@ void LLTeleportHistoryPanel::onTeleport()
|
|||
confirmTeleport(itemp->getIndex());
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLTeleportHistoryPanel::onRemoveSelected()
|
||||
{
|
||||
LLNotificationsUtil::add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2));
|
||||
}
|
||||
|
||||
/*
|
||||
// virtual
|
||||
void LLTeleportHistoryPanel::onCopySLURL()
|
||||
|
|
@ -630,19 +570,28 @@ void LLTeleportHistoryPanel::updateVerbs()
|
|||
if (!isTabVisible())
|
||||
return;
|
||||
|
||||
if (!mLastSelectedFlatlList)
|
||||
if (sRemoveBtn)
|
||||
{
|
||||
mTeleportBtn->setEnabled(false);
|
||||
mShowProfile->setEnabled(false);
|
||||
mShowOnMapBtn->setEnabled(false);
|
||||
return;
|
||||
sRemoveBtn->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem());
|
||||
// virtual
|
||||
LLToggleableMenu* LLTeleportHistoryPanel::getSelectionMenu()
|
||||
{
|
||||
return mGearItemMenu;
|
||||
}
|
||||
|
||||
mTeleportBtn->setEnabled(NULL != itemp);
|
||||
mShowProfile->setEnabled(NULL != itemp);
|
||||
mShowOnMapBtn->setEnabled(NULL != itemp);
|
||||
// virtual
|
||||
LLToggleableMenu* LLTeleportHistoryPanel::getSortingMenu()
|
||||
{
|
||||
return mSortingMenu;
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLToggleableMenu* LLTeleportHistoryPanel::getCreateMenu()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, LLDate& tab_date)
|
||||
|
|
@ -778,7 +727,7 @@ void LLTeleportHistoryPanel::refresh()
|
|||
{
|
||||
LLTeleportHistoryFlatItem* item =
|
||||
LLTeleportHistoryFlatItemStorage::instance()
|
||||
.getFlatItemForPersistentItem(&mContextMenu,
|
||||
.getFlatItemForPersistentItem(mGearItemMenu,
|
||||
items[mCurrentItem],
|
||||
mCurrentItem,
|
||||
filter_string);
|
||||
|
|
@ -847,7 +796,7 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index)
|
|||
|
||||
const LLTeleportHistoryStorage::slurl_list_t& history_items = mTeleportHistory->getItems();
|
||||
LLTeleportHistoryFlatItem* item = LLTeleportHistoryFlatItemStorage::instance()
|
||||
.getFlatItemForPersistentItem(&mContextMenu,
|
||||
.getFlatItemForPersistentItem(mGearItemMenu,
|
||||
history_items[history_items.size() - 1], // Most recent item, it was added instead of removed
|
||||
history_items.size(), // index will be decremented inside loop below
|
||||
sFilterSubString);
|
||||
|
|
@ -1019,38 +968,6 @@ void LLTeleportHistoryPanel::onAccordionTabClose(LLAccordionCtrlTab *tab)
|
|||
mHistoryAccordion->arrange();
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::onExpandAllFolders()
|
||||
{
|
||||
S32 tabs_cnt = mItemContainers.size();
|
||||
|
||||
for (S32 n = 0; n < tabs_cnt; n++)
|
||||
{
|
||||
mItemContainers.at(n)->setDisplayChildren(true);
|
||||
}
|
||||
mHistoryAccordion->arrange();
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::onCollapseAllFolders()
|
||||
{
|
||||
S32 tabs_cnt = mItemContainers.size();
|
||||
|
||||
for (S32 n = 0; n < tabs_cnt; n++)
|
||||
{
|
||||
mItemContainers.at(n)->setDisplayChildren(false);
|
||||
}
|
||||
mHistoryAccordion->arrange();
|
||||
|
||||
if (mLastSelectedFlatlList)
|
||||
{
|
||||
mLastSelectedFlatlList->resetSelection();
|
||||
}
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::onClearTeleportHistory()
|
||||
{
|
||||
LLNotificationsUtil::add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2));
|
||||
}
|
||||
|
||||
bool LLTeleportHistoryPanel::onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
|
||||
|
|
@ -1082,45 +999,137 @@ LLFlatListView* LLTeleportHistoryPanel::getFlatListViewFromTab(LLAccordionCtrlTa
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::gotSLURLCallback(const std::string& slurl)
|
||||
{
|
||||
LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl), 0, slurl.size());
|
||||
|
||||
LLSD args;
|
||||
args["SLURL"] = slurl;
|
||||
|
||||
LLNotificationsUtil::add("CopySLURL", args);
|
||||
}
|
||||
|
||||
void LLTeleportHistoryPanel::onGearMenuAction(const LLSD& userdata)
|
||||
{
|
||||
std::string command_name = userdata.asString();
|
||||
|
||||
if ("expand_all" == command_name)
|
||||
{
|
||||
S32 tabs_cnt = mItemContainers.size();
|
||||
|
||||
for (S32 n = 0; n < tabs_cnt; n++)
|
||||
{
|
||||
mItemContainers.at(n)->setDisplayChildren(true);
|
||||
}
|
||||
mHistoryAccordion->arrange();
|
||||
}
|
||||
else if ("collapse_all" == command_name)
|
||||
{
|
||||
S32 tabs_cnt = mItemContainers.size();
|
||||
|
||||
for (S32 n = 0; n < tabs_cnt; n++)
|
||||
{
|
||||
mItemContainers.at(n)->setDisplayChildren(false);
|
||||
}
|
||||
mHistoryAccordion->arrange();
|
||||
|
||||
if (mLastSelectedFlatlList)
|
||||
{
|
||||
mLastSelectedFlatlList->resetSelection();
|
||||
}
|
||||
}
|
||||
|
||||
S32 index = -1;
|
||||
if (mLastSelectedFlatlList)
|
||||
{
|
||||
LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem());
|
||||
if (itemp)
|
||||
{
|
||||
index = itemp->getIndex();
|
||||
}
|
||||
}
|
||||
|
||||
if ("teleport" == command_name)
|
||||
{
|
||||
confirmTeleport(index);
|
||||
}
|
||||
else if ("view" == command_name)
|
||||
{
|
||||
LLTeleportHistoryFlatItem::showPlaceInfoPanel(index);
|
||||
}
|
||||
else if ("show_on_map" == command_name)
|
||||
{
|
||||
LLTeleportHistoryStorage::getInstance()->showItemOnMap(index);
|
||||
}
|
||||
else if ("copy_slurl" == command_name)
|
||||
{
|
||||
LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[index].mGlobalPos;
|
||||
LLLandmarkActions::getSLURLfromPosGlobal(globalPos,
|
||||
boost::bind(&LLTeleportHistoryPanel::gotSLURLCallback, _1));
|
||||
}
|
||||
}
|
||||
|
||||
bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const
|
||||
{
|
||||
S32 tabs_cnt = mItemContainers.size();
|
||||
std::string command_name = userdata.asString();
|
||||
|
||||
bool has_expanded_tabs = false;
|
||||
bool has_collapsed_tabs = false;
|
||||
if (command_name == "collapse_all"
|
||||
|| command_name == "expand_all")
|
||||
{
|
||||
S32 tabs_cnt = mItemContainers.size();
|
||||
|
||||
for (S32 n = 0; n < tabs_cnt; n++)
|
||||
{
|
||||
LLAccordionCtrlTab* tab = mItemContainers.at(n);
|
||||
if (!tab->getVisible())
|
||||
continue;
|
||||
bool has_expanded_tabs = false;
|
||||
bool has_collapsed_tabs = false;
|
||||
|
||||
if (tab->getDisplayChildren())
|
||||
{
|
||||
has_expanded_tabs = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
has_collapsed_tabs = true;
|
||||
}
|
||||
for (S32 n = 0; n < tabs_cnt; n++)
|
||||
{
|
||||
LLAccordionCtrlTab* tab = mItemContainers.at(n);
|
||||
if (!tab->getVisible())
|
||||
continue;
|
||||
|
||||
if (has_expanded_tabs && has_collapsed_tabs)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (tab->getDisplayChildren())
|
||||
{
|
||||
has_expanded_tabs = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
has_collapsed_tabs = true;
|
||||
}
|
||||
|
||||
std::string command_name = userdata.asString();
|
||||
if (has_expanded_tabs && has_collapsed_tabs)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (has_expanded_tabs && command_name == "collapse_all")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (command_name == "collapse_all")
|
||||
{
|
||||
return has_expanded_tabs;
|
||||
}
|
||||
|
||||
if (has_collapsed_tabs && command_name == "expand_all")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (command_name == "expand_all")
|
||||
{
|
||||
return has_collapsed_tabs;
|
||||
}
|
||||
}
|
||||
|
||||
if (command_name == "clear_history")
|
||||
{
|
||||
return mTeleportHistory->getItems().size() > 0;
|
||||
}
|
||||
|
||||
if ("teleport" == command_name
|
||||
|| "view" == command_name
|
||||
|| "show_on_map" == command_name
|
||||
|| "copy_slurl" == command_name)
|
||||
{
|
||||
if (!mLastSelectedFlatlList)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem());
|
||||
return itemp != NULL;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,38 +43,26 @@ class LLMenuButton;
|
|||
class LLTeleportHistoryPanel : public LLPanelPlacesTab
|
||||
{
|
||||
public:
|
||||
// *TODO: derive from LLListContextMenu?
|
||||
class ContextMenu
|
||||
{
|
||||
public:
|
||||
ContextMenu();
|
||||
void show(LLView* spawning_view, S32 index, S32 x, S32 y);
|
||||
|
||||
private:
|
||||
LLContextMenu* createMenu();
|
||||
void onTeleport();
|
||||
void onInfo();
|
||||
void onCopyToClipboard();
|
||||
|
||||
static void gotSLURLCallback(const std::string& slurl);
|
||||
|
||||
LLContextMenu* mMenu;
|
||||
S32 mIndex;
|
||||
};
|
||||
|
||||
LLTeleportHistoryPanel();
|
||||
virtual ~LLTeleportHistoryPanel();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void draw();
|
||||
BOOL postBuild() override;
|
||||
void draw() override;
|
||||
|
||||
/*virtual*/ void onSearchEdit(const std::string& string);
|
||||
/*virtual*/ void onShowOnMap();
|
||||
/*virtual*/ void onShowProfile();
|
||||
/*virtual*/ void onTeleport();
|
||||
///*virtual*/ void onCopySLURL();
|
||||
/*virtual*/ void updateVerbs();
|
||||
/*virtual*/ bool isSingleItemSelected();
|
||||
void onSearchEdit(const std::string& string) override;
|
||||
void onShowOnMap() override;
|
||||
void onShowProfile() override;
|
||||
void onTeleport() override;
|
||||
///*virtual*/ void onCopySLURL();
|
||||
void onRemoveSelected() override;
|
||||
void updateVerbs() override;
|
||||
bool isSingleItemSelected() override;
|
||||
|
||||
LLToggleableMenu* getSelectionMenu() override;
|
||||
LLToggleableMenu* getSortingMenu() override;
|
||||
LLToggleableMenu* getCreateMenu() override;
|
||||
|
||||
bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) override { return false; }
|
||||
|
||||
private:
|
||||
|
||||
|
|
@ -88,13 +76,15 @@ private:
|
|||
void onClearTeleportHistory();
|
||||
bool onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response);
|
||||
|
||||
void refresh();
|
||||
void refresh() override;
|
||||
void getNextTab(const LLDate& item_date, S32& curr_tab, LLDate& tab_date);
|
||||
void onTeleportHistoryChange(S32 removed_index);
|
||||
void replaceItem(S32 removed_index);
|
||||
void showTeleportHistory();
|
||||
void handleItemSelect(LLFlatListView* );
|
||||
LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *);
|
||||
static void gotSLURLCallback(const std::string& slurl);
|
||||
void onGearMenuAction(const LLSD& userdata);
|
||||
bool isActionEnabled(const LLSD& userdata) const;
|
||||
|
||||
void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed);
|
||||
|
|
@ -115,10 +105,10 @@ private:
|
|||
typedef std::vector<LLAccordionCtrlTab*> item_containers_t;
|
||||
item_containers_t mItemContainers;
|
||||
|
||||
ContextMenu mContextMenu;
|
||||
LLContextMenu* mAccordionTabMenu;
|
||||
LLHandle<LLView> mGearMenuHandle;
|
||||
LLMenuButton* mMenuGearButton;
|
||||
|
||||
LLToggleableMenu* mGearItemMenu;
|
||||
LLToggleableMenu* mSortingMenu;
|
||||
|
||||
boost::signals2::connection mTeleportHistoryChangedConnection;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "llagent.h"
|
||||
#include "llagentui.h"
|
||||
#include "llclipboard.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloatersidepanelcontainer.h"
|
||||
#include "lllandmarkactions.h"
|
||||
#include "lllocationinputctrl.h"
|
||||
|
|
@ -456,7 +457,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item)
|
|||
|
||||
if(landmark == NULL)
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark"));
|
||||
LLFloaterReg::showInstance("add_landmark");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -164,8 +164,12 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
|
|||
std::string type = key["type"].asString();
|
||||
if (type == "my_outfits")
|
||||
{
|
||||
showOutfitsInventoryPanel();
|
||||
showOutfitsInventoryPanel("outfitslist_tab");
|
||||
}
|
||||
else if (type == "now_wearing")
|
||||
{
|
||||
showOutfitsInventoryPanel("cof_tab");
|
||||
}
|
||||
else if (type == "edit_outfit")
|
||||
{
|
||||
showOutfitEditPanel();
|
||||
|
|
@ -287,7 +291,14 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel()
|
|||
{
|
||||
toggleWearableEditPanel(FALSE);
|
||||
toggleOutfitEditPanel(FALSE);
|
||||
toggleMyOutfitsPanel(TRUE);
|
||||
toggleMyOutfitsPanel(TRUE, "");
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::showOutfitsInventoryPanel(const std::string &tab_name)
|
||||
{
|
||||
toggleWearableEditPanel(FALSE);
|
||||
toggleOutfitEditPanel(FALSE);
|
||||
toggleMyOutfitsPanel(TRUE, tab_name);
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::showOutfitEditPanel()
|
||||
|
|
@ -312,37 +323,42 @@ void LLSidepanelAppearance::showOutfitEditPanel()
|
|||
return;
|
||||
}
|
||||
|
||||
toggleMyOutfitsPanel(FALSE);
|
||||
toggleMyOutfitsPanel(FALSE, "");
|
||||
toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode
|
||||
toggleOutfitEditPanel(TRUE);
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = NULL*/, BOOL disable_camera_switch)
|
||||
{
|
||||
toggleMyOutfitsPanel(FALSE);
|
||||
toggleMyOutfitsPanel(FALSE, "");
|
||||
toggleOutfitEditPanel(FALSE, TRUE); // don't switch out of edit appearance mode
|
||||
toggleWearableEditPanel(TRUE, wearable, disable_camera_switch);
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible)
|
||||
void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name)
|
||||
{
|
||||
if (!mPanelOutfitsInventory || mPanelOutfitsInventory->getVisible() == visible)
|
||||
{
|
||||
// visibility isn't changing, hence nothing to do
|
||||
return;
|
||||
}
|
||||
if (!mPanelOutfitsInventory
|
||||
|| (mPanelOutfitsInventory->getVisible() == visible && tab_name.empty()))
|
||||
{
|
||||
// visibility isn't changing, hence nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
mPanelOutfitsInventory->setVisible(visible);
|
||||
mPanelOutfitsInventory->setVisible(visible);
|
||||
|
||||
// *TODO: Move these controls to panel_outfits_inventory.xml
|
||||
// so that we don't need to toggle them explicitly.
|
||||
mFilterEditor->setVisible(visible);
|
||||
mCurrOutfitPanel->setVisible(visible);
|
||||
// *TODO: Move these controls to panel_outfits_inventory.xml
|
||||
// so that we don't need to toggle them explicitly.
|
||||
mFilterEditor->setVisible(visible);
|
||||
mCurrOutfitPanel->setVisible(visible);
|
||||
|
||||
if (visible)
|
||||
{
|
||||
mPanelOutfitsInventory->onOpen(LLSD());
|
||||
}
|
||||
if (visible)
|
||||
{
|
||||
mPanelOutfitsInventory->onOpen(LLSD());
|
||||
if (!tab_name.empty())
|
||||
{
|
||||
mPanelOutfitsInventory->openApearanceTab(tab_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ public:
|
|||
void fetchInventory();
|
||||
void inventoryFetched();
|
||||
|
||||
void showOutfitsInventoryPanel();
|
||||
void showOutfitsInventoryPanel(); // last selected
|
||||
void showOutfitsInventoryPanel(const std::string& tab_name);
|
||||
void showOutfitEditPanel();
|
||||
void showWearableEditPanel(LLViewerWearable *wearable = NULL, BOOL disable_camera_switch = FALSE);
|
||||
void setWearablesLoading(bool val);
|
||||
|
|
@ -72,7 +73,7 @@ private:
|
|||
void onOpenOutfitButtonClicked();
|
||||
void onEditAppearanceButtonClicked();
|
||||
|
||||
void toggleMyOutfitsPanel(BOOL visible);
|
||||
void toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name);
|
||||
void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE);
|
||||
void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE);
|
||||
|
||||
|
|
|
|||
|
|
@ -128,10 +128,12 @@
|
|||
#include "llpanelpick.h"
|
||||
#include "llpanelgrouplandmoney.h"
|
||||
#include "llpanelgroupnotices.h"
|
||||
#include "llparcel.h"
|
||||
#include "llpreview.h"
|
||||
#include "llpreviewscript.h"
|
||||
#include "llproxy.h"
|
||||
#include "llproductinforequest.h"
|
||||
#include "llqueryflags.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llsky.h"
|
||||
#include "llstatview.h"
|
||||
|
|
@ -230,7 +232,6 @@ extern S32 gStartImageHeight;
|
|||
static bool gGotUseCircuitCodeAck = false;
|
||||
static std::string sInitialOutfit;
|
||||
static std::string sInitialOutfitGender; // "male" or "female"
|
||||
static boost::signals2::connection sWearablesLoadedCon;
|
||||
|
||||
static bool gUseCircuitCallbackCalled = false;
|
||||
|
||||
|
|
@ -1678,8 +1679,20 @@ bool idle_startup()
|
|||
if (STATE_INVENTORY_SEND == LLStartUp::getStartupState())
|
||||
{
|
||||
display_startup();
|
||||
|
||||
// request mute list
|
||||
LL_INFOS() << "Requesting Mute List" << LL_ENDL;
|
||||
LLMuteList::getInstance()->requestFromServer(gAgent.getID());
|
||||
|
||||
// Get L$ and ownership credit information
|
||||
LL_INFOS() << "Requesting Money Balance" << LL_ENDL;
|
||||
LLStatusBar::sendMoneyBalanceRequest();
|
||||
|
||||
display_startup();
|
||||
|
||||
// Inform simulator of our language preference
|
||||
LLAgentLanguage::update();
|
||||
|
||||
display_startup();
|
||||
// unpack thin inventory
|
||||
LLSD response = LLLoginInstance::getInstance()->getResponse();
|
||||
|
|
@ -1857,14 +1870,6 @@ bool idle_startup()
|
|||
LLLandmark::registerCallbacks(msg);
|
||||
display_startup();
|
||||
|
||||
// request mute list
|
||||
LL_INFOS() << "Requesting Mute List" << LL_ENDL;
|
||||
LLMuteList::getInstance()->requestFromServer(gAgent.getID());
|
||||
display_startup();
|
||||
// Get L$ and ownership credit information
|
||||
LL_INFOS() << "Requesting Money Balance" << LL_ENDL;
|
||||
LLStatusBar::sendMoneyBalanceRequest();
|
||||
display_startup();
|
||||
// request all group information
|
||||
LL_INFOS() << "Requesting Agent Data" << LL_ENDL;
|
||||
gAgent.sendAgentDataUpdateRequest();
|
||||
|
|
@ -1922,10 +1927,6 @@ bool idle_startup()
|
|||
// Set the show start location to true, now that the user has logged
|
||||
// on with this install.
|
||||
gSavedSettings.setBOOL("ShowStartLocation", TRUE);
|
||||
|
||||
// Open Conversation floater on first login.
|
||||
LLFloaterReg::toggleInstanceOrBringToFront("im_container");
|
||||
|
||||
}
|
||||
|
||||
display_startup();
|
||||
|
|
@ -2286,6 +2287,14 @@ bool idle_startup()
|
|||
|
||||
gAgentAvatarp->sendHoverHeight();
|
||||
|
||||
// look for parcels we own
|
||||
send_places_query(LLUUID::null,
|
||||
LLUUID::null,
|
||||
"",
|
||||
DFQ_AGENT_OWNED,
|
||||
LLParcel::C_ANY,
|
||||
"");
|
||||
|
||||
LLUIUsage::instance().clear();
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -2723,11 +2732,6 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
|
|||
}
|
||||
else
|
||||
{
|
||||
// FIXME SH-3860 - this creates a race condition, where COF
|
||||
// changes (base outfit link added) after appearance update
|
||||
// request has been submitted.
|
||||
sWearablesLoadedCon = gAgentWearables.addLoadedCallback(LLStartUp::saveInitialOutfit);
|
||||
|
||||
bool do_copy = true;
|
||||
bool do_append = false;
|
||||
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
|
||||
|
|
@ -2741,23 +2745,6 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
|
|||
gAgentWearables.sendDummyAgentWearablesUpdate();
|
||||
}
|
||||
|
||||
//static
|
||||
void LLStartUp::saveInitialOutfit()
|
||||
{
|
||||
if (sInitialOutfit.empty()) {
|
||||
LL_DEBUGS() << "sInitialOutfit is empty" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sWearablesLoadedCon.connected())
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "sWearablesLoadedCon is connected, disconnecting" << LL_ENDL;
|
||||
sWearablesLoadedCon.disconnect();
|
||||
}
|
||||
LL_DEBUGS("Avatar") << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << LL_ENDL;
|
||||
LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false);
|
||||
}
|
||||
|
||||
std::string& LLStartUp::getInitialOutfitName()
|
||||
{
|
||||
return sInitialOutfit;
|
||||
|
|
|
|||
|
|
@ -110,9 +110,6 @@ public:
|
|||
static void loadInitialOutfit( const std::string& outfit_folder_name,
|
||||
const std::string& gender_name );
|
||||
|
||||
//save loaded initial outfit into My Outfits category
|
||||
static void saveInitialOutfit();
|
||||
|
||||
static std::string& getInitialOutfitName();
|
||||
static std::string getUserId();
|
||||
|
||||
|
|
|
|||
|
|
@ -416,7 +416,20 @@ void LLStatusBar::sendMoneyBalanceRequest()
|
|||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->nextBlockFast(_PREHASH_MoneyData);
|
||||
msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null );
|
||||
gAgent.sendReliableMessage();
|
||||
|
||||
if (gDisconnected)
|
||||
{
|
||||
LL_DEBUGS() << "Trying to send message when disconnected, skipping balance request!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
if (!gAgent.getRegion())
|
||||
{
|
||||
LL_DEBUGS() << "LLAgent::sendReliableMessage No region for agent yet, skipping balance request!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
// Double amount of retries due to this request initially happening during busy stage
|
||||
// Ideally this should be turned into a capability
|
||||
gMessageSystem->sendReliable(gAgent.getRegionHost(), LL_DEFAULT_RELIABLE_RETRIES * 2, TRUE, LL_PING_BASED_TIMEOUT_DUMMY, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
#include "lldir.h"
|
||||
#include "llteleporthistory.h"
|
||||
#include "llagent.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
|
||||
// Max offset for two global positions to consider them as equal
|
||||
const F64 MAX_GLOBAL_POS_OFFSET = 5.0f;
|
||||
|
|
@ -253,3 +255,23 @@ void LLTeleportHistoryStorage::goToItem(S32 idx)
|
|||
gAgent.teleportViaLocation(mItems[idx].mGlobalPos);
|
||||
}
|
||||
|
||||
void LLTeleportHistoryStorage::showItemOnMap(S32 idx)
|
||||
{
|
||||
// Validate specified index.
|
||||
if (idx < 0 || idx >= (S32)mItems.size())
|
||||
{
|
||||
LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL;
|
||||
dump();
|
||||
return;
|
||||
}
|
||||
|
||||
LLVector3d landmark_global_pos = mItems[idx].mGlobalPos;
|
||||
|
||||
LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
|
||||
if (!landmark_global_pos.isExactlyZero() && worldmap_instance)
|
||||
{
|
||||
worldmap_instance->trackLocation(landmark_global_pos);
|
||||
LLFloaterReg::showInstance("world_map", "center");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,13 @@ public:
|
|||
*/
|
||||
void goToItem(S32 idx);
|
||||
|
||||
/**
|
||||
* Show specific item on map.
|
||||
*
|
||||
* The item is specified by its index (starting from 0).
|
||||
*/
|
||||
void showItemOnMap(S32 idx);
|
||||
|
||||
private:
|
||||
|
||||
void load();
|
||||
|
|
|
|||
|
|
@ -121,6 +121,11 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
|
|||
data.mURLExternal = mNotification->getURLOpenExternally();
|
||||
}
|
||||
|
||||
if((*it).has("width"))
|
||||
{
|
||||
data.mWidth = (*it)["width"].asInteger();
|
||||
}
|
||||
|
||||
mButtonData.push_back(data);
|
||||
option_index++;
|
||||
}
|
||||
|
|
@ -159,15 +164,29 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
|
|||
// Calc total width of buttons
|
||||
S32 button_width = 0;
|
||||
S32 sp = font->getWidth(std::string("OO"));
|
||||
S32 btn_total_width = 0;
|
||||
S32 default_size_btns = 0;
|
||||
for( S32 i = 0; i < num_options; i++ )
|
||||
{
|
||||
{
|
||||
S32 w = S32(font->getWidth( options[i].second ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD;
|
||||
button_width = llmax( w, button_width );
|
||||
if (mButtonData[i].mWidth > w)
|
||||
{
|
||||
btn_total_width += mButtonData[i].mWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
button_width = llmax(w, button_width);
|
||||
default_size_btns++;
|
||||
}
|
||||
}
|
||||
S32 btn_total_width = button_width;
|
||||
|
||||
if( num_options > 1 )
|
||||
{
|
||||
btn_total_width = (num_options * button_width) + ((num_options - 1) * BTN_HPAD);
|
||||
btn_total_width = btn_total_width + (button_width * default_size_btns) + ((num_options - 1) * BTN_HPAD);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_total_width = llmax(btn_total_width, button_width);
|
||||
}
|
||||
|
||||
// Message: create text box using raw string, as text has been structure deliberately
|
||||
|
|
@ -272,7 +291,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
|
|||
mLineEditor->setText(edit_text_contents);
|
||||
|
||||
std::string notif_name = mNotification->getName();
|
||||
if (("SaveOutfitAs" == notif_name) || ("SaveSettingAs" == notif_name))
|
||||
if (("SaveOutfitAs" == notif_name) || ("SaveSettingAs" == notif_name) || ("CreateLandmarkFolder" == notif_name))
|
||||
{
|
||||
mLineEditor->setPrevalidate(&LLTextValidate::validateASCII);
|
||||
}
|
||||
|
|
@ -333,7 +352,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
|
|||
if(btn)
|
||||
{
|
||||
btn->setName(options[i].first);
|
||||
btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ));
|
||||
btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, (mButtonData[i].mWidth == 0) ? button_width : mButtonData[i].mWidth, BTN_HEIGHT ));
|
||||
btn->setLabel(options[i].second);
|
||||
btn->setFont(font);
|
||||
|
||||
|
|
@ -348,7 +367,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
|
|||
btn->setFocus(TRUE);
|
||||
}
|
||||
}
|
||||
button_left += button_width + BTN_HPAD;
|
||||
button_left += ((mButtonData[i].mWidth == 0) ? button_width : mButtonData[i].mWidth) + BTN_HPAD;
|
||||
}
|
||||
|
||||
setCheckBoxes(HPAD, VPAD);
|
||||
|
|
|
|||
|
|
@ -82,9 +82,14 @@ private:
|
|||
|
||||
struct ButtonData
|
||||
{
|
||||
ButtonData()
|
||||
: mWidth(0)
|
||||
{}
|
||||
|
||||
LLButton* mButton;
|
||||
std::string mURL;
|
||||
U32 mURLExternal;
|
||||
S32 mWidth;
|
||||
};
|
||||
std::vector<ButtonData> mButtonData;
|
||||
|
||||
|
|
|
|||
|
|
@ -387,9 +387,9 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
|
|||
if (mIsScriptDialog)
|
||||
{
|
||||
// we are using default width for script buttons so we can determinate button_rows
|
||||
//to get a number of rows we divide the required width of the buttons to button_panel_width
|
||||
S32 button_rows = llceil(F32(buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width);
|
||||
//S32 button_rows = (buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width;
|
||||
// to get a number of rows we divide the required width of the buttons to button_panel_width
|
||||
// buttons.size() is reduced by -2 due to presence of ignore button which is calculated independently a bit lower
|
||||
S32 button_rows = llceil(F32(buttons.size() - 2) * (BUTTON_WIDTH + h_pad) / (button_panel_width + h_pad));
|
||||
//reserve one row for the ignore_btn
|
||||
button_rows++;
|
||||
//calculate required panel height for scripdialog notification.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,214 @@
|
|||
/**
|
||||
* @file llurlfloaterdispatchhandler.cpp
|
||||
* @brief Handles URLFloater generic message from server
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llurlfloaterdispatchhandler.h"
|
||||
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterhowto.h"
|
||||
#include "llfloaterwebcontent.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewergenericmessage.h"
|
||||
#include "llweb.h"
|
||||
|
||||
// Example:
|
||||
// llOpenFloater("guidebook", "http://page.com", []);
|
||||
|
||||
// values specified by server side's dispatcher
|
||||
// for llopenfloater
|
||||
const std::string MESSAGE_URL_FLOATER("URLFloater");
|
||||
const std::string KEY_ACTION("action"); // "action" will be the string constant "OpenURL"
|
||||
const std::string VALUE_OPEN_URL("OpenURL");
|
||||
const std::string KEY_DATA("action_data");
|
||||
const std::string KEY_FLOATER("floater_title"); // name of the floater, not title
|
||||
const std::string KEY_URL("floater_url");
|
||||
const std::string KEY_PARAMS("floater_params");
|
||||
|
||||
// Supported floaters
|
||||
const std::string FLOATER_GUIDEBOOK("guidebook");
|
||||
const std::string FLOATER_HOW_TO("how_to"); // alias for guidebook
|
||||
const std::string FLOATER_WEB_CONTENT("web_content");
|
||||
|
||||
// All arguments are palceholders! Server side will need to add validation first.
|
||||
// Web content universal argument
|
||||
const std::string KEY_TRUSTED_CONTENT("trusted_content");
|
||||
|
||||
// Guidebook specific arguments
|
||||
const std::string KEY_WIDTH("width");
|
||||
const std::string KEY_HEGHT("height");
|
||||
const std::string KEY_CAN_CLOSE("can_close");
|
||||
const std::string KEY_TITLE("title");
|
||||
|
||||
// web_content specific arguments
|
||||
const std::string KEY_SHOW_PAGE_TITLE("show_page_title");
|
||||
const std::string KEY_ALLOW_ADRESS_ENTRY("allow_address_entry"); // It is not recomended to set this to true if trusted content is allowed
|
||||
|
||||
|
||||
LLUrlFloaterDispatchHandler LLUrlFloaterDispatchHandler::sUrlDispatchhandler;
|
||||
|
||||
LLUrlFloaterDispatchHandler::LLUrlFloaterDispatchHandler()
|
||||
{
|
||||
}
|
||||
|
||||
LLUrlFloaterDispatchHandler::~LLUrlFloaterDispatchHandler()
|
||||
{
|
||||
}
|
||||
|
||||
void LLUrlFloaterDispatchHandler::registerInDispatcher()
|
||||
{
|
||||
if (!gGenericDispatcher.isHandlerPresent(MESSAGE_URL_FLOATER))
|
||||
{
|
||||
gGenericDispatcher.addHandler(MESSAGE_URL_FLOATER, &sUrlDispatchhandler);
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::string& key, const LLUUID& invoice, const sparam_t& strings)
|
||||
{
|
||||
// invoice - transaction id
|
||||
|
||||
LLSD message;
|
||||
sparam_t::const_iterator it = strings.begin();
|
||||
|
||||
if (it != strings.end())
|
||||
{
|
||||
const std::string& llsdRaw = *it++;
|
||||
std::istringstream llsdData(llsdRaw);
|
||||
if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length()))
|
||||
{
|
||||
LL_WARNS("URLFloater") << "Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// At the moment command_params is a placeholder and code treats it as map
|
||||
// Once server side adds argument validation this will be either a map or an array
|
||||
std::string floater;
|
||||
LLSD command_params;
|
||||
std::string url;
|
||||
|
||||
if (message.has(KEY_ACTION) && message[KEY_ACTION].asString() == VALUE_OPEN_URL)
|
||||
{
|
||||
LLSD &action_data = message[KEY_DATA];
|
||||
if (action_data.isMap())
|
||||
{
|
||||
floater = action_data[KEY_FLOATER].asString();
|
||||
command_params = action_data[KEY_PARAMS];
|
||||
url = action_data[KEY_URL].asString();
|
||||
}
|
||||
}
|
||||
else if (message.has(KEY_FLOATER))
|
||||
{
|
||||
floater = message[KEY_FLOATER].asString();
|
||||
command_params = message[KEY_PARAMS];
|
||||
url = message[KEY_URL].asString();
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("URLFloater") << "Received " << MESSAGE_URL_FLOATER << " with unexpected data format: " << message << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (url.find("://") == std::string::npos)
|
||||
{
|
||||
// try unescaping
|
||||
url = LLURI::unescape(url);
|
||||
}
|
||||
|
||||
LLFloaterWebContent::Params params;
|
||||
params.url = url;
|
||||
|
||||
if (floater == FLOATER_GUIDEBOOK || floater == FLOATER_HOW_TO)
|
||||
{
|
||||
LL_DEBUGS("URLFloater") << "Opening how_to floater with parameters: " << message << LL_ENDL;
|
||||
if (command_params.isMap()) // by default is undefines
|
||||
{
|
||||
params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false;
|
||||
|
||||
// Script's side argument list can't include other lists, neither
|
||||
// there is a LLRect type, so expect just width and height
|
||||
if (command_params.has(KEY_WIDTH) && command_params.has(KEY_HEGHT))
|
||||
{
|
||||
LLRect rect(0, command_params[KEY_HEGHT].asInteger(), command_params[KEY_WIDTH].asInteger(), 0);
|
||||
params.preferred_media_size.setValue(rect);
|
||||
}
|
||||
}
|
||||
|
||||
// Some locations will have customized guidebook, which this function easists for
|
||||
// only one instance of guidebook can exist at a time, so if this command arrives,
|
||||
// we need to close previous guidebook then reopen it.
|
||||
|
||||
LLFloater* instance = LLFloaterReg::findInstance("guidebook");
|
||||
if (instance)
|
||||
{
|
||||
instance->closeHostedFloater();
|
||||
}
|
||||
|
||||
LLFloaterReg::toggleInstanceOrBringToFront("guidebook", params);
|
||||
|
||||
if (command_params.isMap())
|
||||
{
|
||||
LLFloater* instance = LLFloaterReg::findInstance("guidebook");
|
||||
if (command_params.has(KEY_CAN_CLOSE))
|
||||
{
|
||||
instance->setCanClose(command_params[KEY_CAN_CLOSE].asBoolean());
|
||||
}
|
||||
if (command_params.has(KEY_TITLE))
|
||||
{
|
||||
instance->setTitle(command_params[KEY_TITLE].asString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (floater == FLOATER_WEB_CONTENT)
|
||||
{
|
||||
LL_DEBUGS("URLFloater") << "Opening web_content floater with parameters: " << message << LL_ENDL;
|
||||
if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params
|
||||
{
|
||||
params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false;
|
||||
params.show_page_title = command_params.has(KEY_SHOW_PAGE_TITLE) ? command_params[KEY_SHOW_PAGE_TITLE].asBoolean() : true;
|
||||
params.allow_address_entry = command_params.has(KEY_ALLOW_ADRESS_ENTRY) ? command_params[KEY_ALLOW_ADRESS_ENTRY].asBoolean() : true;
|
||||
}
|
||||
LLFloaterReg::showInstance("web_content", params);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("URLFloater") << "Unknow floater with parameters: " << message << LL_ENDL;
|
||||
if (LLFloaterReg::isRegistered(floater))
|
||||
{
|
||||
// A valid floater
|
||||
LL_INFOS("URLFloater") << "Floater " << floater << " is not supported by llopenfloater or URLFloater" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// A valid message, but no such flaoter
|
||||
LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << floater << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* @file llurlfloaterdispatchhandler.h
|
||||
* @brief Handles URLFloater generic message from server
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLURLFLOATERDISPATCHHANDLER_H
|
||||
#define LL_LLURLFLOATERDISPATCHHANDLER_H
|
||||
|
||||
#include "lldispatcher.h"
|
||||
|
||||
class LLUrlFloaterDispatchHandler : public LLDispatchHandler
|
||||
{
|
||||
public:
|
||||
LOG_CLASS(LLUrlFloaterDispatchHandler);
|
||||
|
||||
LLUrlFloaterDispatchHandler();
|
||||
virtual ~LLUrlFloaterDispatchHandler();
|
||||
|
||||
virtual bool operator()(const LLDispatcher *, const std::string& key, const LLUUID& invoice, const sparam_t& strings) override;
|
||||
|
||||
static void registerInDispatcher();
|
||||
|
||||
private:
|
||||
static LLUrlFloaterDispatchHandler sUrlDispatchhandler;
|
||||
};
|
||||
|
||||
#endif // LL_LLURLFLOATERDISPATCHHANDLER_H
|
||||
|
||||
|
|
@ -474,6 +474,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
gAgent.setTeleportState( LLAgent::TELEPORT_ARRIVING );
|
||||
gAgent.setTeleportMessage(
|
||||
LLAgent::sTeleportProgressMessages["arriving"]);
|
||||
gAgent.sheduleTeleportIM();
|
||||
gTextureList.mForceResetTextureStats = TRUE;
|
||||
gAgentCamera.resetView(TRUE, TRUE);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "llcompilequeue.h"
|
||||
#include "llfasttimerview.h"
|
||||
#include "llfloaterabout.h"
|
||||
#include "llfloateraddpaymentmethod.h"
|
||||
#include "llfloaterauction.h"
|
||||
#include "llfloaterautoreplacesettings.h"
|
||||
#include "llfloateravatar.h"
|
||||
|
|
@ -57,6 +58,7 @@
|
|||
#include "llfloaterchatvoicevolume.h"
|
||||
#include "llfloaterconversationlog.h"
|
||||
#include "llfloaterconversationpreview.h"
|
||||
#include "llfloatercreatelandmark.h"
|
||||
#include "llfloaterdeleteprefpreset.h"
|
||||
#include "llfloaterdestinations.h"
|
||||
#include "llfloatereditextdaycycle.h"
|
||||
|
|
@ -74,6 +76,7 @@
|
|||
#include "llfloatergroups.h"
|
||||
#include "llfloaterhelpbrowser.h"
|
||||
#include "llfloaterhoverheight.h"
|
||||
#include "llfloaterhowto.h"
|
||||
#include "llfloaterhud.h"
|
||||
#include "llfloaterimagepreview.h"
|
||||
#include "llfloaterimsession.h"
|
||||
|
|
@ -194,6 +197,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLFloaterAboutUtil::registerFloater();
|
||||
LLFloaterReg::add("block_timers", "floater_fast_timers.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFastTimerView>);
|
||||
LLFloaterReg::add("about_land", "floater_about_land.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLand>);
|
||||
LLFloaterReg::add("add_payment_method", "floater_add_payment_method.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAddPaymentMethod>);
|
||||
LLFloaterReg::add("appearance", "floater_my_appearance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
|
||||
LLFloaterReg::add("associate_listing", "floater_associate_listing.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAssociateListing>);
|
||||
LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAuction>);
|
||||
|
|
@ -220,6 +224,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLFloaterReg::add("nearby_chat", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterIMNearbyChat::buildFloater);
|
||||
LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>);
|
||||
LLFloaterReg::add("conversation", "floater_conversation_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterConversationLog>);
|
||||
LLFloaterReg::add("add_landmark", "floater_create_landmark.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCreateLandmark>);
|
||||
|
||||
LLFloaterReg::add("delete_pref_preset", "floater_delete_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDeletePrefPreset>);
|
||||
LLFloaterReg::add("destinations", "floater_destinations.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDestinations>);
|
||||
|
|
@ -358,7 +363,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>);
|
||||
LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
|
||||
LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
|
||||
LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
|
||||
LLFloaterReg::add("guidebook", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHowTo>);
|
||||
|
||||
LLFloaterReg::add("big_preview", "floater_big_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBigPreview>);
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
#include "llfloaterimcontainer.h"
|
||||
#include "llfloaterland.h"
|
||||
#include "llfloaterimnearbychat.h"
|
||||
#include "llfloaterlandholdings.h"
|
||||
#include "llfloaterpathfindingcharacters.h"
|
||||
#include "llfloaterpathfindinglinksets.h"
|
||||
#include "llfloaterpay.h"
|
||||
|
|
@ -185,11 +186,15 @@ const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"
|
|||
LLMenuGL* gAttachSubMenu = NULL;
|
||||
LLMenuGL* gDetachSubMenu = NULL;
|
||||
LLMenuGL* gTakeOffClothes = NULL;
|
||||
LLMenuGL* gDetachAvatarMenu = NULL;
|
||||
LLMenuGL* gDetachHUDAvatarMenu = NULL;
|
||||
LLContextMenu* gAttachScreenPieMenu = NULL;
|
||||
LLContextMenu* gAttachPieMenu = NULL;
|
||||
LLContextMenu* gAttachBodyPartPieMenus[9];
|
||||
LLContextMenu* gDetachPieMenu = NULL;
|
||||
LLContextMenu* gDetachScreenPieMenu = NULL;
|
||||
LLContextMenu* gDetachAttSelfMenu = NULL;
|
||||
LLContextMenu* gDetachHUDAttSelfMenu = NULL;
|
||||
LLContextMenu* gDetachBodyPartPieMenus[9];
|
||||
|
||||
//
|
||||
|
|
@ -444,6 +449,9 @@ void init_menus()
|
|||
gMenuAttachmentOther = LLUICtrlFactory::createFromFile<LLContextMenu>(
|
||||
"menu_attachment_other.xml", gMenuHolder, registry);
|
||||
|
||||
gDetachHUDAttSelfMenu = gMenuHolder->getChild<LLContextMenu>("Detach Self HUD", true);
|
||||
gDetachAttSelfMenu = gMenuHolder->getChild<LLContextMenu>("Detach Self", true);
|
||||
|
||||
gMenuLand = LLUICtrlFactory::createFromFile<LLContextMenu>(
|
||||
"menu_land.xml", gMenuHolder, registry);
|
||||
|
||||
|
|
@ -500,6 +508,9 @@ void init_menus()
|
|||
gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE);
|
||||
gDetachSubMenu = gMenuBarView->findChildMenuByName("Detach Object", TRUE);
|
||||
|
||||
gDetachAvatarMenu = gMenuHolder->getChild<LLMenuGL>("Avatar Detach", true);
|
||||
gDetachHUDAvatarMenu = gMenuHolder->getChild<LLMenuGL>("Avatar Detach HUD", true);
|
||||
|
||||
// Don't display the Memory console menu if the feature is turned off
|
||||
LLMenuItemCheckGL *memoryMenu = gMenuBarView->getChild<LLMenuItemCheckGL>("Memory", TRUE);
|
||||
if (memoryMenu)
|
||||
|
|
@ -676,19 +687,6 @@ class LLAdvancedCheckHUDInfo : public view_listener_t
|
|||
};
|
||||
|
||||
|
||||
//////////////
|
||||
// FLYING //
|
||||
//////////////
|
||||
|
||||
class LLAdvancedAgentFlyingInfo : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD&)
|
||||
{
|
||||
return gAgent.getFlying();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
///////////////////////
|
||||
// CLEAR GROUP CACHE //
|
||||
///////////////////////
|
||||
|
|
@ -3743,6 +3741,35 @@ bool enable_sitdown_self()
|
|||
return show_sitdown_self() && !gAgentAvatarp->isEditingAppearance() && !gAgent.getFlying();
|
||||
}
|
||||
|
||||
class LLSelfToggleSitStand : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
if (gAgentAvatarp->isSitting())
|
||||
{
|
||||
gAgent.standUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
gAgent.sitDown();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool enable_sit_stand()
|
||||
{
|
||||
return enable_sitdown_self() || enable_standup_self();
|
||||
}
|
||||
|
||||
bool enable_fly_land()
|
||||
{
|
||||
return gAgent.getFlying() || LLAgent::enableFlying();
|
||||
}
|
||||
|
||||
class LLCheckPanelPeopleTab : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
|
|
@ -4944,7 +4971,7 @@ void handle_buy_or_take()
|
|||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["AMOUNT"] = llformat("%d", total_price);
|
||||
LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString( "BuyingCosts", args ), total_price );
|
||||
LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString( "this_object_costs", args ), total_price );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -4973,13 +5000,6 @@ bool tools_visible_take_object()
|
|||
return !is_selection_buy_not_take();
|
||||
}
|
||||
|
||||
bool enable_how_to_visible(const LLSD& param)
|
||||
{
|
||||
LLFloaterWebContent::Params p;
|
||||
p.target = "__help_how_to";
|
||||
return LLFloaterReg::instanceVisible("how_to", p);
|
||||
}
|
||||
|
||||
class LLToolsEnableBuyOrTake : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
|
|
@ -5935,6 +5955,16 @@ class LLWorldSetHomeLocation : public view_listener_t
|
|||
}
|
||||
};
|
||||
|
||||
class LLWorldLindenHome : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
std::string url = LLFloaterLandHoldings::sHasLindenHome ? LLTrans::getString("lindenhomes_my_home_url") : LLTrans::getString("lindenhomes_get_home_url");
|
||||
LLWeb::loadURL(url);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class LLWorldTeleportHome : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
|
|
@ -6017,7 +6047,7 @@ class LLWorldCreateLandmark : public view_listener_t
|
|||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark"));
|
||||
LLFloaterReg::showInstance("add_landmark");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -6348,6 +6378,11 @@ void handle_edit_outfit()
|
|||
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_outfit"));
|
||||
}
|
||||
|
||||
void handle_now_wearing()
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing"));
|
||||
}
|
||||
|
||||
void handle_edit_shape()
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_shape"));
|
||||
|
|
@ -7704,15 +7739,7 @@ class LLToggleHowTo : public view_listener_t
|
|||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
LLFloaterWebContent::Params p;
|
||||
std::string url = gSavedSettings.getString("HowToHelpURL");
|
||||
p.url = LLWeb::expandURLSubstitutions(url, LLSD());
|
||||
p.show_chrome = false;
|
||||
p.target = "__help_how_to";
|
||||
p.show_page_title = false;
|
||||
p.preferred_media_size = LLRect(0, 460, 335, 0);
|
||||
|
||||
LLFloaterReg::toggleInstanceOrBringToFront("how_to", p);
|
||||
LLFloaterReg::toggleInstanceOrBringToFront("guidebook");
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
@ -8582,37 +8609,32 @@ class LLWorldEnvSettings : public view_listener_t
|
|||
|
||||
if (event_name == "sunrise")
|
||||
{
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().updateEnvironment();
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_INSTANT);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
|
||||
defocusEnvFloaters();
|
||||
}
|
||||
else if (event_name == "noon")
|
||||
{
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().updateEnvironment();
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_INSTANT);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
|
||||
defocusEnvFloaters();
|
||||
}
|
||||
else if (event_name == "sunset")
|
||||
{
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().updateEnvironment();
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_INSTANT);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
|
||||
defocusEnvFloaters();
|
||||
}
|
||||
else if (event_name == "midnight")
|
||||
{
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().updateEnvironment();
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_INSTANT);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
|
||||
defocusEnvFloaters();
|
||||
}
|
||||
else if (event_name == "region")
|
||||
{
|
||||
LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().updateEnvironment();
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
|
||||
defocusEnvFloaters();
|
||||
}
|
||||
else if (event_name == "pause_clouds")
|
||||
|
|
@ -8783,6 +8805,17 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class LLUpdateMembershipLabel : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
const std::string label_str = LLAgentBenefitsMgr::isCurrent("Base") ? LLTrans::getString("MembershipUpgradeText") : LLTrans::getString("MembershipPremiumText");
|
||||
gMenuHolder->childSetLabelArg("Membership", "[Membership]", label_str);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void handle_voice_morphing_subscribe()
|
||||
{
|
||||
LLWeb::loadURL(LLTrans::getString("voice_morphing_url"));
|
||||
|
|
@ -8932,11 +8965,13 @@ void initialize_menus()
|
|||
|
||||
view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts");
|
||||
|
||||
view_listener_t::addEnable(new LLUpdateMembershipLabel(), "Membership.UpdateLabel");
|
||||
|
||||
enable.add("Conversation.IsConversationLoggingAllowed", boost::bind(&LLFloaterIMContainer::isConversationLoggingAllowed));
|
||||
|
||||
// Agent
|
||||
commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying));
|
||||
enable.add("Agent.enableFlying", boost::bind(&LLAgent::enableFlying));
|
||||
enable.add("Agent.enableFlyLand", boost::bind(&enable_fly_land));
|
||||
commit.add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
|
||||
commit.add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
|
||||
commit.add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2));
|
||||
|
|
@ -8952,6 +8987,7 @@ void initialize_menus()
|
|||
view_listener_t::addMenu(new LLEnableHoverHeight(), "Edit.EnableHoverHeight");
|
||||
view_listener_t::addMenu(new LLEnableEditPhysics(), "Edit.EnableEditPhysics");
|
||||
commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar));
|
||||
commit.add("NowWearing", boost::bind(&handle_now_wearing));
|
||||
commit.add("EditOutfit", boost::bind(&handle_edit_outfit));
|
||||
commit.add("EditShape", boost::bind(&handle_edit_shape));
|
||||
commit.add("HoverHeight", boost::bind(&handle_hover_height));
|
||||
|
|
@ -8984,9 +9020,6 @@ void initialize_menus()
|
|||
view_listener_t::addMenu(new LLViewStatusDoNotDisturb(), "View.Status.CheckDoNotDisturb");
|
||||
view_listener_t::addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments");
|
||||
|
||||
// Me > Movement
|
||||
view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
|
||||
|
||||
//Communicate Nearby chat
|
||||
view_listener_t::addMenu(new LLCommunicateNearbyChat(), "Communicate.NearbyChat");
|
||||
|
||||
|
|
@ -9008,6 +9041,7 @@ void initialize_menus()
|
|||
view_listener_t::addMenu(new LLWorldTeleportHome(), "World.TeleportHome");
|
||||
view_listener_t::addMenu(new LLWorldSetAway(), "World.SetAway");
|
||||
view_listener_t::addMenu(new LLWorldSetDoNotDisturb(), "World.SetDoNotDisturb");
|
||||
view_listener_t::addMenu(new LLWorldLindenHome(), "World.LindenHome");
|
||||
|
||||
view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark");
|
||||
view_listener_t::addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation");
|
||||
|
|
@ -9062,7 +9096,6 @@ void initialize_menus()
|
|||
// Help menu
|
||||
// most items use the ShowFloater method
|
||||
view_listener_t::addMenu(new LLToggleHowTo(), "Help.ToggleHowTo");
|
||||
enable.add("Help.HowToVisible", boost::bind(&enable_how_to_visible, _2));
|
||||
|
||||
// Advanced menu
|
||||
view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole");
|
||||
|
|
@ -9250,11 +9283,8 @@ void initialize_menus()
|
|||
view_listener_t::addMenu(new LLAdminOnSaveState(), "Admin.OnSaveState");
|
||||
|
||||
// Self context menu
|
||||
view_listener_t::addMenu(new LLSelfStandUp(), "Self.StandUp");
|
||||
enable.add("Self.EnableStandUp", boost::bind(&enable_standup_self));
|
||||
view_listener_t::addMenu(new LLSelfSitDown(), "Self.SitDown");
|
||||
enable.add("Self.EnableSitDown", boost::bind(&enable_sitdown_self));
|
||||
enable.add("Self.ShowSitDown", boost::bind(&show_sitdown_self));
|
||||
view_listener_t::addMenu(new LLSelfToggleSitStand(), "Self.ToggleSitStand");
|
||||
enable.add("Self.EnableSitStand", boost::bind(&enable_sit_stand));
|
||||
view_listener_t::addMenu(new LLSelfRemoveAllAttachments(), "Self.RemoveAllAttachments");
|
||||
|
||||
view_listener_t::addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments");
|
||||
|
|
|
|||
|
|
@ -188,10 +188,14 @@ extern LLContextMenu *gMenuMuteParticle;
|
|||
extern LLMenuGL* gAttachSubMenu;
|
||||
extern LLMenuGL* gDetachSubMenu;
|
||||
extern LLMenuGL* gTakeOffClothes;
|
||||
extern LLMenuGL* gDetachAvatarMenu;
|
||||
extern LLMenuGL* gDetachHUDAvatarMenu;
|
||||
extern LLContextMenu* gAttachScreenPieMenu;
|
||||
extern LLContextMenu* gDetachScreenPieMenu;
|
||||
extern LLContextMenu* gDetachHUDAttSelfMenu;
|
||||
extern LLContextMenu* gAttachPieMenu;
|
||||
extern LLContextMenu* gDetachPieMenu;
|
||||
extern LLContextMenu* gDetachAttSelfMenu;
|
||||
extern LLContextMenu* gAttachBodyPartPieMenus[9];
|
||||
extern LLContextMenu* gDetachBodyPartPieMenus[9];
|
||||
|
||||
|
|
|
|||
|
|
@ -830,10 +830,7 @@ void upload_done_callback(
|
|||
|
||||
if(!(can_afford_transaction(expected_upload_cost)))
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["NAME"] = data->mAssetInfo.getName();
|
||||
args["AMOUNT"] = llformat("%d", expected_upload_cost);
|
||||
LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("UploadingCosts", args), expected_upload_cost );
|
||||
LLBuyCurrencyHTML::openCurrencyFloater( "", expected_upload_cost );
|
||||
is_balance_sufficient = FALSE;
|
||||
}
|
||||
else if(region)
|
||||
|
|
@ -967,10 +964,7 @@ void upload_new_resource(
|
|||
if (balance < uploadInfo->getExpectedUploadCost())
|
||||
{
|
||||
// insufficient funds, bail on this upload
|
||||
LLStringUtil::format_map_t args;
|
||||
args["NAME"] = uploadInfo->getName();
|
||||
args["AMOUNT"] = llformat("%d", uploadInfo->getExpectedUploadCost());
|
||||
LLBuyCurrencyHTML::openCurrencyFloater(LLTrans::getString("UploadingCosts", args), uploadInfo->getExpectedUploadCost());
|
||||
LLBuyCurrencyHTML::openCurrencyFloater("", uploadInfo->getExpectedUploadCost());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -777,7 +777,6 @@ void response_group_invitation_coro(std::string url, LLUUID group_id, bool notif
|
|||
LL_DEBUGS("GroupInvite") << "Successfully sent response to group " << group_id << " invitation" << LL_ENDL;
|
||||
if (notify_and_update)
|
||||
{
|
||||
LLNotificationsUtil::add("JoinGroupSuccess");
|
||||
gAgent.sendAgentDataUpdateRequest();
|
||||
|
||||
LLGroupMgr::getInstance()->clearGroupData(group_id);
|
||||
|
|
@ -5062,6 +5061,15 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
|
|||
// notification was specified using the new mechanism, so we can just handle it here
|
||||
std::string notificationID;
|
||||
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID);
|
||||
|
||||
//SL-13824 skip notification when both joining a group and leaving a group
|
||||
//remove this after server stops sending these messages
|
||||
if (notificationID == "JoinGroupSuccess" ||
|
||||
notificationID == "GroupDepart")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!LLNotifications::getInstance()->templateExists(notificationID))
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1715,9 +1715,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
|||
// Let interesting parties know about agent parcel change.
|
||||
LLViewerParcelMgr* instance = LLViewerParcelMgr::getInstance();
|
||||
|
||||
// Notify anything that wants to know when the agent changes parcels
|
||||
gAgent.changeParcels();
|
||||
|
||||
if (instance->mTeleportInProgress)
|
||||
{
|
||||
instance->mTeleportInProgress = FALSE;
|
||||
|
|
@ -1733,6 +1730,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
|||
}
|
||||
parcel->setParcelEnvironmentVersion(parcel_environment_version);
|
||||
LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL;
|
||||
|
||||
// Notify anything that wants to know when the agent changes parcels
|
||||
gAgent.changeParcels();
|
||||
instance->mTeleportInProgress = FALSE;
|
||||
|
|
|
|||
|
|
@ -465,6 +465,8 @@ BOOL LLVOAvatarSelf::buildMenus()
|
|||
if (gDetachBodyPartPieMenus[i])
|
||||
{
|
||||
gDetachPieMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] );
|
||||
gDetachAttSelfMenu->appendContextSubMenu(gDetachBodyPartPieMenus[i]);
|
||||
gDetachAvatarMenu->appendContextSubMenu(gDetachBodyPartPieMenus[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -493,12 +495,14 @@ BOOL LLVOAvatarSelf::buildMenus()
|
|||
LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params);
|
||||
|
||||
gDetachPieMenu->addChild(item);
|
||||
|
||||
gDetachAttSelfMenu->addChild(LLUICtrlFactory::create<LLMenuItemCallGL>(item_params));
|
||||
gDetachAvatarMenu->addChild(LLUICtrlFactory::create<LLMenuItemCallGL>(item_params));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add screen attachments
|
||||
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
||||
|
|
@ -532,6 +536,8 @@ BOOL LLVOAvatarSelf::buildMenus()
|
|||
item_params.on_enable.parameter = iter->first;
|
||||
item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params);
|
||||
gDetachScreenPieMenu->addChild(item);
|
||||
gDetachHUDAttSelfMenu->addChild(LLUICtrlFactory::create<LLMenuItemCallGL>(item_params));
|
||||
gDetachHUDAvatarMenu->addChild(LLUICtrlFactory::create<LLMenuItemCallGL>(item_params));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -684,6 +684,21 @@ void LLVivoxVoiceClient::voiceControlCoro()
|
|||
bool success = startAndConnectSession();
|
||||
if (success)
|
||||
{
|
||||
// enable/disable the automatic VAD and explicitly set the initial values of
|
||||
// the VAD variables ourselves when it is off - see SL-15072 for more details
|
||||
// note: we set the other parameters too even if the auto VAD is on which is ok
|
||||
unsigned int vad_auto = gSavedSettings.getU32("VivoxVadAuto");
|
||||
unsigned int vad_hangover = gSavedSettings.getU32("VivoxVadHangover");
|
||||
unsigned int vad_noise_floor = gSavedSettings.getU32("VivoxVadNoiseFloor");
|
||||
unsigned int vad_sensitivity = gSavedSettings.getU32("VivoxVadSensitivity");
|
||||
setupVADParams(vad_auto, vad_hangover, vad_noise_floor, vad_sensitivity);
|
||||
|
||||
// watch for changes to the VAD settings via Debug Settings UI and act on them accordingly
|
||||
gSavedSettings.getControl("VivoxVadAuto")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this));
|
||||
gSavedSettings.getControl("VivoxVadHangover")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this));
|
||||
gSavedSettings.getControl("VivoxVadNoiseFloor")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this));
|
||||
gSavedSettings.getControl("VivoxVadSensitivity")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this));
|
||||
|
||||
if (mTuningMode)
|
||||
{
|
||||
performMicTuning();
|
||||
|
|
@ -3230,6 +3245,73 @@ void LLVivoxVoiceClient::sendLocalAudioUpdates()
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Because of the recurring voice cutout issues (SL-15072) we are going to try
|
||||
* to disable the automatic VAD (Voice Activity Detection) and set the associated
|
||||
* parameters directly. We will expose them via Debug Settings and that should
|
||||
* let us iterate on a collection of values that work for us. Hopefully!
|
||||
*
|
||||
* From the VIVOX Docs:
|
||||
*
|
||||
* VadAuto: A flag indicating if the automatic VAD is enabled (1) or disabled (0)
|
||||
*
|
||||
* VadHangover: The time (in milliseconds) that it takes
|
||||
* for the VAD to switch back to silence from speech mode after the last speech
|
||||
* frame has been detected.
|
||||
*
|
||||
* VadNoiseFloor: A dimensionless value between 0 and
|
||||
* 20000 (default 576) that controls the maximum level at which the noise floor
|
||||
* may be set at by the VAD's noise tracking. Too low of a value will make noise
|
||||
* tracking ineffective (A value of 0 disables noise tracking and the VAD then
|
||||
* relies purely on the sensitivity property). Too high of a value will make
|
||||
* long speech classifiable as noise.
|
||||
*
|
||||
* VadSensitivity: A dimensionless value between 0 and
|
||||
* 100, indicating the 'sensitivity of the VAD'. Increasing this value corresponds
|
||||
* to decreasing the sensitivity of the VAD (i.e. '0' is most sensitive,
|
||||
* while 100 is 'least sensitive')
|
||||
*/
|
||||
void LLVivoxVoiceClient::setupVADParams(unsigned int vad_auto,
|
||||
unsigned int vad_hangover,
|
||||
unsigned int vad_noise_floor,
|
||||
unsigned int vad_sensitivity)
|
||||
{
|
||||
std::ostringstream stream;
|
||||
|
||||
LL_INFOS("Voice") << "Setting the automatic VAD to "
|
||||
<< (vad_auto ? "True" : "False")
|
||||
<< " and discrete values to"
|
||||
<< " VadHangover = " << vad_hangover
|
||||
<< ", VadSensitivity = " << vad_sensitivity
|
||||
<< ", VadNoiseFloor = " << vad_noise_floor
|
||||
<< LL_ENDL;
|
||||
|
||||
// Create a request to set the VAD parameters:
|
||||
stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.SetVadProperties.1\">"
|
||||
<< "<VadAuto>" << vad_auto << "</VadAuto>"
|
||||
<< "<VadHangover>" << vad_hangover << "</VadHangover>"
|
||||
<< "<VadSensitivity>" << vad_sensitivity << "</VadSensitivity>"
|
||||
<< "<VadNoiseFloor>" << vad_noise_floor << "</VadNoiseFloor>"
|
||||
<< "</Request>\n\n\n";
|
||||
|
||||
if (!stream.str().empty())
|
||||
{
|
||||
writeString(stream.str());
|
||||
}
|
||||
}
|
||||
|
||||
void LLVivoxVoiceClient::onVADSettingsChange()
|
||||
{
|
||||
// pick up the VAD variables (one of which was changed)
|
||||
unsigned int vad_auto = gSavedSettings.getU32("VivoxVadAuto");
|
||||
unsigned int vad_hangover = gSavedSettings.getU32("VivoxVadHangover");
|
||||
unsigned int vad_noise_floor = gSavedSettings.getU32("VivoxVadNoiseFloor");
|
||||
unsigned int vad_sensitivity = gSavedSettings.getU32("VivoxVadSensitivity");
|
||||
|
||||
// build a VAD params change request and send it to SLVoice
|
||||
setupVADParams(vad_auto, vad_hangover, vad_noise_floor, vad_sensitivity);
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
// Response/Event handlers
|
||||
|
||||
|
|
@ -7582,6 +7664,18 @@ void LLVivoxProtocolParser::processResponse(std::string tag)
|
|||
{
|
||||
LLVivoxVoiceClient::getInstance()->accountGetTemplateFontsResponse(statusCode, statusString);
|
||||
}
|
||||
else if (!stricmp(actionCstr, "Aux.SetVadProperties.1"))
|
||||
{
|
||||
// both values of statusCode (old and more recent) indicate valid requests
|
||||
if (statusCode != 0 && statusCode != 200)
|
||||
{
|
||||
LL_WARNS("Voice") << "Aux.SetVadProperties.1 request failed: "
|
||||
<< "statusCode: " << statusCode
|
||||
<< " and "
|
||||
<< "statusString: " << statusString
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
/*
|
||||
else if (!stricmp(actionCstr, "Account.ChannelGetList.1"))
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue