Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate

Conflicts:
	indra/newview/llfloateractivespeakers.h - llparticipantlist.h got changed from a panel to a layoutpanel
	indra/newview/lloverlaybar.cpp - Silly conflict, I change one line, Shyotl changes the next two.

Compile fixies:
	indra/newview/llavataractions.cpp needed to include llnotifications.h
	indra/newview/llvoicechannel.cpp needed to include llnotifications.h
This commit is contained in:
Lirusaito
2013-06-23 22:36:04 -04:00
parent 498b63be99
commit 3739639295
177 changed files with 9426 additions and 1650 deletions

View File

@@ -544,7 +544,7 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
// virtual
void LLButton::draw()
{
F32 alpha = mAlpha;
F32 alpha = mAlpha * getDrawContext().mAlpha;
bool flash = FALSE;
if( mFlashing )
{

View File

@@ -307,9 +307,6 @@ LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const
// static
LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("checkbox");
node->getAttributeString("name", name);
std::string label("");
node->getAttributeString("label", label);
@@ -326,7 +323,7 @@ LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
LLRect rect;
createRect(node, rect, parent, LLRect());
LLCheckBoxCtrl* checkbox = new LLCheckboxCtrl(name,
LLCheckBoxCtrl* checkbox = new LLCheckboxCtrl("checkbox",
rect,
label,
font,

View File

@@ -149,9 +149,6 @@ LLXMLNodePtr LLComboBox::getXML(bool save_children) const
// static
LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("combo_box");
node->getAttributeString("name", name);
std::string label("");
node->getAttributeString("label", label);
@@ -164,7 +161,7 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *
S32 max_chars = 20;
node->getAttributeS32("max_chars", max_chars);
LLComboBox* combo_box = new LLComboBox(name,
LLComboBox* combo_box = new LLComboBox("combo_box",
rect,
label);
combo_box->setAllowTextEntry(allow_text_entry, max_chars);
@@ -1245,16 +1242,13 @@ LLXMLNodePtr LLFlyoutButton::getXML(bool save_children) const
//static
LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name = "flyout_button";
node->getAttributeString("name", name);
std::string label("");
node->getAttributeString("label", label);
LLRect rect;
createRect(node, rect, parent, LLRect());
LLFlyoutButton* flyout_button = new LLFlyoutButton(name,
LLFlyoutButton* flyout_button = new LLFlyoutButton("flyout_button",
rect,
label);

View File

@@ -52,9 +52,6 @@ void LLFilterEditor::handleKeystroke()
// static
LLView* LLFilterEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("filter_editor");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -63,7 +60,7 @@ LLView* LLFilterEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
std::string text = node->getValue().substr(0, max_text_length - 1);
LLFilterEditor* search_editor = new LLFilterEditor(name,
LLFilterEditor* search_editor = new LLFilterEditor("filter_editor",
rect,
max_text_length);

View File

@@ -58,6 +58,7 @@
#include "v2math.h"
#include "llfasttimer.h"
#include "airecursive.h"
#include "llnotifications.h"
const S32 MINIMIZED_WIDTH = 160;
const S32 CLOSE_BOX_FROM_TOP = 1;
@@ -1411,6 +1412,10 @@ void LLFloater::closeFocusedFloater()
}
}
LLNotificationPtr LLFloater::addContextualNotification(const std::string& name, const LLSD& substitutions)
{
return LLNotifications::instance().add(LLNotification::Params(name).context(mNotificationContext).substitutions(substitutions));
}
void LLFloater::onClickClose()
{

View File

@@ -40,7 +40,8 @@
#include "llpanel.h"
#include "lluuid.h"
#include "lltabcontainer.h"
#include "llnotifications.h"
#include "llnotificationcontext.h"
#include "llnotificationptr.h"
#include <set>
class LLDragHandle;
@@ -232,10 +233,7 @@ public:
// handle refocusing.
static void closeFocusedFloater();
LLNotification::Params contextualNotification(const std::string& name)
{
return LLNotification::Params(name).context(mNotificationContext);
}
LLNotificationPtr addContextualNotification(const std::string& name, const LLSD& substitutions = LLSD());
void onClickClose();
void onClickMinimize();

View File

@@ -106,7 +106,8 @@ void LLIconCtrl::draw()
{
if( mImagep.notNull() )
{
mImagep->draw(getLocalRect(), mColor );
const F32 alpha = getDrawContext().mAlpha;
mImagep->draw(getLocalRect(), mColor % alpha );
}
LLUICtrl::draw();
@@ -157,9 +158,6 @@ LLXMLNodePtr LLIconCtrl::getXML(bool save_children) const
LLView* LLIconCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("icon");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -172,7 +170,7 @@ LLView* LLIconCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *
LLColor4 color(LLColor4::white);
LLUICtrlFactory::getAttributeColor(node,"color", color);
LLIconCtrl* icon = new LLIconCtrl(name, rect, image_name);
LLIconCtrl* icon = new LLIconCtrl("icon", rect, image_name);
icon->setColor(color);

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,7 @@
#define LL_LLLAYOUTSTACK_H
#include "llpanel.h"
#include "llresizebar.h"
class LLLayoutPanel;
@@ -41,73 +42,138 @@ public:
{
HORIZONTAL,
VERTICAL
} eLayoutOrientation;
} ELayoutOrientation;
LLLayoutStack(eLayoutOrientation orientation);
LLLayoutStack(ELayoutOrientation orientation, S32 border_size, bool animate, bool clip, F32 open_time_constant, F32 close_time_constant, F32 resize_bar_overlap);
virtual ~LLLayoutStack();
/*virtual*/ void draw();
/*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
/*virtual*/ void removeChild(LLView* ctrl);
/*virtual*/ void removeChild(LLView*);
/*virtual*/ BOOL postBuild();
/*virtual*/ bool addChild(LLView* child, S32 tab_groupdatefractuiona = 0);
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
S32 getMinWidth() const { return mMinWidth; }
S32 getMinHeight() const { return mMinHeight; }
typedef enum e_animate
{
NO_ANIMATE,
ANIMATE
} EAnimate;
void addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, EAnimate animate = NO_ANIMATE, S32 index = S32_MAX);
void removePanel(LLPanel* panel);
void addPanel(LLLayoutPanel* panel, EAnimate animate = NO_ANIMATE);
void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE);
S32 getNumPanels() { return mPanels.size(); }
void updateLayout(BOOL force_resize = FALSE);
void updateLayout();
S32 getPanelSpacing() const { return mPanelSpacing; }
private:
void calcMinExtents();
S32 getDefaultHeight(S32 cur_height);
S32 getDefaultWidth(S32 cur_width);
static void updateClass();
const eLayoutOrientation mOrientation;
protected:
LLLayoutStack(const Params&);
friend class LLUICtrlFactory;
friend class LLLayoutPanel;
private:
void updateResizeBarLimits();
bool animatePanels();
void createResizeBar(LLLayoutPanel* panel);
const ELayoutOrientation mOrientation;
typedef std::vector<LLLayoutPanel*> e_panel_list_t;
e_panel_list_t mPanels;
LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
S32 mMinWidth;
S32 mMinHeight;
LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
void updateFractionalSizes();
void normalizeFractionalSizes();
void updatePanelRect( LLLayoutPanel* param1, const LLRect& new_rect );
S32 mPanelSpacing;
// true if we already applied animation this frame
bool mAnimatedThisFrame;
bool mAnimate;
bool mClip;
F32 mOpenTimeConstant;
F32 mCloseTimeConstant;
bool mNeedsLayout;
S32 mResizeBarOverlap;
}; // end class LLLayoutStack
class LLLayoutPanel
{
friend class LLLayoutStack;
friend class LLUICtrlFactory;
friend struct DeletePointer;
LLLayoutPanel(LLPanel* panelp, LLLayoutStack::eLayoutOrientation orientation, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize);
class LLLayoutPanel : public LLPanel
{
friend class LLLayoutStack;
friend class LLUICtrlFactory;
public:
~LLLayoutPanel();
F32 getCollapseFactor();
LLPanel* mPanel;
S32 mMinWidth;
S32 mMinHeight;
bool mAutoResize;
bool mUserResize;
bool mCollapsed;
void initFromParams(const Params& p);
static LLView* fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *factory);
void handleReshape(const LLRect& new_rect, bool by_user);
F32 mVisibleAmt;
F32 mCollapseAmt;
LLLayoutStack::eLayoutOrientation mOrientation;
void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
void setVisible(BOOL visible);
S32 getLayoutDim() const;
S32 getTargetDim() const;
void setTargetDim(S32 value);
S32 getMinDim() const { return llmax(0, mMinDim); }
void setMinDim(S32 value) { mMinDim = value; }
S32 getExpandedMinDim() const { return mExpandedMinDim >= 0 ? mExpandedMinDim : getMinDim(); }
void setExpandedMinDim(S32 value) { mExpandedMinDim = value; }
S32 getRelevantMinDim() const
{
S32 min_dim = mMinDim;
if (!mCollapsed)
{
min_dim = getExpandedMinDim();
}
return min_dim;
}
F32 getAutoResizeFactor() const;
F32 getVisibleAmount() const;
S32 getVisibleDim() const;
LLResizeBar* getResizeBar() { return mResizeBar; }
bool isCollapsed() const { return mCollapsed;}
void setOrientation(LLLayoutStack::ELayoutOrientation orientation);
void storeOriginalDim();
void setIgnoreReshape(bool ignore) { mIgnoreReshape = ignore; }
protected:
LLLayoutPanel(S32 min_dim=-1, BOOL auto_resize=TRUE, BOOL user_resize=TRUE, LLRect rect = LLRect());
/*virtual*/ BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
bool mAutoResize;
bool mUserResize;
S32 mExpandedMinDim;
S32 mMinDim;
bool mCollapsed;
F32 mVisibleAmt;
F32 mCollapseAmt;
F32 mFractionalSize;
S32 mTargetDim;
bool mIgnoreReshape;
LLLayoutStack::ELayoutOrientation mOrientation;
class LLResizeBar* mResizeBar;
};
#endif //LL_LLLAYOUTSTACK_H
#endif

View File

@@ -1702,6 +1702,7 @@ void LLLineEditor::drawMisspelled(LLRect background)
if (glggHunSpell->getSpellCheckHighlight())
{
F32 alpha = getDrawContext().mAlpha;
for (int i =0; i<(int)misspellLocations.size(); i++)
{
S32 wstart =findPixelNearestPos( misspellLocations[i]-getCursor());
@@ -1716,7 +1717,7 @@ void LLLineEditor::drawMisspelled(LLRect background)
{
wstart = maxw;
}
gGL.color4ub(255,0,0,200);
gGL.color4ub(255,0,0,200*alpha);
//3 line zig zags..
while (wstart < wend)
{
@@ -1733,6 +1734,7 @@ void LLLineEditor::drawMisspelled(LLRect background)
void LLLineEditor::draw()
{
F32 alpha = getDrawContext().mAlpha;
S32 text_len = mText.length();
std::string saved_text;
@@ -1776,7 +1778,7 @@ void LLLineEditor::draw()
bg_color = mWriteableBgColor;
}
}
gl_rect_2d(background, bg_color);
gl_rect_2d(background, bg_color % alpha);
}
#endif
@@ -1801,7 +1803,9 @@ void LLLineEditor::draw()
{
text_color = mReadOnlyFgColor;
}
LLColor4 label_color = mTentativeFgColor;
text_color %= alpha;
LLColor4 label_color = mTentativeFgColor % alpha;
if (hasPreeditString())
{
@@ -1824,7 +1828,7 @@ void LLLineEditor::draw()
background.mBottom + PREEDIT_STANDOUT_POSITION,
preedit_pixels_right - PREEDIT_STANDOUT_GAP - 1,
background.mBottom + PREEDIT_STANDOUT_POSITION - PREEDIT_STANDOUT_THICKNESS,
(text_color * PREEDIT_STANDOUT_BRIGHTNESS + bg_color * (1 - PREEDIT_STANDOUT_BRIGHTNESS)).setAlpha(1.0f));
(text_color * PREEDIT_STANDOUT_BRIGHTNESS + bg_color * (1 - PREEDIT_STANDOUT_BRIGHTNESS)).setAlpha(alpha));
}
else
{
@@ -1832,7 +1836,7 @@ void LLLineEditor::draw()
background.mBottom + PREEDIT_MARKER_POSITION,
preedit_pixels_right - PREEDIT_MARKER_GAP - 1,
background.mBottom + PREEDIT_MARKER_POSITION - PREEDIT_MARKER_THICKNESS,
(text_color * PREEDIT_MARKER_BRIGHTNESS + bg_color * (1 - PREEDIT_MARKER_BRIGHTNESS)).setAlpha(1.0f));
(text_color * PREEDIT_MARKER_BRIGHTNESS + bg_color * (1 - PREEDIT_MARKER_BRIGHTNESS)).setAlpha(alpha));
}
}
}
@@ -1874,7 +1878,7 @@ void LLLineEditor::draw()
if( (rendered_pixels_right < (F32)mMaxHPixels) && (rendered_text < text_len) )
{
LLColor4 color(1.f - bg_color.mV[0], 1.f - bg_color.mV[1], 1.f - bg_color.mV[2], 1.f);
LLColor4 color(1.f - bg_color.mV[0], 1.f - bg_color.mV[1], 1.f - bg_color.mV[2], alpha );
// selected middle
S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text);
width = llmin(width, mMaxHPixels - llround(rendered_pixels_right));
@@ -1883,7 +1887,7 @@ void LLLineEditor::draw()
rendered_text += mGLFont->render(
mText, mScrollHPos + rendered_text,
rendered_pixels_right, text_bottom,
LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], 1 ),
LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ),
LLFontGL::LEFT, LLFontGL::BOTTOM,
LLFontGL::NORMAL,
LLFontGL::NO_SHADOW,
@@ -1953,7 +1957,7 @@ void LLLineEditor::draw()
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection())
{
mGLFont->render(mText, getCursor(), (F32)(cursor_left + UI_LINEEDITOR_CURSOR_THICKNESS / 2), text_bottom,
LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], 1 ),
LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ),
LLFontGL::LEFT, LLFontGL::BOTTOM,
LLFontGL::NORMAL,
LLFontGL::NO_SHADOW,
@@ -2551,9 +2555,6 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const
// static
LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("line_editor");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -2580,7 +2581,7 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
S32 border_thickness = 1;
node->getAttributeS32("border_thickness", border_thickness);
LLLineEditor* line_editor = new LLLineEditor(name,
LLLineEditor* line_editor = new LLLineEditor("line_editor",
rect,
text,
font,

View File

@@ -1928,6 +1928,7 @@ LLXMLNodePtr LLMenuGL::getXML(bool save_children) const
void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory *factory)
{
std::string name(child->getName()->mString);
if (child->hasName(LL_MENU_GL_TAG))
{
// SUBMENU
@@ -2025,7 +2026,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory
for (call_child = child->getFirstChild(); call_child.notNull(); call_child = call_child->getNextSibling())
{
if (call_child->hasName("on_check"))
if (call_child->hasName("on_check") || call_child->hasName(name+".on_check"))
{
std::string callback_name;
std::string control_name;
@@ -2083,7 +2084,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory
for (call_child = child->getFirstChild(); call_child.notNull(); call_child = call_child->getNextSibling())
{
if (call_child->hasName("on_click"))
if (call_child->hasName("on_click") || call_child->hasName(name+".on_click"))
{
std::string callback_name;
call_child->getAttributeString("function", callback_name);
@@ -2104,7 +2105,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory
new_item->addListener(callback, "on_click", callback_data);
}
if (call_child->hasName("on_enable"))
if (call_child->hasName("on_enable") || call_child->hasName(name+".on_enable"))
{
std::string callback_name;
std::string control_name;
@@ -2148,7 +2149,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory
}
new_item->setEnabledControl(control_name, parent);
}
if (call_child->hasName("on_visible"))
if (call_child->hasName("on_visible") || call_child->hasName(name+".on_visible"))
{
std::string callback_name;
std::string control_name;
@@ -2322,7 +2323,7 @@ LLView* LLMenuGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa
++token_count;
}
BOOL opaque = FALSE;
BOOL opaque = TRUE;
node->getAttributeBOOL("opaque", opaque);
LLMenuGL *menu = new LLMenuGL(name, new_menu_label);
@@ -4150,13 +4151,10 @@ LLXMLNodePtr LLMenuBarGL::getXML(bool save_children) const
LLView* LLMenuBarGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("menu");
node->getAttributeString("name", name);
BOOL opaque = FALSE;
node->getAttributeBOOL("opaque", opaque);
LLMenuBarGL *menubar = new LLMenuBarGL(name);
LLMenuBarGL *menubar = new LLMenuBarGL("menu");
LLHandle<LLFloater> parent_handle;
LLFloater* parent_floater = dynamic_cast<LLFloater*>(parent);

View File

@@ -624,9 +624,6 @@ LLXMLNodePtr LLMultiSlider::getXML(bool save_children) const
//static
LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("multi_slider_bar");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -654,7 +651,7 @@ LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
BOOL use_triangle = FALSE;
node->getAttributeBOOL("use_triangle", use_triangle);
LLMultiSlider* multiSlider = new LLMultiSlider(name,
LLMultiSlider* multiSlider = new LLMultiSlider("multi_slider_bar",
rect,
NULL,
initial_value,

View File

@@ -472,9 +472,6 @@ LLXMLNodePtr LLMultiSliderCtrl::getXML(bool save_children) const
LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("multi_slider");
node->getAttributeString("name", name);
std::string label;
node->getAttributeString("label", label);
@@ -558,7 +555,7 @@ LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa
label.assign(node->getTextContents());
}
LLMultiSliderCtrl* slider = new LLMultiSliderCtrl(name,
LLMultiSliderCtrl* slider = new LLMultiSliderCtrl("multi_slider",
rect,
label,
font,

View File

@@ -0,0 +1,59 @@
/**
* @file llnotifications.h
* @brief Notification context class, pulled out of llnotifications.h to avoid including said file in llfloater.h. (Needed, as llnotifications.h includes llevents.h, which causes issues)
* @author Q (with assistance from Richard and Coco)
*
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2008-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LLNOTIFICATION_CONTEX
#define LL_LLNOTIFICATION_CONTEX
// context data that can be looked up via a notification's payload by the display logic
// derive from this class to implement specific contexts
class LLNotificationContext : public LLInstanceTracker<LLNotificationContext, LLUUID>
{
public:
LLNotificationContext() : LLInstanceTracker<LLNotificationContext, LLUUID>(LLUUID::generateNewID())
{
}
virtual ~LLNotificationContext() {}
LLSD asLLSD() const
{
return getKey();
}
private:
};
#endif //LL_LLNOTIFICATION_CONTEX

View File

@@ -106,6 +106,7 @@
#include "llui.h"
#include "llxmlnode.h"
#include "llnotificationptr.h"
#include "llnotificationcontext.h"
typedef enum e_notification_priority
{
@@ -121,26 +122,6 @@ typedef boost::function<void (const LLSD&, const LLSD&)> LLNotificationResponder
typedef LLFunctorRegistry<LLNotificationResponder> LLNotificationFunctorRegistry;
typedef LLFunctorRegistration<LLNotificationResponder> LLNotificationFunctorRegistration;
// context data that can be looked up via a notification's payload by the display logic
// derive from this class to implement specific contexts
class LLNotificationContext : public LLInstanceTracker<LLNotificationContext, LLUUID>
{
public:
LLNotificationContext() : LLInstanceTracker<LLNotificationContext, LLUUID>(LLUUID::generateNewID())
{
}
virtual ~LLNotificationContext() {}
LLSD asLLSD() const
{
return getKey();
}
private:
};
// Contains notification form data, such as buttons and text fields along with
// manipulator functions
class LLNotificationForm

View File

@@ -58,6 +58,8 @@
#include "llnotificationsutil.h"
#include "llfasttimer.h"
#include "llnotifications.h"
// LLLayoutStack
#include "llresizebar.h"
#include "llcriticaldamp.h"

View File

@@ -142,7 +142,7 @@ public:
CommitCallbackRegistry::ScopedRegistrar& getCommitCallbackRegistrar() { return mCommitCallbackRegistrar; }
EnableCallbackRegistry::ScopedRegistrar& getEnableCallbackRegistrar() { return mEnableCallbackRegistrar; }
BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
virtual BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory);
void setPanelParameters(LLXMLNodePtr node, LLView *parentp);

View File

@@ -352,9 +352,6 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const
// static
LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("radio_group");
node->getAttributeString("name", name);
U32 initial_value = 0;
node->getAttributeU32("initial_value", initial_value);
@@ -364,7 +361,7 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
LLRect rect;
createRect(node, rect, parent, LLRect());
LLRadioGroup* radio_group = new LLRadioGroup(name,
LLRadioGroup* radio_group = new LLRadioGroup("radio_group",
rect,
initial_value,
NULL,
@@ -408,10 +405,8 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
LLRect item_rect;
createRect(child, item_rect, radio_group, rect);
std::string radioname("radio");
child->getAttributeString("name", radioname);
std::string item_label = child->getTextContents();
LLRadioCtrl* radio = radio_group->addRadioButton(radioname, item_label, item_rect, font);
LLRadioCtrl* radio = radio_group->addRadioButton("radio", item_label, item_rect, font);
radio->initFromXML(child, radio_group);
}

View File

@@ -152,13 +152,10 @@ LLXMLNodePtr LLScrollingPanelList::getXML(bool save_children) const
// static
LLView* LLScrollingPanelList::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("scrolling_panel_list");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
LLScrollingPanelList* scrolling_panel_list = new LLScrollingPanelList(name, rect);
LLScrollingPanelList* scrolling_panel_list = new LLScrollingPanelList("scrolling_panel_list", rect);
scrolling_panel_list->initFromXML(node, parent);
return scrolling_panel_list;
}

View File

@@ -3104,9 +3104,6 @@ void LLScrollListCtrl::setScrollListParameters(LLXMLNodePtr node)
// static
LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("scroll_list");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -3132,7 +3129,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
node->getAttributeBOOL("mouse_wheel_opaque", mouse_wheel_opaque);
LLScrollListCtrl* scroll_list = new LLScrollListCtrl(
name,
"scroll_list",
rect,
NULL,
multi_select,

View File

@@ -147,9 +147,6 @@ void LLSearchEditor::handleKeystroke()
// static
LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("search_editor");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -158,7 +155,7 @@ LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
std::string text = node->getValue().substr(0, max_text_length - 1);
LLSearchEditor* search_editor = new LLSearchEditor(name,
LLSearchEditor* search_editor = new LLSearchEditor("search_editor",
rect,
max_text_length);

View File

@@ -250,6 +250,8 @@ BOOL LLSlider::handleKeyHere(KEY key, MASK mask)
void LLSlider::draw()
{
F32 alpha = getDrawContext().mAlpha;
// since thumb image might still be decoding, need thumb to accomodate image size
updateThumbRect();
@@ -258,31 +260,47 @@ void LLSlider::draw()
// drawing solids requires texturing be disabled
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
F32 opacity = getEnabled() ? 1.f : 0.3f;
LLColor4 center_color = (mThumbCenterColor % opacity);
// Track
LLRect track_rect(mThumbImage->getWidth() / 2,
getLocalRect().getCenterY() + (mTrackImage->getHeight() / 2),
getRect().getWidth() - mThumbImage->getWidth() / 2,
getLocalRect().getCenterY() - (mTrackImage->getHeight() / 2) );
LLRect highlight_rect(track_rect.mLeft, track_rect.mTop, mThumbRect.getCenterX(), track_rect.mBottom);
mTrackImage->draw(track_rect);
mTrackHighlightImage->draw(highlight_rect);
mTrackImage->draw(track_rect, LLColor4::white % alpha);
mTrackHighlightImage->draw(highlight_rect, LLColor4::white % alpha);
// Thumb
if( hasMouseCapture() )
{
// Show ghost where thumb was before dragging began.
mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor % 0.3f);
}
if (hasFocus())
{
// Draw focus highlighting.
mThumbImage->drawBorder(mThumbRect, gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth());
mThumbImage->drawBorder(mThumbRect, gFocusMgr.getFocusColor() % alpha, gFocusMgr.getFocusFlashWidth());
}
if( hasMouseCapture() )
{
// Show ghost where thumb was before dragging began.
if (mThumbImage.notNull())
{
mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor % (0.3f * alpha));
mThumbImage->draw(mThumbRect, mThumbOutlineColor % alpha);
}
}
else if(!getEnabled())
{
if (mThumbImage.notNull())
{
mThumbImage->draw(mThumbRect, mThumbCenterColor % (0.3f * alpha));
}
}
else
{
if (mThumbImage.notNull())
{
mThumbImage->draw(mThumbRect, mThumbCenterColor % alpha);
}
}
// Fill in the thumb.
mThumbImage->draw(mThumbRect, hasMouseCapture() ? mThumbOutlineColor : center_color);
LLUICtrl::draw();
}
@@ -325,9 +343,6 @@ boost::signals2::connection LLSlider::setMouseUpCallback( const commit_signal_t:
//static
LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory)
{
std::string name("slider_bar");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -346,7 +361,7 @@ LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFacto
BOOL volume = node->hasName("volume_slider") ? TRUE : FALSE;
node->getAttributeBOOL("volume", volume);
LLSlider* slider = new LLSlider(name,
LLSlider* slider = new LLSlider("slider_bar",
rect,
NULL,
initial_value,

View File

@@ -96,9 +96,9 @@ private:
S32 mMouseOffset;
LLRect mDragStartThumbRect;
LLUIImage* mThumbImage;
LLUIImage* mTrackImage;
LLUIImage* mTrackHighlightImage;
LLPointer<LLUIImage> mThumbImage;
LLPointer<LLUIImage> mTrackImage;
LLPointer<LLUIImage> mTrackHighlightImage;
LLRect mThumbRect;
LLColor4 mTrackColor;

View File

@@ -403,9 +403,6 @@ LLXMLNodePtr LLSliderCtrl::getXML(bool save_children) const
LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("slider");
node->getAttributeString("name", name);
std::string label;
node->getAttributeString("label", label);
@@ -480,7 +477,7 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
label.assign(node->getTextContents());
}
LLSliderCtrl* slider = new LLSliderCtrl(name,
LLSliderCtrl* slider = new LLSliderCtrl("slider",
rect,
label,
font,

View File

@@ -519,9 +519,6 @@ LLXMLNodePtr LLSpinCtrl::getXML(bool save_children) const
LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("spinner");
node->getAttributeString("name", name);
std::string label;
node->getAttributeString("label", label);
@@ -556,7 +553,7 @@ LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *
label.assign( node->getValue() );
}
LLSpinCtrl* spinner = new LLSpinCtrl(name,
LLSpinCtrl* spinner = new LLSpinCtrl("spinner",
rect,
label,
font,

View File

@@ -197,12 +197,16 @@ void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width)
{
max_width = (F32)getRect().getWidth();
}
if(max_width <= 0.0f)
{
return; //It makes no sense to try to wrap text to fit zero-width columns. (In fact, it causes infinite recursion in the following while loop!)
}
LLWString wtext = utf8str_to_wstring(in_text);
LLWString final_wtext;
LLWString::size_type cur = 0;;
LLWString::size_type len = wtext.size();
LLWString::size_type len = wtext.length();
while (cur < len)
{
@@ -282,6 +286,7 @@ BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text
void LLTextBox::draw()
{
F32 alpha = getDrawContext().mAlpha;
if (mBorderVisible)
{
gl_rect_2d_offset_local(getLocalRect(), 2, FALSE);
@@ -292,12 +297,12 @@ void LLTextBox::draw()
static LLColor4 color_drop_shadow = LLUI::sColorsGroup->getColor("ColorDropShadow");
static S32 drop_shadow_tooltip = LLUI::sConfigGroup->getS32("DropShadowTooltip");
gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
color_drop_shadow, drop_shadow_tooltip);
color_drop_shadow % alpha, drop_shadow_tooltip);
}
if (mBackgroundVisible)
{
gl_rect_2d( getLocalRect(), mBackgroundColor );
gl_rect_2d( getLocalRect(), mBackgroundColor % alpha );
}
S32 text_x = 0;
@@ -320,16 +325,16 @@ void LLTextBox::draw()
{
if(mHasHover)
{
drawText( text_x, text_y, mHoverColor );
drawText( text_x, text_y, mHoverColor % alpha );
}
else
{
drawText( text_x, text_y, mTextColor );
drawText( text_x, text_y, mTextColor % alpha );
}
}
else
{
drawText( text_x, text_y, mDisabledColor );
drawText( text_x, text_y, mDisabledColor % alpha );
}
if (sDebugRects)
@@ -382,6 +387,69 @@ void LLTextBox::reshapeToFitText()
reshape( width + 2 * mHPad, height + 2 * mVPad );
}
// virtual
void LLTextBox::initFromXML(LLXMLNodePtr node, LLView* parent)
{
LLUICtrl::initFromXML(node, parent);
LLFontGL* font = LLView::selectFont(node);
if(font)
mFontGL = font;
setText(node->getTextContents());
LLFontGL::HAlign halign = LLView::selectFontHAlign(node);
setHAlign(halign);
node->getAttributeS32("line_spacing", mLineSpacing);
std::string font_style;
if (node->getAttributeString("font-style", font_style))
{
mFontStyle = LLFontGL::getStyleFromString(font_style);
}
if (node->getAttributeString("font-shadow", font_style))
{
if(font_style == "soft")
mFontShadow = LLFontGL::DROP_SHADOW_SOFT;
else if(font_style == "hard")
mFontShadow = LLFontGL::DROP_SHADOW;
else
mFontShadow = LLFontGL::NO_SHADOW;
}
BOOL mouse_opaque = getMouseOpaque();
if (node->getAttributeBOOL("mouse_opaque", mouse_opaque))
{
setMouseOpaque(mouse_opaque);
}
if(node->hasAttribute("text_color"))
{
LLColor4 color;
LLUICtrlFactory::getAttributeColor(node, "text_color", color);
setColor(color);
}
if(node->hasAttribute("hover_color"))
{
LLColor4 color;
LLUICtrlFactory::getAttributeColor(node, "hover_color", color);
setHoverColor(color);
setHoverActive(true);
}
BOOL hover_active = FALSE;
if(node->getAttributeBOOL("hover", hover_active))
{
setHoverActive(hover_active);
}
node->getAttributeBOOL("use_ellipses", mUseEllipses);
}
// virtual
LLXMLNodePtr LLTextBox::getXML(bool save_children) const
{
@@ -411,68 +479,8 @@ LLXMLNodePtr LLTextBox::getXML(bool save_children) const
// static
LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("text_box");
node->getAttributeString("name", name);
LLFontGL* font = LLView::selectFont(node);
std::string text = node->getTextContents();
LLTextBox* text_box = new LLTextBox(name,
LLRect(),
text,
font,
FALSE);
LLFontGL::HAlign halign = LLView::selectFontHAlign(node);
text_box->setHAlign(halign);
LLTextBox* text_box = new LLTextBox("text_box", LLRect(), "" , NULL, FALSE);
text_box->initFromXML(node, parent);
node->getAttributeS32("line_spacing", text_box->mLineSpacing);
std::string font_style;
if (node->getAttributeString("font-style", font_style))
{
text_box->mFontStyle = LLFontGL::getStyleFromString(font_style);
}
if (node->getAttributeString("font-shadow", font_style))
{
if(font_style == "soft")
text_box->mFontShadow = LLFontGL::DROP_SHADOW_SOFT;
else if(font_style == "hard")
text_box->mFontShadow = LLFontGL::DROP_SHADOW;
else
text_box->mFontShadow = LLFontGL::NO_SHADOW;
}
BOOL mouse_opaque = text_box->getMouseOpaque();
if (node->getAttributeBOOL("mouse_opaque", mouse_opaque))
{
text_box->setMouseOpaque(mouse_opaque);
}
if(node->hasAttribute("text_color"))
{
LLColor4 color;
LLUICtrlFactory::getAttributeColor(node, "text_color", color);
text_box->setColor(color);
}
if(node->hasAttribute("hover_color"))
{
LLColor4 color;
LLUICtrlFactory::getAttributeColor(node, "hover_color", color);
text_box->setHoverColor(color);
text_box->setHoverActive(true);
}
BOOL hover_active = FALSE;
if(node->getAttributeBOOL("hover", hover_active))
{
text_box->setHoverActive(hover_active);
}
return text_box;
}

View File

@@ -63,6 +63,7 @@ public:
virtual ~LLTextBox() {}
virtual void initFromXML(LLXMLNodePtr node, LLView* parent);
virtual LLXMLNodePtr getXML(bool save_children = true) const;
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory);

View File

@@ -4748,9 +4748,6 @@ LLXMLNodePtr LLTextEditor::getXML(bool save_children) const
// static
LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("text_editor");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -4764,7 +4761,7 @@ LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
std::string text = node->getTextContents().substr(0, max_text_length - 1);
LLTextEditor* text_editor = new LLTextEditor(name,
LLTextEditor* text_editor = new LLTextEditor("text_editor",
rect,
max_text_length,
text,

View File

@@ -48,6 +48,8 @@ LLUICtrl::LLUICtrl() :
mCommitCallback(NULL),
mValidateCallback(NULL),
mCallbackUserData(NULL),
mMouseEnterSignal(NULL),
mMouseLeaveSignal(NULL),
mTentative(FALSE),
mTabStop(TRUE),
mIsChrome(FALSE)
@@ -66,6 +68,8 @@ LLUICtrl::LLUICtrl(const std::string& name, const LLRect rect, BOOL mouse_opaque
mViewModel(LLViewModelPtr(new LLViewModel)),
mValidateCallback( NULL ),
mCallbackUserData( NULL ),
mMouseEnterSignal(NULL),
mMouseLeaveSignal(NULL),
mTentative( FALSE ),
mTabStop( TRUE ),
mIsChrome(FALSE)
@@ -88,6 +92,25 @@ LLUICtrl::~LLUICtrl()
delete mValidateSignal;
}
// virtual
void LLUICtrl::onMouseEnter(S32 x, S32 y, MASK mask)
{
if (mMouseEnterSignal)
{
(*mMouseEnterSignal)(this, getValue());
}
}
// virtual
void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
{
if(mMouseLeaveSignal)
{
(*mMouseLeaveSignal)(this, getValue());
}
}
void LLUICtrl::onCommit()
{
if( mCommitCallback )
@@ -462,6 +485,10 @@ BOOL LLUICtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect
void LLUICtrl::initFromXML(LLXMLNodePtr node, LLView* parent)
{
std::string name;
if(node->getAttributeString("name", name))
setName(name);
BOOL has_tab_stop = hasTabStop();
node->getAttributeBOOL("tab_stop", has_tab_stop);
@@ -470,20 +497,36 @@ void LLUICtrl::initFromXML(LLXMLNodePtr node, LLView* parent)
std::string str = node->getName()->mString;
std::string attrib_str;
LLXMLNodePtr child_node;
if(node->getChild((str+".commit_callback").c_str(),child_node,false))
//Since so many other callback 'types' piggyback off of the commitcallback registrar as well as use the same callback signature
//we can assemble a nice little static list to iterate down instead of copy-pasting mostly similar code for each instance.
//Validate/enable callbacks differ, as it uses its own registry/callback signature. This could be worked around with a template, but keeping
//all the code local to this scope is more beneficial.
typedef boost::signals2::connection (LLUICtrl::*commit_fn)( const commit_signal_t::slot_type& cb );
static std::pair<std::string,commit_fn> sCallbackRegistryMap[3] =
{
if(child_node->getAttributeString("function",attrib_str))
std::pair<std::string,commit_fn>(".commit_callback",&LLUICtrl::setCommitCallback),
std::pair<std::string,commit_fn>(".mouseenter_callback",&LLUICtrl::setMouseEnterCallback),
std::pair<std::string,commit_fn>(".mouseleave_callback",&LLUICtrl::setMouseLeaveCallback)
};
for(S32 i= 0; i < sizeof(sCallbackRegistryMap)/sizeof(sCallbackRegistryMap[0]);++i)
{
if(node->getChild((str+sCallbackRegistryMap[i].first).c_str(),child_node,false))
{
commit_callback_t* func = (CommitCallbackRegistry::getValue(attrib_str));
if (func)
if(child_node->getAttributeString("function",attrib_str))
{
if(child_node->getAttributeString("parameter",attrib_str))
setCommitCallback(boost::bind((*func), this, LLSD(attrib_str)));
else
setCommitCallback(commit_signal_t::slot_type(*func));
commit_callback_t* func = (CommitCallbackRegistry::getValue(attrib_str));
if (func)
{
if(child_node->getAttributeString("parameter",attrib_str))
(this->*sCallbackRegistryMap[i].second)(boost::bind((*func), this, LLSD(attrib_str)));
else
(this->*sCallbackRegistryMap[i].second)(commit_signal_t::slot_type(*func));
}
}
}
}
if(node->getChild((str+".validate_callback").c_str(),child_node,false))
{
if(child_node->getAttributeString("function",attrib_str))
@@ -587,3 +630,15 @@ boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t
if (!mValidateSignal) mValidateSignal = new enable_signal_t();
return mValidateSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb )
{
if (!mMouseEnterSignal) mMouseEnterSignal = new commit_signal_t();
return mMouseEnterSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb )
{
if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t();
return mMouseLeaveSignal->connect(cb);
}

View File

@@ -70,6 +70,8 @@ public:
/*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
/*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
/*virtual*/ BOOL isCtrl() const;
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
// From LLFocusableElement
/*virtual*/ void setFocus( BOOL b );
@@ -127,7 +129,9 @@ public:
//Start using these!
boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb );
boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb );
// *TODO: Deprecate; for backwards compatability only:
//Keeping userdata around with legacy setCommitCallback because it's used ALL OVER THE PLACE.
void* getCallbackUserData() const { return mCallbackUserData; }
@@ -162,6 +166,9 @@ protected:
commit_signal_t* mCommitSignal;
enable_signal_t* mValidateSignal;
commit_signal_t* mMouseEnterSignal;
commit_signal_t* mMouseLeaveSignal;
LLViewModelPtr mViewModel;
void (*mCommitCallback)( LLUICtrl* ctrl, void* userdata );

View File

@@ -102,11 +102,8 @@ public:
static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("pad");
node->getAttributeString("name", name);
LLUICtrlLocate *new_ctrl = new LLUICtrlLocate();
new_ctrl->setName(name);
new_ctrl->setName("pad");
new_ctrl->initFromXML(node, parent);
return new_ctrl;
}

View File

@@ -74,6 +74,7 @@ BOOL LLView::sForceReshape = FALSE;
LLView* LLView::sEditingUIView = NULL;
S32 LLView::sLastLeftXML = S32_MIN;
S32 LLView::sLastBottomXML = S32_MIN;
std::vector<LLViewDrawContext*> LLViewDrawContext::sDrawContextStack;
LLView::DrilldownFunc LLView::sDrilldown =
boost::bind(&LLView::pointInView, _1, _2, _3, HIT_TEST_USE_BOUNDING_RECT);
@@ -677,6 +678,16 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask)
}
void LLView::onMouseEnter(S32 x, S32 y, MASK mask)
{
//llinfos << "Mouse entered " << getName() << llendl;
}
void LLView::onMouseLeave(S32 x, S32 y, MASK mask)
{
//llinfos << "Mouse left " << getName() << llendl;
}
std::string LLView::getShowNamesToolTip()
{
LLView* view = getParent();
@@ -2481,6 +2492,56 @@ void LLView::parseFollowsFlags(const LLView::Params& params)
}
}
LLView::tree_iterator_t LLView::beginTreeDFS()
{
return tree_iterator_t(this,
boost::bind(boost::mem_fn(&LLView::beginChild), _1),
boost::bind(boost::mem_fn(&LLView::endChild), _1));
}
LLView::tree_iterator_t LLView::endTreeDFS()
{
// an empty iterator is an "end" iterator
return tree_iterator_t();
}
LLView::tree_post_iterator_t LLView::beginTreeDFSPost()
{
return tree_post_iterator_t(this,
boost::bind(boost::mem_fn(&LLView::beginChild), _1),
boost::bind(boost::mem_fn(&LLView::endChild), _1));
}
LLView::tree_post_iterator_t LLView::endTreeDFSPost()
{
// an empty iterator is an "end" iterator
return tree_post_iterator_t();
}
LLView::bfs_tree_iterator_t LLView::beginTreeBFS()
{
return bfs_tree_iterator_t(this,
boost::bind(boost::mem_fn(&LLView::beginChild), _1),
boost::bind(boost::mem_fn(&LLView::endChild), _1));
}
LLView::bfs_tree_iterator_t LLView::endTreeBFS()
{
// an empty iterator is an "end" iterator
return bfs_tree_iterator_t();
}
LLView::root_to_view_iterator_t LLView::beginRootToView()
{
return root_to_view_iterator_t(this, boost::bind(&LLView::getParent, _1));
}
LLView::root_to_view_iterator_t LLView::endRootToView()
{
return root_to_view_iterator_t();
}
// static
U32 LLView::createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, const LLRect &required_rect)
{
@@ -2944,6 +3005,32 @@ S32 LLView::notifyParent(const LLSD& info)
return parent->notifyParent(info);
return 0;
}
bool LLView::notifyChildren(const LLSD& info)
{
bool ret = false;
BOOST_FOREACH(LLView* childp, mChildList)
{
ret = ret || childp->notifyChildren(info);
}
return ret;
}
// convenient accessor for draw context
const LLViewDrawContext& LLView::getDrawContext()
{
return LLViewDrawContext::getCurrentContext();
}
const LLViewDrawContext& LLViewDrawContext::getCurrentContext()
{
static LLViewDrawContext default_context;
if (sDrawContextStack.empty())
return default_context;
return *sDrawContextStack.back();
}
LLView* LLView::createWidget(LLXMLNodePtr xml_node) const
{
// forward requests to ui ctrl factory

View File

@@ -55,6 +55,7 @@
#include "lluistring.h"
#include "llcursortypes.h"
#include "llinitparam.h"
#include "lltreeiterators.h"
#include "llfocusmgr.h"
#include <boost/unordered_map.hpp>
#include "ailist.h"
@@ -130,6 +131,35 @@ public:
}
};
// maintains render state during traversal of UI tree
class LLViewDrawContext
{
public:
F32 mAlpha;
LLViewDrawContext(F32 alpha = 1.f)
: mAlpha(alpha)
{
if (!sDrawContextStack.empty())
{
LLViewDrawContext* context_top = sDrawContextStack.back();
// merge with top of stack
mAlpha *= context_top->mAlpha;
}
sDrawContextStack.push_back(this);
}
~LLViewDrawContext()
{
sDrawContextStack.pop_back();
}
static const LLViewDrawContext& getCurrentContext();
private:
static std::vector<LLViewDrawContext*> sDrawContextStack;
};
class LLView
: public LLMouseHandler, // handles mouse events
public LLFocusableElement, // handles keyboard events
@@ -378,7 +408,24 @@ public:
BOOL hasAncestor(const LLView* parentp) const;
BOOL hasChild(const std::string& childname, BOOL recurse = FALSE) const;
BOOL childHasKeyboardFocus( const std::string& childname ) const;
// these iterators are used for collapsing various tree traversals into for loops
typedef LLTreeDFSIter<LLView, child_list_const_iter_t> tree_iterator_t;
tree_iterator_t beginTreeDFS();
tree_iterator_t endTreeDFS();
typedef LLTreeDFSPostIter<LLView, child_list_const_iter_t> tree_post_iterator_t;
tree_post_iterator_t beginTreeDFSPost();
tree_post_iterator_t endTreeDFSPost();
typedef LLTreeBFSIter<LLView, child_list_const_iter_t> bfs_tree_iterator_t;
bfs_tree_iterator_t beginTreeBFS();
bfs_tree_iterator_t endTreeBFS();
typedef LLTreeDownIter<LLView> root_to_view_iterator_t;
root_to_view_iterator_t beginRootToView();
root_to_view_iterator_t endRootToView();
//
// UTILITIES
@@ -489,6 +536,9 @@ public:
virtual LLView* childFromPoint(S32 x, S32 y, bool recur=false);
// view-specific handlers
virtual void onMouseEnter(S32 x, S32 y, MASK mask);
virtual void onMouseLeave(S32 x, S32 y, MASK mask);
template <class T> T* findChild(const std::string& name)
{
return getChild<T>(name,true,false);
@@ -607,6 +657,16 @@ public:
//send custom notification to LLView parent
virtual S32 notifyParent(const LLSD& info);
//send custom notification to all view childrend
// return true if _any_ children return true. otherwise false.
virtual bool notifyChildren(const LLSD& info);
//send custom notification to current view
virtual S32 notify(const LLSD& info) { return 0;};
static const LLViewDrawContext& getDrawContext();
protected:
void drawDebugRect();
void drawChild(LLView* childp, S32 x_offset = 0, S32 y_offset = 0, BOOL force_draw = FALSE);

View File

@@ -104,6 +104,8 @@ void LLViewBorder::draw()
void LLViewBorder::drawOnePixelLines()
{
F32 alpha = getDrawContext().mAlpha;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLColor4 top_color = mHighlightLight;
@@ -138,6 +140,9 @@ void LLViewBorder::drawOnePixelLines()
S32 right = getRect().getWidth();
S32 bottom = 0;
top_color %= alpha;
bottom_color %= alpha;
gGL.color4fv( top_color.mV );
gl_line_2d(left, bottom, left, top);
gl_line_2d(left, top, right, top);

View File

@@ -222,6 +222,7 @@ set(viewer_SOURCE_FILES
llfloaterlandholdings.cpp
llfloaterlandmark.cpp
llfloatermap.cpp
llfloatermediasettings.cpp
llfloatermemleak.cpp
llfloatermessagelog.cpp
llfloatermodelpreview.cpp
@@ -263,6 +264,7 @@ set(viewer_SOURCE_FILES
llfloatervoiceeffect.cpp
llfloaterwater.cpp
llfloaterwebcontent.cpp
llfloaterwhitelistentry.cpp
llfloaterwindlight.cpp
llfloaterworldmap.cpp
llfolderview.cpp
@@ -369,6 +371,10 @@ set(viewer_SOURCE_FILES
llpanellogin.cpp
llpanelmaininventory.cpp
llpanelmarketplaceoutboxinventory.cpp
llpanelmediasettingsgeneral.cpp
llpanelmediasettingspermissions.cpp
llpanelmediasettingssecurity.cpp
llpanelnearbymedia.cpp
llpanelmorph.cpp
llpanelmsgs.cpp
llpanelnetwork.cpp
@@ -729,6 +735,7 @@ set(viewer_HEADER_FILES
llfloaterlandholdings.h
llfloaterlandmark.h
llfloatermap.h
llfloatermediasettings.h
llfloatermemleak.h
llfloatermessagelog.h
llfloatermodelpreview.h
@@ -770,6 +777,7 @@ set(viewer_HEADER_FILES
llfloatervoiceeffect.h
llfloaterwater.h
llfloaterwebcontent.h
llfloaterwhitelistentry.h
llfloaterwindlight.h
llfloaterworldmap.h
llfolderview.h
@@ -876,6 +884,10 @@ set(viewer_HEADER_FILES
llpanellogin.h
llpanelmaininventory.h
llpanelmarketplaceoutboxinventory.h
llpanelmediasettingsgeneral.h
llpanelmediasettingspermissions.h
llpanelmediasettingssecurity.h
llpanelnearbymedia.h
llpanelmorph.h
llpanelmsgs.h
llpanelnetwork.h

View File

@@ -425,7 +425,19 @@
</array>
</map>
<!-- Begin: AO-->
<key>ShowNearbyMediaFloater</key>
<map>
<key>Comment</key>
<string>Show nearby media floter</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<!-- Begin: AO-->
<key>ShowAOSitPopup</key>
<map>
@@ -1147,7 +1159,7 @@ This should be as low as possible, but too low may break functionality</string>
<key>Comment</key>
<string>Show Windlight popup</string>
<key>Persist</key>
<integer>0</integer>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -8828,6 +8840,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>LastMediaSettingsTab</key>
<map>
<key>Comment</key>
<string>Last selected tab in media settings window</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>LastRunVersion</key>
<map>
<key>Comment</key>
@@ -17088,6 +17111,22 @@ This should be as low as possible, but too low may break functionality</string>
<integer>473</integer>
</array>
</map>
<key>FloaterNearbyMediaRect</key>
<map>
<key>Comment</key>
<string>Rectangle for nearby media floater.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Rect</string>
<key>Value</key>
<array>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
</array>
</map>
<key>WindEnabled</key>
<map>
<key>Comment</key>

View File

@@ -506,7 +506,7 @@ void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
}
//static
std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick)
std::string HippoGridInfo::sanitizeGridNick(const std::string &gridnick)
{
std::string tmp;
int size = gridnick.size();
@@ -529,7 +529,7 @@ std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick)
}
std::string HippoGridInfo::getGridNick()
std::string HippoGridInfo::getGridNick() const
{
if(!mGridNick.empty())
{
@@ -684,42 +684,57 @@ void HippoGridManager::discardAndReload()
HippoGridInfo* HippoGridManager::getGrid(const std::string& grid) const
{
if(grid.empty())
return NULL;
std::map<std::string, HippoGridInfo*>::const_iterator it;
it = mGridInfo.find(grid);
//The grids are keyed by 'name' which equates to something like "Second Life"
//Try to match such first.
if (it != mGridInfo.end())
{
return it->second;
}
else
else //Fall back to nick short names. (so something like "secondlife" will work)
{
return 0;
for(it = mGridInfo.begin(); it != mGridInfo.end(); ++it)
{
if(it->second && LLStringUtil::compareInsensitive(it->second->getGridNick(), grid)==0)
return it->second;
}
}
return NULL;
}
HippoGridInfo* HippoGridManager::getCurrentGrid() const
{
HippoGridInfo* grid = getGrid(mCurrentGrid);
if (grid)
if(!grid)
{
return grid;
}
else
{
return &HippoGridInfo::FALLBACK_GRIDINFO;
grid = getGrid(mDefaultGrid);
}
return grid ? grid : &HippoGridInfo::FALLBACK_GRIDINFO;
}
const std::string& HippoGridManager::getDefaultGridNick() const
std::string HippoGridManager::getDefaultGridNick() const
{
HippoGridInfo* grid = getGrid(mDefaultGrid);
return grid ? grid->getGridNick() : HippoGridInfo::FALLBACK_GRIDINFO.getGridNick();
}
std::string HippoGridManager::getCurrentGridNick() const
{
return getCurrentGrid()->getGridNick();
}
const std::string& HippoGridManager::getDefaultGridName() const
{
return mDefaultGrid;
}
const std::string& HippoGridManager::getCurrentGridNick() const
const std::string& HippoGridManager::getCurrentGridName() const
{
if (mCurrentGrid.empty())
{
return mDefaultGrid;
}
return mCurrentGrid;
}

View File

@@ -57,7 +57,7 @@ public:
const std::string& getVoiceConnector() const { return mVoiceConnector; }
std::string getSearchUrl(SearchType ty, bool is_web) const;
bool isRenderCompat() const { return mRenderCompat; }
std::string getGridNick();
std::string getGridNick() const;
int getMaxAgentGroups() const { return mMaxAgentGroups; }
const std::string& getCurrencySymbol() const { return mCurrencySymbol; }
@@ -99,7 +99,7 @@ public:
bool retrieveGridInfo();
static const char* getPlatformString(Platform platform);
static std::string sanitizeGridNick(std::string &gridnick);
static std::string sanitizeGridNick(const std::string &gridnick);
static HippoGridInfo FALLBACK_GRIDINFO;
static void initFallback();
@@ -163,8 +163,10 @@ public:
HippoGridInfo* getConnectedGrid() const { return mConnectedGrid ? mConnectedGrid : getCurrentGrid(); }
HippoGridInfo* getCurrentGrid() const;
const std::string& getDefaultGridNick() const;
const std::string& getCurrentGridNick() const;
std::string getDefaultGridNick() const;
std::string getCurrentGridNick() const;
const std::string& getDefaultGridName() const;
const std::string& getCurrentGridName() const;
void setDefaultGrid(const std::string& grid);
void setCurrentGrid(const std::string& grid);

View File

@@ -164,7 +164,7 @@ BOOL HippoPanelGridsImpl::postBuild()
// called internally too
void HippoPanelGridsImpl::refresh()
{
const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
const std::string &defaultGrid = gHippoGridManager->getDefaultGridName();
LLComboBox *grids = getChild<LLComboBox>("grid_selector");
S32 selectIndex = -1, i = 0;
@@ -365,7 +365,7 @@ bool HippoPanelGridsImpl::saveCurGrid()
void HippoPanelGridsImpl::reset()
{
mState = NORMAL;
mCurGrid = gHippoGridManager->getCurrentGridNick();
mCurGrid = gHippoGridManager->getCurrentGridName();
loadCurGrid();
}

View File

@@ -30,6 +30,7 @@
#include "llavataractions.h"
#include "llavatarnamecache.h" // IDEVO
#include "llnotifications.h"
#include "llnotificationsutil.h" // for LLNotificationsUtil
#include "roles_constants.h" // for GP_MEMBER_INVITE

View File

@@ -111,7 +111,7 @@ private:
//
LLChatBar::LLChatBar()
: LLPanel(LLStringUtil::null, LLRect(), BORDER_NO),
: LLPanel(),
mInputEditor(NULL),
mGestureLabelTimer(),
mLastSpecialChatChannel(0),

View File

@@ -36,6 +36,7 @@
#include "llpanel.h"
#include "llframetimer.h"
#include "llchat.h"
#include "lllayoutstack.h"
class LLLineEditor;
class LLMessageSystem;
@@ -45,8 +46,7 @@ class LLFrameTimer;
class LLChatBarGestureObserver;
class LLComboBox;
class LLChatBar
: public LLPanel
class LLChatBar : public LLPanel
{
public:
// constructor for inline chat-bars (e.g. hosted in chat history window)

View File

@@ -352,9 +352,6 @@ LLXMLNodePtr LLColorSwatchCtrl::getXML(bool save_children) const
LLView* LLColorSwatchCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("colorswatch");
node->getAttributeString("name", name);
std::string label;
node->getAttributeString("label", label);
@@ -373,7 +370,7 @@ LLView* LLColorSwatchCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa
}
LLColorSwatchCtrl* color_swatch = new LLColorSwatchCtrl(
name,
"colorswatch",
rect,
label,
color );

View File

@@ -123,7 +123,7 @@ void LLFloaterDayCycle::onClickHelp(void* data)
LLFloaterDayCycle* self = LLFloaterDayCycle::instance();
std::string xml_alert = *(std::string *) data;
LLNotifications::instance().add(self->contextualNotification(xml_alert));
self->addContextualNotification(xml_alert);
}
void LLFloaterDayCycle::initHelpBtn(const std::string& name, const std::string& xml_alert)

View File

@@ -71,6 +71,8 @@
#include "llviewerregion.h"
#include "llwindow.h"
#include "llnotifications.h"
const char* market_panel = "market_panel";
class LLPanelDirMarket : public LLPanelDirFind

View File

@@ -70,7 +70,7 @@ LLFloaterEnvSettings::~LLFloaterEnvSettings()
void LLFloaterEnvSettings::onClickHelp(void* data)
{
LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data;
LLNotifications::instance().add(self->contextualNotification("EnvSettingsHelpButton"));
self->addContextualNotification("EnvSettingsHelpButton");
}
void LLFloaterEnvSettings::initCallbacks(void)

View File

@@ -0,0 +1,319 @@
/**
* @file llfloatermediasettings.cpp
* @brief Tabbed dialog for media settings - class implementation
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "llfloatermediasettings.h"
#include "llfloaterwhitelistentry.h"
#include "llpanelmediasettingsgeneral.h"
#include "llpanelmediasettingssecurity.h"
#include "llpanelmediasettingspermissions.h"
#include "llviewercontrol.h"
#include "lluictrlfactory.h"
#include "llbutton.h"
#include "llselectmgr.h"
#include "llsdutil.h"
LLFloaterMediaSettings* LLFloaterMediaSettings::sInstance = NULL;
////////////////////////////////////////////////////////////////////////////////
//
LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key)
: LLFloater(key),
mTabContainer(NULL),
mPanelMediaSettingsGeneral(NULL),
mPanelMediaSettingsSecurity(NULL),
mPanelMediaSettingsPermissions(NULL),
mWaitingToClose( false ),
mIdenticalHasMediaInfo( true ),
mMultipleMedia(false),
mMultipleValidMedia(false)
{
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_media_settings.xml");
}
////////////////////////////////////////////////////////////////////////////////
//
LLFloaterMediaSettings::~LLFloaterMediaSettings()
{
if ( mPanelMediaSettingsGeneral )
{
delete mPanelMediaSettingsGeneral;
mPanelMediaSettingsGeneral = NULL;
}
if ( mPanelMediaSettingsSecurity )
{
delete mPanelMediaSettingsSecurity;
mPanelMediaSettingsSecurity = NULL;
}
if ( mPanelMediaSettingsPermissions )
{
delete mPanelMediaSettingsPermissions;
mPanelMediaSettingsPermissions = NULL;
}
sInstance = NULL;
}
////////////////////////////////////////////////////////////////////////////////
//
BOOL LLFloaterMediaSettings::postBuild()
{
mApplyBtn = getChild<LLButton>("Apply");
mApplyBtn->setClickedCallback(onBtnApply, this);
mCancelBtn = getChild<LLButton>("Cancel");
mCancelBtn->setClickedCallback(onBtnCancel, this);
mOKBtn = getChild<LLButton>("OK");
mOKBtn->setClickedCallback(onBtnOK, this);
mTabContainer = getChild<LLTabContainer>( "tab_container" );
mPanelMediaSettingsGeneral = new LLPanelMediaSettingsGeneral();
mTabContainer->addTabPanel( mPanelMediaSettingsGeneral, mPanelMediaSettingsGeneral->getLabel() );
mPanelMediaSettingsGeneral->setParent( this );
// note that "permissions" tab is really "Controls" tab - refs to 'perms' and
// 'permissions' not changed to 'controls' since we don't want to change
// shared files in server code and keeping everything the same seemed best.
mPanelMediaSettingsPermissions = new LLPanelMediaSettingsPermissions();
mTabContainer->addTabPanel( mPanelMediaSettingsPermissions, mPanelMediaSettingsPermissions->getLabel() );
mPanelMediaSettingsSecurity = new LLPanelMediaSettingsSecurity();
mTabContainer->addTabPanel( mPanelMediaSettingsSecurity, mPanelMediaSettingsSecurity->getLabel() );
mPanelMediaSettingsSecurity->setParent( this );
// restore the last tab viewed from persistance variable storage
if (!mTabContainer->selectTab(gSavedSettings.getS32("LastMediaSettingsTab")))
{
mTabContainer->selectFirstTab();
};
sInstance = this;
return TRUE;
}
//static
LLFloaterMediaSettings* LLFloaterMediaSettings::getInstance()
{
if ( !sInstance )
{
sInstance = new LLFloaterMediaSettings(LLSD());
sInstance->setVisible(FALSE);
}
return sInstance;
}
//static
void LLFloaterMediaSettings::apply()
{
if (sInstance->haveValuesChanged())
{
LLSD settings;
sInstance->mPanelMediaSettingsGeneral->preApply();
sInstance->mPanelMediaSettingsGeneral->getValues( settings, false );
sInstance->mPanelMediaSettingsSecurity->preApply();
sInstance->mPanelMediaSettingsSecurity->getValues( settings, false );
sInstance->mPanelMediaSettingsPermissions->preApply();
sInstance->mPanelMediaSettingsPermissions->getValues( settings, false );
LLSelectMgr::getInstance()->selectionSetMedia( LLTextureEntry::MF_HAS_MEDIA, settings );
sInstance->mPanelMediaSettingsGeneral->postApply();
sInstance->mPanelMediaSettingsSecurity->postApply();
sInstance->mPanelMediaSettingsPermissions->postApply();
}
}
////////////////////////////////////////////////////////////////////////////////
void LLFloaterMediaSettings::onClose(bool app_quitting)
{
if(mPanelMediaSettingsGeneral)
{
mPanelMediaSettingsGeneral->onClose(app_quitting);
}
if(LLFloaterWhiteListEntry::instanceExists())
LLFloaterWhiteListEntry::getInstance()->close(app_quitting);
LLFloater::onClose(app_quitting);
}
////////////////////////////////////////////////////////////////////////////////
//static
void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editable )
{
if (sInstance->hasFocus()) return;
sInstance->clearValues(editable);
// update all panels with values from simulator
sInstance->mPanelMediaSettingsGeneral->
initValues( sInstance->mPanelMediaSettingsGeneral, media_settings, editable );
sInstance->mPanelMediaSettingsSecurity->
initValues( sInstance->mPanelMediaSettingsSecurity, media_settings, editable );
sInstance->mPanelMediaSettingsPermissions->
initValues( sInstance->mPanelMediaSettingsPermissions, media_settings, editable );
// Squirrel away initial values
sInstance->mInitialValues.clear();
sInstance->mPanelMediaSettingsGeneral->getValues( sInstance->mInitialValues );
sInstance->mPanelMediaSettingsSecurity->getValues( sInstance->mInitialValues );
sInstance->mPanelMediaSettingsPermissions->getValues( sInstance->mInitialValues );
sInstance->mApplyBtn->setEnabled(editable);
sInstance->mOKBtn->setEnabled(editable);
}
////////////////////////////////////////////////////////////////////////////////
//
void LLFloaterMediaSettings::commitFields()
{
if (hasFocus())
{
LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
if (cur_focus && cur_focus->acceptsTextInput())
{
cur_focus->onCommit();
};
};
}
////////////////////////////////////////////////////////////////////////////////
//static
void LLFloaterMediaSettings::clearValues( bool editable)
{
if (sInstance)
{
// clean up all panels before updating
sInstance->mPanelMediaSettingsGeneral ->clearValues(sInstance->mPanelMediaSettingsGeneral, editable);
sInstance->mPanelMediaSettingsSecurity ->clearValues(sInstance->mPanelMediaSettingsSecurity, editable);
sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions, editable);
}
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLFloaterMediaSettings::onBtnOK( void* userdata )
{
sInstance->commitFields();
sInstance->apply();
sInstance->close();
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLFloaterMediaSettings::onBtnApply( void* userdata )
{
sInstance->commitFields();
sInstance->apply();
sInstance->mInitialValues.clear();
sInstance->mPanelMediaSettingsGeneral->getValues( sInstance->mInitialValues );
sInstance->mPanelMediaSettingsSecurity->getValues( sInstance->mInitialValues );
sInstance->mPanelMediaSettingsPermissions->getValues( sInstance->mInitialValues );
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLFloaterMediaSettings::onBtnCancel( void* userdata )
{
sInstance->close();
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLFloaterMediaSettings::onTabChanged(void* user_data, bool from_click)
{
LLTabContainer* self = (LLTabContainer*)user_data;
gSavedSettings.setS32("LastMediaSettingsTab", self->getCurrentPanelIndex());
}
////////////////////////////////////////////////////////////////////////////////
//
const std::string LLFloaterMediaSettings::getHomeUrl()
{
if ( mPanelMediaSettingsGeneral )
return mPanelMediaSettingsGeneral->getHomeUrl();
else
return std::string( "" );
}
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLFloaterMediaSettings::draw()
{
if (NULL != mApplyBtn)
{
// Set the enabled state of the "Apply" button if values changed
mApplyBtn->setEnabled( haveValuesChanged() );
}
LLFloater::draw();
}
//private
bool LLFloaterMediaSettings::haveValuesChanged() const
{
bool values_changed = false;
// *NOTE: The code below is very inefficient. Better to do this
// only when data change.
// Every frame, check to see what the values are. If they are not
// the same as the initial media data, enable the OK/Apply buttons
LLSD settings;
sInstance->mPanelMediaSettingsGeneral->getValues( settings );
sInstance->mPanelMediaSettingsSecurity->getValues( settings );
sInstance->mPanelMediaSettingsPermissions->getValues( settings );
LLSD::map_const_iterator iter = settings.beginMap();
LLSD::map_const_iterator end = settings.endMap();
for ( ; iter != end; ++iter )
{
const std::string &current_key = iter->first;
const LLSD &current_value = iter->second;
if ( ! llsd_equals(current_value, mInitialValues[current_key]))
{
values_changed = true;
break;
}
}
return values_changed;
}
bool LLFloaterMediaSettings::instanceExists()
{
return sInstance;
}

View File

@@ -0,0 +1,89 @@
/**
* @file llfloatermediasettings.cpp
* @brief Tabbed dialog for media settings - class definition
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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_LLFLOATERMEDIASETTINGS_H
#define LL_LLFLOATERMEDIASETTINGS_H
#include "llfloater.h"
#include "lltabcontainer.h"
class LLPanelMediaSettingsGeneral;
class LLPanelMediaSettingsSecurity;
class LLPanelMediaSettingsPermissions;
class LLFloaterMediaSettings :
public LLFloater
{
public:
LLFloaterMediaSettings(const LLSD& key);
~LLFloaterMediaSettings();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onClose(bool app_quitting);
static LLFloaterMediaSettings* getInstance();
static bool instanceExists();
static void apply();
static void initValues( const LLSD& media_settings , bool editable);
static void clearValues( bool editable);
LLPanelMediaSettingsSecurity* getPanelSecurity(){return mPanelMediaSettingsSecurity;};
const std::string getHomeUrl();
//bool passesWhiteList( const std::string& test_url );
virtual void draw();
bool mIdenticalHasMediaInfo;
bool mMultipleMedia;
bool mMultipleValidMedia;
protected:
LLButton *mOKBtn;
LLButton *mCancelBtn;
LLButton *mApplyBtn;
LLTabContainer *mTabContainer;
LLPanelMediaSettingsGeneral* mPanelMediaSettingsGeneral;
LLPanelMediaSettingsSecurity* mPanelMediaSettingsSecurity;
LLPanelMediaSettingsPermissions* mPanelMediaSettingsPermissions;
static void onBtnOK(void*);
static void onBtnCancel(void*);
static void onBtnApply(void*);
static void onTabChanged(void* user_data, bool from_click);
void commitFields();
static LLFloaterMediaSettings* sInstance;
private:
bool haveValuesChanged() const;
LLSD mInitialValues;
bool mWaitingToClose;
};
#endif // LL_LLFLOATERMEDIASETTINGS_H

View File

@@ -43,7 +43,7 @@
const S32 NOTIFICATION_PANEL_HEADER_HEIGHT = 20;
const S32 HEADER_PADDING = 38;
class LLNotificationChannelPanel : public LLPanel
class LLNotificationChannelPanel : public LLLayoutPanel
{
public:
LLNotificationChannelPanel(const std::string& channel_name);
@@ -59,8 +59,9 @@ private:
};
LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channel_name)
: LLPanel(channel_name)
: LLLayoutPanel(NOTIFICATION_PANEL_HEADER_HEIGHT,true,true)
{
setName(channel_name);
mChannelPtr = LLNotifications::instance().getChannel(channel_name);
mChannelRejectsPtr = LLNotificationChannelPtr(
LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(), !boost::bind(mChannelPtr->getFilter(), _1)));
@@ -203,7 +204,7 @@ void LLFloaterNotificationConsole::addChannel(const std::string& name, bool open
{
LLLayoutStack& stack = getChildRef<LLLayoutStack>("notification_channels");
LLNotificationChannelPanel* panelp = new LLNotificationChannelPanel(name);
stack.addPanel(panelp, 0, NOTIFICATION_PANEL_HEADER_HEIGHT, TRUE, TRUE, LLLayoutStack::ANIMATE);
stack.addPanel(panelp, LLLayoutStack::ANIMATE);
LLButton& header_button = panelp->getChildRef<LLButton>("header");
header_button.setToggleState(!open);
@@ -217,7 +218,7 @@ void LLFloaterNotificationConsole::removeChannel(const std::string& name)
LLPanel* panelp = getChild<LLPanel>(name, TRUE, FALSE);
if (panelp)
{
getChildRef<LLLayoutStack>("notification_channels").removePanel(panelp);
getChildRef<LLLayoutStack>("notification_channels").removeChild(panelp);
delete panelp;
}

View File

@@ -124,6 +124,7 @@ public:
static void closeWithoutSaving();
protected:
friend class LLPanelNearByMedia;
LLPreferenceCore *mPreferenceCore;
/*virtual*/ void onClose(bool app_quitting);

File diff suppressed because it is too large Load Diff

View File

@@ -49,6 +49,7 @@ class LLPanelLandInfo;
class LLSlider;
class LLTabContainer;
class LLTextBox;
class LLMediaCtrl;
class LLTool;
class LLParcelSelection;
class LLObjectSelection;
@@ -71,11 +72,11 @@ public:
LLFloaterTools();
virtual ~LLFloaterTools();
virtual void onOpen();
virtual BOOL canClose();
virtual void onClose(bool app_quitting);
/*virtual*/ void onOpen();
/*virtual*/ BOOL canClose();
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void draw();
virtual void onFocusReceived();
/*virtual*/ void onFocusReceived();
// call this once per frame to handle visibility, rect location,
// button highlights, etc.
@@ -100,13 +101,25 @@ public:
void setStatusText(const std::string& text);
static void setEditTool(void* data);
void setTool(const LLSD& user_data);
void saveLastTool();
void onClickBtnDeleteMedia();
void onClickBtnAddMedia();
void onClickBtnEditMedia();
void clearMediaSettings();
void updateMediaTitle();
void navigateToTitleMedia( const std::string url );
bool selectedMediaEditable();
private:
void refresh();
void refreshMedia();
void getMediaState();
void updateMediaSettings();
static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response);
static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
static void setObjectType( LLPCode pcode );
static void onClickGridOptions(void* data);
void onClickGridOptions();
public:
LLButton *mBtnFocus;
@@ -190,6 +203,8 @@ public:
LLParcelSelectionHandle mParcelSelection;
LLObjectSelectionHandle mObjectSelection;
LLMediaCtrl *mTitleMedia;
bool mNeedMediaTitle;
private:
BOOL mDirty;
@@ -197,6 +212,8 @@ private:
void updateTreeGrassCombo(bool visible);
static void onSelectTreesGrass(LLUICtrl*, void*);
protected:
LLSD mMediaSettings;
};
extern LLFloaterTools *gFloaterTools;

View File

@@ -174,7 +174,7 @@ void LLFloaterWater::onClickHelp(void* data)
LLFloaterWater* self = LLFloaterWater::instance();
const std::string* xml_alert = (std::string*)data;
LLNotifications::instance().add(self->contextualNotification(*xml_alert));
self->addContextualNotification(*xml_alert);
}
void LLFloaterWater::initHelpBtn(const std::string& name, const std::string& xml_alert)

View File

@@ -0,0 +1,91 @@
/**
* @file llfloaterwhitelistentry.cpp
* @brief LLFloaterWhistListEntry class implementation
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "llfloatermediasettings.h"
#include "llfloaterwhitelistentry.h"
#include "llpanelmediasettingssecurity.h"
#include "lluictrlfactory.h"
#include "llwindow.h"
#include "llviewerwindow.h"
#include "lllineeditor.h"
///////////////////////////////////////////////////////////////////////////////
//
LLFloaterWhiteListEntry::LLFloaterWhiteListEntry() :
LLFloater()
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_whitelist_entry.xml");
}
///////////////////////////////////////////////////////////////////////////////
//
LLFloaterWhiteListEntry::~LLFloaterWhiteListEntry()
{
}
///////////////////////////////////////////////////////////////////////////////
//
BOOL LLFloaterWhiteListEntry::postBuild()
{
mWhiteListEdit = getChild<LLLineEditor>("whitelist_entry");
childSetAction("cancel_btn", onBtnCancel, this);
childSetAction("ok_btn", onBtnOK, this);
setDefaultBtn("ok_btn");
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
// static
void LLFloaterWhiteListEntry::onBtnOK( void* userdata )
{
LLFloaterWhiteListEntry *self =(LLFloaterWhiteListEntry *)userdata;
LLPanelMediaSettingsSecurity* panel = LLFloaterMediaSettings::instanceExists() ? LLFloaterMediaSettings::getInstance()->getPanelSecurity() : NULL;
if ( panel )
{
std::string white_list_item = self->mWhiteListEdit->getText();
panel->addWhiteListEntry( white_list_item );
panel->updateWhitelistEnableStatus();
};
self->close();
}
///////////////////////////////////////////////////////////////////////////////
// static
void LLFloaterWhiteListEntry::onBtnCancel( void* userdata )
{
LLFloaterWhiteListEntry *self =(LLFloaterWhiteListEntry *)userdata;
self->close();
}

View File

@@ -0,0 +1,50 @@
/**
* @file llfloaterwhitelistentry.h
* @brief LLFloaterWhiteListEntry class definition
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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_LLFLOATERWHITELISTENTRY_H
#define LL_LLFLOATERWHITELISTENTRY_H
#include "llfloater.h"
class LLLineEditor;
class LLFloaterWhiteListEntry :
public LLFloater, public LLSingleton<LLFloaterWhiteListEntry>
{
public:
LLFloaterWhiteListEntry();
~LLFloaterWhiteListEntry();
BOOL postBuild();
private:
LLLineEditor* mWhiteListEdit;
static void onBtnOK(void*);
static void onBtnCancel(void*);
};
#endif // LL_LLFLOATERWHITELISTENTRY_H

View File

@@ -231,7 +231,7 @@ void LLFloaterWindLight::onClickHelp(void* data)
LLFloaterWindLight* self = LLFloaterWindLight::instance();
const std::string xml_alert = *(std::string*)data;
LLNotifications::instance().add(self->contextualNotification(xml_alert));
self->addContextualNotification(xml_alert);
}
void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& xml_alert)

View File

@@ -70,6 +70,9 @@
#include "llviewertexturelist.h"
//#include "lltoolobjpicker.h"
#include "llhudmanager.h" // HACK for creating flex obj's
#include "llviewermenu.h"
#include "llviewermedia.h"
#include "llmediaentry.h"
#include "llhudmanager.h" // For testing effects
#include "llhudeffect.h"
@@ -294,201 +297,257 @@ void LLHoverView::updateText()
//
BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip");
LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode();;
LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode();
if (nodep)
{
line.clear();
if (nodep->mName.empty())
{
line.append(LLTrans::getString("TooltipNoName"));
}
else
{
line.append( nodep->mName );
}
mText.push_back(line);
if (!nodep->mDescription.empty()
&& nodep->mDescription != DEFAULT_DESC)
bool for_copy = nodep->mValid && nodep->mPermissions->getMaskEveryone() & PERM_COPY && hit_object && hit_object->permCopy();
bool for_sale = nodep->mValid && for_sale_selection(nodep);
bool has_media = false;
bool is_time_based_media = false;
bool is_web_based_media = false;
bool is_media_playing = false;
bool is_media_displaying = false;
// Does this face have media?
const LLTextureEntry* tep = hit_object ? hit_object->getTE(mLastPickInfo.mObjectFace) : NULL;
if(tep)
{
mText.push_back( nodep->mDescription );
}
// Line: "Owner: James Linden"
line.clear();
line.append(LLTrans::getString("TooltipOwner") + " ");
if (nodep->mValid)
{
LLUUID owner;
std::string name;
if (!nodep->mPermissions->isGroupOwned())
has_media = tep->hasMedia();
const LLMediaEntry* mep = has_media ? tep->getMediaData() : NULL;
if (mep)
{
owner = nodep->mPermissions->getOwner();
if (LLUUID::null == owner)
viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());
LLPluginClassMedia* media_plugin = NULL;
if (media_impl.notNull() && (media_impl->hasMedia()))
{
line.append(LLTrans::getString("TooltipPublic"));
}
else if(LLAvatarNameCache::getPNSName(owner, name))
{
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
name = RlvStrings::getAnonym(name);
is_media_displaying = true;
//LLStringUtil::format_map_t args;
media_plugin = media_impl->getMediaPlugin();
if(media_plugin)
{
if(media_plugin->pluginSupportsMediaTime())
{
is_time_based_media = true;
is_web_based_media = false;
//args["[CurrentURL]"] = media_impl->getMediaURL();
is_media_playing = media_impl->isMediaPlaying();
}
else
{
is_time_based_media = false;
is_web_based_media = true;
//args["[CurrentURL]"] = media_plugin->getLocation();
}
//tooltip_msg.append(LLTrans::getString("CurrentURL", args));
}
// [/RLVa:KB]
}
}
}
line.append(name);
// Avoid showing tip over media that's displaying unless it's for sale
// also check the primary node since sometimes it can have an action even though
// the root node doesn't
if(!suppressObjectHoverDisplay || !is_media_displaying || for_sale)
{
if (nodep->mName.empty())
{
line.append(LLTrans::getString("TooltipNoName"));
}
else
{
line.append( nodep->mName );
}
mText.push_back(line);
if (!nodep->mDescription.empty()
&& nodep->mDescription != DEFAULT_DESC)
{
mText.push_back( nodep->mDescription );
}
// Line: "Owner: James Linden"
line.clear();
line.append(LLTrans::getString("TooltipOwner") + " ");
if (nodep->mValid)
{
LLUUID owner;
std::string name;
if (!nodep->mPermissions->isGroupOwned())
{
owner = nodep->mPermissions->getOwner();
if (LLUUID::null == owner)
{
line.append(LLTrans::getString("TooltipPublic"));
}
else if(LLAvatarNameCache::getPNSName(owner, name))
{
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
name = RlvStrings::getAnonym(name);
}
// [/RLVa:KB]
line.append(name);
}
else
{
line.append(LLTrans::getString("RetrievingData"));
}
}
else
{
line.append(LLTrans::getString("RetrievingData"));
std::string name;
owner = nodep->mPermissions->getGroup();
if (gCacheName->getGroupName(owner, name))
{
line.append(name);
line.append(LLTrans::getString("TooltipIsGroup"));
}
else
{
line.append(LLTrans::getString("RetrievingData"));
}
}
}
else
{
std::string name;
owner = nodep->mPermissions->getGroup();
if (gCacheName->getGroupName(owner, name))
{
line.append(name);
line.append(LLTrans::getString("TooltipIsGroup"));
}
else
{
line.append(LLTrans::getString("RetrievingData"));
}
}
}
else
{
line.append(LLTrans::getString("RetrievingData"));
}
mText.push_back(line);
// Build a line describing any special properties of this object.
LLViewerObject *object = hit_object;
LLViewerObject *parent = (LLViewerObject *)object->getParent();
if (object &&
(object->flagUsePhysics() ||
object->flagScripted() ||
object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ||
object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ||
object->flagAllowInventoryAdd() ||
object->flagTemporary() ||
object->flagPhantom()) )
{
line.clear();
if (object->flagScripted())
{
line.append(LLTrans::getString("TooltipFlagScript") + " ");
}
if (object->flagUsePhysics())
{
line.append(LLTrans::getString("TooltipFlagPhysics") + " ");
}
if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) )
{
line.append(LLTrans::getString("TooltipFlagTouch") + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) )
{
line.append(gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagAllowInventoryAdd())
{
line.append(LLTrans::getString("TooltipFlagDropInventory") + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagPhantom())
{
line.append(LLTrans::getString("TooltipFlagPhantom") + " ");
}
if (object->flagTemporary())
{
line.append(LLTrans::getString("TooltipFlagTemporary") + " ");
}
if (object->flagUsePhysics() ||
object->flagHandleTouch() ||
(parent && parent->flagHandleTouch()) )
{
line.append(LLTrans::getString("TooltipFlagRightClickMenu") + " ");
line.append(LLTrans::getString("RetrievingData"));
}
mText.push_back(line);
}
// Free to copy / For Sale: L$
line.clear();
if (nodep->mValid)
{
BOOL for_copy = nodep->mPermissions->getMaskEveryone() & PERM_COPY && object->permCopy();
BOOL for_sale = nodep->mSaleInfo.isForSale() &&
nodep->mPermissions->getMaskOwner() & PERM_TRANSFER &&
(nodep->mPermissions->getMaskOwner() & PERM_COPY ||
nodep->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY);
if (for_copy)
// Build a line describing any special properties of this object.
LLViewerObject *object = hit_object;
LLViewerObject *parent = (LLViewerObject *)object->getParent();
if (object &&
(object->flagUsePhysics() ||
object->flagScripted() ||
object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ||
object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ||
object->flagAllowInventoryAdd() ||
object->flagTemporary() ||
object->flagPhantom()) )
{
line.append(LLTrans::getString("TooltipFreeToCopy"));
suppressObjectHoverDisplay = FALSE; // Show tip
line.clear();
if (object->flagScripted())
{
line.append(LLTrans::getString("TooltipFlagScript") + " ");
}
if (object->flagUsePhysics())
{
line.append(LLTrans::getString("TooltipFlagPhysics") + " ");
}
if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) )
{
line.append(LLTrans::getString("TooltipFlagTouch") + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) )
{
line.append(gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagAllowInventoryAdd())
{
line.append(LLTrans::getString("TooltipFlagDropInventory") + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagPhantom())
{
line.append(LLTrans::getString("TooltipFlagPhantom") + " ");
}
if (object->flagTemporary())
{
line.append(LLTrans::getString("TooltipFlagTemporary") + " ");
}
if (object->flagUsePhysics() ||
object->flagHandleTouch() ||
(parent && parent->flagHandleTouch()) )
{
line.append(LLTrans::getString("TooltipFlagRightClickMenu") + " ");
}
mText.push_back(line);
}
else if (for_sale)
// Free to copy / For Sale: L$
line.clear();
if (nodep->mValid)
{
LLStringUtil::format_map_t args;
args["[AMOUNT]"] = llformat("%d", nodep->mSaleInfo.getSalePrice());
line.append(LLTrans::getString("TooltipForSaleL$", args));
suppressObjectHoverDisplay = FALSE; // Show tip
if (for_copy)
{
line.append(LLTrans::getString("TooltipFreeToCopy"));
suppressObjectHoverDisplay = FALSE; // Show tip
}
else if (for_sale)
{
LLStringUtil::format_map_t args;
args["[AMOUNT]"] = llformat("%d", nodep->mSaleInfo.getSalePrice());
line.append(LLTrans::getString("TooltipForSaleL$", args));
suppressObjectHoverDisplay = FALSE; // Show tip
}
else
{
// Nothing if not for sale
// line.append("Not for sale");
}
}
else
{
// Nothing if not for sale
// line.append("Not for sale");
LLStringUtil::format_map_t args;
args["[MESSAGE]"] = LLTrans::getString("RetrievingData");
line.append(LLTrans::getString("TooltipForSaleMsg", args));
}
mText.push_back(line);
line.clear();
S32 prim_count = LLSelectMgr::getInstance()->getHoverObjects()->getObjectCount();
line.append(llformat("Prims: %d", prim_count));
mText.push_back(line);
line.clear();
line.append("Position: ");
LLViewerRegion *region = gAgent.getRegion();
LLVector3 position = region->getPosRegionFromGlobal(hit_object->getPositionGlobal());//regionp->getOriginAgent();
LLVector3 mypos = region->getPosRegionFromGlobal(gAgent.getPositionGlobal());
LLVector3 delta = position - mypos;
F32 distance = (F32)delta.magVec();
line.append(llformat("<%.02f,%.02f,%.02f>",position.mV[0],position.mV[1],position.mV[2]));
mText.push_back(line);
line.clear();
line.append(llformat("Distance: %.02fm",distance));
mText.push_back(line);
}
else
{
LLStringUtil::format_map_t args;
args["[MESSAGE]"] = LLTrans::getString("RetrievingData");
line.append(LLTrans::getString("TooltipForSaleMsg", args));
suppressObjectHoverDisplay = TRUE;
}
// If the hover tip shouldn't be shown, delete all the object text
if (suppressObjectHoverDisplay)
{
mText.clear();
}
mText.push_back(line);
}
line.clear();
S32 prim_count = LLSelectMgr::getInstance()->getHoverObjects()->getObjectCount();
line.append(llformat("Prims: %d", prim_count));
mText.push_back(line);
line.clear();
line.append("Position: ");
LLViewerRegion *region = gAgent.getRegion();
LLVector3 position = region->getPosRegionFromGlobal(hit_object->getPositionGlobal());//regionp->getOriginAgent();
LLVector3 mypos = region->getPosRegionFromGlobal(gAgent.getPositionGlobal());
LLVector3 delta = position - mypos;
F32 distance = (F32)delta.magVec();
line.append(llformat("<%.02f,%.02f,%.02f>",position.mV[0],position.mV[1],position.mV[2]));
mText.push_back(line);
line.clear();
line.append(llformat("Distance: %.02fm",distance));
mText.push_back(line);
// If the hover tip shouldn't be shown, delete all the object text
if (suppressObjectHoverDisplay)
{
mText.clear();
}
}
}

View File

@@ -48,6 +48,7 @@
#include "llpreview.h" // For LLMultiPreview
#include "lltrans.h"
#include "llvoavatarself.h"
#include "llnotifications.h"
extern LLUUID gAgentID;

View File

@@ -331,9 +331,6 @@ LLXMLNodePtr LLJoystickAgentTurn::getXML(bool save_children) const
LLView* LLJoystickAgentTurn::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("button");
node->getAttributeString("name", name);
std::string image_unselected;
if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected);
@@ -343,7 +340,7 @@ LLView* LLJoystickAgentTurn::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrl
EJoystickQuadrant quad = JQ_ORIGIN;
if (node->hasAttribute("quadrant")) quad = selectQuadrant(node);
LLJoystickAgentTurn *button = new LLJoystickAgentTurn(name,
LLJoystickAgentTurn *button = new LLJoystickAgentTurn("button",
LLRect(),
image_unselected,
image_selected,
@@ -449,9 +446,6 @@ LLXMLNodePtr LLJoystickAgentSlide::getXML(bool save_children) const
// static
LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("button");
node->getAttributeString("name", name);
std::string image_unselected;
if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected);
@@ -462,7 +456,7 @@ LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtr
EJoystickQuadrant quad = JQ_ORIGIN;
if (node->hasAttribute("quadrant")) quad = selectQuadrant(node);
LLJoystickAgentSlide *button = new LLJoystickAgentSlide(name,
LLJoystickAgentSlide *button = new LLJoystickAgentSlide("button",
LLRect(),
image_unselected,
image_selected,

View File

@@ -102,7 +102,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
mHomePageMimeType(p.initial_mime_type),
mErrorPageURL(p.error_page_url),
mTrusted(p.trusted_content),
mHoverTextChanged(false)
mHoverTextChanged(false),
mContextMenu()
{
{
LLColor4 color = p.caret_color().get();
@@ -308,6 +309,14 @@ BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
setFocus( TRUE );
}
LLMenuGL* menu = (LLMenuGL*)mContextMenu.get();
if (menu)
{
menu->buildDrawLabels();
menu->updateParent(LLMenuGL::sMenuContainer);
LLMenuGL::showPopup(this,menu, x, y);
}
return TRUE;
}
@@ -370,6 +379,12 @@ void LLMediaCtrl::onFocusLost()
//
BOOL LLMediaCtrl::postBuild ()
{
LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_media_ctrl.xml",LLMenuGL::sMenuContainer);
if(menu)
{
mContextMenu = menu->getHandle();
}
setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
return true;
}
@@ -1161,7 +1176,7 @@ LLView* LLMediaCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
if(node->getAttributeBOOL("focus_on_click", bval))
p.focus_on_click = bval;
if(node->getAttributeBOOL("decouple_texture_size", bval))
p.focus_on_click = bval;
p.decouple_texture_size = bval;
if(node->getAttributeBOOL("trusted_content", bval))
p.trusted_content = bval;
if(node->getAttributeS32("texture_width", ival))

View File

@@ -209,6 +209,7 @@ public:
viewer_media_t mMediaSource;
S32 mTextureWidth,
mTextureHeight;
LLHandle<LLView> mContextMenu;
};
#endif // LL_LLMediaCtrl_H

View File

@@ -46,20 +46,18 @@
// statics
std::set<LLNameBox*> LLNameBox::sInstances;
static LLRegisterWidget<LLNameBox> r("name_box");
LLNameBox::LLNameBox(const std::string& name, const LLRect& rect, const LLUUID& name_id, BOOL is_group, const LLFontGL* font, BOOL mouse_opaque)
: LLTextBox(name, rect, std::string("(retrieving)"), font, mouse_opaque),
mNameID(name_id)
LLNameBox::LLNameBox(const std::string& name)
: LLTextBox(name, LLRect(), "" , NULL, TRUE)
{
mNameID = LLUUID::null;
mLink = false;
//mParseHTML = mLink; // STORM-215
mInitialValue = "(retrieving)";
LLNameBox::sInstances.insert(this);
if(!name_id.isNull())
{
setNameID(name_id, is_group);
}
else
{
setText(LLStringUtil::null);
}
setText(LLStringUtil::null);
}
LLNameBox::~LLNameBox()
@@ -72,25 +70,30 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group)
mNameID = name_id;
std::string name;
BOOL got_name = FALSE;
if (!is_group)
{
gCacheName->getFullName(name_id, name);
got_name = gCacheName->getFullName(name_id, name);
}
else
{
gCacheName->getGroupName(name_id, name);
got_name = gCacheName->getGroupName(name_id, name);
}
setText(name);
// Got the name already? Set it.
// Otherwise it will be set later in refresh().
if (got_name)
setName(name, is_group);
else
setText(mInitialValue);
}
void LLNameBox::refresh(const LLUUID& id, const std::string& full_name, bool is_group)
{
if (id == mNameID)
{
setText(full_name);
setName(full_name, is_group);
}
}
@@ -105,3 +108,39 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& full_name, bool
box->refresh(id, full_name, is_group);
}
}
void LLNameBox::setName(const std::string& name, BOOL is_group)
{
if (mLink)
{
std::string url;
if (is_group)
url = "[secondlife:///app/group/" + mNameID.asString() + "/about " + name + "]";
else
url = "[secondlife:///app/agent/" + mNameID.asString() + "/about " + name + "]";
setText(url);
}
else
{
setText(name);
}
}
// virtual
void LLNameBox::initFromXML(LLXMLNodePtr node, LLView* parent)
{
LLTextBox::initFromXML(node, parent);
node->getAttributeBOOL("link", mLink);
node->getAttributeString("initial_value", mInitialValue);
}
// static
LLView* LLNameBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
LLNameBox* name_box = new LLNameBox("name_box");
name_box->initFromXML(node,parent);
return name_box;
}

View File

@@ -44,10 +44,9 @@ class LLNameBox
: public LLTextBox
{
public:
LLNameBox(const std::string& name, const LLRect& rect, const LLUUID& name_id = LLUUID::null, BOOL is_group = FALSE, const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE );
// By default, follows top and left and is mouse-opaque.
// If no text, text = name.
// If no font, uses default system font.
virtual void initFromXML(LLXMLNodePtr node, LLView* parent);
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
virtual ~LLNameBox();
void setNameID(const LLUUID& name_id, BOOL is_group);
@@ -56,11 +55,19 @@ public:
static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
protected:
LLNameBox (const std::string& name);
friend class LLUICtrlFactory;
private:
void setName(const std::string& name, BOOL is_group);
static std::set<LLNameBox*> sInstances;
private:
LLUUID mNameID;
BOOL mLink;
std::string mInitialValue;
};

View File

@@ -132,9 +132,6 @@ LLXMLNodePtr LLNameEditor::getXML(bool save_children) const
LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("name_editor");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -143,7 +140,7 @@ LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
LLFontGL* font = LLView::selectFont(node);
LLNameEditor* line_editor = new LLNameEditor(name,
LLNameEditor* line_editor = new LLNameEditor("name_editor",
rect,
LLUUID::null, FALSE,
font,

View File

@@ -319,9 +319,6 @@ LLXMLNodePtr LLNameListCtrl::getXML(bool save_children) const
LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("name_list");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent, LLRect());
@@ -337,7 +334,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
S32 name_column_index = 0;
node->getAttributeS32("name_column_index", name_column_index);
LLNameListCtrl* name_list = new LLNameListCtrl(name,
LLNameListCtrl* name_list = new LLNameListCtrl("name_list",
rect,
multi_select,
draw_border,

View File

@@ -69,7 +69,7 @@
#include "llmediactrl.h"
#include "llselectmgr.h"
#include "wlfPanel_AdvSettings.h"
#include "llpanelnearbymedia.h"
@@ -90,7 +90,6 @@ LLOverlayBar *gOverlayBar = NULL;
extern S32 MENU_BAR_HEIGHT;
extern ImportTracker gImportTracker;
BOOL LLOverlayBar::sAdvSettingsPopup;
BOOL LLOverlayBar::sChatVisible;
//
@@ -115,9 +114,7 @@ void* LLOverlayBar::createVoiceRemote(void* userdata)
void* LLOverlayBar::createAdvSettings(void* userdata)
{
LLOverlayBar *self = (LLOverlayBar*)userdata;
self->mAdvSettings = new wlfPanel_AdvSettings();
return self->mAdvSettings;
return wlfPanel_AdvSettings::getInstance();
}
void* LLOverlayBar::createAORemote(void* userdata)
@@ -134,7 +131,7 @@ void* LLOverlayBar::createChatBar(void* userdata)
}
LLOverlayBar::LLOverlayBar()
: LLPanel(),
: LLLayoutPanel(),
mMediaRemote(NULL),
mVoiceRemote(NULL),
mAORemote(NULL),
@@ -156,11 +153,21 @@ LLOverlayBar::LLOverlayBar()
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map);
}
bool updateAdvSettingsPopup(const LLSD &data)
bool LLOverlayBar::updateAdvSettingsPopup()
{
LLOverlayBar::sAdvSettingsPopup = gSavedSettings.getBOOL("wlfAdvSettingsPopup");
gOverlayBar->childSetVisible("AdvSettings_container", !LLOverlayBar::sAdvSettingsPopup);
gOverlayBar->childSetVisible("AdvSettings_container_exp", LLOverlayBar::sAdvSettingsPopup);
bool wfl_adv_settings_popup = gSavedSettings.getBOOL("wlfAdvSettingsPopup");
wlfPanel_AdvSettings::updateClass();
if(LLLayoutStack* layout_stack = findChild<LLLayoutStack>("overlay_layout_panel"))
{
LLLayoutPanel* layout_panel = layout_stack->findChild<LLLayoutPanel>("AdvSettings_container");
if(layout_panel)
{
layout_stack->collapsePanel(layout_panel,!wfl_adv_settings_popup);
if(wfl_adv_settings_popup)
layout_panel->setTargetDim(layout_panel->getChild<LLView>("Adv_Settings")->getBoundingRect().getWidth());
}
}
return true;
}
@@ -176,6 +183,11 @@ bool updateAORemote(const LLSD &data)
return true;
}
bool updateNearbyMediaFloater(const LLSD &data)
{
LLFloaterNearbyMedia::updateClass();
return true;
}
BOOL LLOverlayBar::postBuild()
{
@@ -204,16 +216,16 @@ BOOL LLOverlayBar::postBuild()
layoutButtons();
sAdvSettingsPopup = gSavedSettings.getBOOL("wlfAdvSettingsPopup");
sChatVisible = gSavedSettings.getBOOL("ChatVisible");
gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(boost::bind(&updateAdvSettingsPopup,_2));
gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(boost::bind(&LLOverlayBar::updateAdvSettingsPopup,this));
gSavedSettings.getControl("ChatVisible")->getSignal()->connect(boost::bind(&updateChatVisible,_2));
gSavedSettings.getControl("EnableAORemote")->getSignal()->connect(boost::bind(&updateAORemote,_2));
childSetVisible("AdvSettings_container", !sAdvSettingsPopup);
childSetVisible("AdvSettings_container_exp", sAdvSettingsPopup);
gSavedSettings.getControl("ShowNearbyMediaFloater")->getSignal()->connect(boost::bind(&updateNearbyMediaFloater,_2));
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
updateAdvSettingsPopup();
return TRUE;
}
@@ -342,7 +354,6 @@ void LLOverlayBar::refresh()
childSetVisible("media_remote_container", FALSE);
childSetVisible("voice_remote_container", FALSE);
childSetVisible("AdvSettings_container", FALSE);
childSetVisible("AdvSettings_container_exp", FALSE);
childSetVisible("ao_remote_container", FALSE);
childSetVisible("state_management_buttons_container", FALSE);
}
@@ -351,8 +362,7 @@ void LLOverlayBar::refresh()
// update "remotes"
childSetVisible("media_remote_container", TRUE);
childSetVisible("voice_remote_container", LLVoiceClient::getInstance()->voiceEnabled());
childSetVisible("AdvSettings_container", !sAdvSettingsPopup);//!gSavedSettings.getBOOL("wlfAdvSettingsPopup"));
childSetVisible("AdvSettings_container_exp", sAdvSettingsPopup);//gSavedSettings.getBOOL("wlfAdvSettingsPopup"));
childSetVisible("AdvSettings_container", TRUE);
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
childSetVisible("state_management_buttons_container", TRUE);
}

View File

@@ -34,6 +34,7 @@
#define LL_LLOVERLAYBAR_H
#include "llpanel.h"
#include "lllayoutstack.h"
// "Constants" loaded from settings.xml at start time
extern S32 STATUS_BAR_HEIGHT;
@@ -55,7 +56,7 @@ class AORemoteCtrl;
class LLChatBar;
class LLOverlayBar
: public LLPanel
: public LLLayoutPanel
{
public:
LLOverlayBar();
@@ -98,7 +99,6 @@ public:
void setCancelTPButtonVisible(BOOL b, const std::string& label);
static BOOL sChatVisible;
static BOOL sAdvSettingsPopup;
protected:
static void* createMediaRemote(void* userdata);
static void* createVoiceRemote(void* userdata);
@@ -109,10 +109,10 @@ protected:
void enableMediaButtons();
protected:
friend class LLFloaterNearbyMedia; //Crappy workaround to access mMediaRemote
LLMediaRemoteCtrl* mMediaRemote;
LLVoiceRemoteCtrl* mVoiceRemote;
LLButton* mCancelBtn;
wlfPanel_AdvSettings* mAdvSettings;
AORemoteCtrl* mAORemote;
bool mBuilt; // dialog constructed yet?
enum { STOPPED=0, PLAYING=1, PAUSED=2 };
@@ -130,8 +130,8 @@ protected:
private:
/*static void updateAdvSettingsPopup(const LLSD &data);
static void updateChatVisible(const LLSD &data);*/
bool updateAdvSettingsPopup();
//static void updateChatVisible(const LLSD &data);
};

View File

@@ -82,6 +82,13 @@
//
// Globals
//
const char* LLPanelContents::TENTATIVE_SUFFIX = "_tentative";
const char* LLPanelContents::PERMS_OWNER_INTERACT_KEY = "perms_owner_interact";
const char* LLPanelContents::PERMS_OWNER_CONTROL_KEY = "perms_owner_control";
const char* LLPanelContents::PERMS_GROUP_INTERACT_KEY = "perms_group_interact";
const char* LLPanelContents::PERMS_GROUP_CONTROL_KEY = "perms_group_control";
const char* LLPanelContents::PERMS_ANYONE_INTERACT_KEY = "perms_anyone_interact";
const char* LLPanelContents::PERMS_ANYONE_CONTROL_KEY = "perms_anyone_control";
BOOL LLPanelContents::postBuild()
{

View File

@@ -54,6 +54,17 @@ public:
static void onClickNewScript( void* userdata);
static void onClickPermissions( void* userdata);
// Key suffix for "tentative" fields
static const char* TENTATIVE_SUFFIX;
// These aren't fields in LLMediaEntry, so we have to define them ourselves for checkbox control
static const char* PERMS_OWNER_INTERACT_KEY;
static const char* PERMS_OWNER_CONTROL_KEY;
static const char* PERMS_GROUP_INTERACT_KEY;
static const char* PERMS_GROUP_CONTROL_KEY;
static const char* PERMS_ANYONE_INTERACT_KEY;
static const char* PERMS_ANYONE_CONTROL_KEY;
protected:
void getState(LLViewerObject *object);

View File

@@ -45,6 +45,7 @@
#include "llscrollingpanelparam.h"
#include "llradiogroup.h"
#include "llnotificationsutil.h"
#include "llnotifications.h"
#include "llcolorswatch.h"
#include "lltexturectrl.h"

View File

@@ -79,6 +79,22 @@
BOOL LLPanelFace::postBuild()
{
childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this);
childSetCommitCallback("combobox bumpiness",&LLPanelFace::onCommitBump,this);
childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("checkbox flip s",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("checkbox flip t",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureInfo, this);
childSetAction("button apply",&LLPanelFace::onClickApply,this);
childSetCommitCallback("checkbox planar align",&LLPanelFace::onCommitPlanarAlign, this);
childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this);
childSetAction("button align",&LLPanelFace::onClickAutoFix,this);
childSetAction("copytextures",&LLPanelFace::onClickCopy,this);
childSetAction("pastetextures",&LLPanelFace::onClickPaste,this);
LLTextureCtrl* mTextureCtrl;
LLColorSwatchCtrl* mColorSwatch;
@@ -96,7 +112,7 @@ BOOL LLPanelFace::postBuild()
if(mTextureCtrl)
{
mTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" )));
mTextureCtrl->setCommitCallback( LLPanelFace::onCommitTexture );
mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) );
mTextureCtrl->setOnCancelCallback( LLPanelFace::onCancelTexture );
mTextureCtrl->setOnSelectCallback( LLPanelFace::onSelectTexture );
mTextureCtrl->setDragCallback(LLPanelFace::onDragTexture);
@@ -127,7 +143,7 @@ BOOL LLPanelFace::postBuild()
mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(mColorSwatch)
{
mColorSwatch->setCommitCallback(LLPanelFace::onCommitColor);
mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2));
mColorSwatch->setOnCancelCallback(LLPanelFace::onCancelColor);
mColorSwatch->setOnSelectCallback(LLPanelFace::onSelectColor);
mColorSwatch->setCallbackUserData( this );
@@ -146,8 +162,7 @@ BOOL LLPanelFace::postBuild()
mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans");
if(mCtrlColorTransp)
{
mCtrlColorTransp->setCommitCallback(LLPanelFace::onCommitAlpha);
mCtrlColorTransp->setCallbackUserData(this);
mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2));
mCtrlColorTransp->setPrecision(0);
mCtrlColorTransp->setFollowsTop();
mCtrlColorTransp->setFollowsLeft();
@@ -156,39 +171,22 @@ BOOL LLPanelFace::postBuild()
mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright");
if (mCheckFullbright)
{
mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright);
mCheckFullbright->setCallbackUserData( this );
mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright, this);
}
mComboTexGen = getChild<LLComboBox>("combobox texgen");
if(mComboTexGen)
{
mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen);
mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen, this);
mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
mComboTexGen->setCallbackUserData( this );
}
mCtrlGlow = getChild<LLSpinCtrl>("glow");
if(mCtrlGlow)
{
mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow);
mCtrlGlow->setCallbackUserData(this);
mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this);
}
childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this);
childSetCommitCallback("combobox bumpiness",&LLPanelFace::onCommitBump,this);
childSetCommitCallback("checkbox planar align",&LLPanelFace::onCommitPlanarAlign, this);
childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("checkbox flip s",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("checkbox flip t",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureInfo, this);
childSetAction("button apply",&onClickApply,this);
childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this);
childSetAction("button align",onClickAutoFix,this);
childSetAction("copytextures",onClickCopy,this);
childSetAction("pastetextures",onClickPaste,this);
clearCtrls();
@@ -521,12 +519,9 @@ void LLPanelFace::getState()
{
BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
// only turn on auto-adjust button if there is a media renderer and the media is loaded
childSetEnabled("textbox autofix",FALSE);
//mLabelTexAutoFix->setEnabled ( FALSE );
childSetEnabled("button align",FALSE);
//mBtnAutoFix->setEnabled ( FALSE );
getChildView("textbox autofix")->setEnabled(editable);
getChildView("button align")->setEnabled(editable);
//if ( LLMediaEngine::getInstance()->getMediaRenderer () )
// if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
@@ -543,7 +538,7 @@ void LLPanelFace::getState()
childSetEnabled("copytextures", single_volume && editable);
childSetEnabled("pastetextures", single_volume && editable);
childSetEnabled("textbox params", single_volume && editable);
childSetEnabled("button apply",editable);
getChildView("button apply")->setEnabled(editable);
bool identical;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
@@ -684,7 +679,7 @@ void LLPanelFace::getState()
// Texture scale
{
childSetEnabled("tex scale",editable);
getChildView("tex scale")->setEnabled(editable);
//mLabelTexScale->setEnabled( editable );
F32 scale_s = 1.f;
struct f2 : public LLSelectedTEGetFunctor<F32>
@@ -696,12 +691,12 @@ void LLPanelFace::getState()
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_s );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexScaleU",editable ? llabs(scale_s) : 0);
childSetTentative("TexScaleU",LLSD((BOOL)(!identical)));
childSetEnabled("TexScaleU",editable);
childSetValue("checkbox flip s",LLSD((BOOL)(scale_s < 0 ? TRUE : FALSE )));
childSetTentative("checkbox flip s",LLSD((BOOL)((!identical) ? TRUE : FALSE )));
childSetEnabled("checkbox flip s",editable);
getChild<LLUICtrl>("TexScaleU")->setValue(editable ? llabs(scale_s) : 0);
getChild<LLUICtrl>("TexScaleU")->setTentative(LLSD((BOOL)(!identical)));
getChildView("TexScaleU")->setEnabled(editable);
getChild<LLUICtrl>("checkbox flip s")->setValue(LLSD((BOOL)(scale_s < 0 ? TRUE : FALSE )));
getChild<LLUICtrl>("checkbox flip s")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE )));
getChildView("checkbox flip s")->setEnabled(editable);
}
{
@@ -716,17 +711,17 @@ void LLPanelFace::getState()
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_t );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexScaleV",llabs(editable ? llabs(scale_t) : 0));
childSetTentative("TexScaleV",LLSD((BOOL)(!identical)));
childSetEnabled("TexScaleV",editable);
childSetValue("checkbox flip t",LLSD((BOOL)(scale_t< 0 ? TRUE : FALSE )));
childSetTentative("checkbox flip t",LLSD((BOOL)((!identical) ? TRUE : FALSE )));
childSetEnabled("checkbox flip t",editable);
getChild<LLUICtrl>("TexScaleV")->setValue(llabs(editable ? llabs(scale_t) : 0));
getChild<LLUICtrl>("TexScaleV")->setTentative(LLSD((BOOL)(!identical)));
getChildView("TexScaleV")->setEnabled(editable);
getChild<LLUICtrl>("checkbox flip t")->setValue(LLSD((BOOL)(scale_t< 0 ? TRUE : FALSE )));
getChild<LLUICtrl>("checkbox flip t")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE )));
getChildView("checkbox flip t")->setEnabled(editable);
}
// Texture offset
{
childSetEnabled("tex offset",editable);
getChildView("tex offset")->setEnabled(editable);
F32 offset_s = 0.f;
struct f4 : public LLSelectedTEGetFunctor<F32>
{
@@ -737,9 +732,9 @@ void LLPanelFace::getState()
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_s );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexOffsetU", editable ? offset_s : 0);
childSetTentative("TexOffsetU",!identical);
childSetEnabled("TexOffsetU",editable);
getChild<LLUICtrl>("TexOffsetU")->setValue(editable ? offset_s : 0);
getChild<LLUICtrl>("TexOffsetU")->setTentative(!identical);
getChildView("TexOffsetU")->setEnabled(editable);
}
{
@@ -753,14 +748,14 @@ void LLPanelFace::getState()
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_t );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexOffsetV", editable ? offset_t : 0);
childSetTentative("TexOffsetV",!identical);
childSetEnabled("TexOffsetV",editable);
getChild<LLUICtrl>("TexOffsetV")->setValue(editable ? offset_t : 0);
getChild<LLUICtrl>("TexOffsetV")->setTentative(!identical);
getChildView("TexOffsetV")->setEnabled(editable);
}
// Texture rotation
{
childSetEnabled("tex rotate",editable);
getChildView("tex rotate")->setEnabled(editable);
F32 rotation = 0.f;
struct f6 : public LLSelectedTEGetFunctor<F32>
{
@@ -771,9 +766,9 @@ void LLPanelFace::getState()
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, rotation );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexRot", editable ? rotation * RAD_TO_DEG : 0);
childSetTentative("TexRot",!identical);
childSetEnabled("TexRot",editable);
getChild<LLUICtrl>("TexRot")->setValue(editable ? rotation * RAD_TO_DEG : 0);
getChild<LLUICtrl>("TexRot")->setTentative(!identical);
getChildView("TexRot")->setEnabled(editable);
}
// Color swatch
@@ -799,13 +794,13 @@ void LLPanelFace::getState()
}
// Color transparency
{
childSetEnabled("color trans",editable);
getChildView("color trans")->setEnabled(editable);
}
F32 transparency = (1.f - color.mV[VALPHA]) * 100.f;
{
childSetValue("ColorTrans", editable ? transparency : 0);
childSetEnabled("ColorTrans",editable);
getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0);
getChildView("ColorTrans")->setEnabled(editable);
}
{
@@ -819,10 +814,10 @@ void LLPanelFace::getState()
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, glow );
childSetValue("glow",glow);
childSetEnabled("glow",editable);
childSetTentative("glow",!identical);
childSetEnabled("glow label",editable);
getChild<LLUICtrl>("glow")->setValue(glow);
getChildView("glow")->setEnabled(editable);
getChild<LLUICtrl>("glow")->setTentative(!identical);
getChildView("glow label")->setEnabled(editable);
}
@@ -847,9 +842,9 @@ void LLPanelFace::getState()
{
llwarns << "failed childGetSelectionInterface for 'combobox shininess'" << llendl;
}
childSetEnabled("combobox shininess",editable);
childSetTentative("combobox shininess",!identical);
childSetEnabled("label shininess",editable);
getChildView("combobox shininess")->setEnabled(editable);
getChild<LLUICtrl>("combobox shininess")->setTentative(!identical);
getChildView("label shininess")->setEnabled(editable);
}
{
@@ -872,9 +867,9 @@ void LLPanelFace::getState()
{
llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl;
}
childSetEnabled("combobox bumpiness",editable);
childSetTentative("combobox bumpiness",!identical);
childSetEnabled("label bumpiness",editable);
getChildView("combobox bumpiness")->setEnabled(editable);
getChild<LLUICtrl>("combobox bumpiness")->setTentative(!identical);
getChildView("label bumpiness")->setEnabled(editable);
}
{
@@ -898,19 +893,21 @@ void LLPanelFace::getState()
{
llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl;
}
childSetEnabled("combobox texgen",editable);
childSetTentative("combobox texgen",!identical);
childSetEnabled("tex gen",editable);
getChildView("combobox texgen")->setEnabled(editable);
getChild<LLUICtrl>("combobox texgen")->setTentative(!identical);
getChildView("tex gen")->setEnabled(editable);
if (selected_texgen == 1)
{
childSetText("tex scale",getString("string repeats per meter"));
childSetValue("TexScaleU", 2.0f * childGetValue("TexScaleU").asReal() );
childSetValue("TexScaleV", 2.0f * childGetValue("TexScaleV").asReal() );
getChild<LLUICtrl>("TexScaleU")->setValue(2.0f * getChild<LLUICtrl>("TexScaleU")->getValue().asReal() );
getChild<LLUICtrl>("TexScaleV")->setValue(2.0f * getChild<LLUICtrl>("TexScaleV")->getValue().asReal() );
// EXP-1507 (change label based on the mapping mode)
getChild<LLUICtrl>("tex scale")->setValue(getString("string repeats per meter"));
}
else
{
childSetText("tex scale",getString("string repeats per face"));
getChild<LLUICtrl>("tex scale")->setValue(getString("string repeats per face"));
}
}
@@ -926,14 +923,14 @@ void LLPanelFace::getState()
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, fullbrightf );
childSetValue("checkbox fullbright",(S32)fullbrightf);
childSetEnabled("checkbox fullbright",editable);
childSetTentative("checkbox fullbright",!identical);
getChild<LLUICtrl>("checkbox fullbright")->setValue((S32)fullbrightf);
getChildView("checkbox fullbright")->setEnabled(editable);
getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical);
}
// Repeats per meter label
{
childSetEnabled("rpt",editable);
getChildView("rpt")->setEnabled(editable);
}
// Repeats per meter
@@ -953,14 +950,14 @@ void LLPanelFace::getState()
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, repeats );
childSetValue("rptctrl", editable ? repeats : 0);
childSetTentative("rptctrl",!identical);
getChild<LLUICtrl>("rptctrl")->setValue(editable ? repeats : 0);
getChild<LLUICtrl>("rptctrl")->setTentative(!identical);
LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen");
if (mComboTexGen)
{
BOOL enabled = editable && (!mComboTexGen || mComboTexGen->getCurrentIndex() != 1);
childSetEnabled("rptctrl",enabled);
childSetEnabled("button apply",enabled);
getChildView("rptctrl")->setEnabled(enabled);
getChildView("button apply")->setEnabled(enabled);
}
}
@@ -994,19 +991,21 @@ void LLPanelFace::getState()
mColorSwatch->setFallbackImageName("locked_image.j2c" );
mColorSwatch->setValid(FALSE);
}
childSetEnabled("color trans",FALSE);
childSetEnabled("rpt",FALSE);
childSetEnabled("tex scale",FALSE);
childSetEnabled("tex offset",FALSE);
childSetEnabled("tex rotate",FALSE);
childSetEnabled("tex gen",FALSE);
childSetEnabled("label shininess",FALSE);
childSetEnabled("label bumpiness",FALSE);
getChildView("color trans")->setEnabled(FALSE);
getChildView("rpt")->setEnabled(FALSE);
getChildView("tex scale")->setEnabled(FALSE);
getChildView("tex offset")->setEnabled(FALSE);
getChildView("tex rotate")->setEnabled(FALSE);
getChildView("tex gen")->setEnabled(FALSE);
getChildView("label shininess")->setEnabled(FALSE);
getChildView("label bumpiness")->setEnabled(FALSE);
childSetEnabled("textbox autofix",FALSE);
getChildView("textbox autofix")->setEnabled(FALSE);
childSetEnabled("button align",FALSE);
childSetEnabled("button apply",FALSE);
getChildView("button align")->setEnabled(FALSE);
getChildView("button apply")->setEnabled(FALSE);
//getChildView("has media")->setEnabled(FALSE);
//getChildView("media info set")->setEnabled(FALSE);
// Set variable values for numeric expressions
@@ -1037,18 +1036,14 @@ F32 LLPanelFace::valueGlow(LLViewerObject* object, S32 face)
}
// static
void LLPanelFace::onCommitColor(LLUICtrl* ctrl, void* userdata)
void LLPanelFace::onCommitColor(const LLSD& data)
{
LLPanelFace* self = (LLPanelFace*) userdata;
self->sendColor();
sendColor();
}
// static
void LLPanelFace::onCommitAlpha(LLUICtrl* ctrl, void* userdata)
void LLPanelFace::onCommitAlpha(const LLSD& data)
{
LLPanelFace* self = (LLPanelFace*) userdata;
self->sendAlpha();
sendAlpha();
}
// static
@@ -1118,14 +1113,10 @@ BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*)
return accept;
}
// static
void LLPanelFace::onCommitTexture( LLUICtrl* ctrl, void* userdata )
void LLPanelFace::onCommitTexture( const LLSD& data )
{
LLPanelFace* self = (LLPanelFace*) userdata;
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
self->sendTexture();
sendTexture();
}
// static
@@ -1138,7 +1129,7 @@ void LLPanelFace::onCancelTexture(LLUICtrl* ctrl, void* userdata)
void LLPanelFace::onSelectTexture(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
self->sendTexture();
}
@@ -1159,12 +1150,10 @@ void LLPanelFace::onClickApply(void* userdata)
gFocusMgr.setKeyboardFocus( NULL );
//F32 repeats_per_meter = self->mCtrlRepeatsPerMeter->get();
F32 repeats_per_meter = (F32)self->childGetValue( "rptctrl" ).asReal();//self->mCtrlRepeatsPerMeter->get();
F32 repeats_per_meter = (F32)self->getChild<LLUICtrl>("rptctrl")->getValue().asReal();//self->mCtrlRepeatsPerMeter->get();
LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
}
// commit the fit media texture to prim button
struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor
{
virtual bool apply(LLViewerObject* object, S32 te)

View File

@@ -73,17 +73,18 @@ protected:
void sendGlow();
void sendMedia();
// this function is to return TRUE if the dra should succeed.
// this function is to return TRUE if the drag should succeed.
static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item, void* ud);
static void onCommitTexture( LLUICtrl* ctrl, void* userdata);
static void onCancelTexture( LLUICtrl* ctrl, void* userdata);
static void onSelectTexture( LLUICtrl* ctrl, void* userdata);
static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata);
static void onCommitColor( LLUICtrl* ctrl, void* userdata);
static void onCommitAlpha( LLUICtrl* ctrl, void* userdata);
void onCommitTexture(const LLSD& data);
static void onCancelTexture( LLUICtrl* ctrl, void* userdata);
static void onSelectTexture( LLUICtrl* ctrl, void* userdata);
void onCommitColor(const LLSD& data);
void onCommitAlpha(const LLSD& data);
static void onCancelColor( LLUICtrl* ctrl, void* userdata);
static void onSelectColor( LLUICtrl* ctrl, void* userdata);
static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata);
static void onCommitBump( LLUICtrl* ctrl, void* userdata);
static void onCommitTexGen( LLUICtrl* ctrl, void* userdata);
static void onCommitShiny( LLUICtrl* ctrl, void* userdata);

View File

@@ -47,6 +47,7 @@
#include "llavatarnamecache.h"
#include "llvoavatar.h"
#include "llcallingcard.h"
#include "llnotifications.h"
LLPanelGeneral::LLPanelGeneral()
{

View File

@@ -119,9 +119,7 @@ void LLPanelGroupTab::handleClickHelp()
LLSD args;
args["MESSAGE"] = help_text;
LLFloater* parent_floater = gFloaterView->getParentFloater(this);
LLNotification::Params params(parent_floater->contextualNotification("GenericAlert"));
params.substitutions(args);
LLNotifications::instance().add(params);
parent_floater->addContextualNotification("GenericAlert",args);
}
}

View File

@@ -143,14 +143,7 @@ BOOL LLPanelGroupGeneral::postBuild()
mBtnInfo->setClickedCallback(boost::bind(LLGroupActions::show, mGroupID));
}
LLTextBox* founder = getChild<LLTextBox>("founder_name");
if (founder)
{
mFounderName = new LLNameBox(founder->getName(),founder->getRect(),LLUUID::null,FALSE,founder->getFont(),founder->getMouseOpaque());
removeChild(founder);
delete founder;
addChild(mFounderName);
}
mFounderName = getChild<LLNameBox>("founder_name");
mListVisibleMembers = getChild<LLNameListCtrl>("visible_members", recurse);
if (mListVisibleMembers)

View File

@@ -130,7 +130,8 @@ static std::string nameJoin(const std::string& first,const std::string& last, bo
}
static std::string getDisplayString(const std::string& first, const std::string& last, const std::string& grid, bool is_secondlife) {
if(grid == gHippoGridManager->getDefaultGridNick())
//grid comes via LLSavedLoginEntry, which uses full grid names, not nicks
if(grid == gHippoGridManager->getDefaultGridName())
return nameJoin(first, last, is_secondlife);
else
return nameJoin(first, last, is_secondlife) + " (" + grid + ")";
@@ -633,7 +634,9 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus)
//sInstance->childSetText("name_combo", fullname);
std::string grid = entry.getGrid();
if(!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridNick()) {
//grid comes via LLSavedLoginEntry, which uses full grid names, not nicks
if(!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridName())
{
gHippoGridManager->setCurrentGrid(grid);
LLPanelLogin::refreshLoginPage();
}
@@ -791,27 +794,34 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh)
void LLPanelLogin::updateGridCombo()
{
const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
const std::string &currentGrid = gHippoGridManager->getCurrentGridNick();
const std::string &defaultGrid = gHippoGridManager->getDefaultGridName();
LLComboBox *grids = getChild<LLComboBox>("grids_combo");
S32 selectIndex = -1, i = 0;
std::string top_entry;
grids->removeall();
if (defaultGrid != "") {
grids->add(defaultGrid);
selectIndex = i++;
}
const HippoGridInfo *curGrid = gHippoGridManager->getCurrentGrid();
const HippoGridInfo *defGrid = gHippoGridManager->getGrid(defaultGrid);
HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
for (it = gHippoGridManager->beginGrid(); it != end; ++it)
{
std::string grid = it->second->getGridName();
if (grid != defaultGrid) {
grids->add(grid);
if (grid == currentGrid) selectIndex = i;
i++;
}
if(grid.empty() || it->second == defGrid || it->second == curGrid)
continue;
grids->add(grid);
}
if (selectIndex >= 0) {
grids->setCurrentByIndex(selectIndex);
} else {
if(curGrid || defGrid)
{
if(defGrid)
grids->add(defGrid->getGridName(),ADD_TOP);
if(curGrid && defGrid != curGrid)
grids->add(curGrid->getGridName(),ADD_TOP);
grids->setCurrentByIndex(0);
}
else
{
grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
}
}

View File

@@ -0,0 +1,515 @@
/**
* @file llpanelmediasettingsgeneral.cpp
* @brief LLPanelMediaSettingsGeneral class implementation
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "llpanelmediasettingsgeneral.h"
// library includes
#include "llcombobox.h"
#include "llcheckboxctrl.h"
#include "llnotificationsutil.h"
#include "llspinctrl.h"
#include "lluictrlfactory.h"
// project includes
#include "llagent.h"
#include "llviewerwindow.h"
#include "llviewermedia.h"
#include "llsdutil.h"
#include "llselectmgr.h"
#include "llbutton.h"
#include "lltexturectrl.h"
#include "llurl.h"
#include "llwindow.h"
#include "llmediaentry.h"
#include "llmediactrl.h"
#include "llpanelcontents.h"
#include "llpermissions.h"
#include "llpluginclassmedia.h"
#include "llfloatermediasettings.h"
#include "llfloatertools.h"
#include "lltrans.h"
#include "lltextbox.h"
#include "llpanelmediasettingssecurity.h"
const char *CHECKERBOARD_DATA_URL = "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%%22 height=%22100%%22 %3E%3Cdefs%3E%3Cpattern id=%22checker%22 patternUnits=%22userSpaceOnUse%22 x=%220%22 y=%220%22 width=%22128%22 height=%22128%22 viewBox=%220 0 128 128%22 %3E%3Crect x=%220%22 y=%220%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3Crect x=%2264%22 y=%2264%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3C/pattern%3E%3C/defs%3E%3Crect x=%220%22 y=%220%22 width=%22100%%22 height=%22100%%22 fill=%22url(#checker)%22 /%3E%3C/svg%3E";
////////////////////////////////////////////////////////////////////////////////
//
LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() :
mAutoLoop( NULL ),
mFirstClick( NULL ),
mAutoZoom( NULL ),
mAutoPlay( NULL ),
mAutoScale( NULL ),
mWidthPixels( NULL ),
mHeightPixels( NULL ),
mHomeURL( NULL ),
mCurrentURL( NULL ),
mParent( NULL ),
mMediaEditable(false)
{
// build dialog from XML
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_media_settings_general.xml");
}
////////////////////////////////////////////////////////////////////////////////
//
BOOL LLPanelMediaSettingsGeneral::postBuild()
{
// connect member vars with UI widgets
mAutoLoop = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_LOOP_KEY );
mAutoPlay = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_PLAY_KEY );
mAutoScale = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_SCALE_KEY );
mAutoZoom = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_ZOOM_KEY );
mCurrentURL = getChild< LLTextBox >( LLMediaEntry::CURRENT_URL_KEY );
mFirstClick = getChild< LLCheckBoxCtrl >( LLMediaEntry::FIRST_CLICK_INTERACT_KEY );
mHeightPixels = getChild< LLSpinCtrl >( LLMediaEntry::HEIGHT_PIXELS_KEY );
mHomeURL = getChild< LLLineEditor >( LLMediaEntry::HOME_URL_KEY );
mWidthPixels = getChild< LLSpinCtrl >( LLMediaEntry::WIDTH_PIXELS_KEY );
mPreviewMedia = getChild<LLMediaCtrl>("preview_media");
mFailWhiteListText = getChild<LLTextBox>( "home_fails_whitelist_label" );
// watch commit action for HOME URL
childSetCommitCallback( LLMediaEntry::HOME_URL_KEY, onCommitHomeURL, this);
childSetCommitCallback( "current_url_reset_btn",onBtnResetCurrentUrl, this);
// interrogates controls and updates widgets as required
updateMediaPreview();
return true;
}
////////////////////////////////////////////////////////////////////////////////
// virtual
LLPanelMediaSettingsGeneral::~LLPanelMediaSettingsGeneral()
{
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsGeneral::draw()
{
// housekeeping
LLPanel::draw();
// TODO: we need to call this repeatedly until the floater panels are fully
// created but once we have a valid answer, we should stop looking here - the
// commit callback will handle it
checkHomeUrlPassesWhitelist();
// enable/disable pixel values image entry based on auto scale checkbox
if ( mAutoScale->getValue().asBoolean() == false )
{
getChildView( LLMediaEntry::WIDTH_PIXELS_KEY )->setEnabled( true );
getChildView( LLMediaEntry::HEIGHT_PIXELS_KEY )->setEnabled( true );
}
else
{
getChildView( LLMediaEntry::WIDTH_PIXELS_KEY )->setEnabled( false );
getChildView( LLMediaEntry::HEIGHT_PIXELS_KEY )->setEnabled( false );
};
// enable/disable UI based on type of media
bool reset_button_is_active = true;
if( mPreviewMedia )
{
LLPluginClassMedia* media_plugin = mPreviewMedia->getMediaPlugin();
if( media_plugin )
{
// turn off volume (if we can) for preview. Note: this really only
// works for QuickTime movies right now - no way to control the
// volume of a flash app embedded in a page for example
media_plugin->setVolume( 0 );
// some controls are only appropriate for time or browser type plugins
// so we selectively enable/disable them - need to do it in draw
// because the information from plugins arrives assynchronously
bool show_time_controls = media_plugin->pluginSupportsMediaTime();
if ( show_time_controls )
{
getChildView( LLMediaEntry::CURRENT_URL_KEY )->setEnabled( false );
reset_button_is_active = false;
getChildView("current_url_label")->setEnabled(false );
getChildView( LLMediaEntry::AUTO_LOOP_KEY )->setEnabled( true );
}
else
{
getChildView( LLMediaEntry::CURRENT_URL_KEY )->setEnabled( true );
reset_button_is_active = true;
getChildView("current_url_label")->setEnabled(true );
getChildView( LLMediaEntry::AUTO_LOOP_KEY )->setEnabled( false );
};
};
};
// current URL can change over time, update it here
updateCurrentUrl();
LLPermissions perm;
bool user_can_press_reset = mMediaEditable;
// several places modify this widget so we must collect states in one place
if ( reset_button_is_active )
{
// user has perms to press reset button and it is active
if ( user_can_press_reset )
{
getChildView("current_url_reset_btn")->setEnabled(true );
}
// user does not has perms to press reset button and it is active
else
{
getChildView("current_url_reset_btn")->setEnabled(false );
};
}
else
// reset button is inactive so we just slam it to off - other states don't matter
{
getChildView("current_url_reset_btn")->setEnabled(false );
};
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
self->mAutoLoop->clear();
self->mAutoPlay->clear();
self->mAutoScale->clear();
self->mAutoZoom ->clear();
self->mCurrentURL->setValue("");
self->mFirstClick->clear();
self->mHeightPixels->clear();
self->mHomeURL->clear();
self->mWidthPixels->clear();
self->mAutoLoop ->setEnabled(editable);
self->mAutoPlay ->setEnabled(editable);
self->mAutoScale ->setEnabled(editable);
self->mAutoZoom ->setEnabled(editable);
self->mCurrentURL ->setEnabled(editable);
self->mFirstClick ->setEnabled(editable);
self->mHeightPixels ->setEnabled(editable);
self->mHomeURL ->setEnabled(editable);
self->mWidthPixels ->setEnabled(editable);
self->updateMediaPreview();
}
// static
bool LLPanelMediaSettingsGeneral::isMultiple()
{
// IF all the faces have media (or all dont have media)
if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo )
{
if(LLFloaterMediaSettings::getInstance()->mMultipleMedia)
{
return true;
}
}
else
{
if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
{
return true;
}
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& _media_settings, bool editable)
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
self->mMediaEditable = editable;
LLSD media_settings = _media_settings;
if ( LLPanelMediaSettingsGeneral::isMultiple() )
{
// *HACK: "edit" the incoming media_settings
media_settings[LLMediaEntry::CURRENT_URL_KEY] = LLTrans::getString("Multiple Media");
media_settings[LLMediaEntry::HOME_URL_KEY] = LLTrans::getString("Multiple Media");
}
std::string base_key( "" );
std::string tentative_key( "" );
struct
{
std::string key_name;
LLUICtrl* ctrl_ptr;
std::string ctrl_type;
} data_set [] =
{
{ LLMediaEntry::AUTO_LOOP_KEY, self->mAutoLoop, "LLCheckBoxCtrl" },
{ LLMediaEntry::AUTO_PLAY_KEY, self->mAutoPlay, "LLCheckBoxCtrl" },
{ LLMediaEntry::AUTO_SCALE_KEY, self->mAutoScale, "LLCheckBoxCtrl" },
{ LLMediaEntry::AUTO_ZOOM_KEY, self->mAutoZoom, "LLCheckBoxCtrl" },
{ LLMediaEntry::CURRENT_URL_KEY, self->mCurrentURL, "LLTextBox" },
{ LLMediaEntry::HEIGHT_PIXELS_KEY, self->mHeightPixels, "LLSpinCtrl" },
{ LLMediaEntry::HOME_URL_KEY, self->mHomeURL, "LLLineEditor" },
{ LLMediaEntry::FIRST_CLICK_INTERACT_KEY, self->mFirstClick, "LLCheckBoxCtrl" },
{ LLMediaEntry::WIDTH_PIXELS_KEY, self->mWidthPixels, "LLSpinCtrl" },
{ "", NULL , "" }
};
for( int i = 0; data_set[ i ].key_name.length() > 0; ++i )
{
base_key = std::string( data_set[ i ].key_name );
tentative_key = base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX );
// TODO: CP - I bet there is a better way to do this using Boost
if ( media_settings[ base_key ].isDefined() )
{
if ( data_set[ i ].ctrl_type == "LLLineEditor" )
{
static_cast< LLLineEditor* >( data_set[ i ].ctrl_ptr )->
setText( media_settings[ base_key ].asString() );
}
else
if ( data_set[ i ].ctrl_type == "LLCheckBoxCtrl" )
static_cast< LLCheckBoxCtrl* >( data_set[ i ].ctrl_ptr )->
setValue( media_settings[ base_key ].asBoolean() );
else
if ( data_set[ i ].ctrl_type == "LLComboBox" )
static_cast< LLComboBox* >( data_set[ i ].ctrl_ptr )->
setCurrentByIndex( media_settings[ base_key ].asInteger() );
else
if ( data_set[ i ].ctrl_type == "LLSpinCtrl" )
static_cast< LLSpinCtrl* >( data_set[ i ].ctrl_ptr )->
setValue( media_settings[ base_key ].asInteger() );
data_set[ i ].ctrl_ptr->setEnabled(self->mMediaEditable);
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
};
};
// interrogates controls and updates widgets as required
self->updateMediaPreview();
}
////////////////////////////////////////////////////////////////////////////////
// Helper to set media control to media URL as required
void LLPanelMediaSettingsGeneral::updateMediaPreview()
{
if ( mHomeURL->getValue().asString().length() > 0 )
{
if(mPreviewMedia->getCurrentNavUrl() != mHomeURL->getValue().asString())
{
mPreviewMedia->navigateTo( mHomeURL->getValue().asString() );
}
}
else
// new home URL will be empty if media is deleted so display a
// "preview goes here" data url page
{
if(mPreviewMedia->getCurrentNavUrl() != CHECKERBOARD_DATA_URL)
{
mPreviewMedia->navigateTo( CHECKERBOARD_DATA_URL );
}
};
}
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLPanelMediaSettingsGeneral::onClose(bool app_quitting)
{
if(mPreviewMedia)
{
mPreviewMedia->unloadMediaSource();
}
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsGeneral::checkHomeUrlPassesWhitelist()
{
// parent floater has not constructed the security panel yet
if ( mParent->getPanelSecurity() == 0 )
return;
std::string home_url = getHomeUrl();
if ( home_url.empty() || mParent->getPanelSecurity()->urlPassesWhiteList( home_url ) )
{
// Home URL is empty or passes the white list so hide the warning message
mFailWhiteListText->setVisible( false );
}
else
{
// Home URL does not pass the white list so show the warning message
mFailWhiteListText->setVisible( true );
};
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsGeneral::onCommitHomeURL( LLUICtrl* ctrl, void *userdata )
{
LLPanelMediaSettingsGeneral* self =(LLPanelMediaSettingsGeneral *)userdata;
// check home url passes whitelist and display warning if not
self->checkHomeUrlPassesWhitelist();
self->updateMediaPreview();
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsGeneral::onBtnResetCurrentUrl(LLUICtrl* ctrl, void *userdata)
{
LLPanelMediaSettingsGeneral* self =(LLPanelMediaSettingsGeneral *)userdata;
self->navigateHomeSelectedFace(false);
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsGeneral::preApply()
{
// Make sure the home URL entry is committed
mHomeURL->onCommit();
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in, bool include_tentative )
{
if (include_tentative || !mAutoLoop->getTentative()) fill_me_in[LLMediaEntry::AUTO_LOOP_KEY] = (LLSD::Boolean)mAutoLoop->getValue();
if (include_tentative || !mAutoPlay->getTentative()) fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = (LLSD::Boolean)mAutoPlay->getValue();
if (include_tentative || !mAutoScale->getTentative()) fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = (LLSD::Boolean)mAutoScale->getValue();
if (include_tentative || !mAutoZoom->getTentative()) fill_me_in[LLMediaEntry::AUTO_ZOOM_KEY] = (LLSD::Boolean)mAutoZoom->getValue();
//Don't fill in current URL: this is only supposed to get changed via navigate
// if (include_tentative || !mCurrentURL->getTentative()) fill_me_in[LLMediaEntry::CURRENT_URL_KEY] = mCurrentURL->getValue();
if (include_tentative || !mHeightPixels->getTentative()) fill_me_in[LLMediaEntry::HEIGHT_PIXELS_KEY] = (LLSD::Integer)mHeightPixels->getValue();
// Don't fill in the home URL if it is the special "Multiple Media" string!
if ((include_tentative || !mHomeURL->getTentative())
&& LLTrans::getString("Multiple Media") != mHomeURL->getValue())
fill_me_in[LLMediaEntry::HOME_URL_KEY] = (LLSD::String)mHomeURL->getValue();
if (include_tentative || !mFirstClick->getTentative()) fill_me_in[LLMediaEntry::FIRST_CLICK_INTERACT_KEY] = (LLSD::Boolean)mFirstClick->getValue();
if (include_tentative || !mWidthPixels->getTentative()) fill_me_in[LLMediaEntry::WIDTH_PIXELS_KEY] = (LLSD::Integer)mWidthPixels->getValue();
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsGeneral::postApply()
{
// Make sure to navigate to the home URL if the current URL is empty and
// autoplay is on
navigateHomeSelectedFace(true);
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsGeneral::setParent( LLFloaterMediaSettings* parent )
{
mParent = parent;
};
////////////////////////////////////////////////////////////////////////////////
//
bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace(bool only_if_current_is_empty)
{
struct functor_navigate_media : public LLSelectedTEGetFunctor< bool>
{
functor_navigate_media(bool flag) : only_if_current_is_empty(flag) {}
bool get( LLViewerObject* object, S32 face )
{
if ( object && object->getTE(face) && object->permModify() )
{
const LLMediaEntry *media_data = object->getTE(face)->getMediaData();
if ( media_data )
{
if (!only_if_current_is_empty || (media_data->getCurrentURL().empty() && media_data->getAutoPlay()))
{
viewer_media_t media_impl =
LLViewerMedia::getMediaImplFromTextureID(object->getTE(face)->getMediaData()->getMediaID());
if(media_impl)
{
media_impl->navigateHome();
return true;
}
}
}
}
return false;
};
bool only_if_current_is_empty;
} functor_navigate_media(only_if_current_is_empty);
bool all_face_media_navigated = false;
LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection();
selected_objects->getSelectedTEValue( &functor_navigate_media, all_face_media_navigated );
// Note: we don't update the 'current URL' field until the media data itself changes
return all_face_media_navigated;
}
////////////////////////////////////////////////////////////////////////////////
//
const std::string LLPanelMediaSettingsGeneral::getHomeUrl()
{
return mHomeURL->getValue().asString();
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsGeneral::updateCurrentUrl()
{
// Get the current URL from the selection
const LLMediaEntry default_media_data;
std::string value_str = default_media_data.getCurrentURL();
struct functor_getter_current_url : public LLSelectedTEGetFunctor< std::string >
{
functor_getter_current_url(const LLMediaEntry& entry): mMediaEntry(entry) {}
std::string get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getCurrentURL();
return mMediaEntry.getCurrentURL();
};
const LLMediaEntry & mMediaEntry;
} func_current_url(default_media_data);
bool identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func_current_url, value_str );
mCurrentURL->setText(value_str);
mCurrentURL->setTentative(identical);
if ( LLPanelMediaSettingsGeneral::isMultiple() )
{
mCurrentURL->setText(LLTrans::getString("Multiple Media"));
}
}

View File

@@ -0,0 +1,100 @@
/**
* @file llpanelmediasettingsgeneral.h
* @brief LLPanelMediaSettingsGeneral class definition
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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_LLPANELMEDIAMEDIASETTINGSGENERAL_H
#define LL_LLPANELMEDIAMEDIASETTINGSGENERAL_H
#include "llpanel.h"
class LLButton;
class LLCheckBoxCtrl;
class LLLineEditor;
class LLSpinCtrl;
class LLTextureCtrl;
class LLMediaCtrl;
class LLTextBox;
class LLFloaterMediaSettings;
class LLPanelMediaSettingsGeneral : public LLPanel
{
public:
LLPanelMediaSettingsGeneral();
~LLPanelMediaSettingsGeneral();
// XXX TODO: put these into a common parent class?
// Hook that the floater calls before applying changes from the panel
void preApply();
// Function that asks the panel to fill in values associated with the panel
// 'include_tentative' means fill in tentative values as well, otherwise do not
void getValues(LLSD &fill_me_in, bool include_tentative = true);
// Hook that the floater calls after applying changes to the panel
void postApply();
BOOL postBuild();
/*virtual*/ void draw();
/*virtual*/ void onClose(bool app_quitting);
void setParent( LLFloaterMediaSettings* parent );
static void initValues( void* userdata, const LLSD& media_settings ,bool editable);
static void clearValues( void* userdata, bool editable);
// Navigates the current selected face to the Home URL.
// If 'only_if_current_is_empty' is "true", it only performs
// the operation if: 1) the current URL is empty, and 2) auto play is true.
bool navigateHomeSelectedFace(bool only_if_current_is_empty);
void updateMediaPreview();
const std::string getHomeUrl();
protected:
LLFloaterMediaSettings* mParent;
bool mMediaEditable;
private:
void updateCurrentUrl();
static void onBtnResetCurrentUrl(LLUICtrl* ctrl, void *userdata);
static void onCommitHomeURL(LLUICtrl* ctrl, void *userdata );
static bool isMultiple();
void checkHomeUrlPassesWhitelist();
LLCheckBoxCtrl* mAutoLoop;
LLCheckBoxCtrl* mFirstClick;
LLCheckBoxCtrl* mAutoZoom;
LLCheckBoxCtrl* mAutoPlay;
LLCheckBoxCtrl* mAutoScale;
LLSpinCtrl* mWidthPixels;
LLSpinCtrl* mHeightPixels;
LLLineEditor* mHomeURL;
LLTextBox* mCurrentURL;
LLMediaCtrl* mPreviewMedia;
LLTextBox* mFailWhiteListText;
};
#endif // LL_LLPANELMEDIAMEDIASETTINGSGENERAL_H

View File

@@ -0,0 +1,285 @@
/**
* @file llpanelmediasettingspermissions.cpp
* @brief LLPanelMediaSettingsPermissions class implementation
*
* note that "permissions" tab is really "Controls" tab - refs to 'perms' and
* 'permissions' not changed to 'controls' since we don't want to change
* shared files in server code and keeping everything the same seemed best.
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "llpanelmediasettingspermissions.h"
#include "llpanelcontents.h"
#include "llcombobox.h"
#include "llcheckboxctrl.h"
#include "llspinctrl.h"
#include "llurlhistory.h"
#include "lluictrlfactory.h"
#include "llwindow.h"
#include "llviewerwindow.h"
#include "llsdutil.h"
#include "llselectmgr.h"
#include "llmediaentry.h"
#include "llnamebox.h"
#include "lltrans.h"
#include "llfloatermediasettings.h"
////////////////////////////////////////////////////////////////////////////////
//
LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() :
mControls( NULL ),
mPermsOwnerInteract( 0 ),
mPermsOwnerControl( 0 ),
mPermsGroupName( 0 ),
mPermsGroupInteract( 0 ),
mPermsGroupControl( 0 ),
mPermsWorldInteract( 0 ),
mPermsWorldControl( 0 )
{
// build dialog from XML
//buildFromFile( "panel_media_settings_permissions.xml");
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_media_settings_permissions.xml");
}
////////////////////////////////////////////////////////////////////////////////
//
BOOL LLPanelMediaSettingsPermissions::postBuild()
{
// connect member vars with UI widgets
mControls = getChild< LLComboBox >( LLMediaEntry::CONTROLS_KEY );
mPermsOwnerInteract = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_OWNER_INTERACT_KEY );
mPermsOwnerControl = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_OWNER_CONTROL_KEY );
mPermsGroupInteract = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_GROUP_INTERACT_KEY );
mPermsGroupControl = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_GROUP_CONTROL_KEY );
mPermsWorldInteract = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_ANYONE_INTERACT_KEY );
mPermsWorldControl = getChild< LLCheckBoxCtrl >( LLPanelContents::PERMS_ANYONE_CONTROL_KEY );
mPermsGroupName = getChild< LLNameBox >( "perms_group_name" );
return true;
}
////////////////////////////////////////////////////////////////////////////////
// virtual
LLPanelMediaSettingsPermissions::~LLPanelMediaSettingsPermissions()
{
}
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLPanelMediaSettingsPermissions::draw()
{
// housekeeping
LLPanel::draw();
getChild<LLUICtrl>("perms_group_name")->setValue(LLStringUtil::null);
LLUUID group_id;
BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id);
if (groups_identical)
{
if(mPermsGroupName)
{
mPermsGroupName->setNameID(group_id, true);
}
}
else
{
if(mPermsGroupName)
{
mPermsGroupName->setNameID(LLUUID::null, TRUE);
mPermsGroupName->refresh(LLUUID::null, std::string(), true);
}
}
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsPermissions::clearValues( void* userdata, bool editable)
{
LLPanelMediaSettingsPermissions *self =(LLPanelMediaSettingsPermissions *)userdata;
self->mControls->clear();
self->mPermsOwnerInteract->clear();
self->mPermsOwnerControl->clear();
self->mPermsGroupInteract->clear();
self->mPermsGroupControl->clear();
self->mPermsWorldInteract->clear();
self->mPermsWorldControl->clear();
self->mControls->setEnabled(editable);
self->mPermsOwnerInteract->setEnabled(editable);
self->mPermsOwnerControl->setEnabled(editable);
self->mPermsGroupInteract->setEnabled(editable);
self->mPermsGroupControl->setEnabled(editable);
self->mPermsWorldInteract->setEnabled(editable);
self->mPermsWorldControl->setEnabled(editable);
self->getChild< LLTextBox >("controls_label")->setEnabled(editable);
self->getChild< LLTextBox >("owner_label")->setEnabled(editable);
self->getChild< LLTextBox >("group_label")->setEnabled(editable);
self->getChild< LLNameBox >("perms_group_name")->setEnabled(editable);
self->getChild< LLTextBox >("anyone_label")->setEnabled(editable);
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& media_settings , bool editable)
{
LLPanelMediaSettingsPermissions *self =(LLPanelMediaSettingsPermissions *)userdata;
std::string base_key( "" );
std::string tentative_key( "" );
struct
{
std::string key_name;
LLUICtrl* ctrl_ptr;
std::string ctrl_type;
} data_set [] =
{
{ LLMediaEntry::CONTROLS_KEY, self->mControls, "LLComboBox" },
{ LLPanelContents::PERMS_OWNER_INTERACT_KEY, self->mPermsOwnerInteract, "LLCheckBoxCtrl" },
{ LLPanelContents::PERMS_OWNER_CONTROL_KEY, self->mPermsOwnerControl, "LLCheckBoxCtrl" },
{ LLPanelContents::PERMS_GROUP_INTERACT_KEY, self->mPermsGroupInteract, "LLCheckBoxCtrl" },
{ LLPanelContents::PERMS_GROUP_CONTROL_KEY, self->mPermsGroupControl, "LLCheckBoxCtrl" },
{ LLPanelContents::PERMS_ANYONE_INTERACT_KEY, self->mPermsWorldInteract, "LLCheckBoxCtrl" },
{ LLPanelContents::PERMS_ANYONE_CONTROL_KEY, self->mPermsWorldControl, "LLCheckBoxCtrl" },
{ "", NULL , "" }
};
for( int i = 0; data_set[ i ].key_name.length() > 0; ++i )
{
base_key = std::string( data_set[ i ].key_name );
tentative_key = base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX );
// TODO: CP - I bet there is a better way to do this using Boost
if ( media_settings[ base_key ].isDefined() )
{
if ( data_set[ i ].ctrl_type == "LLCheckBoxCtrl" )
{
// Most recent change to the "sense" of these checkboxes
// means the value in the checkbox matches that on the server
static_cast< LLCheckBoxCtrl* >( data_set[ i ].ctrl_ptr )->
setValue( media_settings[ base_key ].asBoolean() );
}
else
if ( data_set[ i ].ctrl_type == "LLComboBox" )
static_cast< LLComboBox* >( data_set[ i ].ctrl_ptr )->
setCurrentByIndex( media_settings[ base_key ].asInteger() );
data_set[ i ].ctrl_ptr->setEnabled(editable);
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
};
};
// *NOTE: If any of a particular flavor is tentative, we have to disable
// them all because of an architectural issue: namely that we represent
// these as a bit field, and we can't selectively apply only one bit to all selected
// faces if they don't match. Also see the *NOTE below.
if ( self->mPermsOwnerInteract->getTentative() ||
self->mPermsGroupInteract->getTentative() ||
self->mPermsWorldInteract->getTentative())
{
self->mPermsOwnerInteract->setEnabled(false);
self->mPermsGroupInteract->setEnabled(false);
self->mPermsWorldInteract->setEnabled(false);
}
if ( self->mPermsOwnerControl->getTentative() ||
self->mPermsGroupControl->getTentative() ||
self->mPermsWorldControl->getTentative())
{
self->mPermsOwnerControl->setEnabled(false);
self->mPermsGroupControl->setEnabled(false);
self->mPermsWorldControl->setEnabled(false);
}
self->getChild< LLTextBox >("controls_label")->setEnabled(editable);
self->getChild< LLTextBox >("owner_label")->setEnabled(editable);
self->getChild< LLTextBox >("group_label")->setEnabled(editable);
self->getChild< LLNameBox >("perms_group_name")->setEnabled(editable);
self->getChild< LLTextBox >("anyone_label")->setEnabled(editable);
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsPermissions::preApply()
{
// no-op
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsPermissions::getValues( LLSD &fill_me_in, bool include_tentative )
{
// moved over from the 'General settings' tab
if (include_tentative || !mControls->getTentative()) fill_me_in[LLMediaEntry::CONTROLS_KEY] = (LLSD::Integer)mControls->getCurrentIndex();
// *NOTE: For some reason, gcc does not like these symbol references in the
// expressions below (inside the static_casts). I have NO idea why :(.
// For some reason, assigning them to const temp vars here fixes the link
// error. Bizarre.
const U8 none = LLMediaEntry::PERM_NONE;
const U8 owner = LLMediaEntry::PERM_OWNER;
const U8 group = LLMediaEntry::PERM_GROUP;
const U8 anyone = LLMediaEntry::PERM_ANYONE;
const LLSD::Integer control = static_cast<LLSD::Integer>(
(mPermsOwnerControl->getValue() ? owner : none ) |
(mPermsGroupControl->getValue() ? group: none ) |
(mPermsWorldControl->getValue() ? anyone : none ));
const LLSD::Integer interact = static_cast<LLSD::Integer>(
(mPermsOwnerInteract->getValue() ? owner: none ) |
(mPermsGroupInteract->getValue() ? group : none ) |
(mPermsWorldInteract->getValue() ? anyone : none ));
// *TODO: This will fill in the values of all permissions values, even if
// one or more is tentative. This is not quite the user expectation...what
// it should do is only change the bit that was made "untentative", but in
// a multiple-selection situation, this isn't possible given the architecture
// for how settings are applied.
if (include_tentative ||
!mPermsOwnerControl->getTentative() ||
!mPermsGroupControl->getTentative() ||
!mPermsWorldControl->getTentative())
{
fill_me_in[LLMediaEntry::PERMS_CONTROL_KEY] = control;
}
if (include_tentative ||
!mPermsOwnerInteract->getTentative() ||
!mPermsGroupInteract->getTentative() ||
!mPermsWorldInteract->getTentative())
{
fill_me_in[LLMediaEntry::PERMS_INTERACT_KEY] = interact;
}
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsPermissions::postApply()
{
// no-op
}

View File

@@ -0,0 +1,73 @@
/**
* @file llpanelmediasettingspermissions.h
* @brief LLPanelMediaSettingsPermissions class definition
*
* note that "permissions" tab is really "Controls" tab - refs to 'perms' and
* 'permissions' not changed to 'controls' since we don't want to change
* shared files in server code and keeping everything the same seemed best.
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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_LLPANELMEDIAMEDIASETTINGSPERMISSIONS_H
#define LL_LLPANELMEDIAMEDIASETTINGSPERMISSIONS_H
#include "llpanel.h"
#include "lluuid.h"
class LLComboBox;
class LLCheckBoxCtrl;
class LLNameBox;
class LLPanelMediaSettingsPermissions : public LLPanel
{
public:
LLPanelMediaSettingsPermissions();
~LLPanelMediaSettingsPermissions();
BOOL postBuild();
virtual void draw();
// XXX TODO: put these into a common parent class?
// Hook that the floater calls before applying changes from the panel
void preApply();
// Function that asks the panel to fill in values associated with the panel
// 'include_tentative' means fill in tentative values as well, otherwise do not
void getValues(LLSD &fill_me_in, bool include_tentative = true);
// Hook that the floater calls after applying changes to the panel
void postApply();
static void initValues( void* userdata, const LLSD& media_settings, bool editable );
static void clearValues( void* userdata, bool editable);
private:
LLComboBox* mControls;
LLCheckBoxCtrl* mPermsOwnerInteract;
LLCheckBoxCtrl* mPermsOwnerControl;
LLNameBox* mPermsGroupName;
LLCheckBoxCtrl* mPermsGroupInteract;
LLCheckBoxCtrl* mPermsGroupControl;
LLCheckBoxCtrl* mPermsWorldInteract;
LLCheckBoxCtrl* mPermsWorldControl;
};
#endif // LL_LLPANELMEDIAMEDIASETTINGSPERMISSIONS_H

View File

@@ -0,0 +1,366 @@
/**
* @file llpanelmediasettingssecurity.cpp
* @brief LLPanelMediaSettingsSecurity class implementation
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "llpanelmediasettingssecurity.h"
#include "llpanelcontents.h"
#include "llcheckboxctrl.h"
#include "llnotificationsutil.h"
#include "llscrolllistctrl.h"
#include "lluictrlfactory.h"
#include "llwindow.h"
#include "llviewerwindow.h"
#include "llsdutil.h"
#include "llselectmgr.h"
#include "llmediaentry.h"
#include "lltextbox.h"
#include "llfloaterwhitelistentry.h"
#include "llfloatermediasettings.h"
////////////////////////////////////////////////////////////////////////////////
//
LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() :
mParent( NULL )
{
mCommitCallbackRegistrar.add("Media.whitelistAdd", boost::bind(&LLPanelMediaSettingsSecurity::onBtnAdd, this));
mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this));
// build dialog from XML
//buildFromFile( "panel_media_settings_security.xml");
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_media_settings_security.xml");
}
////////////////////////////////////////////////////////////////////////////////
//
BOOL LLPanelMediaSettingsSecurity::postBuild()
{
mEnableWhiteList = getChild< LLCheckBoxCtrl >( LLMediaEntry::WHITELIST_ENABLE_KEY );
mWhiteListList = getChild< LLScrollListCtrl >( LLMediaEntry::WHITELIST_KEY );
mHomeUrlFailsWhiteListText = getChild<LLTextBox>( "home_url_fails_whitelist" );
setDefaultBtn("whitelist_add");
return true;
}
////////////////////////////////////////////////////////////////////////////////
// virtual
LLPanelMediaSettingsSecurity::~LLPanelMediaSettingsSecurity()
{
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::draw()
{
// housekeeping
LLPanel::draw();
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsSecurity::initValues( void* userdata, const LLSD& media_settings , bool editable)
{
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
std::string base_key( "" );
std::string tentative_key( "" );
struct
{
std::string key_name;
LLUICtrl* ctrl_ptr;
std::string ctrl_type;
} data_set [] =
{
{ LLMediaEntry::WHITELIST_ENABLE_KEY, self->mEnableWhiteList, "LLCheckBoxCtrl" },
{ LLMediaEntry::WHITELIST_KEY, self->mWhiteListList, "LLScrollListCtrl" },
{ "", NULL , "" }
};
for( int i = 0; data_set[ i ].key_name.length() > 0; ++i )
{
base_key = std::string( data_set[ i ].key_name );
tentative_key = base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX );
bool enabled_overridden = false;
// TODO: CP - I bet there is a better way to do this using Boost
if ( media_settings[ base_key ].isDefined() )
{
if ( data_set[ i ].ctrl_type == "LLCheckBoxCtrl" )
{
static_cast< LLCheckBoxCtrl* >( data_set[ i ].ctrl_ptr )->
setValue( media_settings[ base_key ].asBoolean() );
}
else
if ( data_set[ i ].ctrl_type == "LLScrollListCtrl" )
{
// get control
LLScrollListCtrl* list = static_cast< LLScrollListCtrl* >( data_set[ i ].ctrl_ptr );
list->deleteAllItems();
// points to list of white list URLs
LLSD url_list = media_settings[ base_key ];
// better be the whitelist
llassert(data_set[ i ].ctrl_ptr == self->mWhiteListList);
// If tentative, don't add entries
if (media_settings[ tentative_key ].asBoolean())
{
self->mWhiteListList->setEnabled(false);
enabled_overridden = true;
}
else {
// iterate over them and add to scroll list
LLSD::array_iterator iter = url_list.beginArray();
while( iter != url_list.endArray() )
{
std::string entry = *iter;
self->addWhiteListEntry( entry );
++iter;
}
}
};
if ( ! enabled_overridden) data_set[ i ].ctrl_ptr->setEnabled(editable);
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
};
};
// initial update - hides/shows status messages etc.
self->updateWhitelistEnableStatus();
}
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsSecurity::clearValues( void* userdata , bool editable)
{
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
self->mEnableWhiteList->clear();
self->mWhiteListList->deleteAllItems();
self->mEnableWhiteList->setEnabled(editable);
self->mWhiteListList->setEnabled(editable);
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::preApply()
{
// no-op
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in, bool include_tentative )
{
if (include_tentative || !mEnableWhiteList->getTentative())
fill_me_in[LLMediaEntry::WHITELIST_ENABLE_KEY] = (LLSD::Boolean)mEnableWhiteList->getValue();
if (include_tentative || !mWhiteListList->getTentative())
{
// iterate over white list and extract items
std::vector< LLScrollListItem* > whitelist_items = mWhiteListList->getAllData();
std::vector< LLScrollListItem* >::iterator iter = whitelist_items.begin();
// *NOTE: need actually set the key to be an emptyArray(), or the merge
// we do with this LLSD will think there's nothing to change.
fill_me_in[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray();
while( iter != whitelist_items.end() )
{
LLScrollListCell* cell = (*iter)->getColumn( ENTRY_COLUMN );
std::string whitelist_url = cell->getValue().asString();
fill_me_in[ LLMediaEntry::WHITELIST_KEY ].append( whitelist_url );
++iter;
};
}
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::postApply()
{
// no-op
}
///////////////////////////////////////////////////////////////////////////////
// Try to make a valid URL if a fragment (
// white list list box widget and build a list to test against. Can also
const std::string LLPanelMediaSettingsSecurity::makeValidUrl( const std::string& src_url )
{
// use LLURI to determine if we have a valid scheme
LLURI candidate_url( src_url );
if ( candidate_url.scheme().empty() )
{
// build a URL comprised of default scheme and the original fragment
const std::string default_scheme( "http://" );
return default_scheme + src_url;
};
// we *could* test the "default scheme" + "original fragment" URL again
// using LLURI to see if it's valid but I think the outcome is the same
// in either case - our only option is to return the original URL
// we *think* the original url passed in was valid
return src_url;
}
///////////////////////////////////////////////////////////////////////////////
// wrapper for testing a URL against the whitelist. We grab entries from
// white list list box widget and build a list to test against.
bool LLPanelMediaSettingsSecurity::urlPassesWhiteList( const std::string& test_url )
{
// If the whitlelist list is tentative, it means we have multiple settings.
// In that case, we have no choice but to return true
if ( mWhiteListList->getTentative() ) return true;
// the checkUrlAgainstWhitelist(..) function works on a vector
// of strings for the white list entries - in this panel, the white list
// is stored in the widgets themselves so we need to build something compatible.
std::vector< std::string > whitelist_strings;
whitelist_strings.clear(); // may not be required - I forget what the spec says.
// step through whitelist widget entries and grab them as strings
std::vector< LLScrollListItem* > whitelist_items = mWhiteListList->getAllData();
std::vector< LLScrollListItem* >::iterator iter = whitelist_items.begin();
while( iter != whitelist_items.end() )
{
LLScrollListCell* cell = (*iter)->getColumn( ENTRY_COLUMN );
std::string whitelist_url = cell->getValue().asString();
whitelist_strings.push_back( whitelist_url );
++iter;
};
// possible the URL is just a fragment so we validize it
const std::string valid_url = makeValidUrl( test_url );
// indicate if the URL passes whitelist
return LLMediaEntry::checkUrlAgainstWhitelist( valid_url, whitelist_strings );
}
///////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::updateWhitelistEnableStatus()
{
// get the value for home URL and make it a valid URL
const std::string valid_url = makeValidUrl( mParent->getHomeUrl() );
// now check to see if the home url passes the whitelist in its entirity
if ( urlPassesWhiteList( valid_url ) )
{
mEnableWhiteList->setEnabled( true );
mHomeUrlFailsWhiteListText->setVisible( false );
}
else
{
mEnableWhiteList->set( false );
mEnableWhiteList->setEnabled( false );
mHomeUrlFailsWhiteListText->setVisible( true );
};
}
///////////////////////////////////////////////////////////////////////////////
// Add an entry to the whitelist scrollbox and indicate if the current
// home URL passes this entry or not using an icon
void LLPanelMediaSettingsSecurity::addWhiteListEntry( const std::string& entry )
{
// grab the home url
std::string home_url( "" );
if ( mParent )
home_url = mParent->getHomeUrl();
// try to make a valid URL based on what the user entered - missing scheme for example
const std::string valid_url = makeValidUrl( home_url );
// check the home url against this single whitelist entry
std::vector< std::string > whitelist_entries;
whitelist_entries.push_back( entry );
bool home_url_passes_entry = LLMediaEntry::checkUrlAgainstWhitelist( valid_url, whitelist_entries );
// build an icon cell based on whether or not the home url pases it or not
LLSD row;
if ( home_url_passes_entry || home_url.empty() )
{
row[ "columns" ][ ICON_COLUMN ][ "type" ] = "icon";
row[ "columns" ][ ICON_COLUMN ][ "value" ] = "";
row[ "columns" ][ ICON_COLUMN ][ "width" ] = 20;
}
else
{
row[ "columns" ][ ICON_COLUMN ][ "type" ] = "icon";
row[ "columns" ][ ICON_COLUMN ][ "value" ] = "Parcel_Exp_Color.png";
row[ "columns" ][ ICON_COLUMN ][ "width" ] = 20;
};
// always add in the entry itself
row[ "columns" ][ ENTRY_COLUMN ][ "type" ] = "text";
row[ "columns" ][ ENTRY_COLUMN ][ "value" ] = entry;
// add to the white list scroll box
mWhiteListList->addElement( row );
};
///////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsSecurity::onBtnAdd( void* userdata )
{
LLPanelMediaSettingsSecurity* self = (LLPanelMediaSettingsSecurity*)userdata;
LLFloaterWhiteListEntry::getInstance()->open();
for(LLView* parent = self->getParent(); parent !=NULL; parent = parent->getParent())
{
if(dynamic_cast<LLFloater*>(parent))
{
LLFloaterWhiteListEntry::getInstance()->centerWithin(parent->getRect());
break;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsSecurity::onBtnDel( void* userdata )
{
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
self->mWhiteListList->deleteSelectedItems();
// contents of whitelist changed so recheck it against home url
self->updateWhitelistEnableStatus();
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent )
{
mParent = parent;
};

View File

@@ -0,0 +1,82 @@
/**
* @file llpanelmediasettingssecurity.h
* @brief LLPanelMediaSettingsSecurity class definition
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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_LLPANELMEDIAMEDIASETTINGSSECURITY_H
#define LL_LLPANELMEDIAMEDIASETTINGSSECURITY_H
#include "llpanel.h"
class LLCheckBoxCtrl;
class LLScrollListCtrl;
class LLTextBox;
class LLFloaterMediaSettings;
class LLPanelMediaSettingsSecurity : public LLPanel
{
public:
LLPanelMediaSettingsSecurity();
~LLPanelMediaSettingsSecurity();
BOOL postBuild();
virtual void draw();
// XXX TODO: put these into a common parent class?
// Hook that the floater calls before applying changes from the panel
void preApply();
// Function that asks the panel to fill in values associated with the panel
// 'include_tentative' means fill in tentative values as well, otherwise do not
void getValues(LLSD &fill_me_in, bool include_tentative = true);
// Hook that the floater calls after applying changes to the panel
void postApply();
static void initValues( void* userdata, const LLSD& media_settings, bool editable);
static void clearValues( void* userdata, bool editable);
void addWhiteListEntry( const std::string& url );
void setParent( LLFloaterMediaSettings* parent );
bool urlPassesWhiteList( const std::string& test_url );
const std::string makeValidUrl( const std::string& src_url );
void updateWhitelistEnableStatus();
protected:
LLFloaterMediaSettings* mParent;
private:
enum ColumnIndex
{
ICON_COLUMN = 0,
ENTRY_COLUMN = 1,
};
LLCheckBoxCtrl* mEnableWhiteList;
LLScrollListCtrl* mWhiteListList;
LLTextBox* mHomeUrlFailsWhiteListText;
static void onBtnAdd(void*);
static void onBtnDel(void*);
};
#endif // LL_LLPANELMEDIAMEDIASETTINGSSECURITY_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,198 @@
/**
* @file llpanelnearbymedia.h
* @brief Management interface for muting and controlling nearby media
*
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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_LLPANELNEARBYMEDIA_H
#define LL_LLPANELNEARBYMEDIA_H
#include "llpanel.h"
#include "llfloater.h"
#include "llsingleton.h"
class LLPanelNearbyMedia;
class LLButton;
class LLScrollListCtrl;
class LLSlider;
class LLSliderCtrl;
class LLCheckBoxCtrl;
class LLTextBox;
class LLComboBox;
class LLViewerMediaImpl;
class LLPanelNearByMedia : public LLPanel
{
public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
/*virtual*/ void onTopLost();
/*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
// this is part of the nearby media *dialog* so we can track whether
// the user *implicitly* wants audio on or off via their *explicit*
// interaction with our buttons.
bool getParcelAudioAutoStart();
// callback for when the auto play media preference changes
// to update mParcelAudioAutoStart
void handleMediaAutoPlayChanged(const LLSD& newvalue);
LLPanelNearByMedia(bool standalone_panel = true);
virtual ~LLPanelNearByMedia();
private:
enum ColumnIndex {
CHECKBOX_COLUMN = 0,
PROXIMITY_COLUMN = 1,
VISIBILITY_COLUMN = 2,
CLASS_COLUMN = 3,
NAME_COLUMN = 4,
DEBUG_COLUMN = 5
};
// Media "class" enumeration
enum MediaClass {
MEDIA_CLASS_ALL = 0,
MEDIA_CLASS_FOCUSED = 1,
MEDIA_CLASS_WITHIN_PARCEL = 2,
MEDIA_CLASS_OUTSIDE_PARCEL = 3,
MEDIA_CLASS_ON_OTHERS = 4
};
// Add/remove an LLViewerMediaImpl to/from the list
LLScrollListItem* addListItem(const LLUUID &id);
void updateListItem(LLScrollListItem* item, LLViewerMediaImpl* impl);
void updateListItem(LLScrollListItem* item,
const std::string &item_name,
const std::string &item_tooltip,
S32 proximity,
bool is_disabled,
bool has_media,
bool is_time_based_and_playing,
MediaClass media_class,
const std::string &debug_str);
void removeListItem(const LLUUID &id);
// Refresh the list in the UI
void refreshList();
void refreshParcelItems();
// UI Callbacks
void onClickEnableAll();
void onClickDisableAll();
void onClickEnableParcelMedia();
void onClickDisableParcelMedia();
void onClickMuteParcelMedia();
void onParcelMediaVolumeSlider();
void onClickParcelMediaPlay();
void onClickParcelMediaStop();
void onClickParcelMediaPause();
void onClickParcelAudioPlay();
void onClickParcelAudioStop();
void onClickParcelAudioPause();
void onCheckAutoPlay();
void onAdvancedButtonClick();
void onMoreLess();
void onCheckItem(LLUICtrl* ctrl, const LLUUID &row_id);
static void onZoomMedia(void* user_data);
private:
bool setDisabled(const LLUUID &id, bool disabled);
static void getNameAndUrlHelper(LLViewerMediaImpl* impl, std::string& name, std::string & url, const std::string &defaultName);
void updateColumns();
bool shouldShow(LLViewerMediaImpl* impl);
void showBasicControls(bool playing, bool include_zoom, bool is_zoomed, bool muted, F32 volume);
void showTimeBasedControls(bool playing, bool include_zoom, bool is_zoomed, bool muted, F32 volume);
void showDisabledControls();
void updateControls();
void onClickSelectedMediaStop();
void onClickSelectedMediaPlay();
void onClickSelectedMediaPause();
void onClickSelectedMediaMute();
void onCommitSelectedMediaVolume();
void onClickSelectedMediaZoom();
void onClickSelectedMediaUnzoom();
LLUICtrl* mNearbyMediaPanel;
LLScrollListCtrl* mMediaList;
LLUICtrl* mEnableAllCtrl;
LLUICtrl* mDisableAllCtrl;
LLComboBox* mShowCtrl;
// Dynamic (selection-dependent) controls
LLUICtrl* mStopCtrl;
LLUICtrl* mPlayCtrl;
LLUICtrl* mPauseCtrl;
LLUICtrl* mMuteCtrl;
LLUICtrl* mVolumeSliderCtrl;
LLUICtrl* mZoomCtrl;
LLUICtrl* mUnzoomCtrl;
LLSlider* mVolumeSlider;
LLButton* mMuteBtn;
bool mAllMediaDisabled;
bool mDebugInfoVisible;
bool mParcelAudioAutoStart;
std::string mEmptyNameString;
std::string mPlayingString;
std::string mParcelMediaName;
std::string mParcelAudioName;
LLRect mMoreRect;
LLRect mLessRect;
LLFrameTimer mHoverTimer;
LLScrollListItem* mParcelMediaItem;
LLScrollListItem* mParcelAudioItem;
bool mStandalonePanel;
};
class LLFloaterNearbyMedia : public LLFloater, public LLSingleton<LLFloaterNearbyMedia>
{
public:
LLFloaterNearbyMedia();
static void updateClass();
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void onOpen();
virtual void handleReshape(const LLRect& new_rect, bool by_user);
};
#endif // LL_LLPANELNEARBYMEDIA_H

View File

@@ -730,7 +730,7 @@ void LLPanelPrimMediaControls::draw()
}
}
F32 alpha = 1.f;
F32 alpha = getDrawContext().mAlpha;
if(mHideImmediately)
{
//hide this panel
@@ -781,7 +781,7 @@ void LLPanelPrimMediaControls::draw()
}
{
//LLViewDrawContext context(alpha);
LLViewDrawContext context(alpha);
LLPanel::draw();
}
}

View File

@@ -27,13 +27,13 @@
#ifndef LL_PARTICIPANTLIST_H
#define LL_PARTICIPANTLIST_H
#include "llpanel.h"
#include "lllayoutstack.h"
class LLSpeakerMgr;
class LLScrollListCtrl;
class LLUICtrl;
class LLParticipantList : public LLPanel
class LLParticipantList : public LLLayoutPanel
{
LOG_CLASS(LLParticipantList);
public:

View File

@@ -845,5 +845,52 @@ template <typename T> bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGet
return identical;
}
// Templates
//-----------------------------------------------------------------------------
// isMultipleTEValue iterate through all TEs and test for uniqueness
// with certain return value ignored when performing the test.
// e.g. when testing if the selection has a unique non-empty homeurl :
// you can set ignore_value = "" and it will only compare among the non-empty
// homeUrls and ignore the empty ones.
//-----------------------------------------------------------------------------
template <typename T> bool LLObjectSelection::isMultipleTEValue(LLSelectedTEGetFunctor<T>* func, const T& ignore_value)
{
bool have_first = false;
T selected_value = T();
// Now iterate through all TEs to test for sameness
bool unique = TRUE;
for (iterator iter = begin(); iter != end(); iter++)
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
for (S32 te = 0; te < object->getNumTEs(); ++te)
{
if (!node->isTESelected(te))
{
continue;
}
T value = func->get(object, te);
if(value == ignore_value)
{
continue;
}
if (!have_first)
{
have_first = true;
}
else
{
if (value !=selected_value )
{
unique = false;
return !unique;
}
}
}
}
return !unique;
}
#endif

View File

@@ -53,11 +53,14 @@ const char* LLSLURL::SLURL_REGION_PATH = "region";
const char* LLSLURL::SIM_LOCATION_HOME = "home";
const char* LLSLURL::SIM_LOCATION_LAST = "last";
const std::string MAIN_GRID_SLURL_BASE = "http://maps.secondlife.com/secondlife/";
const std::string SYSTEM_GRID_APP_SLURL_BASE = "secondlife:///app";
#define MAINGRID "util.agni.lindenlab.com"
const char* SYSTEM_GRID_SLURL_BASE = "secondlife://%s/secondlife/";
const char* DEFAULT_SLURL_BASE = "https://%s/region/";
const char* DEFAULT_APP_SLURL_BASE = "x-grid-location-info://%s/app";
#define MAINGRID "secondlife"
// resolve a simstring from a slurl
LLSLURL::LLSLURL(const std::string& slurl)
{
@@ -87,7 +90,19 @@ LLSLURL::LLSLURL(const std::string& slurl)
// where the user can type in <regionname>/<x>/<y>/<z>
//std::string fixed_slurl = LLGridManager::getInstance()->getSLURLBase();
//Singu TODO: Implement LLHippoGridMgr::getSLURLBase some day. For now it's hardcoded.
std::string fixed_slurl = MAIN_GRID_SLURL_BASE;
std::string fixed_slurl;
if(gHippoGridManager->getCurrentGrid()->isSecondLife())
{
if(gHippoGridManager->getCurrentGrid()->isInProductionGrid())
fixed_slurl = MAIN_GRID_SLURL_BASE;
else
fixed_slurl = llformat(SYSTEM_GRID_SLURL_BASE, gHippoGridManager->getCurrentGridNick().c_str());
}
else
fixed_slurl = llformat(DEFAULT_SLURL_BASE, gHippoGridManager->getCurrentGridNick().c_str());
//std::string fixed_slurl = MAIN_GRID_SLURL_BASE;
// the slurl that was passed in might have a prepended /, or not. So,
// we strip off the prepended '/' so we don't end up with http://slurl.com/secondlife/<region>/<x>/<y>/<z>
@@ -147,7 +162,15 @@ LLSLURL::LLSLURL(const std::string& slurl)
// so parse the grid name to derive the grid ID
if (!slurl_uri.hostName().empty())
{
mGrid = gHippoGridManager->getGrid(slurl_uri.hostName())->getGridNick();
if(slurl_uri.hostName() == "util.agni.lindenlab.com")
mGrid = MAINGRID;
else if(slurl_uri.hostName() == "util.aditi.lindenlab.com")
mGrid = "secondlife_beta";
else
{
HippoGridInfo* grid = gHippoGridManager->getGrid(slurl_uri.hostName());
mGrid = grid ? grid->getGridNick() : gHippoGridManager->getDefaultGridNick();
}
}
else if(path_array[0].asString() == LLSLURL::SLURL_SECONDLIFE_PATH)
{
@@ -353,8 +376,8 @@ LLSLURL::LLSLURL(const std::string& grid,
const std::string& region,
const LLVector3d& global_position)
{
HippoGridInfo* target_grid = gHippoGridManager->getGrid(grid);
*this = LLSLURL((target_grid ? target_grid->getGridNick() : ""),
HippoGridInfo* gridp = gHippoGridManager->getGrid(grid);
*this = LLSLURL(gridp ? gridp->getGridNick() : gHippoGridManager->getDefaultGridNick(),
region, LLVector3(global_position.mdV[VX],
global_position.mdV[VY],
global_position.mdV[VZ]));
@@ -394,7 +417,17 @@ std::string LLSLURL::getSLURLString() const
S32 z = llround( (F32)mPosition[VZ] );
//return LLGridManager::getInstance()->getSLURLBase(mGrid) +
//Singu TODO: Implement LLHippoGridMgr::getSLURLBase some day. For now it's hardcoded.
return MAIN_GRID_SLURL_BASE +
std::string fixed_slurl;
if(gHippoGridManager->getCurrentGrid()->isSecondLife())
{
if(gHippoGridManager->getCurrentGrid()->isInProductionGrid())
fixed_slurl = MAIN_GRID_SLURL_BASE;
else
fixed_slurl = llformat(SYSTEM_GRID_SLURL_BASE, gHippoGridManager->getCurrentGridNick().c_str());
}
else
fixed_slurl = llformat(DEFAULT_SLURL_BASE, gHippoGridManager->getCurrentGridNick().c_str());
return fixed_slurl +
LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z);
}
case APP:
@@ -402,7 +435,10 @@ std::string LLSLURL::getSLURLString() const
std::ostringstream app_url;
//app_url << LLGridManager::getInstance()->getAppSLURLBase() << "/" << mAppCmd;
//Singu TODO: Implement LLHippoGridMgr::getAppSLURLBase some day. For now it's hardcoded.
app_url << SYSTEM_GRID_APP_SLURL_BASE << "/" << mAppCmd;
if(gHippoGridManager->getCurrentGrid()->isSecondLife())
app_url << SYSTEM_GRID_APP_SLURL_BASE << "/" << mAppCmd;
else
app_url << llformat(DEFAULT_APP_SLURL_BASE, gHippoGridManager->getCurrentGridNick().c_str()) << "/" << mAppCmd;
for(LLSD::array_const_iterator i = mAppPath.beginArray();
i != mAppPath.endArray();
i++)

View File

@@ -1675,8 +1675,6 @@ bool idle_startup()
// object is created. I think this must be done after setting the region. JC
gAgent.setPositionAgent(agent_start_position_region);
wlfPanel_AdvSettings::fixPanel();
display_startup();
LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT );
return FALSE;
@@ -3935,11 +3933,11 @@ bool process_login_success_response(std::string& password)
std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml");
LLSavedLogins history_data = LLSavedLogins::loadFile(history_file);
std::string grid_nick = gHippoGridManager->getConnectedGrid()->getGridName();
history_data.deleteEntry(firstname, lastname, grid_nick);
std::string grid_name = gHippoGridManager->getConnectedGrid()->getGridName();
history_data.deleteEntry(firstname, lastname, grid_name);
if (gSavedSettings.getBOOL("RememberLogin"))
{
LLSavedLoginEntry login_entry(firstname, lastname, password, grid_nick);
LLSavedLoginEntry login_entry(firstname, lastname, password, grid_name);
history_data.addEntry(login_entry);
}
else
@@ -4224,8 +4222,6 @@ bool process_login_success_response(std::string& password)
LLViewerMedia::openIDSetup(openid_url, openid_token);
}
gIMMgr->loadIgnoreGroup();
bool success = false;
// JC: gesture loading done below, when we have an asset system
// in place. Don't delete/clear user_credentials until then.

View File

@@ -1173,9 +1173,6 @@ LLXMLNodePtr LLTextureCtrl::getXML(bool save_children) const
LLView* LLTextureCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
std::string name("texture_picker");
node->getAttributeString("name", name);
LLRect rect;
createRect(node, rect, parent);
@@ -1206,7 +1203,7 @@ LLView* LLTextureCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
}
LLTextureCtrl* texture_picker = new LLTextureCtrl(
name,
"texture_picker",
rect,
label,
LLUUID(image_id),

View File

@@ -66,6 +66,21 @@ LLTool::~LLTool()
}
}
BOOL LLTool::handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down)
{
BOOL result = LLMouseHandler::handleAnyMouseClick(x, y, mask, clicktype, down);
// This behavior was moved here from LLViewerWindow::handleAnyMouseClick, so it can be selectively overridden by LLTool subclasses.
if(down && result)
{
// This is necessary to force clicks in the world to cause edit
// boxes that might have keyboard focus to relinquish it, and hence
// cause a commit to update their value. JC
gFocusMgr.setKeyboardFocus(NULL);
}
return result;
}
BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask)
{

View File

@@ -55,6 +55,7 @@ public:
virtual BOOL isView() const { return FALSE; }
// Virtual functions inherited from LLMouseHandler
virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);

View File

@@ -114,7 +114,7 @@ F32 LLToolBar::sInventoryAutoOpenTime = 1.f;
//
LLToolBar::LLToolBar()
: LLPanel()
: LLLayoutPanel()
#if LL_DARWIN
, mResizeHandle(NULL)
#endif // LL_DARWIN

View File

@@ -34,6 +34,7 @@
#define LL_LLTOOLBAR_H
#include "llpanel.h"
#include "lllayoutstack.h"
#include "llframetimer.h"
@@ -47,7 +48,7 @@ extern S32 TOOL_BAR_HEIGHT;
class LLFlyoutButton;
class LLToolBar
: public LLPanel
: public LLLayoutPanel
{
public:
LLToolBar();

View File

@@ -92,6 +92,15 @@ LLToolPie::LLToolPie()
{
}
BOOL LLToolPie::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
{
BOOL result = LLMouseHandler::handleAnyMouseClick(x, y, mask, clicktype, down);
// This override DISABLES the keyboard focus reset that LLTool::handleAnyMouseClick adds.
// LLToolPie will do the right thing in its pick callback.
return result;
}
BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask)
{
@@ -892,7 +901,6 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick)
pick.mObjectFace < 0 ||
pick.mObjectFace >= objectp->getNumTEs())
{
LLSelectMgr::getInstance()->deselect();
LLViewerMediaFocus::getInstance()->clearFocus();
return false;
@@ -930,7 +938,6 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick)
return true;
}
LLSelectMgr::getInstance()->deselect();
LLViewerMediaFocus::getInstance()->clearFocus();
return false;

View File

@@ -46,6 +46,7 @@ public:
LLToolPie( );
// Virtual functions inherited from LLMouseHandler
virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);

View File

@@ -216,9 +216,9 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
{
LLSD args;
args["SLURL"] = slurl.getLocationString();
args["CURRENT_GRID"] = gHippoGridManager->getCurrentGridNick();
args["CURRENT_GRID"] = gHippoGridManager->getCurrentGrid()->getGridName();
std::string grid_label = new_grid ? new_grid->getGridNick() : "";
std::string grid_label = new_grid ? new_grid->getGridName() : "";
if(!grid_label.empty())
{
@@ -226,7 +226,7 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
}
else
{
args["GRID"] = slurl.getGrid();
args["GRID"] = slurl.getGrid() + " (Unrecognized)";
}
LLNotificationsUtil::add("CantTeleportToGrid", args);
return;
@@ -255,8 +255,7 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
{
url_displayp->setSnapshotDisplay(snapshot_id);
}
LLVector3 pos = slurl.getPosition();
std::string locationString = llformat("%s %d, %d, %d", slurl.getRegion().c_str(), local_pos.mV[VX],local_pos.mV[VY],local_pos.mV[VZ]);
std::string locationString = llformat("%s %i, %i, %i", slurl.getRegion().c_str(), (S32)local_pos.mV[VX],(S32)local_pos.mV[VY],(S32)local_pos.mV[VZ]);
url_displayp->setLocationString(locationString);
}
}

View File

@@ -35,6 +35,7 @@
#include "linden_common.h"
#include "llpluginclassmedia.h"
#include "llpluginclassmediaowner.h"
#include "llviewermedia.h"
#include "llviewermedia_streamingaudio.h"
@@ -63,18 +64,18 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
if (!mMediaPlugin) // lazy-init the underlying media plugin
{
mMediaPlugin = initializeMedia("audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
llinfos << "mMediaPlugin is now " << mMediaPlugin << llendl;
llinfos << "streaming audio mMediaPlugin is now " << mMediaPlugin << llendl;
}
if(!mMediaPlugin)
return;
if (!url.empty()) {
llinfos << "Starting internet stream: " << url << llendl;
mURL = url;
mMediaPlugin->loadURI ( url );
mMediaPlugin->start();
llinfos << "Playing....." << llendl;
llinfos << "Playing stream..." << llendl;
} else {
llinfos << "setting stream to NULL"<< llendl;
mURL.clear();
@@ -84,11 +85,9 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
void LLStreamingAudio_MediaPlugins::stop()
{
llinfos << "entered LLStreamingAudio_MediaPlugins::stop()" << llendl;
llinfos << "Stopping internet stream." << llendl;
if(mMediaPlugin)
{
llinfos << "Stopping internet stream: " << mURL << llendl;
mMediaPlugin->stop();
}
@@ -102,10 +101,12 @@ void LLStreamingAudio_MediaPlugins::pause(int pause)
if(pause)
{
llinfos << "Pausing internet stream." << llendl;
mMediaPlugin->pause();
}
else
{
llinfos << "Unpausing internet stream." << llendl;
mMediaPlugin->start();
}
}
@@ -119,20 +120,21 @@ void LLStreamingAudio_MediaPlugins::update()
int LLStreamingAudio_MediaPlugins::isPlaying()
{
if (!mMediaPlugin)
return 0;
return 0; // stopped
// *TODO: can probably do better than this
if (mMediaPlugin->isPluginRunning())
{
return 1; // Active and playing
}
LLPluginClassMediaOwner::EMediaStatus status =
mMediaPlugin->getStatus();
if (mMediaPlugin->isPluginExited())
switch (status)
{
case LLPluginClassMediaOwner::MEDIA_LOADING: // but not MEDIA_LOADED
case LLPluginClassMediaOwner::MEDIA_PLAYING:
return 1; // Active and playing
case LLPluginClassMediaOwner::MEDIA_PAUSED:
return 2; // paused
default:
return 0; // stopped
}
return 2; // paused
}
void LLStreamingAudio_MediaPlugins::setGain(F32 vol)

View File

@@ -419,13 +419,13 @@ void LLViewerMediaFocus::update()
// We have an object and impl to point at.
// Make sure the media HUD object exists.
/*if(! mMediaControls.get())
if(! mMediaControls.get())
{
LLPanelPrimMediaControls* media_controls = new LLPanelPrimMediaControls();
mMediaControls = media_controls->getHandle();
gHUDView->addChild(media_controls);
}
mMediaControls.get()->setMediaFace(viewer_object, face, media_impl, normal);*/
mMediaControls.get()->setMediaFace(viewer_object, face, media_impl, normal);
}
else
{
@@ -434,6 +434,7 @@ void LLViewerMediaFocus::update()
{
mMediaControls.get()->setMediaFace(NULL, 0, NULL);
}
}
}

View File

@@ -325,7 +325,7 @@ public:
/*virtual*/ S32 setTEGlow(const U8 te, const F32 glow);
/*virtual*/ BOOL setMaterial(const U8 material);
virtual void setTEImage(const U8 te, LLViewerTexture *imagep); // Not derived from LLPrimitive
void changeTEImage(S32 index, LLViewerTexture* new_image) ;
virtual void changeTEImage(S32 index, LLViewerTexture* new_image) ;
LLViewerTexture *getTEImage(const U8 te) const;
void fitFaceTexture(const U8 face);

Some files were not shown because too many files have changed in this diff Show More