summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--[-rwxr-xr-x]BuildParams0
-rw-r--r--[-rwxr-xr-x]indra/llcommon/llversionviewer.h0
-rw-r--r--[-rwxr-xr-x]indra/llmath/llvolume.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llprimitive/llprimitive.h0
-rw-r--r--indra/llui/llaccordionctrltab.cpp2
-rw-r--r--indra/llui/llbadge.cpp117
-rw-r--r--indra/llui/llbadge.h9
-rw-r--r--indra/llui/llbutton.cpp3
-rw-r--r--indra/llui/llconsole.h2
-rw-r--r--indra/llui/llcontainerview.h2
-rw-r--r--indra/llui/lldraghandle.h4
-rw-r--r--indra/llui/llfiltereditor.h7
-rw-r--r--indra/llui/llfloater.cpp2
-rw-r--r--indra/llui/llflyoutbutton.h2
-rw-r--r--indra/llui/lliconctrl.cpp5
-rw-r--r--indra/llui/lllayoutstack.cpp4
-rw-r--r--indra/llui/lllineeditor.cpp2
-rw-r--r--indra/llui/llmenugl.cpp29
-rw-r--r--indra/llui/llmenugl.h23
-rw-r--r--indra/llui/llmultislider.cpp6
-rw-r--r--indra/llui/llpanel.cpp1
-rw-r--r--indra/llui/llradiogroup.cpp8
-rw-r--r--indra/llui/llscrollbar.cpp4
-rw-r--r--indra/llui/llscrollcontainer.cpp6
-rw-r--r--indra/llui/llscrollingpanellist.h7
-rw-r--r--indra/llui/llscrolllistcolumn.cpp5
-rw-r--r--indra/llui/llscrolllistcolumn.h2
-rw-r--r--indra/llui/llscrolllistctrl.cpp14
-rw-r--r--indra/llui/llsearcheditor.h4
-rw-r--r--indra/llui/llslider.cpp4
-rw-r--r--indra/llui/llsliderctrl.cpp65
-rw-r--r--indra/llui/llstatbar.h2
-rw-r--r--indra/llui/llstatview.h2
-rw-r--r--indra/llui/lltabcontainer.cpp5
-rw-r--r--indra/llui/lltooltip.cpp8
-rw-r--r--indra/llui/lluictrlfactory.h13
-rw-r--r--indra/llui/llview.cpp69
-rw-r--r--indra/llui/llviewborder.cpp3
-rw-r--r--indra/llui/llwindowshade.cpp2
-rw-r--r--indra/llxuixml/llinitparam.h44
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/app_settings/settings_per_account.xml4
-rw-r--r--[-rwxr-xr-x]indra/newview/llassetuploadresponders.cpp0
-rw-r--r--indra/newview/llavatariconctrl.cpp1
-rw-r--r--indra/newview/llchannelmanager.h5
-rw-r--r--indra/newview/llchatmsgbox.cpp2
-rw-r--r--indra/newview/llchiclet.cpp6
-rw-r--r--indra/newview/llchiclet.h19
-rw-r--r--indra/newview/llcolorswatch.cpp1
-rw-r--r--indra/newview/lldebugview.h2
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloatermodelpreview.cpp0
-rw-r--r--indra/newview/llfolderview.cpp31
-rw-r--r--indra/newview/llfoldervieweventlistener.h3
-rw-r--r--indra/newview/llfolderviewitem.cpp94
-rw-r--r--indra/newview/llfolderviewitem.h7
-rw-r--r--indra/newview/llinventorybridge.cpp371
-rw-r--r--indra/newview/llinventorybridge.h26
-rw-r--r--indra/newview/llinventoryfunctions.cpp180
-rw-r--r--indra/newview/llinventoryfunctions.h7
-rw-r--r--indra/newview/llinventorypanel.cpp49
-rw-r--r--indra/newview/llinventorypanel.h2
-rw-r--r--indra/newview/lljoystickbutton.h4
-rw-r--r--indra/newview/llmediactrl.cpp1
-rw-r--r--indra/newview/llmemoryview.h4
-rw-r--r--[-rwxr-xr-x]indra/newview/llmeshrepository.cpp0
-rw-r--r--[-rwxr-xr-x]indra/newview/llmeshrepository.h0
-rw-r--r--indra/newview/llmorphview.h4
-rw-r--r--indra/newview/llnamelistctrl.cpp1
-rw-r--r--indra/newview/llpanelavatar.cpp4
-rw-r--r--indra/newview/llpanelgroupnotices.cpp4
-rw-r--r--indra/newview/llpanelmarketplaceinbox.cpp474
-rw-r--r--indra/newview/llpanelmarketplaceinbox.h4
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.cpp92
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.h30
-rw-r--r--indra/newview/llpanelmarketplaceoutbox.cpp188
-rw-r--r--indra/newview/llpanelmarketplaceoutbox.h16
-rw-r--r--indra/newview/llpanelmarketplaceoutboxinventory.cpp271
-rw-r--r--indra/newview/llpanelmarketplaceoutboxinventory.h97
-rw-r--r--indra/newview/llpanelobjectinventory.cpp12
-rw-r--r--indra/newview/llsearchcombobox.cpp7
-rw-r--r--indra/newview/llsidepanelinventory.cpp245
-rw-r--r--indra/newview/llsidepanelinventory.h9
-rw-r--r--indra/newview/llsidetray.cpp2
-rw-r--r--indra/newview/llsidetraypanelcontainer.cpp4
-rw-r--r--indra/newview/llspeakbutton.cpp10
-rw-r--r--indra/newview/lltexturectrl.h6
-rw-r--r--indra/newview/lltextureview.cpp6
-rw-r--r--indra/newview/lltooldraganddrop.cpp13
-rw-r--r--indra/newview/llviewermedia.cpp66
-rw-r--r--indra/newview/llviewermedia.h2
-rw-r--r--indra/newview/llviewerobjectlist.cpp4
-rw-r--r--indra/newview/llviewertexteditor.h7
-rw-r--r--[-rwxr-xr-x]indra/newview/llvovolume.cpp0
-rw-r--r--indra/newview/skins/default/colors.xml13
-rw-r--r--indra/newview/skins/default/textures/textures.xml4
-rw-r--r--indra/newview/skins/default/textures/widgets/Badge_Background_New.pngbin1369 -> 0 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/Error_Tag_Background.pngbin0 -> 1354 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/New_Tag_Background.pngbin0 -> 957 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/New_Tag_Border.pngbin0 -> 969 bytes
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/en/floater_model_preview.xml0
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml21
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml42
-rw-r--r--indra/newview/skins/default/xui/en/panel_inbox_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_outbox_inventory.xml7
-rw-r--r--indra/newview/skins/default/xui/en/sidepanel_inventory.xml115
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml33
-rw-r--r--indra/newview/skins/default/xui/en/widgets/badge.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/button.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/color_swatch.xml2
-rw-r--r--indra/newview/skins/default/xui/en/widgets/filter_editor.xml1
-rw-r--r--indra/newview/skins/default/xui/en/widgets/folder_view_item.xml2
-rw-r--r--indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml12
-rw-r--r--indra/newview/skins/default/xui/en/widgets/layout_stack.xml4
-rw-r--r--indra/newview/skins/default/xui/en/widgets/menu.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/menu_bar.xml7
-rw-r--r--indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml8
-rw-r--r--indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml9
-rw-r--r--indra/newview/skins/default/xui/en/widgets/multi_slider.xml9
-rw-r--r--indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml7
-rw-r--r--indra/newview/skins/default/xui/en/widgets/name_list.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml19
-rw-r--r--indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml2
-rw-r--r--indra/newview/skins/default/xui/en/widgets/panel.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/scroll_bar.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml7
-rw-r--r--indra/newview/skins/default/xui/en/widgets/scroll_container.xml7
-rw-r--r--indra/newview/skins/default/xui/en/widgets/scroll_list.xml4
-rw-r--r--indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml2
-rw-r--r--indra/newview/skins/default/xui/en/widgets/search_editor.xml1
-rw-r--r--indra/newview/skins/default/xui/en/widgets/slider_bar.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/tab_container.xml4
-rw-r--r--indra/newview/skins/default/xui/en/widgets/text_editor.xml1
-rw-r--r--indra/newview/skins/default/xui/en/widgets/texture_picker.xml6
-rw-r--r--indra/newview/skins/default/xui/en/widgets/view_border.xml7
-rw-r--r--indra/newview/skins/default/xui/en/widgets/web_browser.xml4
-rwxr-xr-x[-rw-r--r--]scripts/gpu_table_tester0
138 files changed, 2425 insertions, 857 deletions
diff --git a/BuildParams b/BuildParams
index b62d7b7af1..b62d7b7af1 100755..100644
--- a/BuildParams
+++ b/BuildParams
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index ef55cfec89..ef55cfec89 100755..100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 2893e746e9..2893e746e9 100755..100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index 998016f8f6..998016f8f6 100755..100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 6afe276379..4b0b7c561d 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -339,7 +339,7 @@ LLAccordionCtrlTab::Params::Params()
,fit_panel("fit_panel",true)
,selection_enabled("selection_enabled", false)
{
- mouse_opaque(false);
+ changeDefault(mouse_opaque, false);
}
LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p)
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp
index fde3c53a65..8ede4e3468 100644
--- a/indra/llui/llbadge.cpp
+++ b/indra/llui/llbadge.cpp
@@ -27,11 +27,14 @@
#define LLBADGE_CPP
#include "llbadge.h"
+#include "llscrollcontainer.h"
#include "lluictrlfactory.h"
static LLDefaultChildRegistry::Register<LLBadge> r("badge");
+static const S32 BADGE_OFFSET_NOT_SPECIFIED = 0x7FFFFFFF;
+
// Compiler optimization, generate extern template
template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, BOOL recurse) const;
@@ -46,14 +49,13 @@ LLBadge::Params::Params()
, label_offset_horiz("label_offset_horiz")
, label_offset_vert("label_offset_vert")
, location("location", LLRelPos::TOP_LEFT)
+ , location_offset_hcenter("location_offset_hcenter")
+ , location_offset_vcenter("location_offset_vcenter")
, location_percent_hcenter("location_percent_hcenter")
, location_percent_vcenter("location_percent_vcenter")
, padding_horiz("padding_horiz")
, padding_vert("padding_vert")
-{
- // We set a name here so the name isn't necessary in any xml files that use badges
- name = "badge";
-}
+{}
bool LLBadge::Params::equals(const Params& a) const
{
@@ -70,6 +72,8 @@ bool LLBadge::Params::equals(const Params& a) const
comp &= (label_offset_horiz() == a.label_offset_horiz());
comp &= (label_offset_vert() == a.label_offset_vert());
comp &= (location() == a.location());
+ comp &= (location_offset_hcenter() == a.location_offset_hcenter());
+ comp &= (location_offset_vcenter() == a.location_offset_vcenter());
comp &= (location_percent_hcenter() == a.location_percent_hcenter());
comp &= (location_percent_vcenter() == a.location_percent_vcenter());
comp &= (padding_horiz() == a.padding_horiz());
@@ -91,16 +95,29 @@ LLBadge::LLBadge(const LLBadge::Params& p)
, mLabelOffsetHoriz(p.label_offset_horiz)
, mLabelOffsetVert(p.label_offset_vert)
, mLocation(p.location)
+ , mLocationOffsetHCenter(BADGE_OFFSET_NOT_SPECIFIED)
+ , mLocationOffsetVCenter(BADGE_OFFSET_NOT_SPECIFIED)
, mLocationPercentHCenter(0.5f)
, mLocationPercentVCenter(0.5f)
, mPaddingHoriz(p.padding_horiz)
, mPaddingVert(p.padding_vert)
+ , mParentScroller(NULL)
{
if (mImage.isNull())
{
llwarns << "Badge: " << getName() << " with no image!" << llendl;
}
+ if (p.location_offset_hcenter.isProvided())
+ {
+ mLocationOffsetHCenter = p.location_offset_hcenter();
+ }
+
+ if (p.location_offset_vcenter.isProvided())
+ {
+ mLocationOffsetVCenter = p.location_offset_vcenter();
+ }
+
//
// The following logic is to set the mLocationPercentHCenter and mLocationPercentVCenter
// based on the Location enum and our horizontal and vertical location percentages. The
@@ -144,6 +161,15 @@ bool LLBadge::addToView(LLView * view)
if (child_added)
{
setShape(view->getLocalRect());
+
+ // Find a parent scroll container, if there is one in case we need it for positioning
+
+ LLView * parent = mOwner.get();
+
+ while ((parent != NULL) && ((mParentScroller = dynamic_cast<LLScrollContainer *>(parent)) == NULL))
+ {
+ parent = parent->getParent();
+ }
}
return child_added;
@@ -201,21 +227,11 @@ void LLBadge::draw()
if (owner_view)
{
//
- // Calculate badge position based on owner
- //
-
- LLRect owner_rect;
- owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this);
-
- F32 badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter;
- F32 badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter;
-
- //
// Calculate badge size based on label text
//
LLWString badge_label_wstring = mLabel;
-
+
S32 badge_label_begin_offset = 0;
S32 badge_char_length = S32_MAX;
S32 badge_pixel_length = S32_MAX;
@@ -228,6 +244,77 @@ void LLBadge::draw()
F32 badge_height = (2.0f * mPaddingVert) + mGLFont->getLineHeight();
//
+ // Calculate badge position based on owner
+ //
+
+ LLRect owner_rect;
+ owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this);
+
+ S32 location_offset_horiz = mLocationOffsetHCenter;
+ S32 location_offset_vert = mLocationOffsetVCenter;
+
+ // If we're in a scroll container, do some math to keep us in the same place on screen if applicable
+ if (mParentScroller != NULL)
+ {
+ LLRect visibleRect = mParentScroller->getVisibleContentRect();
+
+ if (mLocationOffsetHCenter != BADGE_OFFSET_NOT_SPECIFIED)
+ {
+ if (LLRelPos::IsRight(mLocation))
+ {
+ location_offset_horiz += visibleRect.mRight;
+ }
+ else if (LLRelPos::IsLeft(mLocation))
+ {
+ location_offset_horiz += visibleRect.mLeft;
+ }
+ else // center
+ {
+ location_offset_horiz += (visibleRect.mLeft + visibleRect.mRight) / 2;
+ }
+ }
+
+ if (mLocationOffsetVCenter != BADGE_OFFSET_NOT_SPECIFIED)
+ {
+ if (LLRelPos::IsTop(mLocation))
+ {
+ location_offset_vert += visibleRect.mTop;
+ }
+ else if (LLRelPos::IsBottom(mLocation))
+ {
+ location_offset_vert += visibleRect.mBottom;
+ }
+ else // center
+ {
+ location_offset_vert += (visibleRect.mBottom + visibleRect.mTop) / 2;
+ }
+ }
+ }
+
+ F32 badge_center_x;
+ F32 badge_center_y;
+
+ // Compute x position
+ if (mLocationOffsetHCenter == BADGE_OFFSET_NOT_SPECIFIED)
+ {
+ badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter;
+ }
+ else
+ {
+ badge_center_x = location_offset_horiz;
+ }
+
+ // Compute y position
+ if (mLocationOffsetVCenter == BADGE_OFFSET_NOT_SPECIFIED)
+ {
+ badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter;
+ }
+ else
+ {
+ badge_center_y = location_offset_vert;
+ }
+
+ //
// Draw button image, if available.
// Otherwise draw basic rectangular button.
//
diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h
index f81ccdf0cd..4b21a71aaa 100644
--- a/indra/llui/llbadge.h
+++ b/indra/llui/llbadge.h
@@ -39,8 +39,9 @@
// Declarations
//
-class LLUICtrlFactory;
class LLFontGL;
+class LLScrollContainer;
+class LLUICtrlFactory;
//
// Relative Position Alignment
@@ -108,6 +109,8 @@ public:
Optional< S32 > label_offset_vert;
Optional< LLRelPos::Location > location;
+ Optional< S32 > location_offset_hcenter;
+ Optional< S32 > location_offset_vcenter;
Optional< U32 > location_percent_hcenter;
Optional< U32 > location_percent_vcenter;
@@ -150,6 +153,8 @@ private:
S32 mLabelOffsetVert;
LLRelPos::Location mLocation;
+ S32 mLocationOffsetHCenter;
+ S32 mLocationOffsetVCenter;
F32 mLocationPercentHCenter;
F32 mLocationPercentVCenter;
@@ -157,6 +162,8 @@ private:
F32 mPaddingHoriz;
F32 mPaddingVert;
+
+ LLScrollContainer* mParentScroller;
};
// Build time optimization, generate once in .cpp file
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 7b015bd576..a12235c16f 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -104,8 +104,7 @@ LLButton::Params::Params()
handle_right_mouse("handle_right_mouse")
{
addSynonym(is_toggle, "toggle");
- held_down_delay.seconds = 0.5f;
- initial_value.set(LLSD(false), false);
+ changeDefault(initial_value, LLSD(false));
}
diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h
index bb8ea50bed..f32f1dd74c 100644
--- a/indra/llui/llconsole.h
+++ b/indra/llui/llconsole.h
@@ -54,7 +54,7 @@ public:
persist_time("persist_time", 0.f), // forever
font_size_index("font_size_index")
{
- mouse_opaque(false);
+ changeDefault(mouse_opaque, false);
}
};
protected:
diff --git a/indra/llui/llcontainerview.h b/indra/llui/llcontainerview.h
index 7d3d5cf787..e81600fd6c 100644
--- a/indra/llui/llcontainerview.h
+++ b/indra/llui/llcontainerview.h
@@ -50,7 +50,7 @@ public:
show_label("show_label", FALSE),
display_children("display_children", TRUE)
{
- mouse_opaque(false);
+ changeDefault(mouse_opaque, false);
}
};
diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h
index 7c56475e75..e095e577b1 100644
--- a/indra/llui/lldraghandle.h
+++ b/indra/llui/lldraghandle.h
@@ -51,8 +51,8 @@ public:
drag_highlight_color("drag_highlight_color", LLUIColorTable::instance().getColor("DefaultHighlightLight")),
drag_shadow_color("drag_shadow_color", LLUIColorTable::instance().getColor("DefaultShadowDark"))
{
- mouse_opaque(true);
- follows.flags(FOLLOWS_ALL);
+ changeDefault(mouse_opaque, true);
+ changeDefault(follows.flags, FOLLOWS_ALL);
}
};
void initFromParams(const Params&);
diff --git a/indra/llui/llfiltereditor.h b/indra/llui/llfiltereditor.h
index 710699fdc1..3a05bc05a1 100644
--- a/indra/llui/llfiltereditor.h
+++ b/indra/llui/llfiltereditor.h
@@ -42,12 +42,7 @@ class LLFilterEditor : public LLSearchEditor
{
public:
struct Params : public LLInitParam::Block<Params, LLSearchEditor::Params>
- {
- Params()
- {
- name = "filter_editor";
- }
- };
+ {};
protected:
LLFilterEditor(const Params&);
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 8917d5490c..bc494e97f5 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -182,7 +182,7 @@ LLFloater::Params::Params()
open_callback("open_callback"),
close_callback("close_callback")
{
- visible = false;
+ changeDefault(visible, false);
}
diff --git a/indra/llui/llflyoutbutton.h b/indra/llui/llflyoutbutton.h
index 8d59380a00..36998eba2e 100644
--- a/indra/llui/llflyoutbutton.h
+++ b/indra/llui/llflyoutbutton.h
@@ -46,7 +46,7 @@ public:
: action_button("action_button"),
allow_text_entry("allow_text_entry")
{
- LLComboBox::Params::allow_text_entry = false;
+ changeDefault(LLComboBox::Params::allow_text_entry, false);
}
};
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp
index 47f2cfaf89..30b79b4d20 100644
--- a/indra/llui/lliconctrl.cpp
+++ b/indra/llui/lliconctrl.cpp
@@ -43,10 +43,7 @@ LLIconCtrl::Params::Params()
color("color"),
use_draw_context_alpha("use_draw_context_alpha", true),
scale_image("scale_image")
-{
- tab_stop = false;
- mouse_opaque = false;
-}
+{}
LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
: LLUICtrl(p),
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index a59247ba09..a250404292 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -115,9 +115,7 @@ LLLayoutStack::Params::Params()
open_time_constant("open_time_constant", 0.02f),
close_time_constant("close_time_constant", 0.03f),
border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0))
-{
- name="stack";
-}
+{}
LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p)
: LLView(p),
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 06fbc0f234..c2173fb89c 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -103,7 +103,7 @@ LLLineEditor::Params::Params()
text_pad_right("text_pad_right"),
default_text("default_text")
{
- mouse_opaque = true;
+ changeDefault(mouse_opaque, true);
addSynonym(select_on_focus, "select_all_on_focus_received");
addSynonym(border, "border");
addSynonym(label, "watermark_text");
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 8de9c769e2..6cac841cde 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -90,7 +90,6 @@ const S32 TEAROFF_SEPARATOR_HEIGHT_PIXELS = 10;
const S32 MENU_ITEM_PADDING = 4;
const std::string SEPARATOR_NAME("separator");
-const std::string SEPARATOR_LABEL( "-----------" );
const std::string VERTICAL_SEPARATOR_LABEL( "|" );
const std::string LLMenuGL::BOOLEAN_TRUE_PREFIX( "\xE2\x9C\x94" ); // U+2714 HEAVY CHECK MARK
@@ -149,7 +148,7 @@ LLMenuItemGL::Params::Params()
highlight_bg_color("highlight_bg_color"),
highlight_fg_color("highlight_fg_color")
{
- mouse_opaque = true;
+ changeDefault(mouse_opaque, true);
}
// Default constructor
@@ -566,8 +565,6 @@ void LLMenuItemGL::handleVisibilityChange(BOOL new_visibility)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LLMenuItemSeparatorGL::Params::Params()
{
- name = "separator";
- label = SEPARATOR_LABEL;
}
LLMenuItemSeparatorGL::LLMenuItemSeparatorGL(const LLMenuItemSeparatorGL::Params& p) :
@@ -755,30 +752,6 @@ U32 LLMenuItemTearOffGL::getNominalHeight( void ) const
return TEAROFF_SEPARATOR_HEIGHT_PIXELS;
}
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLMenuItemBlankGL
-//
-// This class represents a blank, non-functioning item.
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-class LLMenuItemBlankGL : public LLMenuItemGL
-{
-public:
- struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params>
- {
- Params()
- {
- name="";
- enabled = false;
- }
- };
- LLMenuItemBlankGL( const Params& p ) : LLMenuItemGL( p )
- {}
- virtual void draw( void ) {}
-};
-
-
///============================================================================
/// Class LLMenuItemCallGL
///============================================================================
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 7bde8e83ec..b5579a831a 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -381,8 +381,6 @@ public:
{
addSynonym(bg_visible, "opaque");
addSynonym(bg_color, "color");
-
- name = "menu";
}
};
@@ -650,7 +648,7 @@ public:
{
Params()
{
- visible = false;
+ changeDefault(visible, false);
}
};
@@ -698,16 +696,7 @@ class LLMenuBarGL : public LLMenuGL
{
public:
struct Params : public LLInitParam::Block<Params, LLMenuGL::Params>
- {
- Params()
- {
- can_tear_off = false;
- keep_fixed_size = true;
- horizontal_layout = true;
- visible = true;
- drop_shadow = false;
- }
- };
+ {};
LLMenuBarGL( const Params& p );
virtual ~LLMenuBarGL();
@@ -825,13 +814,7 @@ class LLMenuItemTearOffGL : public LLMenuItemGL
{
public:
struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params>
- {
- Params()
- {
- name = "tear off";
- label = "~~~~~~~~~~~";
- }
- };
+ {};
LLMenuItemTearOffGL( const Params& );
diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp
index 9052bc7d1d..70bcfb5b4f 100644
--- a/indra/llui/llmultislider.cpp
+++ b/indra/llui/llmultislider.cpp
@@ -66,11 +66,7 @@ LLMultiSlider::Params::Params()
mouse_up_callback("mouse_up_callback"),
thumb_width("thumb_width"),
sliders("slider")
-{
- name = "multi_slider_bar";
- mouse_opaque(true);
- follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);
-}
+{}
LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p)
: LLF32UICtrl(p),
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index e3193bc352..a45b617c2e 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -90,7 +90,6 @@ LLPanel::Params::Params()
visible_callback("visible_callback"),
accepts_badge("accepts_badge")
{
- name = "panel";
addSynonym(background_visible, "bg_visible");
addSynonym(has_border, "border_visible");
addSynonym(label, "title");
diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp
index 3a12debf7e..95a7d09382 100644
--- a/indra/llui/llradiogroup.cpp
+++ b/indra/llui/llradiogroup.cpp
@@ -74,9 +74,6 @@ LLRadioGroup::Params::Params()
{
addSynonym(items, "radio_item");
- name = "radio_group";
- mouse_opaque = true;
- follows.flags = FOLLOWS_LEFT | FOLLOWS_TOP;
// radio items are not tabbable until they are selected
tab_stop = false;
}
@@ -96,7 +93,10 @@ void LLRadioGroup::initFromParams(const Params& p)
{
LLRadioGroup::ItemParams item_params(*it);
- item_params.font.setIfNotProvided(mFont); // apply radio group font by default
+ if (!item_params.font.isProvided())
+ {
+ item_params.font = mFont; // apply radio group font by default
+ }
item_params.commit_callback.function = boost::bind(&LLRadioGroup::onClickButton, this, _1);
item_params.from_xui = p.from_xui;
if (p.from_xui)
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp
index 3a867a10a7..5d3bf7a670 100644
--- a/indra/llui/llscrollbar.cpp
+++ b/indra/llui/llscrollbar.cpp
@@ -63,9 +63,7 @@ LLScrollbar::Params::Params()
right_button("right_button"),
bg_visible("bg_visible", false),
bg_color("bg_color", LLColor4::black)
-{
- tab_stop = false;
-}
+{}
LLScrollbar::LLScrollbar(const Params & p)
: LLUICtrl(p),
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 380c477eb2..b44b4c36b6 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -74,11 +74,7 @@ LLScrollContainer::Params::Params()
min_auto_scroll_rate("min_auto_scroll_rate", 100),
max_auto_scroll_rate("max_auto_scroll_rate", 1000),
reserve_scroll_corner("reserve_scroll_corner", false)
-{
- name = "scroll_container";
- mouse_opaque(true);
- tab_stop(false);
-}
+{}
// Default constructor
diff --git a/indra/llui/llscrollingpanellist.h b/indra/llui/llscrollingpanellist.h
index 8f569c2a58..e8df176ec3 100644
--- a/indra/llui/llscrollingpanellist.h
+++ b/indra/llui/llscrollingpanellist.h
@@ -51,12 +51,7 @@ class LLScrollingPanelList : public LLUICtrl
{
public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
- {
- Params()
- {
- name = "scrolling_panel_list";
- }
- };
+ {};
LLScrollingPanelList(const Params& p)
: LLUICtrl(p)
{}
diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp
index 696e4a2bb1..07a6dfaa10 100644
--- a/indra/llui/llscrolllistcolumn.cpp
+++ b/indra/llui/llscrolllistcolumn.cpp
@@ -46,10 +46,7 @@ static LLWidgetNameRegistry::StaticRegistrar sRegisterColumnHeaderParams(&typeid
//---------------------------------------------------------------------------
LLScrollColumnHeader::Params::Params()
: column("column")
-{
- name = "column_header";
- tab_stop(false);
-}
+{}
LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p)
diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h
index e2711ac75a..12baea8e0c 100644
--- a/indra/llui/llscrolllistcolumn.h
+++ b/indra/llui/llscrolllistcolumn.h
@@ -135,7 +135,7 @@ public:
halign("halign", LLFontGL::LEFT)
{
// default choice to "dynamic_width"
- width.dynamic_width = true;
+ changeDefault(width.dynamic_width, true);
addSynonym(sort_column, "sort");
}
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index b7848ec37c..622f3e215c 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -147,12 +147,9 @@ LLScrollListCtrl::Params::Params()
highlighted_color("highlighted_color"),
contents(""),
scroll_bar_bg_visible("scroll_bar_bg_visible"),
- scroll_bar_bg_color("scroll_bar_bg_color")
- , border("border")
-{
- name = "scroll_list";
- mouse_opaque = true;
-}
+ scroll_bar_bg_color("scroll_bar_bg_color"),
+ border("border")
+{}
LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
: LLUICtrl(p),
@@ -2813,7 +2810,10 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
}
S32 index = columnp->mIndex;
- cell_p.width.setIfNotProvided(columnp->getWidth());
+ if (!cell_p.width.isProvided())
+ {
+ cell_p.width = columnp->getWidth();
+ }
LLScrollListCell* cell = LLScrollListCell::create(cell_p);
diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h
index f5c3b532c4..c2d7916938 100644
--- a/indra/llui/llsearcheditor.h
+++ b/indra/llui/llsearcheditor.h
@@ -55,9 +55,7 @@ public:
search_button_visible("search_button_visible"),
clear_button("clear_button"),
clear_button_visible("clear_button_visible")
- {
- name = "search_editor";
- }
+ {}
};
void setCommitOnFocusLost(BOOL b) { if (mSearchEditor) mSearchEditor->setCommitOnFocusLost(b); }
diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp
index 013950a5ad..db72234f94 100644
--- a/indra/llui/llslider.cpp
+++ b/indra/llui/llslider.cpp
@@ -54,9 +54,7 @@ LLSlider::Params::Params()
track_highlight_vertical_image("track_highlight_vertical_image"),
mouse_down_callback("mouse_down_callback"),
mouse_up_callback("mouse_up_callback")
-{
- follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);
-}
+{}
LLSlider::LLSlider(const LLSlider::Params& p)
: LLF32UICtrl(p),
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index d760178e35..583ed1ed2e 100644
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -76,8 +76,14 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
}
LLRect label_rect( left, top, label_width, bottom );
LLTextBox::Params params(p.slider_label);
- params.rect.setIfNotProvided(label_rect);
- params.font.setIfNotProvided(p.font);
+ if (!params.rect.isProvided())
+ {
+ params.rect = label_rect;
+ }
+ if (!params.font.isProvided())
+ {
+ params.font = p.font;
+ }
params.initial_value(p.label());
mLabelBox = LLUICtrlFactory::create<LLTextBox> (params);
addChild(mLabelBox);
@@ -113,15 +119,33 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
S32 slider_left = label_width ? label_width + sliderctrl_spacing : 0;
LLSlider::Params slider_p(p.slider_bar);
slider_p.name("slider_bar");
- slider_p.rect.setIfNotProvided(LLRect(slider_left,top,slider_right,bottom));
- slider_p.initial_value.setIfNotProvided(p.initial_value().asReal());
- slider_p.min_value.setIfNotProvided(p.min_value);
- slider_p.max_value.setIfNotProvided(p.max_value);
- slider_p.increment.setIfNotProvided(p.increment);
- slider_p.orientation.setIfNotProvided(p.orientation);
+ if (!slider_p.rect.isProvided())
+ {
+ slider_p.rect = LLRect(slider_left,top,slider_right,bottom);
+ }
+ if (!slider_p.initial_value.isProvided())
+ {
+ slider_p.initial_value = p.initial_value().asReal();
+ }
+ if (!slider_p.min_value.isProvided())
+ {
+ slider_p.min_value = p.min_value;
+ }
+ if (!slider_p.max_value.isProvided())
+ {
+ slider_p.max_value = p.max_value;
+ }
+ if (!slider_p.increment.isProvided())
+ {
+ slider_p.increment = p.increment;
+ }
+ if (!slider_p.orientation.isProvided())
+ {
+ slider_p.orientation = p.orientation;
+ }
- slider_p.commit_callback.function(&LLSliderCtrl::onSliderCommit);
- slider_p.control_name(p.control_name);
+ slider_p.commit_callback.function = &LLSliderCtrl::onSliderCommit;
+ slider_p.control_name = p.control_name;
slider_p.mouse_down_callback( p.mouse_down_callback );
slider_p.mouse_up_callback( p.mouse_up_callback );
mSlider = LLUICtrlFactory::create<LLSlider> (slider_p);
@@ -134,8 +158,15 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
if( p.can_edit_text() )
{
LLLineEditor::Params line_p(p.value_editor);
- line_p.rect.setIfNotProvided(text_rect);
- line_p.font.setIfNotProvided(p.font);
+ if (!line_p.rect.isProvided())
+ {
+ line_p.rect = text_rect;
+ }
+ if (!line_p.font.isProvided())
+ {
+ line_p.font = p.font;
+ }
+
line_p.commit_callback.function(&LLSliderCtrl::onEditorCommit);
line_p.prevalidate_callback(&LLTextValidate::validateFloat);
mEditor = LLUICtrlFactory::create<LLLineEditor>(line_p);
@@ -149,8 +180,14 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
else
{
LLTextBox::Params text_p(p.value_text);
- text_p.rect.setIfNotProvided(text_rect);
- text_p.font.setIfNotProvided(p.font);
+ if (!text_p.rect.isProvided())
+ {
+ text_p.rect = text_rect;
+ }
+ if (!text_p.font.isProvided())
+ {
+ text_p.font = p.font;
+ }
mTextBox = LLUICtrlFactory::create<LLTextBox>(text_p);
addChild(mTextBox);
}
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index 62a9db82fe..513fff3234 100644
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -65,7 +65,7 @@ public:
show_mean("show_mean", TRUE),
stat("stat")
{
- follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
+ changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
}
};
LLStatBar(const Params&);
diff --git a/indra/llui/llstatview.h b/indra/llui/llstatview.h
index 22a9fcd672..5abdc42448 100644
--- a/indra/llui/llstatview.h
+++ b/indra/llui/llstatview.h
@@ -46,7 +46,7 @@ public:
Params()
: setting("setting")
{
- follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
+ changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
}
};
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 7f0d650403..9c6a76822c 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -217,10 +217,7 @@ LLTabContainer::Params::Params()
tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0),
use_ellipses("use_ellipses"),
font_halign("halign")
-{
- name(std::string("tab_container"));
- mouse_opaque = false;
-}
+{}
LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
: LLPanel(p),
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 6390039794..bc6461a0c2 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -55,7 +55,7 @@ static LLDefaultChildRegistry::Register<LLToolTipView> register_tooltip_view("to
LLToolTipView::Params::Params()
{
- mouse_opaque = false;
+ changeDefault(mouse_opaque, false);
}
LLToolTipView::LLToolTipView(const LLToolTipView::Params& p)
@@ -156,7 +156,7 @@ LLToolTip::Params::Params()
web_based_media("web_based_media", false),
media_playing("media_playing", false)
{
- chrome = true;
+ changeDefault(chrome, true);
}
LLToolTip::LLToolTip(const LLToolTip::Params& p)
@@ -402,12 +402,12 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params)
LLToolTip::Params tooltip_params(params);
// block mouse events if there is a click handler registered (specifically, hover)
- if (params.click_callback.isProvided())
+ if (params.click_callback.isProvided() && !params.mouse_opaque.isProvided())
{
// set mouse_opaque to true if it wasn't already set to something else
// this prevents mouse down from going "through" the tooltip and ultimately
// causing the tooltip to disappear
- tooltip_params.mouse_opaque.setIfNotProvided(true);
+ tooltip_params.mouse_opaque = true;
}
tooltip_params.rect = LLRect (0, 1, 1, 0);
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 499b97f52d..f0ba7fc7d7 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -104,14 +104,17 @@ private:
public:
ParamDefaults()
{
- // recursively initialize from base class param block
- ((typename PARAM_BLOCK::base_block_t&)mPrototype).fillFrom(ParamDefaults<typename PARAM_BLOCK::base_block_t, DUMMY>::instance().get());
- // after initializing base classes, look up template file for this param block
+ // look up template file for this param block...
const std::string* param_block_tag = getWidgetTag(&typeid(PARAM_BLOCK));
if (param_block_tag)
- {
- LLUICtrlFactory::loadWidgetTemplate(*param_block_tag, mPrototype);
+ { // ...and if it exists, back fill values using the most specific template first
+ PARAM_BLOCK params;
+ LLUICtrlFactory::loadWidgetTemplate(*param_block_tag, params);
+ mPrototype.fillFrom(params);
}
+ // recursively fill from base class param block
+ ((typename PARAM_BLOCK::base_block_t&)mPrototype).fillFrom(ParamDefaults<typename PARAM_BLOCK::base_block_t, DUMMY>::instance().get());
+
}
const PARAM_BLOCK& get() { return mPrototype; }
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 659a54cc6e..0616c2a0c0 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2485,7 +2485,7 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
{
LLRect parent_rect = parent->getLocalRect();
// overwrite uninitialized rect params, using context
- LLRect last_rect = parent->getLocalRect();
+ LLRect default_rect = parent->getLocalRect();
bool layout_topleft = (p.layout() == "topleft");
@@ -2509,15 +2509,13 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
p.rect.height = MIN_WIDGET_HEIGHT;
}
- last_rect.translate(0, last_rect.getHeight());
+ default_rect.translate(0, default_rect.getHeight());
// If there was a recently constructed child, use its rectangle
- get_last_child_rect(parent, &last_rect);
+ get_last_child_rect(parent, &default_rect);
if (layout_topleft)
{
- p.bottom_delta.setIfNotProvided(0, false);
-
// Invert the sense of bottom_delta for topleft layout
if (p.bottom_delta.isProvided())
{
@@ -2530,33 +2528,44 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
else if (p.top_delta.isProvided())
{
p.bottom_delta =
- -(p.top_delta + p.rect.height - last_rect.getHeight());
+ -(p.top_delta + p.rect.height - default_rect.getHeight());
}
- else if (!p.bottom_delta.isProvided()
- && !p.left_delta.isProvided()
- && !p.top_pad.isProvided()
+ else if (!p.left_delta.isProvided()
&& !p.left_pad.isProvided())
{
// set default position is just below last rect
p.bottom_delta.set(-(p.rect.height + VPAD), false);
}
+ else
+ {
+ p.bottom_delta.set(0, false);
+ }
// default to same left edge
- p.left_delta.setIfNotProvided(0, false);
+ if (!p.left_delta.isProvided())
+ {
+ p.left_delta.set(0, false);
+ }
if (p.left_pad.isProvided())
{
// left_pad is based on prior widget's right edge
- p.left_delta.set(p.left_pad + last_rect.getWidth(), false);
+ p.left_delta.set(p.left_pad + default_rect.getWidth(), false);
}
- last_rect.translate(p.left_delta, p.bottom_delta);
+ default_rect.translate(p.left_delta, p.bottom_delta);
}
else
{
// set default position is just below last rect
- p.bottom_delta.setIfNotProvided(-(p.rect.height + VPAD), false);
- p.left_delta.setIfNotProvided(0, false);
- last_rect.translate(p.left_delta, p.bottom_delta);
+ if (!p.bottom_delta.isProvided())
+ {
+ p.bottom_delta.set(-(p.rect.height + VPAD), false);
+ }
+ if (!p.left_delta.isProvided())
+ {
+ p.left_delta.set(0, false);
+ }
+ default_rect.translate(p.left_delta, p.bottom_delta);
}
// this handles case where *both* x and x_delta are provided
@@ -2567,12 +2576,30 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
// selectively apply rectangle defaults, making sure that
// params are not flagged as having been "provided"
// as rect params are overconstrained and rely on provided flags
- p.rect.left.setIfNotProvided(last_rect.mLeft, false);
- p.rect.bottom.setIfNotProvided(last_rect.mBottom, false);
- p.rect.top.setIfNotProvided(last_rect.mTop, false);
- p.rect.right.setIfNotProvided(last_rect.mRight, false);
- p.rect.width.setIfNotProvided(last_rect.getWidth(), false);
- p.rect.height.setIfNotProvided(last_rect.getHeight(), false);
+ if (!p.rect.left.isProvided())
+ {
+ p.rect.left.set(default_rect.mLeft, false);
+ }
+ if (!p.rect.bottom.isProvided())
+ {
+ p.rect.bottom.set(default_rect.mBottom, false);
+ }
+ if (!p.rect.top.isProvided())
+ {
+ p.rect.top.set(default_rect.mTop, false);
+ }
+ if (!p.rect.right.isProvided())
+ {
+ p.rect.right.set(default_rect.mRight, false);
+ }
+ if (!p.rect.width.isProvided())
+ {
+ p.rect.width.set(default_rect.getWidth(), false);
+ }
+ if (!p.rect.height.isProvided())
+ {
+ p.rect.height.set(default_rect.getHeight(), false);
+ }
}
}
diff --git a/indra/llui/llviewborder.cpp b/indra/llui/llviewborder.cpp
index 32d7ea7c25..919267dcc6 100644
--- a/indra/llui/llviewborder.cpp
+++ b/indra/llui/llviewborder.cpp
@@ -57,9 +57,6 @@ LLViewBorder::Params::Params()
{
addSynonym(border_thickness, "thickness");
addSynonym(render_style, "style");
- name = "view_border";
- mouse_opaque = false;
- follows.flags = FOLLOWS_ALL;
}
diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index 77e94385d4..cf76202215 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -43,7 +43,7 @@ LLWindowShade::Params::Params()
text_color("text_color"),
can_close("can_close", true)
{
- mouse_opaque = false;
+ changeDefault(mouse_opaque, false);
}
LLWindowShade::LLWindowShade(const LLWindowShade::Params& params)
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 194ef8af6a..e40bdb4a3d 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -717,14 +717,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
- void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
- {
- if (!isProvided())
- {
- set(val, flag_as_provided);
- }
- }
-
// implicit conversion
operator value_assignment_t() const { return param_value_t::getValue(); }
// explicit conversion
@@ -869,14 +861,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
- void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
- {
- if (!isProvided())
- {
- set(val, flag_as_provided);
- }
- }
-
// propagate changed status up to enclosing block
/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
{
@@ -1033,15 +1017,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
-
- void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
- {
- if (!isProvided())
- {
- set(val, flag_as_provided);
- }
- }
-
value_t& add()
{
mValues.push_back(param_value_t(value_t()));
@@ -1232,14 +1207,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
- void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
- {
- if (!isProvided())
- {
- set(val, flag_as_provided);
- }
- }
-
value_t& add()
{
mValues.push_back(value_t());
@@ -1719,6 +1686,17 @@ namespace LLInitParam
static BlockDescriptor sBlockDescriptor;
return sBlockDescriptor;
}
+
+ template <typename T, typename NAME_VALUE_LOOKUP, bool multiple, bool is_block>
+ void changeDefault(TypedParam<T, NAME_VALUE_LOOKUP, multiple, is_block>& param,
+ typename TypedParam<T, NAME_VALUE_LOOKUP, multiple, is_block>::value_assignment_t value)
+ {
+ if (!param.isProvided())
+ {
+ param.set(value, false);
+ }
+ }
+
};
template<typename T>
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index a117d9a593..11b19ca4fe 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -368,6 +368,7 @@ set(viewer_SOURCE_FILES
llpanelmarketplaceinbox.cpp
llpanelmarketplaceinboxinventory.cpp
llpanelmarketplaceoutbox.cpp
+ llpanelmarketplaceoutboxinventory.cpp
llpanelmediasettingsgeneral.cpp
llpanelmediasettingspermissions.cpp
llpanelmediasettingssecurity.cpp
@@ -924,6 +925,7 @@ set(viewer_HEADER_FILES
llpanelmarketplaceinbox.h
llpanelmarketplaceinboxinventory.h
llpanelmarketplaceoutbox.h
+ llpanelmarketplaceoutboxinventory.h
llpanelmediasettingsgeneral.h
llpanelmediasettingspermissions.h
llpanelmediasettingssecurity.h
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 6ebb0162a4..7ab9f36b87 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4281,6 +4281,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>InventoryMarketplaceUserStatus</key>
+ <map>
+ <key>Comment</key>
+ <string>Marketplace user status.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string />
+ </map>
<key>InventorySortOrder</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index 1142f01232..c7140283f1 100644
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -33,10 +33,10 @@
<key>Value</key>
<string />
</map>
- <key>LastInventoryInboxExpand</key>
+ <key>LastInventoryInboxActivity</key>
<map>
<key>Comment</key>
- <string>The last time the received items inbox was expanded.</string>
+ <string>The last time the received items inbox was poked by the user.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 966f5b941e..966f5b941e 100755..100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index d0f4d19f56..42e7decec1 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -141,7 +141,6 @@ LLAvatarIconCtrl::Params::Params()
draw_tooltip("draw_tooltip", true),
default_icon_name("default_icon_name")
{
- name = "avatar_icon";
}
diff --git a/indra/newview/llchannelmanager.h b/indra/newview/llchannelmanager.h
index db936b28d9..1a0b98f6cf 100644
--- a/indra/newview/llchannelmanager.h
+++ b/indra/newview/llchannelmanager.h
@@ -43,7 +43,7 @@ namespace LLNotificationsUI
*/
class LLChannelManager : public LLSingleton<LLChannelManager>
{
-public:
+public:
struct Params
{
LLUUID id;
@@ -51,7 +51,8 @@ public:
EToastAlignment toast_align;
EChannelAlignment channel_align;
- Params(): id(LLUUID("")), display_toasts_always(false), toast_align(NA_BOTTOM), channel_align(CA_LEFT)
+ Params()
+ : id(LLUUID("")), display_toasts_always(false), toast_align(NA_BOTTOM), channel_align(CA_LEFT)
{}
};
diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp
index 024ccbcd0b..aa6c9c094c 100644
--- a/indra/newview/llchatmsgbox.cpp
+++ b/indra/newview/llchatmsgbox.cpp
@@ -70,7 +70,7 @@ private:
LLChatMsgBox::Params::Params() :
block_spacing("block_spacing", 10)
{
- line_spacing.pixels = 4;
+ changeDefault(line_spacing.pixels, 4);
}
LLChatMsgBox::LLChatMsgBox(const Params& p) :
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 3000209aad..245157923d 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -126,9 +126,9 @@ LLSysWellChiclet::Params::Params()
, unread_notifications("unread_notifications")
, max_displayed_count("max_displayed_count", 99)
{
- button.name("button");
- button.tab_stop(FALSE);
- button.label(LLStringUtil::null);
+ button.name = "button";
+ button.tab_stop = FALSE;
+ button.label = LLStringUtil::null;
}
LLSysWellChiclet::LLSysWellChiclet(const Params& p)
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index a6e12006a1..1f1069dcb4 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -107,9 +107,9 @@ public:
{
Params()
{
- draw_tooltip(FALSE);
- mouse_opaque(FALSE);
- default_icon_name("Generic_Person");
+ changeDefault(draw_tooltip, FALSE);
+ changeDefault(mouse_opaque, FALSE);
+ changeDefault(default_icon_name, "Generic_Person");
};
};
@@ -131,9 +131,8 @@ public:
Optional<std::string> default_icon;
Params()
- : default_icon("default_icon", "Generic_Group")
- {
- };
+ : default_icon("default_icon", "Generic_Group")
+ {}
};
/**
@@ -162,9 +161,9 @@ public:
Optional<std::string> default_icon;
Params()
- : default_icon("default_icon", "Generic_Object_Small")
+ : default_icon("default_icon", "Generic_Object_Small")
{
- avatar_id = LLUUID::null;
+ changeDefault(avatar_id, LLUUID::null);
};
};
@@ -314,9 +313,7 @@ public:
TYPE_AD_HOC
};
struct Params : public LLInitParam::Block<Params, LLChiclet::Params>
- {
- Params(){}
- };
+ {};
virtual ~LLIMChiclet() {};
diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp
index d77ebc5367..5b942f283a 100644
--- a/indra/newview/llcolorswatch.cpp
+++ b/indra/newview/llcolorswatch.cpp
@@ -57,7 +57,6 @@ LLColorSwatchCtrl::Params::Params()
caption_text("caption_text"),
border("border")
{
- name = "colorswatch";
}
LLColorSwatchCtrl::LLColorSwatchCtrl(const Params& p)
diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h
index 5245f163c0..20262fc89e 100644
--- a/indra/newview/lldebugview.h
+++ b/indra/newview/lldebugview.h
@@ -48,7 +48,7 @@ public:
{
Params()
{
- mouse_opaque = false;
+ changeDefault(mouse_opaque, false);
}
};
LLDebugView(const Params&);
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 2510f43aa7..2510f43aa7 100755..100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index e4bd2049fa..8b72d83830 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1010,6 +1010,33 @@ void LLFolderView::removeSelectedItems( void )
LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLFolderView::onItemsRemovalConfirmation, this, _1, _2));
}
+bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector<LLFolderViewItem*>& selectedItems)
+{
+ LLFolderViewItem* item_parent = dynamic_cast<LLFolderViewItem*>(item->getParent());
+
+ if (item_parent)
+ {
+ for(std::vector<LLFolderViewItem*>::const_iterator it = selectedItems.begin(); it != selectedItems.end(); ++it)
+ {
+ const LLFolderViewItem* const selected_item = (*it);
+
+ LLFolderViewItem* parent = item_parent;
+
+ while (parent)
+ {
+ if (selected_item == parent)
+ {
+ return true;
+ }
+
+ parent = dynamic_cast<LLFolderViewItem*>(parent->getParent());
+ }
+ }
+ }
+
+ return false;
+}
+
void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -1084,7 +1111,7 @@ void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LL
if (!new_selection)
{
new_selection = last_item->getPreviousOpenNode(FALSE);
- while (new_selection && new_selection->isSelected())
+ while (new_selection && (new_selection->isSelected() || isDescendantOfASelectedItem(new_selection, items)))
{
new_selection = new_selection->getPreviousOpenNode(FALSE);
}
@@ -1919,7 +1946,7 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
{
if (getListener()->getUUID().notNull())
{
- LLFolderViewFolder::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+ handled = LLFolderViewFolder::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
}
else
{
diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h
index 3bfbf36110..aee31ca033 100644
--- a/indra/newview/llfoldervieweventlistener.h
+++ b/indra/newview/llfoldervieweventlistener.h
@@ -96,7 +96,8 @@ public:
// otherwise FALSE.
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data) = 0;
+ void* cargo_data,
+ std::string& tooltip_msg) = 0;
};
#endif
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index e2b7c45eab..2888f779f4 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -101,10 +101,7 @@ LLFolderViewItem::Params::Params()
item_height("item_height"),
item_top_pad("item_top_pad"),
creation_date()
-{
- mouse_opaque(true);
- follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT);
-}
+{}
// Default constructor
LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
@@ -132,7 +129,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mIconOpen(p.icon_open),
mIconOverlay(p.icon_overlay),
mListener(p.listener),
- mShowLoadStatus(false)
+ mShowLoadStatus(false),
+ mIsMouseOverTitle(false)
{
}
@@ -724,6 +722,8 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )
BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
{
+ mIsMouseOverTitle = (y > (getRect().getHeight() - mItemHeight));
+
if( hasMouseCapture() && isMovable() )
{
S32 screen_x;
@@ -830,6 +830,11 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask )
return TRUE;
}
+void LLFolderViewItem::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+ mIsMouseOverTitle = false;
+}
+
BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
@@ -840,7 +845,7 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
BOOL handled = FALSE;
if(mListener)
{
- accepted = mListener->dragOrDrop(mask,drop,cargo_type,cargo_data);
+ accepted = mListener->dragOrDrop(mask,drop,cargo_type,cargo_data, tooltip_msg);
handled = accepted;
if (accepted)
{
@@ -879,6 +884,7 @@ void LLFolderViewItem::draw()
static LLUIColor sLibraryColor = LLUIColorTable::instance().getColor("InventoryItemLibraryColor", DEFAULT_WHITE);
static LLUIColor sLinkColor = LLUIColorTable::instance().getColor("InventoryItemLinkColor", DEFAULT_WHITE);
static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE);
+ static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
const Params& default_params = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
const S32 TOP_PAD = default_params.item_top_pad;
@@ -960,6 +966,14 @@ void LLFolderViewItem::draw()
}
}
}
+ else if (mIsMouseOverTitle)
+ {
+ gl_rect_2d(FOCUS_LEFT,
+ focus_top,
+ getRect().getWidth() - 2,
+ focus_bottom,
+ sMouseOverColor, FALSE);
+ }
//--------------------------------------------------------------------------------//
// Draw DragNDrop highlight
@@ -2040,23 +2054,42 @@ BOOL LLFolderViewFolder::isRemovable()
BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item)
{
mItems.push_back(item);
+
if (item->isSelected())
{
recursiveIncrementNumDescendantsSelected(1);
}
+
item->setRect(LLRect(0, 0, getRect().getWidth(), 0));
item->setVisible(FALSE);
- addChild( item );
+
+ addChild(item);
+
item->dirtyFilter();
+
+ // Update the folder creation date if the child is newer than our current date
+ setCreationDate(llmax<time_t>(mCreationDate, item->getCreationDate()));
+
+ // Handle sorting
requestArrange();
requestSort();
+
+ // Traverse parent folders and update creation date and resort, if necessary
LLFolderViewFolder* parentp = getParentFolder();
- while (parentp && parentp->mSortFunction.isByDate())
+ while (parentp)
{
- // parent folder doesn't have a time stamp yet, so get it from us
- parentp->requestSort();
+ // Update the folder creation date if the child is newer than our current date
+ parentp->setCreationDate(llmax<time_t>(parentp->mCreationDate, item->getCreationDate()));
+
+ if (parentp->mSortFunction.isByDate())
+ {
+ // parent folder doesn't have a time stamp yet, so get it from us
+ parentp->requestSort();
+ }
+
parentp = parentp->getParentFolder();
}
+
return TRUE;
}
@@ -2162,7 +2195,7 @@ BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask,
EAcceptance* accept,
std::string& tooltip_msg)
{
- BOOL accepted = mListener && mListener->dragOrDrop(mask,drop,c_type,cargo_data);
+ BOOL accepted = mListener && mListener->dragOrDrop(mask,drop,c_type,cargo_data, tooltip_msg);
if (accepted)
{
mDragAndDropTarget = TRUE;
@@ -2254,7 +2287,7 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask,
if (!handled)
{
- BOOL accepted = mListener && mListener->dragOrDrop(mask, drop,cargo_type,cargo_data);
+ BOOL accepted = mListener && mListener->dragOrDrop(mask, drop,cargo_type,cargo_data, tooltip_msg);
if (accepted)
{
@@ -2299,6 +2332,8 @@ BOOL LLFolderViewFolder::handleRightMouseDown( S32 x, S32 y, MASK mask )
BOOL LLFolderViewFolder::handleHover(S32 x, S32 y, MASK mask)
{
+ mIsMouseOverTitle = (y > (getRect().getHeight() - mItemHeight));
+
BOOL handled = LLView::handleHover(x, y, mask);
if (!handled)
@@ -2418,41 +2453,6 @@ void LLFolderViewFolder::draw()
time_t LLFolderViewFolder::getCreationDate() const
{
- // folders have no creation date try to create one from an item somewhere in our folder hierarchy
- if (!mCreationDate)
- {
- for (items_t::const_iterator iit = mItems.begin();
- iit != mItems.end(); ++iit)
- {
- LLFolderViewItem* itemp = (*iit);
-
- const time_t item_creation_date = itemp->getCreationDate();
-
- if (item_creation_date)
- {
- setCreationDate(item_creation_date);
- break;
- }
- }
-
- if (!mCreationDate)
- {
- for (folders_t::const_iterator fit = mFolders.begin();
- fit != mFolders.end(); ++fit)
- {
- LLFolderViewFolder* folderp = (*fit);
-
- const time_t folder_creation_date = folderp->getCreationDate();
-
- if (folder_creation_date)
- {
- setCreationDate(folder_creation_date);
- break;
- }
- }
- }
- }
-
return llmax<time_t>(mCreationDate, mSubtreeCreationDate);
}
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index dac0c3032c..676eaf825d 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -136,7 +136,7 @@ protected:
std::string mSearchableLabel;
S32 mLabelWidth;
bool mLabelWidthDirty;
- mutable time_t mCreationDate;
+ time_t mCreationDate;
LLFolderViewFolder* mParentFolder;
LLFolderViewEventListener* mListener;
BOOL mIsCurSelection;
@@ -159,6 +159,7 @@ protected:
BOOL mIsLoading;
LLTimer mTimeSinceRequestStart;
bool mShowLoadStatus;
+ bool mIsMouseOverTitle;
// helper function to change the selection from the root.
void changeSelectionFromRoot(LLFolderViewItem* selection, BOOL selected);
@@ -173,7 +174,7 @@ protected:
static LLFontGL* getLabelFontForStyle(U8 style);
- virtual void setCreationDate(time_t creation_date_utc) const { mCreationDate = creation_date_utc; }
+ virtual void setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; }
public:
BOOL postBuild();
@@ -328,6 +329,8 @@ public:
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
+ virtual void onMouseLeave(S32 x, S32 y, MASK mask);
+
virtual LLView* findChildView(const std::string& name, BOOL recurse) const { return NULL; }
// virtual void handleDropped();
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index f0fc710f3d..b4dac28595 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -107,6 +107,23 @@ bool confirm_attachment_rez(const LLSD& notification, const LLSD& response);
void teleport_via_landmark(const LLUUID& asset_id);
static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
+// Helper functions
+
+bool isAddAction(const std::string& action)
+{
+ return ("wear" == action || "attach" == action || "activate" == action);
+}
+
+bool isRemoveAction(const std::string& action)
+{
+ return ("take_off" == action || "detach" == action || "deactivate" == action);
+}
+
+bool isMarketplaceCopyAction(const std::string& action)
+{
+ return (("copy_to_outbox" == action) || ("move_to_outbox" == action));
+}
+
// +=================================================+
// | LLInvFVBridge |
// +=================================================+
@@ -538,10 +555,14 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
items.push_back(std::string("Find Links"));
}
- items.push_back(std::string("Rename"));
- if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
+
+ if (!isInboxFolder())
{
- disabled_items.push_back(std::string("Rename"));
+ items.push_back(std::string("Rename"));
+ if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
+ {
+ disabled_items.push_back(std::string("Rename"));
+ }
}
if (show_asset_id)
@@ -569,11 +590,31 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
disabled_items.push_back(std::string("Copy"));
}
+
+ if (canListOnMarketplace())
+ {
+ items.push_back(std::string("Marketplace Separator"));
+
+ bool copyable = true;
+ LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID);
+ if (inv_item)
+ {
+ copyable = inv_item->getPermissions().allowCopyBy(gAgent.getID());
+ }
+
+ const std::string merchant_action = ((copyable == true) ? "Merchant Copy" : "Merchant Move");
+ items.push_back(merchant_action);
+
+ if (!canListOnMarketplaceNow())
+ {
+ disabled_items.push_back(merchant_action);
+ }
+ }
}
}
// Don't allow items to be pasted directly into the COF or the inbox
- if (!isCOFFolder() && !isInboxFolder())
+ if (!isCOFFolder() && !isInboxFolder() && !isOutboxFolder())
{
items.push_back(std::string("Paste"));
}
@@ -610,6 +651,10 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
+ }
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
}
else
{
@@ -794,6 +839,25 @@ BOOL LLInvFVBridge::isInboxFolder() const
return gInventory.isObjectDescendentOf(mUUID, inbox_id);
}
+BOOL LLInvFVBridge::isOutboxFolder() const
+{
+ const LLUUID outbox_id = getOutboxFolder();
+
+ if (outbox_id.isNull())
+ {
+ return FALSE;
+ }
+
+ return gInventory.isObjectDescendentOf(mUUID, outbox_id);
+}
+
+const LLUUID LLInvFVBridge::getOutboxFolder() const
+{
+ const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+
+ return outbox_id;
+}
+
BOOL LLInvFVBridge::isItemPermissive() const
{
return FALSE;
@@ -938,9 +1002,14 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
new_listener = new LLMeshBridge(inventory, root, uuid);
break;
+ case LLAssetType::AT_IMAGE_TGA:
+ case LLAssetType::AT_IMAGE_JPEG:
+ //llwarns << LLAssetType::lookup(asset_type) << " asset type is unhandled for uuid " << uuid << llendl;
+ break;
+
default:
llinfos << "Unhandled asset type (llassetstorage.h): "
- << (S32)asset_type << llendl;
+ << (S32)asset_type << " (" << LLAssetType::lookup(asset_type) << ")" << llendl;
break;
}
@@ -989,6 +1058,57 @@ BOOL LLInvFVBridge::canShare() const
return FALSE;
}
+BOOL LLInvFVBridge::canListOnMarketplace() const
+{
+ LLInventoryModel * model = getInventoryModel();
+ const LLViewerInventoryCategory * cat = model->getCategory(mUUID);
+ if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
+ {
+ return FALSE;
+ }
+
+ if (!isAgentInventory())
+ {
+ return FALSE;
+ }
+
+ if (getOutboxFolder().isNull())
+ {
+ return FALSE;
+ }
+
+ if (isInboxFolder() || isOutboxFolder())
+ {
+ return FALSE;
+ }
+
+ LLViewerInventoryItem * item = model->getItem(mUUID);
+ if (item && !item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+BOOL LLInvFVBridge::canListOnMarketplaceNow() const
+{
+ if (get_is_item_worn(mUUID))
+ {
+ return FALSE;
+ }
+
+ // Loop through all items worn by avatar and check to see if they are descendants
+ // of the item we are trying to list on the marketplace
+ if (get_is_parent_to_worn_item(mUUID))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
// +=================================================+
// | InventoryFVBridgeBuilder |
// +=================================================+
@@ -1086,6 +1206,16 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
folder_view_itemp->getListener()->pasteLinkFromClipboard();
return;
}
+ else if (isMarketplaceCopyAction(action))
+ {
+ llinfos << "Copy item to marketplace action!" << llendl;
+
+ LLInventoryItem* itemp = model->getItem(mUUID);
+ if (!itemp) return;
+
+ const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+ copy_item_to_outbox(itemp, outbox_id, LLUUID::null);
+ }
}
void LLItemBridge::selectItem()
@@ -1226,7 +1356,7 @@ std::string LLItemBridge::getLabelSuffix() const
{
// String table is loaded before login screen and inventory items are
// loaded after login, so LLTrans should be ready.
- static std::string NO_COPY =LLTrans::getString("no_copy");
+ static std::string NO_COPY = LLTrans::getString("no_copy");
static std::string NO_MOD = LLTrans::getString("no_modify");
static std::string NO_XFER = LLTrans::getString("no_transfer");
static std::string LINK = LLTrans::getString("link");
@@ -1294,6 +1424,11 @@ BOOL LLItemBridge::isItemRenameable() const
return FALSE;
}
+ if (isInboxFolder())
+ {
+ return FALSE;
+ }
+
return (item->getPermissions().allowModifyBy(gAgent.getID()));
}
return FALSE;
@@ -1457,16 +1592,6 @@ BOOL LLItemBridge::isItemPermissive() const
return FALSE;
}
-bool LLItemBridge::isAddAction(std::string action) const
-{
- return ("wear" == action || "attach" == action || "activate" == action);
-}
-
-bool LLItemBridge::isRemoveAction(std::string action) const
-{
- return ("take_off" == action || "detach" == action || "deactivate" == action);
-}
-
// +=================================================+
// | LLFolderBridge |
// +=================================================+
@@ -1648,8 +1773,77 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
}
+static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_msg)
+{
+ bool worn = get_is_item_worn(inv_item->getUUID());
+ bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
+
+ if (!allow_transfer)
+ {
+ tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer");
+ }
+ else if(worn)
+ {
+ tooltip_msg = LLTrans::getString("TooltipOutboxWorn");
+ }
+
+ return !worn && allow_transfer;
+}
+
+
+
+void LLFolderBridge::dropFolderToOutbox(LLInventoryCategory* inv_cat)
+{
+ copy_folder_to_outbox(inv_cat, getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false), inv_cat->getUUID());
+}
+
+
+
+int get_folder_levels(LLInventoryCategory* inv_cat)
+{
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+ gInventory.getDirectDescendentsOf(inv_cat->getUUID(), cats, items);
+
+ int max_child_levels = 0;
+
+ for (S32 i=0; i < cats->count(); ++i)
+ {
+ LLInventoryCategory* category = cats->get(i);
+ max_child_levels = llmax(max_child_levels, get_folder_levels(category));
+ }
+
+ return 1 + max_child_levels;
+}
+
+int get_folder_path_length(const LLUUID& ancestor_id, const LLUUID& descendant_id)
+{
+ int depth = 0;
+
+ if (ancestor_id == descendant_id) return depth;
+
+ const LLInventoryCategory* category = gInventory.getCategory(descendant_id);
+
+ while(category)
+ {
+ LLUUID parent_id = category->getParentUUID();
+
+ if (parent_id.isNull()) break;
+
+ depth++;
+
+ if (parent_id == ancestor_id) return depth;
+
+ category = gInventory.getCategory(parent_id);
+ }
+
+ llwarns << "get_folder_path_length() couldn't trace a path from the descendant to the ancestor" << llendl;
+ return -1;
+}
+
BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
- BOOL drop)
+ BOOL drop,
+ std::string& tooltip_msg)
{
LLInventoryModel* model = getInventoryModel();
@@ -1674,10 +1868,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
const LLUUID &cat_id = inv_cat->getUUID();
const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false);
const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
-
+ const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+
const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id);
const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT);
const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id);
+ const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
+ const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_cat->getUUID(), outbox_id);
//--------------------------------------------------------------------------------
// Determine if folder can be moved.
@@ -1730,6 +1927,27 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
}
}
+ if (move_is_into_outbox)
+ {
+ for (S32 i=0; i < descendent_items.count(); ++i)
+ {
+ LLInventoryItem* item = descendent_items[i];
+ if (!can_move_to_outbox(item, tooltip_msg))
+ {
+ is_movable = FALSE;
+ break;
+ }
+ }
+
+ int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat);
+
+ if (nested_folder_levels > 4)
+ {
+ tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels");
+ is_movable = FALSE;
+ }
+
+ }
//
//--------------------------------------------------------------------------------
@@ -1797,6 +2015,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
#endif
}
}
+ if (move_is_into_outbox && !move_is_from_outbox)
+ {
+ dropFolderToOutbox(inv_cat);
+ }
else
{
if (gInventory.isObjectDescendentOf(inv_cat->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
@@ -2209,6 +2431,16 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
removeSystemFolder();
}
#endif
+ else if (isMarketplaceCopyAction(action))
+ {
+ llinfos << "Copy folder to marketplace action!" << llendl;
+
+ LLInventoryCategory * cat = gInventory.getCategory(mUUID);
+ if (!cat) return;
+
+ const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+ copy_folder_to_outbox(cat, outbox_id, cat->getUUID());
+ }
}
void LLFolderBridge::openItem()
@@ -2493,6 +2725,7 @@ void LLFolderBridge::folderOptionsMenu()
if (trash_id == mUUID) return;
if (isItemInTrash()) return;
if (!isAgentInventory()) return;
+ if (isOutboxFolder()) return;
LLFolderType::EType type = category->getPreferredType();
const bool is_system_folder = LLFolderType::lookupIsProtectedType(type);
@@ -2628,6 +2861,10 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
mItems.clear(); // clear any items that used to exist
addTrashContextMenuOptions(mItems, mDisabledItems);
}
+ else if(isOutboxFolder())
+ {
+ mItems.push_back(std::string("Delete"));
+ }
else if(isAgentInventory()) // do not allow creating in library
{
LLViewerInventoryCategory *cat = getCategory();
@@ -2635,7 +2872,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
// Not sure what the right thing is to do here.
if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT))
{
- if (!isInboxFolder()) // don't allow creation in inbox
+ if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox
{
// Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694.
if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat))
@@ -2702,10 +2939,13 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
mDisabledItems.push_back(std::string("Delete System Folder"));
}
- mItems.push_back(std::string("Share"));
- if (!canShare())
+ if (!isOutboxFolder())
{
- mDisabledItems.push_back(std::string("Share"));
+ mItems.push_back(std::string("Share"));
+ if (!canShare())
+ {
+ mDisabledItems.push_back(std::string("Share"));
+ }
}
hide_context_entries(menu, mItems, mDisabledItems);
@@ -2746,7 +2986,8 @@ BOOL LLFolderBridge::hasChildren() const
BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data)
+ void* cargo_data,
+ std::string& tooltip_msg)
{
LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
@@ -2766,7 +3007,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop,
case DAD_ANIMATION:
case DAD_GESTURE:
case DAD_MESH:
- accept = dragItemIntoFolder(inv_item, drop);
+ accept = dragItemIntoFolder(inv_item, drop, tooltip_msg);
break;
case DAD_LINK:
// DAD_LINK type might mean one of two asset types: AT_LINK or AT_LINK_FOLDER.
@@ -2777,12 +3018,12 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop,
LLInventoryCategory* linked_category = gInventory.getCategory(inv_item->getLinkedUUID());
if (linked_category)
{
- accept = dragCategoryIntoFolder((LLInventoryCategory*)linked_category, drop);
+ accept = dragCategoryIntoFolder((LLInventoryCategory*)linked_category, drop, tooltip_msg);
}
}
else
{
- accept = dragItemIntoFolder(inv_item, drop);
+ accept = dragItemIntoFolder(inv_item, drop, tooltip_msg);
}
break;
case DAD_CATEGORY:
@@ -2792,7 +3033,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop,
}
else
{
- accept = dragCategoryIntoFolder((LLInventoryCategory*)cargo_data, drop);
+ accept = dragCategoryIntoFolder((LLInventoryCategory*)cargo_data, drop, tooltip_msg);
}
break;
case DAD_ROOT_CATEGORY:
@@ -3049,7 +3290,8 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c
// into the folder, as well as performing the actual drop, depending
// if drop == TRUE.
BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
- BOOL drop)
+ BOOL drop,
+ std::string& tooltip_msg)
{
LLInventoryModel* model = getInventoryModel();
@@ -3060,11 +3302,14 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false);
const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
+ const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
const BOOL move_is_into_favorites = (mUUID == favorites_id);
const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id);
+ const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); //(mUUID == outbox_id);
+ const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_item->getUUID(), outbox_id);
LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
BOOL accept = FALSE;
@@ -3130,6 +3375,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
accept = can_move_to_landmarks(inv_item);
}
+ else if (move_is_into_outbox)
+ {
+ accept = can_move_to_outbox(inv_item, tooltip_msg);
+ }
if(accept && drop)
{
@@ -3180,6 +3429,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
dropToOutfit(inv_item, move_is_into_current_outfit);
}
+ else if (move_is_into_outbox && !move_is_from_outbox)
+ {
+ copy_item_to_outbox(inv_item, outbox_id, LLUUID::null);
+ }
// NORMAL or TRASH folder
// (move the item, restamp if into trash)
else
@@ -3380,6 +3633,10 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
+ }
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
}
else
{
@@ -3456,6 +3713,10 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
+ }
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
}
else
{
@@ -3470,8 +3731,11 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
getClipboardEntries(true, items, disabled_items, flags);
}
- items.push_back(std::string("Sound Separator"));
- items.push_back(std::string("Sound Play"));
+ if (!isOutboxFolder())
+ {
+ items.push_back(std::string("Sound Separator"));
+ items.push_back(std::string("Sound Play"));
+ }
hide_context_entries(menu, items, disabled_items);
}
@@ -3507,6 +3771,10 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
+ }
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
}
else
{
@@ -3521,8 +3789,11 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
getClipboardEntries(true, items, disabled_items, flags);
}
- items.push_back(std::string("Landmark Separator"));
- items.push_back(std::string("About Landmark"));
+ if (!isOutboxFolder())
+ {
+ items.push_back(std::string("Landmark Separator"));
+ items.push_back(std::string("About Landmark"));
+ }
// Disable "About Landmark" menu item for
// multiple landmarks selected. Only one landmark
@@ -3736,6 +4007,10 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
+ }
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
}
else
{
@@ -3778,7 +4053,8 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data)
+ void* cargo_data,
+ std::string& tooltip_msg)
{
LLViewerInventoryItem* item = getItem();
BOOL rv = FALSE;
@@ -3993,6 +4269,10 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
addTrashContextMenuOptions(items, disabled_items);
}
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
+ }
else
{
items.push_back(std::string("Share"));
@@ -4046,6 +4326,10 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
+ }
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
}
else
{
@@ -4060,9 +4344,12 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
getClipboardEntries(true, items, disabled_items, flags);
}
- items.push_back(std::string("Animation Separator"));
- items.push_back(std::string("Animation Play"));
- items.push_back(std::string("Animation Audition"));
+ if (!isOutboxFolder())
+ {
+ items.push_back(std::string("Animation Separator"));
+ items.push_back(std::string("Animation Play"));
+ items.push_back(std::string("Animation Audition"));
+ }
hide_context_entries(menu, items, disabled_items);
@@ -4319,6 +4606,10 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
+ }
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
}
else
{
@@ -4652,6 +4943,10 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
addTrashContextMenuOptions(items, disabled_items);
}
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
+ }
else
{ // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere
BOOL can_open = ((flags & SUPPRESS_OPEN_ITEM) != SUPPRESS_OPEN_ITEM);
@@ -5040,6 +5335,10 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Restore Item"));
}
+ else if(isOutboxFolder())
+ {
+ items.push_back(std::string("Delete"));
+ }
else
{
items.push_back(std::string("Properties"));
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 15629c0c75..2d625befb4 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -52,7 +52,7 @@ typedef std::vector<std::string> menuentry_vec_t;
//
// You'll want to call LLInvItemFVELister::createBridge() to actually create
// an instance of this class. This helps encapsulate the
-// funcationality a bit. (except for folders, you can create those
+// functionality a bit. (except for folders, you can create those
// manually...)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLInvFVBridge : public LLFolderViewEventListener
@@ -70,6 +70,8 @@ public:
virtual ~LLInvFVBridge() {}
BOOL canShare() const;
+ BOOL canListOnMarketplace() const;
+ BOOL canListOnMarketplaceNow() const;
//--------------------------------------------------------------------
// LLInvFVBridge functionality
@@ -115,7 +117,8 @@ public:
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data) { return FALSE; }
+ void* cargo_data,
+ std::string& tooltip_msg) { return FALSE; }
virtual LLInventoryType::EType getInventoryType() const { return mInvType; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
@@ -140,6 +143,9 @@ protected:
BOOL isAgentInventory() const; // false if lost or in the inventory library
BOOL isCOFFolder() const; // true if COF or descendent of
BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox
+ BOOL isOutboxFolder() const; // true if COF or descendent of marketplace outbox
+ const LLUUID getOutboxFolder() const;
+
virtual BOOL isItemPermissive() const;
static void changeItemParent(LLInventoryModel* model,
LLViewerInventoryItem* item,
@@ -208,8 +214,7 @@ public:
/*virtual*/ void clearDisplayName() { mDisplayName.clear(); }
LLViewerInventoryItem* getItem() const;
- bool isAddAction(std::string action) const;
- bool isRemoveAction(std::string action) const;
+
protected:
BOOL confirmRemoveItem(const LLSD& notification, const LLSD& response);
virtual BOOL isItemPermissive() const;
@@ -228,8 +233,9 @@ public:
mCallingCards(FALSE),
mWearables(FALSE)
{}
- BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop);
- BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop);
+
+ BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, std::string& tooltip_msg);
+ BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop, std::string& tooltip_msg);
virtual void performAction(LLInventoryModel* model, std::string action);
virtual void openItem();
@@ -255,7 +261,8 @@ public:
virtual BOOL hasChildren() const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data);
+ void* cargo_data,
+ std::string& tooltip_msg);
virtual BOOL isItemRemovable() const;
virtual BOOL isItemMovable() const ;
@@ -299,6 +306,8 @@ protected:
void dropToFavorites(LLInventoryItem* inv_item);
void dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
+ void dropToOutbox(LLInventoryItem* inv_item);
+ void dropFolderToOutbox(LLInventoryCategory* inv_cat);
//--------------------------------------------------------------------
// Messy hacks for handling folder options
@@ -378,7 +387,8 @@ public:
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data);
+ void* cargo_data,
+ std::string& tooltip_msg);
void refreshFolderViewItem();
protected:
LLCallingCardObserver* mObserver;
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index db3b968730..0af013fde5 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -58,6 +58,7 @@
#include "llinventorypanel.h"
#include "lllineeditor.h"
#include "llmenugl.h"
+#include "llnotificationsutil.h"
#include "llpanelmaininventory.h"
#include "llpreviewanim.h"
#include "llpreviewgesture.h"
@@ -210,6 +211,58 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
model->notifyObservers();
}
+class LLInventoryCollectAllItems : public LLInventoryCollectFunctor
+{
+public:
+ virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
+ {
+ return true;
+ }
+};
+
+BOOL get_is_parent_to_worn_item(const LLUUID& id)
+{
+ const LLViewerInventoryCategory* cat = gInventory.getCategory(id);
+ if (!cat)
+ {
+ return FALSE;
+ }
+
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLInventoryCollectAllItems collect_all;
+ gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), cats, items, LLInventoryModel::EXCLUDE_TRASH, collect_all);
+
+ for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it)
+ {
+ const LLViewerInventoryItem * const item = *it;
+
+ llassert(item->getIsLinkType());
+
+ LLUUID linked_id = item->getLinkedUUID();
+ const LLViewerInventoryItem * const linked_item = gInventory.getItem(linked_id);
+
+ if (linked_item)
+ {
+ LLUUID parent_id = linked_item->getParentUUID();
+
+ while (!parent_id.isNull())
+ {
+ LLInventoryCategory * parent_cat = gInventory.getCategory(parent_id);
+
+ if (cat == parent_cat)
+ {
+ return TRUE;
+ }
+
+ parent_id = parent_cat->getParentUUID();
+ }
+ }
+ }
+
+ return FALSE;
+}
+
BOOL get_is_item_worn(const LLUUID& id)
{
const LLViewerInventoryItem* item = gInventory.getItem(id);
@@ -471,6 +524,133 @@ void show_item_original(const LLUUID& item_uuid)
}
}
+void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option != 0) return; // canceled
+
+ LLViewerInventoryItem * viitem = gInventory.getItem(notification["payload"]["item_id"].asUUID());
+ LLUUID dest_folder_id = notification["payload"]["dest_folder_id"].asUUID();
+
+ if (viitem)
+ {
+ // when moving item directly into outbox create folder with that name
+ if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
+ {
+ dest_folder_id = gInventory.createNewCategory(dest_folder_id, LLFolderType::FT_NONE, viitem->getName());
+ gInventory.notifyObservers();
+ }
+
+ LLUUID parent = viitem->getParentUUID();
+
+ change_item_parent(
+ &gInventory,
+ viitem,
+ dest_folder_id,
+ false);
+
+ LLUUID top_level_folder = notification["payload"]["top_level_folder"].asUUID();
+
+ if (top_level_folder != LLUUID::null)
+ {
+ LLViewerInventoryCategory* category;
+
+ while (parent.notNull())
+ {
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(parent,cat_array,item_array);
+
+ LLUUID next_parent;
+
+ category = gInventory.getCategory(parent);
+
+ if (!category) break;
+
+ next_parent = category->getParentUUID();
+
+ if (cat_array->empty() && item_array->empty())
+ {
+ remove_category(&gInventory, parent);
+ }
+
+ if (parent == top_level_folder)
+ {
+ break;
+ }
+
+ parent = next_parent;
+ }
+ }
+
+ }
+}
+
+
+void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder)
+{
+ if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
+ {
+ // when moving item directly into outbox create folder with that name
+ if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
+ {
+ dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName());
+ gInventory.notifyObservers();
+ }
+
+ copy_inventory_item(
+ gAgent.getID(),
+ inv_item->getPermissions().getOwner(),
+ inv_item->getUUID(),
+ dest_folder,
+ inv_item->getName(),
+ LLPointer<LLInventoryCallback>(NULL));
+ }
+ else
+ {
+ LLSD args;
+ args["ITEM_NAME"] = inv_item->getName();
+ LLSD payload;
+ payload["item_id"] = inv_item->getUUID();
+ payload["dest_folder_id"] = dest_folder;
+ payload["top_level_folder"] = top_level_folder;
+ LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2));
+ }
+}
+
+void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder)
+{
+ LLUUID new_folder_id = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_cat->getName());
+ gInventory.notifyObservers();
+
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(inv_cat->getUUID(),cat_array,item_array);
+
+ // copy the vector because otherwise the iterator won't be happy if we delete from it
+ LLInventoryModel::item_array_t item_array_copy = *item_array;
+
+ for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
+ {
+ LLInventoryItem* item = *iter;
+ copy_item_to_outbox(item, new_folder_id, top_level_folder);
+ }
+
+ LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
+
+ for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
+ {
+ LLViewerInventoryCategory* category = *iter;
+ copy_folder_to_outbox(category, new_folder_id, top_level_folder);
+ }
+
+ // delete the folder if we have emptied it
+ //if (cat_array->empty() && item_array->empty())
+ //{
+ // remove_category(inventory_model, inv_cat->getUUID());
+ //}
+}
+
///----------------------------------------------------------------------------
/// LLInventoryCollectFunctor implementations
///----------------------------------------------------------------------------
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 2016b92666..7b452537f8 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -37,6 +37,9 @@
** MISCELLANEOUS GLOBAL FUNCTIONS
**/
+// Is this a parent folder to a worn item
+BOOL get_is_parent_to_worn_item(const LLUUID& id);
+
// Is this item or its baseitem is worn, attached, etc...
BOOL get_is_item_worn(const LLUUID& id);
@@ -71,6 +74,10 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
// Generates a string containing the path to the item specified by item_id.
void append_path(const LLUUID& id, std::string& path);
+void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder);
+
+void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder);
+
/** Miscellaneous global functions
** **
*******************************************************************************/
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 1aa402802e..173e5c6ae6 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -163,49 +163,6 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
{
root_id = gInventory.getLibraryRootFolderID();
}
- // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type
- else if (preferred_type == LLFolderType::FT_INBOX)
- {
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
-
- gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items);
-
- if (cats)
- {
- for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it)
- {
- LLInventoryCategory* cat = *cat_it;
-
- if (cat->getName() == "Received Items")
- {
- root_id = cat->getUUID();
- }
- }
- }
- }
- // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type
- else if (preferred_type == LLFolderType::FT_OUTBOX)
- {
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
-
- gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items);
-
- if (cats)
- {
- for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it)
- {
- LLInventoryCategory* cat = *cat_it;
-
- if (cat->getName() == "Merchant Outbox")
- {
- root_id = cat->getUUID();
- }
- }
- }
- }
- // leslie -- end temporary HACK
else
{
root_id = (preferred_type != LLFolderType::FT_NONE)
@@ -277,10 +234,10 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
{
setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER));
}
- mFolderRoot->setSortOrder(getFilter()->getSortOrder());
// hide inbox
getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX));
+ getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX));
// Initialize base class params.
LLPanel::initFromParams(params);
@@ -389,6 +346,10 @@ U32 LLInventoryPanel::getSortOrder() const
return mFolderRoot->getSortOrder();
}
+void LLInventoryPanel::requestSort()
+{
+ mFolderRoot->requestSort();
+}
void LLInventoryPanel::setSinceLogoff(BOOL sl)
{
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 7676bbb6d7..cfb84bf4b7 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -208,6 +208,8 @@ public:
void setSortOrder(U32 order);
U32 getSortOrder() const;
+ void requestSort();
+
private:
std::string mSortOrderSetting;
diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h
index 93e2e7128b..8d76aa9531 100644
--- a/indra/newview/lljoystickbutton.h
+++ b/indra/newview/lljoystickbutton.h
@@ -57,7 +57,7 @@ public:
Params()
: quadrant("quadrant", JQ_ORIGIN)
{
- label = "";
+ changeDefault(label, "");
}
};
LLJoystick(const Params&);
@@ -137,7 +137,7 @@ public:
{
Params()
{
- held_down_delay.seconds(0.0);
+ changeDefault(held_down_delay.seconds, 0.0);
}
};
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 5bbef78dd4..0bdeb114f5 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -79,7 +79,6 @@ LLMediaCtrl::Params::Params()
trusted_content("trusted_content", false),
focus_on_click("focus_on_click", true)
{
- tab_stop(false);
}
LLMediaCtrl::LLMediaCtrl( const Params& p) :
diff --git a/indra/newview/llmemoryview.h b/indra/newview/llmemoryview.h
index 9bdc59ab10..dc4849a9c4 100644
--- a/indra/newview/llmemoryview.h
+++ b/indra/newview/llmemoryview.h
@@ -38,8 +38,8 @@ public:
{
Params()
{
- mouse_opaque = true;
- visible = false;
+ changeDefault(mouse_opaque, true);
+ changeDefault(visible, false);
}
};
LLMemoryView(const LLMemoryView::Params&);
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index fc594841e3..fc594841e3 100755..100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 35a7314cd5..35a7314cd5 100755..100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
diff --git a/indra/newview/llmorphview.h b/indra/newview/llmorphview.h
index 1d8ee8e944..318d49bba5 100644
--- a/indra/newview/llmorphview.h
+++ b/indra/newview/llmorphview.h
@@ -40,8 +40,8 @@ public:
{
Params()
{
- mouse_opaque(false);
- follows.flags(FOLLOWS_ALL);
+ changeDefault(mouse_opaque, false);
+ changeDefault(follows.flags, FOLLOWS_ALL);
}
};
LLMorphView(const LLMorphView::Params&);
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index afceb58ccf..4e28d1f526 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -57,7 +57,6 @@ LLNameListCtrl::Params::Params()
allow_calling_card_drop("allow_calling_card_drop", false),
short_names("short_names", false)
{
- name = "name_list";
}
LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index d58a1cb663..988e801b61 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -66,8 +66,8 @@ public:
Params()
: agent_id("agent_id")
{
- mouse_opaque(false);
- follows.flags(FOLLOWS_ALL);
+ changeDefault(mouse_opaque, false);
+ changeDefault(follows.flags, FOLLOWS_ALL);
}
};
diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp
index e64192c2ae..31c0e3d01a 100644
--- a/indra/newview/llpanelgroupnotices.cpp
+++ b/indra/newview/llpanelgroupnotices.cpp
@@ -82,8 +82,8 @@ public:
: panel("panel"),
group_id("group_id")
{
- mouse_opaque(false);
- follows.flags(FOLLOWS_ALL);
+ changeDefault(mouse_opaque, false);
+ changeDefault(follows.flags, FOLLOWS_ALL);
}
};
LLGroupDropTarget(const Params&);
diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp
index f17f36a977..8d0712a328 100644
--- a/indra/newview/llpanelmarketplaceinbox.cpp
+++ b/indra/newview/llpanelmarketplaceinbox.cpp
@@ -1,236 +1,238 @@
-/**
- * @file llpanelmarketplaceinbox.cpp
- * @brief Panel for marketplace inbox
- *
-* $LicenseInfo:firstyear=2011&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 "llpanelmarketplaceinbox.h"
-#include "llpanelmarketplaceinboxinventory.h"
-
-#include "llappviewer.h"
-#include "llbutton.h"
-#include "llinventorypanel.h"
-#include "llfolderview.h"
-#include "llsidepanelinventory.h"
-#include "llviewercontrol.h"
-
-
-static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox");
-
-const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams()
-{
- return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>();
-}
-
-// protected
-LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)
- : LLPanel(p)
- , mInventoryPanel(NULL)
-{
-}
-
-LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
-{
- if (getChild<LLButton>("inbox_btn")->getToggleState())
- {
- gSavedPerAccountSettings.setString("LastInventoryInboxExpand", LLDate::now().asString());
- }
-}
-
-// virtual
-BOOL LLPanelMarketplaceInbox::postBuild()
-{
- LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this));
-
- LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this));
-
- return TRUE;
-}
-
-void LLPanelMarketplaceInbox::onSelectionChange()
-{
- LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
-
- sidepanel_inventory->updateVerbs();
-}
-
-
-void LLPanelMarketplaceInbox::handleLoginComplete()
-{
- // Set us up as the class to drive the badge value for the sidebar_inventory button
- LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this);
-}
-
-LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel()
-{
- LLView * inbox_inventory_placeholder = getChild<LLView>("inbox_inventory_placeholder");
- LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent();
-
- mInventoryPanel =
- LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_inbox_inventory.xml",
- inbox_inventory_parent,
- LLInventoryPanel::child_registry_t::instance());
-
- // Reshape the inventory to the proper size
- LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect();
- mInventoryPanel->setShape(inventory_placeholder_rect);
-
- // Set the sort order newest to oldest, and a selection change callback
- mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);
- mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
-
- // Set up the note to display when the inbox is empty
- mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryInboxNoItems");
-
- // Hide the placeholder text
- inbox_inventory_placeholder->setVisible(FALSE);
-
- return mInventoryPanel;
-}
-
-void LLPanelMarketplaceInbox::onFocusReceived()
-{
- LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
-
- sidepanel_inventory->clearSelections(true, false, true);
-}
-
-BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)
-{
- *accept = ACCEPT_NO;
- return TRUE;
-}
-
-U32 LLPanelMarketplaceInbox::getFreshItemCount() const
-{
-#if SUPPORTING_FRESH_ITEM_COUNT
-
- //
- // NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably
- // will return "2" for the Inventory and LIBRARY top-levels when that happens.
- //
-
- U32 fresh_item_count = 0;
-
- if (mInventoryPanel)
- {
- const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
-
- if (inbox_folder)
- {
- LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin();
- LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd();
-
- for (; folders_it != folders_end; ++folders_it)
- {
- const LLFolderViewFolder * folder_view = *folders_it;
- const LLInboxFolderViewFolder * inbox_folder_view = dynamic_cast<const LLInboxFolderViewFolder*>(folder_view);
-
- if (inbox_folder_view && inbox_folder_view->isFresh())
- {
- fresh_item_count++;
- }
- }
- }
- }
-
- return fresh_item_count;
-#else
- return getTotalItemCount();
-#endif
-}
-
-U32 LLPanelMarketplaceInbox::getTotalItemCount() const
-{
- U32 item_count = 0;
-
- if (mInventoryPanel)
- {
- const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
-
- if (inbox_folder)
- {
- item_count += inbox_folder->getFoldersCount();
- }
- }
-
- return item_count;
-}
-
-std::string LLPanelMarketplaceInbox::getBadgeString() const
-{
- std::string item_count_str("");
-
- // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel
- if (getParent()->getVisible() &&
- (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")))
- {
- U32 item_count = getFreshItemCount();
-
- if (item_count)
- {
- item_count_str = llformat("%d", item_count);
- }
- }
-
- return item_count_str;
-}
-
-void LLPanelMarketplaceInbox::draw()
-{
- U32 item_count = getTotalItemCount();
-
- LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count");
-
- if (item_count > 0)
- {
- std::string item_count_str = llformat("%d", item_count);
-
- LLStringUtil::format_map_t args;
- args["[NUM]"] = item_count_str;
- getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args));
-
-#if SUPPORTING_FRESH_ITEM_COUNT
- // set green text to fresh item count
- U32 fresh_item_count = getFreshItemCount();
- fresh_new_count_view->setVisible((fresh_item_count > 0));
-
- if (fresh_item_count > 0)
- {
- getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count));
- }
-#else
- fresh_new_count_view->setVisible(FALSE);
-#endif
- }
- else
- {
- getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg"));
-
- fresh_new_count_view->setVisible(FALSE);
- }
-
- LLPanel::draw();
-}
+/**
+ * @file llpanelmarketplaceinbox.cpp
+ * @brief Panel for marketplace inbox
+ *
+* $LicenseInfo:firstyear=2011&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 "llpanelmarketplaceinbox.h"
+#include "llpanelmarketplaceinboxinventory.h"
+
+#include "llappviewer.h"
+#include "llbutton.h"
+#include "llinventorypanel.h"
+#include "llfolderview.h"
+#include "llsidepanelinventory.h"
+#include "llviewercontrol.h"
+
+
+static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox");
+
+const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams()
+{
+ return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>();
+}
+
+// protected
+LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)
+ : LLPanel(p)
+ , mInventoryPanel(NULL)
+{
+}
+
+LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
+{
+}
+
+// virtual
+BOOL LLPanelMarketplaceInbox::postBuild()
+{
+ LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this));
+
+ LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this));
+
+ return TRUE;
+}
+
+void LLPanelMarketplaceInbox::onSelectionChange()
+{
+ LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
+
+ sidepanel_inventory->updateVerbs();
+}
+
+
+void LLPanelMarketplaceInbox::handleLoginComplete()
+{
+ // Set us up as the class to drive the badge value for the sidebar_inventory button
+ LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this);
+}
+
+LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel()
+{
+ LLView * inbox_inventory_placeholder = getChild<LLView>("inbox_inventory_placeholder");
+ LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent();
+
+ mInventoryPanel =
+ LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_inbox_inventory.xml",
+ inbox_inventory_parent,
+ LLInventoryPanel::child_registry_t::instance());
+
+ llassert(mInventoryPanel);
+
+ // Reshape the inventory to the proper size
+ LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect();
+ mInventoryPanel->setShape(inventory_placeholder_rect);
+
+ // Set the sort order newest to oldest
+ mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);
+
+ // Set selection callback for proper update of inventory status buttons
+ mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
+
+ // Set up the note to display when the inbox is empty
+ mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryInboxNoItems");
+
+ // Hide the placeholder text
+ inbox_inventory_placeholder->setVisible(FALSE);
+
+ return mInventoryPanel;
+}
+
+void LLPanelMarketplaceInbox::onFocusReceived()
+{
+ LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
+
+ sidepanel_inventory->clearSelections(true, false, true);
+
+ gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+}
+
+BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)
+{
+ *accept = ACCEPT_NO;
+ return TRUE;
+}
+
+U32 LLPanelMarketplaceInbox::getFreshItemCount() const
+{
+#if SUPPORTING_FRESH_ITEM_COUNT
+
+ //
+ // NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably
+ // will return "2" for the Inventory and LIBRARY top-levels when that happens.
+ //
+
+ U32 fresh_item_count = 0;
+
+ if (mInventoryPanel)
+ {
+ const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
+
+ if (inbox_folder)
+ {
+ LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin();
+ LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd();
+
+ for (; folders_it != folders_end; ++folders_it)
+ {
+ const LLFolderViewFolder * folder_view = *folders_it;
+ const LLInboxFolderViewFolder * inbox_folder_view = dynamic_cast<const LLInboxFolderViewFolder*>(folder_view);
+
+ if (inbox_folder_view && inbox_folder_view->isFresh())
+ {
+ fresh_item_count++;
+ }
+ }
+ }
+ }
+
+ return fresh_item_count;
+#else
+ return getTotalItemCount();
+#endif
+}
+
+U32 LLPanelMarketplaceInbox::getTotalItemCount() const
+{
+ U32 item_count = 0;
+
+ if (mInventoryPanel)
+ {
+ const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
+
+ if (inbox_folder)
+ {
+ item_count += inbox_folder->getFoldersCount();
+ }
+ }
+
+ return item_count;
+}
+
+std::string LLPanelMarketplaceInbox::getBadgeString() const
+{
+ std::string item_count_str("");
+
+ // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel
+ if (getParent()->getVisible() &&
+ (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")))
+ {
+ U32 item_count = getFreshItemCount();
+
+ if (item_count)
+ {
+ item_count_str = llformat("%d", item_count);
+ }
+ }
+
+ return item_count_str;
+}
+
+void LLPanelMarketplaceInbox::draw()
+{
+ U32 item_count = getTotalItemCount();
+
+ LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count");
+
+ if (item_count > 0)
+ {
+ std::string item_count_str = llformat("%d", item_count);
+
+ LLStringUtil::format_map_t args;
+ args["[NUM]"] = item_count_str;
+ getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args));
+
+#if SUPPORTING_FRESH_ITEM_COUNT
+ // set green text to fresh item count
+ U32 fresh_item_count = getFreshItemCount();
+ fresh_new_count_view->setVisible((fresh_item_count > 0));
+
+ if (fresh_item_count > 0)
+ {
+ getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count));
+ }
+#else
+ fresh_new_count_view->setVisible(FALSE);
+#endif
+ }
+ else
+ {
+ getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg"));
+
+ fresh_new_count_view->setVisible(FALSE);
+ }
+
+ LLPanel::draw();
+}
diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h
index 7b4ed137db..705a095cf0 100644
--- a/indra/newview/llpanelmarketplaceinbox.h
+++ b/indra/newview/llpanelmarketplaceinbox.h
@@ -37,9 +37,7 @@ class LLPanelMarketplaceInbox : public LLPanel, public LLSideTrayTabBadgeDriver
public:
struct Params : public LLInitParam::Block<Params, LLPanel::Params>
- {
- Params() {}
- };
+ {};
LOG_CLASS(LLPanelMarketplaceInbox);
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index 2c97d539a1..47f34434db 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -37,6 +37,8 @@
#include "llviewerfoldertype.h"
+#define DEBUGGING_FRESHNESS 0
+
//
// statics
//
@@ -66,7 +68,7 @@ void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& para
LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false);
- // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type
+ // leslie -- temporary HACK to work around sim not creating inbox with proper system folder type
if (root_id.isNull())
{
std::string start_folder_name(params.start_folder());
@@ -133,6 +135,27 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge
return LLUICtrlFactory::create<LLInboxFolderViewFolder>(params);
}
+LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
+{
+ LLFolderViewItem::Params params;
+
+ params.name = bridge->getDisplayName();
+ params.icon = bridge->getIcon();
+ params.icon_open = bridge->getOpenIcon();
+
+ if (mShowItemLinkOverlays) // if false, then links show up just like normal items
+ {
+ params.icon_overlay = LLUI::getUIImage("Inv_Link");
+ }
+
+ params.creation_date = bridge->getCreationDate();
+ params.root = mFolderRoot;
+ params.listener = bridge;
+ params.rect = LLRect (0, 0, 0, 0);
+ params.tool_tip = params.name;
+
+ return LLUICtrlFactory::create<LLInboxFolderViewItem>(params);
+}
//
// LLInboxFolderViewFolder Implementation
@@ -141,7 +164,7 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge
LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p)
: LLFolderViewFolder(p)
, LLBadgeOwner(getHandle())
- , mFresh(true)
+ , mFresh(false)
{
#if SUPPORTING_FRESH_ITEM_COUNT
initBadgeParams(p.new_badge());
@@ -153,19 +176,6 @@ LLInboxFolderViewFolder::~LLInboxFolderViewFolder()
}
// virtual
-time_t LLInboxFolderViewFolder::getCreationDate() const
-{
- time_t ret_val = LLFolderViewFolder::getCreationDate();
-
- if (!mCreationDate)
- {
- updateFlag();
- }
-
- return ret_val;
-}
-
-// virtual
void LLInboxFolderViewFolder::draw()
{
#if SUPPORTING_FRESH_ITEM_COUNT
@@ -180,29 +190,67 @@ void LLInboxFolderViewFolder::draw()
LLFolderViewFolder::draw();
}
-void LLInboxFolderViewFolder::updateFlag() const
+void LLInboxFolderViewFolder::computeFreshness()
+{
+ const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxActivity");
+
+ if (!last_expansion.empty())
+ {
+ LLDate saved_freshness_date = LLDate(last_expansion);
+
+ mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch());
+
+#if DEBUGGING_FRESHNESS
+ if (mFresh)
+ {
+ llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << saved_freshness_date.secondsSinceEpoch() << llendl;
+ }
+#endif
+ }
+ else
+ {
+ mFresh = true;
+ }
+}
+
+void LLInboxFolderViewFolder::deFreshify()
{
- LLDate saved_freshness_date = LLDate(gSavedPerAccountSettings.getString("LastInventoryInboxExpand"));
- mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch());
+ mFresh = false;
+
+ gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
}
void LLInboxFolderViewFolder::selectItem()
{
- mFresh = false;
LLFolderViewFolder::selectItem();
+
+ deFreshify();
}
void LLInboxFolderViewFolder::toggleOpen()
{
- mFresh = false;
LLFolderViewFolder::toggleOpen();
+
+ deFreshify();
}
-void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const
+void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
- updateFlag();
+
+ if (mParentFolder == mRoot)
+ {
+ computeFreshness();
+ }
}
+//
+// LLInboxFolderViewItem Implementation
+//
+
+BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ return TRUE;
+}
// eof
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h
index 8946b9dc98..46eeb9ea7f 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.h
+++ b/indra/newview/llpanelmarketplaceinboxinventory.h
@@ -33,7 +33,7 @@
#include "llfolderviewitem.h"
-#define SUPPORTING_FRESH_ITEM_COUNT 0
+#define SUPPORTING_FRESH_ITEM_COUNT 1
@@ -41,9 +41,7 @@ class LLInboxInventoryPanel : public LLInventoryPanel
{
public:
struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
- {
- Params() {}
- };
+ {};
LLInboxInventoryPanel(const Params& p);
~LLInboxInventoryPanel();
@@ -52,7 +50,8 @@ public:
void buildFolderView(const LLInventoryPanel::Params& params);
// virtual
- class LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge);
+ LLFolderViewFolder * createFolderViewFolder(LLInvFVBridge * bridge);
+ LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
};
@@ -72,21 +71,32 @@ public:
LLInboxFolderViewFolder(const Params& p);
~LLInboxFolderViewFolder();
- time_t getCreationDate() const;
-
void draw();
- void updateFlag() const;
+ void computeFreshness();
+ void deFreshify();
+
void selectItem();
void toggleOpen();
bool isFresh() const { return mFresh; }
protected:
- void setCreationDate(time_t creation_date_utc) const;
+ void setCreationDate(time_t creation_date_utc);
- mutable bool mFresh;
+ bool mFresh;
};
+class LLInboxFolderViewItem : public LLFolderViewItem
+{
+public:
+ LLInboxFolderViewItem(const Params& p)
+ : LLFolderViewItem(p)
+ {
+ }
+
+ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
+};
+
#endif //LL_INBOXINVENTORYPANEL_H
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index d51a0d78fe..839369bffe 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -27,6 +27,7 @@
#include "llviewerprecompiledheaders.h"
#include "llpanelmarketplaceoutbox.h"
+#include "llpanelmarketplaceoutboxinventory.h"
#include "llappviewer.h"
#include "llbutton.h"
@@ -34,11 +35,17 @@
#include "lleventcoro.h"
#include "llinventorypanel.h"
#include "llloadingindicator.h"
+#include "llnotificationsutil.h"
#include "llpanelmarketplaceinbox.h"
+#include "llsdutil.h"
#include "llsidepanelinventory.h"
#include "llsidetray.h"
#include "lltimer.h"
-
+#include "llviewernetwork.h"
+#include "llagent.h"
+#include "llviewermedia.h"
+#include "llfolderview.h"
+#include "llinventoryfunctions.h"
static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox");
@@ -83,7 +90,7 @@ void LLPanelMarketplaceOutbox::handleLoginComplete()
void LLPanelMarketplaceOutbox::onFocusReceived()
{
LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
-
+
sidepanel_inventory->clearSelections(true, true, false);
}
@@ -96,7 +103,7 @@ void LLPanelMarketplaceOutbox::onSelectionChange()
LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel()
{
- LLView * outbox_inventory_placeholder = getChild<LLView>("outbox_inventory_placeholder");
+ LLView * outbox_inventory_placeholder = getChild<LLView>("outbox_inventory_placeholder_panel");
LLView * outbox_inventory_parent = outbox_inventory_placeholder->getParent();
mInventoryPanel =
@@ -104,6 +111,8 @@ LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel()
outbox_inventory_parent,
LLInventoryPanel::child_registry_t::instance());
+ llassert(mInventoryPanel);
+
// Reshape the inventory to the proper size
LLRect inventory_placeholder_rect = outbox_inventory_placeholder->getRect();
mInventoryPanel->setShape(inventory_placeholder_rect);
@@ -121,11 +130,30 @@ LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel()
return mInventoryPanel;
}
-bool LLPanelMarketplaceOutbox::isOutboxEmpty() const
+BOOL LLPanelMarketplaceOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg)
{
- // TODO: Check for contents of outbox
+ BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+
+ if (!handled && mInventoryPanel && mInventoryPanel->getRootFolder())
+ {
+ handled = mInventoryPanel->getRootFolder()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg);
+
+ if (handled)
+ {
+ mInventoryPanel->getRootFolder()->setDragAndDropThisFrame();
+ }
+ }
- return false;
+ return handled;
+}
+
+bool LLPanelMarketplaceOutbox::isOutboxEmpty() const
+{
+ return (getTotalItemCount() == 0);
}
bool LLPanelMarketplaceOutbox::isSyncInProgress() const
@@ -149,28 +177,119 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
waitForEventOn(self, "mainloop");
}
- outboxPanel->onSyncComplete();
+ outboxPanel->onSyncComplete(true, LLSD::emptyMap());
gTimeDelayDebugFunc = "";
}
-void LLPanelMarketplaceOutbox::onSyncButtonClicked()
+
+class LLInventorySyncResponder : public LLHTTPClient::Responder
{
- // TODO: Actually trigger sync to marketplace
+public:
+ LLInventorySyncResponder(LLPanelMarketplaceOutbox * outboxPanel)
+ : LLCurl::Responder()
+ , mOutboxPanel(outboxPanel)
+ {
+ }
+
+ void completed(U32 status, const std::string& reason, const LLSD& content)
+ {
+ llinfos << "inventory_import complete status: " << status << ", reason: " << reason << llendl;
+
+ if (isGoodStatus(status))
+ {
+ // Complete success
+ llinfos << "success" << llendl;
+ }
+ else
+ {
+ llwarns << "failed" << llendl;
+ }
+
+ mOutboxPanel->onSyncComplete(isGoodStatus(status), content);
+ }
+
+private:
+ LLPanelMarketplaceOutbox * mOutboxPanel;
+};
+void LLPanelMarketplaceOutbox::onSyncButtonClicked()
+{
+ // Get the sync animation going
mSyncInProgress = true;
updateSyncButtonStatus();
- // Set a timer (for testing only)
+ // Make the url for the inventory import request
+ std::string url = "https://marketplace.secondlife.com/";
+
+ if (!LLGridManager::getInstance()->isInProductionGrid())
+ {
+ std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
+ url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
+
+ // TEMP for Jim's pdp
+ //url = "http://pdp24.lindenlab.com:3000/";
+ }
+
+ url += "api/1/users/";
+ url += gAgent.getID().getString();
+ url += "/inventory_import";
+
+ llinfos << "http get: " << url << llendl;
+ LLHTTPClient::get(url, new LLInventorySyncResponder(this), LLViewerMedia::getHeaders());
- gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
+ // Set a timer (for testing only)
+ //gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
}
-void LLPanelMarketplaceOutbox::onSyncComplete()
+void LLPanelMarketplaceOutbox::onSyncComplete(bool goodStatus, const LLSD& content)
{
mSyncInProgress = false;
-
updateSyncButtonStatus();
+
+ const LLSD& errors_list = content["errors"];
+
+ if (goodStatus && (errors_list.size() == 0))
+ {
+ LLNotificationsUtil::add("OutboxUploadComplete", LLSD::emptyMap(), LLSD::emptyMap());
+ }
+ else
+ {
+ LLNotificationsUtil::add("OutboxUploadHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
+ }
+
+ llinfos << "Marketplace upload llsd:" << llendl;
+ llinfos << ll_pretty_print_sd(content) << llendl;
+ llinfos << llendl;
+
+ const LLSD& imported_list = content["imported"];
+ LLSD::array_const_iterator it = imported_list.beginArray();
+ for ( ; it != imported_list.endArray(); ++it)
+ {
+ LLUUID imported_folder = (*it).asUUID();
+ llinfos << "Successfully uploaded folder " << imported_folder.asString() << " to marketplace." << llendl;
+ }
+
+ for (it = errors_list.beginArray(); it != errors_list.endArray(); ++it)
+ {
+ const LLSD& item_error_map = (*it);
+
+ LLUUID error_folder = item_error_map["folder_id"].asUUID();
+ const std::string& error_string = item_error_map["identifier"].asString();
+ LLUUID error_item = item_error_map["item_id"].asUUID();
+ const std::string& error_item_name = item_error_map["item_name"].asString();
+ const std::string& error_message = item_error_map["message"].asString();
+
+ llinfos << "Error item " << error_folder.asString() << ", " << error_string << ", "
+ << error_item.asString() << ", " << error_item_name << ", " << error_message << llendl;
+
+ LLFolderViewFolder * item_folder = mInventoryPanel->getRootFolder()->getFolderByID(error_folder);
+ LLOutboxFolderViewFolder * outbox_item_folder = dynamic_cast<LLOutboxFolderViewFolder *>(item_folder);
+
+ llassert(outbox_item_folder);
+
+ outbox_item_folder->setErrorString(error_string);
+ }
}
void LLPanelMarketplaceOutbox::updateSyncButtonStatus()
@@ -192,3 +311,46 @@ void LLPanelMarketplaceOutbox::updateSyncButtonStatus()
mSyncButton->setEnabled(!isOutboxEmpty());
}
}
+
+U32 LLPanelMarketplaceOutbox::getTotalItemCount() const
+{
+ U32 item_count = 0;
+
+ if (mInventoryPanel)
+ {
+ const LLFolderViewFolder * outbox_folder = mInventoryPanel->getRootFolder();
+
+ if (outbox_folder)
+ {
+ item_count += outbox_folder->getFoldersCount();
+ }
+ }
+
+ return item_count;
+}
+
+void LLPanelMarketplaceOutbox::draw()
+{
+ const U32 item_count = getTotalItemCount();
+ const bool not_empty = (item_count > 0);
+
+ if (not_empty)
+ {
+ std::string item_count_str = llformat("%d", item_count);
+
+ LLStringUtil::format_map_t args;
+ args["[NUM]"] = item_count_str;
+ getChild<LLButton>("outbox_btn")->setLabel(getString("OutboxLabelWithArg", args));
+ }
+ else
+ {
+ getChild<LLButton>("outbox_btn")->setLabel(getString("OutboxLabelNoArg"));
+ }
+
+ if (!isSyncInProgress())
+ {
+ mSyncButton->setEnabled(not_empty);
+ }
+
+ LLPanel::draw();
+}
diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h
index 8e2c35914d..c6b4a5abe2 100644
--- a/indra/newview/llpanelmarketplaceoutbox.h
+++ b/indra/newview/llpanelmarketplaceoutbox.h
@@ -40,9 +40,7 @@ class LLPanelMarketplaceOutbox : public LLPanel
public:
struct Params : public LLInitParam::Block<Params, LLPanel::Params>
- {
- Params() {}
- };
+ {};
LOG_CLASS(LLPanelMarketplaceOutbox);
@@ -54,12 +52,22 @@ public:
/*virtual*/ BOOL postBuild();
+ /*virtual*/ void draw();
+
LLInventoryPanel * setupInventoryPanel();
+ U32 getTotalItemCount() const;
+
bool isOutboxEmpty() const;
bool isSyncInProgress() const;
- void onSyncComplete();
+ void onSyncComplete(bool goodStatus, const LLSD& content);
+
+ /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg);
protected:
void onSyncButtonClicked();
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
new file mode 100644
index 0000000000..ed1206aec8
--- /dev/null
+++ b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
@@ -0,0 +1,271 @@
+/**
+ * @file llpanelmarketplaceoutboxinventory.cpp
+ * @brief LLOutboxInventoryPanel class definition
+ *
+ * $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 "llpanelmarketplaceoutboxinventory.h"
+
+#include "llfolderview.h"
+#include "llfoldervieweventlistener.h"
+#include "llinventorybridge.h"
+#include "llinventoryfunctions.h"
+#include "llpanellandmarks.h"
+#include "llplacesinventorybridge.h"
+#include "lltrans.h"
+#include "llviewerfoldertype.h"
+
+
+//
+// statics
+//
+
+static LLDefaultChildRegistry::Register<LLOutboxInventoryPanel> r1("outbox_inventory_panel");
+static LLDefaultChildRegistry::Register<LLOutboxFolderViewFolder> r2("outbox_folder_view_folder");
+
+
+//
+// Marketplace errors
+//
+
+enum
+{
+ MKTERR_NONE = 0,
+
+ MKTERR_NOT_MERCHANT,
+ MKTERR_FOLDER_EMPTY,
+ MKTERR_UNASSOCIATED_PRODUCTS,
+ MKTERR_OBJECT_LIMIT,
+ MKTERR_FOLDER_DEPTH,
+ MKTERR_UNSELLABLE_ITEM,
+ MKTERR_INTERNAL_IMPORT,
+
+ MKTERR_COUNT
+};
+
+static const std::string MARKETPLACE_ERROR_STRINGS[MKTERR_COUNT] =
+{
+ "NO_ERROR",
+ "NOT_MERCHANT_ERROR",
+ "FOLDER_EMPTY_ERROR",
+ "UNASSOCIATED_PRODUCTS_ERROR",
+ "OBJECT_LIMIT_ERROR",
+ "FOLDER_DEPTH_ERROR",
+ "UNSELLABLE_ITEM_FOUND",
+ "INTERNAL_IMPORT_ERROR",
+};
+
+static const std::string MARKETPLACE_ERROR_NAMES[MKTERR_COUNT] =
+{
+ "Marketplace Error None",
+ "Marketplace Error Not Merchant",
+ "Marketplace Error Empty Folder",
+ "Marketplace Error Unassociated Products",
+ "Marketplace Error Object Limit",
+ "Marketplace Error Folder Depth",
+ "Marketplace Error Unsellable Item",
+ "Marketplace Error Internal Import",
+};
+
+
+//
+// LLOutboxInventoryPanel Implementation
+//
+
+LLOutboxInventoryPanel::LLOutboxInventoryPanel(const LLOutboxInventoryPanel::Params& p)
+ : LLInventoryPanel(p)
+{
+}
+
+LLOutboxInventoryPanel::~LLOutboxInventoryPanel()
+{
+}
+
+// virtual
+void LLOutboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
+{
+ // Determine the root folder in case specified, and
+ // build the views starting with that folder.
+
+ LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+
+ // leslie -- temporary HACK to work around sim not creating outbox with proper system folder type
+ if (root_id.isNull())
+ {
+ std::string start_folder_name(params.start_folder());
+
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+
+ gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items);
+
+ if (cats)
+ {
+ for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it)
+ {
+ LLInventoryCategory* cat = *cat_it;
+
+ if (cat->getName() == start_folder_name)
+ {
+ root_id = cat->getUUID();
+ break;
+ }
+ }
+ }
+
+ if (root_id == LLUUID::null)
+ {
+ llwarns << "No category found that matches outbox inventory panel start_folder: " << start_folder_name << llendl;
+ }
+ }
+ // leslie -- end temporary HACK
+
+ if (root_id == LLUUID::null)
+ {
+ llwarns << "Outbox inventory panel has no root folder!" << llendl;
+ root_id = LLUUID::generateNewID();
+ }
+
+ LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
+ LLAssetType::AT_CATEGORY,
+ LLInventoryType::IT_CATEGORY,
+ this,
+ NULL,
+ root_id);
+
+ mFolderRoot = createFolderView(new_listener, params.use_label_suffix());
+}
+
+LLFolderViewFolder * LLOutboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
+{
+ LLOutboxFolderViewFolder::Params params;
+
+ params.name = bridge->getDisplayName();
+ params.icon = bridge->getIcon();
+ params.icon_open = bridge->getOpenIcon();
+
+ if (mShowItemLinkOverlays) // if false, then links show up just like normal items
+ {
+ params.icon_overlay = LLUI::getUIImage("Inv_Link");
+ }
+
+ params.root = mFolderRoot;
+ params.listener = bridge;
+ params.tool_tip = params.name;
+
+ return LLUICtrlFactory::create<LLOutboxFolderViewFolder>(params);
+}
+
+LLFolderViewItem * LLOutboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
+{
+ LLFolderViewItem::Params params;
+
+ params.name = bridge->getDisplayName();
+ params.icon = bridge->getIcon();
+ params.icon_open = bridge->getOpenIcon();
+
+ if (mShowItemLinkOverlays) // if false, then links show up just like normal items
+ {
+ params.icon_overlay = LLUI::getUIImage("Inv_Link");
+ }
+
+ params.creation_date = bridge->getCreationDate();
+ params.root = mFolderRoot;
+ params.listener = bridge;
+ params.rect = LLRect (0, 0, 0, 0);
+ params.tool_tip = params.name;
+
+ return LLUICtrlFactory::create<LLOutboxFolderViewItem>(params);
+}
+
+//
+// LLOutboxFolderViewFolder Implementation
+//
+
+LLOutboxFolderViewFolder::LLOutboxFolderViewFolder(const Params& p)
+ : LLFolderViewFolder(p)
+ , LLBadgeOwner(getHandle())
+ , mError(0)
+{
+ initBadgeParams(p.error_badge());
+}
+
+LLOutboxFolderViewFolder::~LLOutboxFolderViewFolder()
+{
+}
+
+// virtual
+void LLOutboxFolderViewFolder::draw()
+{
+ if (!badgeHasParent())
+ {
+ addBadgeToParentPanel();
+ }
+
+ setBadgeVisibility(hasError());
+
+ LLFolderViewFolder::draw();
+}
+
+void LLOutboxFolderViewFolder::setErrorString(const std::string& errorString)
+{
+ S32 error_code = MKTERR_NONE;
+
+ for (S32 i = 1; i < MKTERR_COUNT; ++i)
+ {
+ if (MARKETPLACE_ERROR_STRINGS[i] == errorString)
+ {
+ error_code = i;
+ break;
+ }
+ }
+
+ setError(error_code);
+}
+
+void LLOutboxFolderViewFolder::setError(S32 errorCode)
+{
+ mError = errorCode;
+
+ if (hasError())
+ {
+ setToolTip(LLTrans::getString(MARKETPLACE_ERROR_NAMES[mError]));
+ }
+ else
+ {
+ setToolTip(LLStringExplicit(""));
+ }
+}
+
+//
+// LLOutboxFolderViewItem Implementation
+//
+
+BOOL LLOutboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ return TRUE;
+}
+
+// eof
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.h b/indra/newview/llpanelmarketplaceoutboxinventory.h
new file mode 100644
index 0000000000..346680a79d
--- /dev/null
+++ b/indra/newview/llpanelmarketplaceoutboxinventory.h
@@ -0,0 +1,97 @@
+/**
+ * @file llpanelmarketplaceoutboxinventory.h
+ * @brief LLOutboxInventoryPanel class declaration
+ *
+ * $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$
+ */
+
+#ifndef LL_OUTBOXINVENTORYPANEL_H
+#define LL_OUTBOXINVENTORYPANEL_H
+
+
+#include "llbadgeowner.h"
+#include "llinventorypanel.h"
+#include "llfolderviewitem.h"
+
+
+class LLOutboxInventoryPanel : public LLInventoryPanel
+{
+public:
+ struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
+ {
+ Params() {}
+ };
+
+ LLOutboxInventoryPanel(const Params& p);
+ ~LLOutboxInventoryPanel();
+
+ // virtual
+ void buildFolderView(const LLInventoryPanel::Params& params);
+
+ // virtual
+ LLFolderViewFolder * createFolderViewFolder(LLInvFVBridge * bridge);
+ LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
+};
+
+
+class LLOutboxFolderViewFolder : public LLFolderViewFolder, public LLBadgeOwner
+{
+public:
+ struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
+ {
+ Optional<LLBadge::Params> error_badge;
+
+ Params()
+ : error_badge("error_badge")
+ {
+ }
+ };
+
+ LLOutboxFolderViewFolder(const Params& p);
+ ~LLOutboxFolderViewFolder();
+
+ void draw();
+
+ void setErrorString(const std::string& errorString);
+ void setError(S32 errorCode);
+
+ bool hasError() const { return (mError != 0); }
+
+protected:
+ S32 mError;
+};
+
+
+class LLOutboxFolderViewItem : public LLFolderViewItem
+{
+public:
+ LLOutboxFolderViewItem(const Params& p)
+ : LLFolderViewItem(p)
+ {
+ }
+
+ // virtual
+ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
+};
+
+
+#endif //LL_OUTBOXINVENTORYPANEL_H
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 83ba8afbfc..44364b5831 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -140,7 +140,8 @@ public:
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data);
+ void* cargo_data,
+ std::string& tooltip_msg);
};
LLTaskInvFVBridge::LLTaskInvFVBridge(
@@ -581,7 +582,8 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
BOOL LLTaskInvFVBridge::dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data)
+ void* cargo_data,
+ std::string& tooltip_msg)
{
//llinfos << "LLTaskInvFVBridge::dragOrDrop()" << llendl;
return FALSE;
@@ -711,7 +713,8 @@ public:
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data);
+ void* cargo_data,
+ std::string& tooltip_msg);
virtual BOOL canOpenItem() const { return TRUE; }
virtual void openItem();
};
@@ -805,7 +808,8 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data)
+ void* cargo_data,
+ std::string& tooltip_msg)
{
//llinfos << "LLTaskCategoryBridge::dragOrDrop()" << llendl;
BOOL accept = FALSE;
diff --git a/indra/newview/llsearchcombobox.cpp b/indra/newview/llsearchcombobox.cpp
index 6558c9a7fa..2824c70582 100644
--- a/indra/newview/llsearchcombobox.cpp
+++ b/indra/newview/llsearchcombobox.cpp
@@ -52,10 +52,9 @@ protected:
};
LLSearchComboBox::Params::Params()
-: search_button("search_button")
-, dropdown_button_visible("dropdown_button_visible", false)
-{
-}
+: search_button("search_button"),
+ dropdown_button_visible("dropdown_button_visible", false)
+{}
LLSearchComboBox::LLSearchComboBox(const Params&p)
: LLComboBox(p)
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index a800611aac..858639215c 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -52,7 +52,10 @@
#include "llsidepaneltaskinfo.h"
#include "llstring.h"
#include "lltabcontainer.h"
+#include "lltextbox.h"
+#include "lltrans.h"
#include "llviewermedia.h"
+#include "llviewernetwork.h"
#include "llweb.h"
static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory");
@@ -61,16 +64,25 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_
// Constants
//
+// No longer want the inbox panel to auto-expand since it creates issues with the "new" tag time stamp
+#define AUTO_EXPAND_INBOX 0
+
+// Temporarily disabling the outbox until we straighten out the API
+#define ENABLE_MERCHANT_OUTBOX_PANEL 0 // keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX
+
static const char * const INBOX_BUTTON_NAME = "inbox_btn";
static const char * const OUTBOX_BUTTON_NAME = "outbox_btn";
static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel";
static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel";
+
+static const char * const INBOX_OUTBOX_LAYOUT_PANEL_NAME = "inbox_outbox_layout_panel";
static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel";
static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox";
static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox";
+static const char * const INBOX_OUTBOX_LAYOUT_STACK_NAME = "inbox_outbox_layout_stack";
static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack";
static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
@@ -235,16 +247,20 @@ BOOL LLSidepanelInventory::postBuild()
// Marketplace inbox/outbox setup
{
- LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
+ LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
// Disable user_resize on main inventory panel by default
- stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false);
- stack->setPanelUserResize(INBOX_LAYOUT_PANEL_NAME, false);
- stack->setPanelUserResize(OUTBOX_LAYOUT_PANEL_NAME, false);
+ inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false);
+ inv_stack->setPanelUserResize(INBOX_OUTBOX_LAYOUT_PANEL_NAME, false);
+
+ // Collapse marketplace panel by default
+ inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME), true);
+
+ LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME);
// Collapse both inbox and outbox panels
- stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true);
- stack->collapsePanel(getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME), true);
+ inout_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true);
+ inout_stack->collapsePanel(getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME), true);
// Set up button states and callbacks
LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME);
@@ -297,15 +313,16 @@ void LLSidepanelInventory::handleLoginComplete()
enableInbox(true);
}
+#if ENABLE_MERCHANT_OUTBOX_PANEL
// Set up observer for outbox changes, if we have an outbox already
if (!outbox_id.isNull())
{
observeOutboxModifications(outbox_id);
// Enable the display of the outbox if it exists
- //enableOutbox(true);
- // leslie NOTE: Disabling outbox until we support it officially.
+ enableOutbox(true);
}
+#endif
}
void LLSidepanelInventory::observeInboxOutboxCreation()
@@ -388,96 +405,159 @@ void LLSidepanelInventory::observeOutboxModifications(const LLUUID& outboxID)
void LLSidepanelInventory::enableInbox(bool enabled)
{
mInboxEnabled = enabled;
- getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled);
+
+ LLLayoutPanel * inbox_layout_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
+ inbox_layout_panel->setVisible(enabled);
+
+ if (mInboxEnabled)
+ {
+ LLLayoutPanel * inout_layout_panel = getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME);
+
+ inout_layout_panel->setVisible(TRUE);
+
+ if (mOutboxEnabled)
+ {
+ S32 inbox_min_dim = inbox_layout_panel->getMinDim();
+ S32 outbox_min_dim = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->getMinDim();
+
+ inout_layout_panel->setMinDim(inbox_min_dim + outbox_min_dim);
+ }
+ }
}
void LLSidepanelInventory::enableOutbox(bool enabled)
{
mOutboxEnabled = enabled;
- getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled);
+
+ LLLayoutPanel * outbox_layout_panel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
+ outbox_layout_panel->setVisible(enabled);
+
+ if (mOutboxEnabled)
+ {
+ LLLayoutPanel * inout_layout_panel = getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME);
+
+ inout_layout_panel->setVisible(TRUE);
+
+ if (mInboxEnabled)
+ {
+ S32 inbox_min_dim = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->getMinDim();
+ S32 outbox_min_dim = outbox_layout_panel->getMinDim();
+
+ inout_layout_panel->setMinDim(inbox_min_dim + outbox_min_dim);
+ }
+
+ updateOutboxUserStatus();
+ }
}
void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id)
{
// Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting
LLInventoryModelBackgroundFetch::instance().start(inbox_id);
-
- // Expand the inbox since we have fresh items
- LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL);
- if (inbox)
+
+#if AUTO_EXPAND_INBOX
+ // If the outbox is expanded, don't auto-expand the inbox
+ if (mOutboxEnabled)
+ {
+ if (getChild<LLButton>(OUTBOX_BUTTON_NAME)->getToggleState())
+ {
+ return;
+ }
+ }
+
+ // Expand the inbox since we have fresh items and the outbox is not expanded
+ if (mInboxEnabled)
{
getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true);
onToggleInboxBtn();
- }
+ }
+#endif
}
void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id)
{
- // Perhaps use this to track outbox changes?
+ // Expand the outbox since we have new items in it
+ if (mOutboxEnabled)
+ {
+ getChild<LLButton>(OUTBOX_BUTTON_NAME)->setToggleState(true);
+ onToggleOutboxBtn();
+ }
}
-bool manageInboxOutboxPanels(LLLayoutStack * stack,
- LLButton * pressedButton, LLLayoutPanel * pressedPanel,
+bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel,
LLButton * otherButton, LLLayoutPanel * otherPanel)
{
bool expand = pressedButton->getToggleState();
bool otherExpanded = otherButton->getToggleState();
- //
- // NOTE: Ideally we could have two panel sizes stored for a collapsed and expanded minimum size.
- // For now, leave this code disabled because it creates some bad artifacts when expanding
- // and collapsing the inbox/outbox.
- //
- //S32 smallMinSize = (expand ? pressedPanel->getMinDim() : otherPanel->getMinDim());
- //S32 pressedMinSize = (expand ? 2 * smallMinSize : smallMinSize);
- //otherPanel->setMinDim(smallMinSize);
- //pressedPanel->setMinDim(pressedMinSize);
+ LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
+ LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME);
+ LLLayoutPanel* inout_panel = getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME);
+ // Enable user_resize on main inventory panel only when a marketplace box is expanded
+ inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand);
+ inv_stack->collapsePanel(inout_panel, !expand);
+
+ // Collapse other marketplace panel if it is expanded
if (expand && otherExpanded)
{
// Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size
pressedPanel->reshape(pressedPanel->getRect().getWidth(), otherPanel->getRect().getHeight());
- stack->collapsePanel(otherPanel, true);
+ inout_stack->collapsePanel(otherPanel, true);
otherButton->setToggleState(false);
}
+ else
+ {
+ // NOTE: This is an attempt to reshape the inventory panel to the proper size but it doesn't seem to propagate
+ // properly to the child panels.
- stack->collapsePanel(pressedPanel, !expand);
+ S32 new_height = inout_panel->getRect().getHeight();
- // Enable user_resize on main inventory panel only when a marketplace box is expanded
- stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand);
+ if (otherPanel->getVisible())
+ {
+ new_height -= otherPanel->getMinDim();
+ }
+
+ pressedPanel->reshape(pressedPanel->getRect().getWidth(), new_height);
+ }
+
+ // Expand/collapse the indicated panel
+ inout_stack->collapsePanel(pressedPanel, !expand);
return expand;
}
void LLSidepanelInventory::onToggleInboxBtn()
{
- LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
- LLButton* pressedButton = getChild<LLButton>(INBOX_BUTTON_NAME);
- LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
- LLButton* otherButton = getChild<LLButton>(OUTBOX_BUTTON_NAME);
- LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
+ LLButton* inboxButton = getChild<LLButton>(INBOX_BUTTON_NAME);
+ LLLayoutPanel* inboxPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
+ LLButton* outboxButton = getChild<LLButton>(OUTBOX_BUTTON_NAME);
+ LLLayoutPanel* outboxPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
- manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel);
+ const bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel, outboxButton, outboxPanel);
- gSavedPerAccountSettings.setString("LastInventoryInboxExpand", LLDate::now().asString());
+ if (inbox_expanded && inboxPanel->isInVisibleChain())
+ {
+ gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+ }
}
void LLSidepanelInventory::onToggleOutboxBtn()
{
- LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
- LLButton* pressedButton = getChild<LLButton>(OUTBOX_BUTTON_NAME);
- LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
- LLButton* otherButton = getChild<LLButton>(INBOX_BUTTON_NAME);
- LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
+ LLButton* inboxButton = getChild<LLButton>(INBOX_BUTTON_NAME);
+ LLLayoutPanel* inboxPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
+ LLButton* outboxButton = getChild<LLButton>(OUTBOX_BUTTON_NAME);
+ LLLayoutPanel* outboxPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
- manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel);
+ manageInboxOutboxPanels(outboxButton, outboxPanel, inboxButton, inboxPanel);
}
void LLSidepanelInventory::onOpen(const LLSD& key)
{
LLFirstUse::newInventory(false);
+#if AUTO_EXPAND_INBOX
// Expand the inbox if we have fresh items
LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL);
if (inbox && (inbox->getFreshItemCount() > 0))
@@ -485,6 +565,12 @@ void LLSidepanelInventory::onOpen(const LLSD& key)
getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true);
onToggleInboxBtn();
}
+#else
+ if (mInboxEnabled && getChild<LLButton>(INBOX_BUTTON_NAME)->getToggleState())
+ {
+ gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+ }
+#endif
if(key.size() == 0)
return;
@@ -636,6 +722,77 @@ void LLSidepanelInventory::showInventoryPanel()
updateVerbs();
}
+void LLSidepanelInventory::updateOutboxUserStatus()
+{
+ const bool isMerchant = (gSavedSettings.getString("InventoryMarketplaceUserStatus") == "merchant");
+ const bool hasOutbox = !gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false).isNull();
+
+ LLView * outbox_placeholder = getChild<LLView>("outbox_inventory_placeholder_panel");
+ LLView * outbox_placeholder_parent = outbox_placeholder->getParent();
+
+ LLTextBox * outbox_title_box = outbox_placeholder->getChild<LLTextBox>("outbox_inventory_placeholder_title");
+ LLTextBox * outbox_text_box = outbox_placeholder->getChild<LLTextBox>("outbox_inventory_placeholder_text");
+
+ std::string outbox_text;
+ std::string outbox_title;
+ std::string outbox_tooltip;
+
+ if (isMerchant)
+ {
+ if (hasOutbox)
+ {
+ outbox_text = LLTrans::getString("InventoryOutboxNoItems");
+ outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle");
+ outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip");
+ }
+ else
+ {
+ outbox_text = LLTrans::getString("InventoryOutboxCreationError");
+ outbox_title = LLTrans::getString("InventoryOutboxCreationErrorTitle");
+ outbox_tooltip = LLTrans::getString("InventoryOutboxCreationErrorTooltip");
+ }
+ }
+ else
+ {
+ //
+ // The string to become a merchant contains 3 URL's which need the domain name patched in.
+ //
+
+ std::string domain = "secondlife.com";
+
+ if (!LLGridManager::getInstance()->isInProductionGrid())
+ {
+ std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
+ domain = llformat("%s.lindenlab.com", utf8str_tolower(gridLabel).c_str());
+ }
+
+ LLStringUtil::format_map_t domain_arg;
+ domain_arg["[DOMAIN_NAME]"] = domain;
+
+ std::string marketplace_url = LLTrans::getString("MarketplaceURL", domain_arg);
+ std::string marketplace_url_create = LLTrans::getString("MarketplaceURL_CreateStore", domain_arg);
+ std::string marketplace_url_info = LLTrans::getString("MarketplaceURL_LearnMore", domain_arg);
+
+ LLStringUtil::format_map_t args1, args2, args3;
+ args1["[MARKETPLACE_URL]"] = marketplace_url;
+ args2["[LEARN_MORE_URL]"] = marketplace_url_info;
+ args3["[CREATE_STORE_URL]"] = marketplace_url_create;
+
+ // NOTE: This is dumb, ridiculous and very finicky. The order of these is very important
+ // to have these three string substitutions work properly.
+ outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", args1);
+ LLStringUtil::format(outbox_text, args2);
+ LLStringUtil::format(outbox_text, args3);
+
+ outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle");
+ outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip");
+ }
+
+ outbox_text_box->setValue(outbox_text);
+ outbox_title_box->setValue(outbox_title);
+ outbox_placeholder_parent->setToolTip(outbox_tooltip);
+}
+
void LLSidepanelInventory::updateVerbs()
{
mInfoBtn->setEnabled(FALSE);
diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h
index f80a3a9dd3..b7d11f7f9b 100644
--- a/indra/newview/llsidepanelinventory.h
+++ b/indra/newview/llsidepanelinventory.h
@@ -29,11 +29,13 @@
#include "llpanel.h"
+class LLButton;
class LLFolderViewItem;
class LLInboxOutboxAddedObserver;
class LLInventoryCategoriesObserver;
class LLInventoryItem;
class LLInventoryPanel;
+class LLLayoutPanel;
class LLPanelMainInventory;
class LLSidepanelItemInfo;
class LLSidepanelTaskInfo;
@@ -58,7 +60,7 @@ public:
LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any.
LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; }
BOOL isMainInventoryPanelActive() const;
-
+
void clearSelections(bool clearMain, bool clearInbox, bool clearOutbox);
std::set<LLUUID> getInboxOrOutboxSelectionList();
@@ -74,10 +76,11 @@ public:
void enableInbox(bool enabled);
void enableOutbox(bool enabled);
-
+
bool isInboxEnabled() const { return mInboxEnabled; }
bool isOutboxEnabled() const { return mOutboxEnabled; }
+ void updateOutboxUserStatus();
void updateVerbs();
protected:
@@ -93,6 +96,8 @@ protected:
void onInboxChanged(const LLUUID& inbox_id);
void onOutboxChanged(const LLUUID& outbox_id);
+ bool manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel, LLButton * otherButton, LLLayoutPanel * otherPanel);
+
//
// UI Elements
//
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index a7c4057846..f53b08a4bc 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -1449,7 +1449,7 @@ void LLSideTray::updateSidetrayVisibility()
parent->setVisible(new_visibility);
// Signal change of visible width.
- llinfos << "Visible: " << new_visibility << llendl;
+ //llinfos << "Visible: " << new_visibility << llendl;
mVisibleWidthChangeSignal(this, new_visibility);
}
}
diff --git a/indra/newview/llsidetraypanelcontainer.cpp b/indra/newview/llsidetraypanelcontainer.cpp
index 214f595772..95a12c7c23 100644
--- a/indra/newview/llsidetraypanelcontainer.cpp
+++ b/indra/newview/llsidetraypanelcontainer.cpp
@@ -32,10 +32,10 @@ static LLDefaultChildRegistry::Register<LLSideTrayPanelContainer> r2("panel_cont
std::string LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME = "sub_panel_name";
LLSideTrayPanelContainer::Params::Params()
- : default_panel_name("default_panel_name")
+: default_panel_name("default_panel_name")
{
// Always hide tabs.
- hide_tabs(true);
+ changeDefault(hide_tabs, true);
}
LLSideTrayPanelContainer::LLSideTrayPanelContainer(const Params& p)
diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp
index d3e96f8dfb..bbe573c546 100644
--- a/indra/newview/llspeakbutton.cpp
+++ b/indra/newview/llspeakbutton.cpp
@@ -47,12 +47,10 @@ static LLDefaultChildRegistry::Register<LLSpeakButton> t1("talk_button");
//////////////////////////////////////////////////////////////////////////
LLSpeakButton::Params::Params()
- : speak_button("speak_button")
- , show_button("show_button")
- , monitor("monitor")
-{
- // See widgets/talk_button.xml
-}
+: speak_button("speak_button"),
+ show_button("show_button"),
+ monitor("monitor")
+{}
LLSpeakButton::LLSpeakButton(const Params& p)
: LLUICtrl(p)
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index fdfbee400e..b1312d641f 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -92,11 +92,7 @@ public:
multiselect_text("multiselect_text"),
caption_text("caption_text"),
border("border")
- {
- name = "texture picker";
- mouse_opaque(true);
- follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);
- }
+ {}
};
protected:
LLTextureCtrl(const Params&);
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 0115115a23..6547154bc4 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -94,7 +94,7 @@ public:
Params()
: texture_view("texture_view")
{
- mouse_opaque(false);
+ changeDefault(mouse_opaque, false);
}
};
LLTextureBar(const Params& p)
@@ -387,7 +387,7 @@ public:
: texture_view("texture_view")
{
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
- rect(LLRect(0,0,100,line_height * 4));
+ changeDefault(rect, LLRect(0,0,100,line_height * 4));
}
};
@@ -486,7 +486,7 @@ public:
: texture_view("texture_view")
{
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
- rect(LLRect(0,0,100,line_height * 4));
+ changeDefault(rect, LLRect(0,0,100,line_height * 4));
}
};
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 14f17e8917..d5a99cefb2 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1652,6 +1652,13 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
return ACCEPT_NO;
}
+ const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+ if(gInventory.isObjectDescendentOf(item->getUUID(), outbox_id))
+ {
+ return ACCEPT_NO;
+ }
+
+
if( drop )
{
if(mSource == SOURCE_LIBRARY)
@@ -2055,6 +2062,12 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
return ACCEPT_NO;
}
+ const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+ if(gInventory.isObjectDescendentOf(category->getUUID(), outbox_id))
+ {
+ return ACCEPT_NO;
+ }
+
if(drop)
{
BOOL append = ( (mask & MASK_SHIFT) ? TRUE : FALSE );
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 31b22119cb..56ef31fb0b 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1366,6 +1366,10 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom
}
+// This is defined in two files but I don't want to create a dependence between this and llsidepanelinventory
+// just to be able to temporarily disable the outbox.
+#define ENABLE_INVENTORY_DISPLAY_OUTBOX 0 // keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL
+
class LLInventoryUserStatusResponder : public LLHTTPClient::Responder
{
public:
@@ -1378,8 +1382,18 @@ public:
{
if (isGoodStatus(status))
{
+ std::string merchantStatus = content[gAgent.getID().getString()].asString();
+ llinfos << "Marketplace merchant status: " << merchantStatus << llendl;
+
+ // Save the merchant status before turning on the display
+ gSavedSettings.setString("InventoryMarketplaceUserStatus", merchantStatus);
+
// Complete success
gSavedSettings.setBOOL("InventoryDisplayInbox", true);
+
+#if ENABLE_INVENTORY_DISPLAY_OUTBOX
+ gSavedSettings.setBOOL("InventoryDisplayOutbox", true);
+#endif
}
else if (status == 401)
{
@@ -1394,6 +1408,39 @@ public:
}
};
+
+void doOnetimeEarlyHTTPRequests()
+{
+ std::string url = "https://marketplace.secondlife.com/";
+
+ if (!LLGridManager::getInstance()->isInProductionGrid())
+ {
+ std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
+ url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
+
+ // TEMP for Jim's pdp
+ //url = "http://pdp24.lindenlab.com:3000/";
+ }
+
+ url += "api/1/users/";
+ url += gAgent.getID().getString();
+ url += "/user_status";
+
+ llinfos << "http get: " << url << llendl;
+ LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), LLViewerMedia::getHeaders());
+}
+
+
+LLSD LLViewerMedia::getHeaders()
+{
+ LLSD headers = LLSD::emptyMap();
+ headers["Accept"] = "*/*";
+ headers["Cookie"] = sOpenIDCookie;
+ headers["User-Agent"] = getCurrentUserAgent();
+
+ return headers;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// static
void LLViewerMedia::setOpenIDCookie()
@@ -1441,24 +1488,7 @@ void LLViewerMedia::setOpenIDCookie()
new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
headers);
- std::string url = "https://marketplace.secondlife.com/";
-
- if (!LLGridManager::getInstance()->isInProductionGrid())
- {
- std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
- url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
- }
-
- url += "api/1/users/";
- url += gAgent.getID().getString();
- url += "/user_status";
-
- headers = LLSD::emptyMap();
- headers["Accept"] = "*/*";
- headers["Cookie"] = sOpenIDCookie;
- headers["User-Agent"] = getCurrentUserAgent();
-
- LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), headers);
+ doOnetimeEarlyHTTPRequests();
}
}
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index aeac6ba29a..0b69b8f0c1 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -162,6 +162,8 @@ public:
static LLPluginClassMedia* getSpareBrowserMediaSource();
static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id);
+
+ static LLSD getHeaders();
private:
static void setOpenIDCookie();
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index db5684665b..153a91e7d8 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1254,7 +1254,8 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
{
// Don't ever kill gAgentAvatarp, just force it to the agent's region
- if (objectp == gAgentAvatarp)
+ // unless region is NULL which is assumed to mean you are logging out.
+ if ((objectp == gAgentAvatarp) && gAgent.getRegion())
{
objectp->setRegion(gAgent.getRegion());
return FALSE;
@@ -1277,6 +1278,7 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
return TRUE;
}
+
return FALSE;
}
diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h
index 0861dfcb20..fb428d0dc1 100644
--- a/indra/newview/llviewertexteditor.h
+++ b/indra/newview/llviewertexteditor.h
@@ -36,12 +36,7 @@ class LLViewerTextEditor : public LLTextEditor
{
public:
struct Params : public LLInitParam::Block<Params, LLTextEditor::Params>
- {
- Params()
- {
- name = "text_editor";
- }
- };
+ {};
protected:
LLViewerTextEditor(const Params&);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 528c7acbc8..528c7acbc8 100755..100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 31b6fc77f5..d19e56e9a0 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -30,9 +30,15 @@
name="LtGray"
value="0.75 0.75 0.75 1" />
<color
+ name="LtGray_35"
+ value="0.75 0.75 0.75 0.35" />
+ <color
name="LtGray_50"
value="0.75 0.75 0.75 0.50" />
<color
+ name="Gray"
+ value="0.5 0.5 0.5 1" />
+ <color
name="DkGray"
value="0.125 0.125 0.125 1" />
<color
@@ -197,7 +203,7 @@
reference="Black" />
<color
name="ColorPaletteEntry02"
- value="0.5 0.5 0.5 1" />
+ reference="Gray" />
<color
name="ColorPaletteEntry03"
value="0.5 0 0 1" />
@@ -424,11 +430,14 @@
name="InventoryItemLinkColor"
reference="LtGray_50" />
<color
+ name="InventoryMouseOverColor"
+ reference="LtGray_35" />
+ <color
name="InventorySearchStatusColor"
reference="EmphasisColor" />
<color
name="LabelDisabledColor"
- reference="White_25" />
+ reference="White_25" />
<color
name="LabelSelectedColor"
reference="White" />
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 799cd907dc..4d83ec2902 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -72,6 +72,10 @@ with the same filename but different name
<texture name="BackButton_Over" file_name="icons/back_arrow_over.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" />
<texture name="BackButton_Press" file_name="icons/back_arrow_press.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" />
+ <texture name="Error_Tag_Background" file_name="widgets/Error_Tag_Background.png" preload="true" scale.left="12" scale.top="2" scale.right="36" scale.bottom="2" />
+ <texture name="New_Tag_Background" file_name="widgets/New_Tag_Background.png" preload="true" scale.left="12" scale.top="2" scale.right="36" scale.bottom="2" />
+ <texture name="New_Tag_Border" file_name="widgets/New_Tag_Border.png" preload="true" scale.left="12" scale.top="2" scale.right="36" scale.bottom="2" />
+
<texture name="Badge_Background" file_name="widgets/Badge_Background.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
<texture name="Badge_Border" file_name="widgets/Badge_Border.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png b/indra/newview/skins/default/textures/widgets/Badge_Background_New.png
deleted file mode 100644
index 9f114f2e4a..0000000000
--- a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png
+++ /dev/null
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/Error_Tag_Background.png b/indra/newview/skins/default/textures/widgets/Error_Tag_Background.png
new file mode 100644
index 0000000000..c8dbc8e87a
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/Error_Tag_Background.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/New_Tag_Background.png b/indra/newview/skins/default/textures/widgets/New_Tag_Background.png
new file mode 100644
index 0000000000..cd639dd80f
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/New_Tag_Background.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/New_Tag_Border.png b/indra/newview/skins/default/textures/widgets/New_Tag_Border.png
new file mode 100644
index 0000000000..56df0d0127
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/New_Tag_Border.png
Binary files differ
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 1d4a1d4827..1d4a1d4827 100755..100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index e91f4458ae..fb85e5278a 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -674,7 +674,26 @@
function="Inventory.DoToSelected"
parameter="take_off" />
</menu_item_call>
- <menu_item_call
+ <menu_item_separator
+ layout="topleft"
+ name="Marketplace Separator" />
+ <menu_item_call
+ label="Copy to Merchant Outbox"
+ layout="topleft"
+ name="Merchant Copy">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="copy_to_outbox" />
+ </menu_item_call>
+ <menu_item_call
+ label="Move to Merchant Outbox"
+ layout="topleft"
+ name="Merchant Move">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="move_to_outbox" />
+ </menu_item_call>
+ <menu_item_call
label="--no options--"
layout="topleft"
name="--no options--" />
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 99ab56d10a..a9ae4475b6 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -201,6 +201,40 @@ Save changes to current clothing/body part?
<notification
icon="alertmodal.tga"
+ name="ConfirmNoCopyToOutbox"
+ type="alertmodal">
+ You don't have permission to copy this item to the Marketplace Outbox. Are you sure you want to move the following item?
+ [ITEM_NAME]
+ <usetemplate
+ name="okcancelbuttons"
+ notext="No"
+ yestext="Yes"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="OutboxUploadComplete"
+ type="alertmodal">
+Marketplace upload complete.
+ <usetemplate
+ name="okbutton"
+ yestext="Hooray!"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="OutboxUploadHadErrors"
+ type="alertmodal">
+Marketplace upload completed with errors! Please correct the problems in your outbox and retry. Thanks.
+ <usetemplate
+ name="okbutton"
+ yestext="Boo!"/>
+ </notification>
+
+
+
+ <notification
+ icon="alertmodal.tga"
name="CompileQueueSaveText"
type="alertmodal">
There was a problem uploading the text for a script due to the following reason: [REASON]. Please try again later.
@@ -5089,7 +5123,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
name="FriendOnline"
type="notifytip">
<tag>friendship</tag>
-&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Online
+[NAME] is Online
</notification>
<notification
@@ -5097,7 +5131,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
name="FriendOffline"
type="notifytip">
<tag>friendship</tag>
-&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Offline
+[NAME] is Offline
</notification>
<notification
@@ -6818,7 +6852,7 @@ Select residents to share with.
See the log file for details.
</notification>
- <notification
+ <notification
name="MeshUploadPermError"
icon="alert.tga"
type="alert">
@@ -6842,7 +6876,7 @@ Are you sure you want to share the following items:
With the following Residents:
-&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
+[RESIDENTS]
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
index d06190ec54..383e637ace 100644
--- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
@@ -4,7 +4,7 @@
start_folder="Received Items"
follows="all" layout="topleft"
top="0" left="0" height="165" width="308"
- top_pad="0"
+ top_pad="0"
bg_opaque_color="DkGray2"
bg_alpha_color="DkGray2"
background_visible="true"
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 0df9aa2868..888230a00e 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -6,7 +6,7 @@
height="423"
label="Things"
layout="topleft"
- min_height="350"
+ min_height="300"
min_width="240"
name="main inventory panel"
width="330">
diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
index af32056428..66117615e4 100644
--- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<inventory_panel
+<outbox_inventory_panel
name="inventory_outbox"
start_folder="Outbox"
follows="all" layout="topleft"
top="0" left="0" height="165" width="308"
- top_pad="0"
+ top_pad="0"
bg_opaque_color="DkGray2"
bg_alpha_color="DkGray2"
background_visible="true"
@@ -12,6 +12,7 @@
border="false"
bevel_style="none"
show_item_link_overlays="true"
+ tool_tip="Drag and drop items here to prepare them for sale on your storefront"
>
<scroll reserve_scroll_corner="false" />
-</inventory_panel>
+</outbox_inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 79a0ec7c72..7a176ff367 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -30,11 +30,12 @@
width="330">
<layout_panel
name="main_inventory_layout_panel"
+ layout="topleft"
min_dim="150"
width="330"
follows="bottom|left|right"
user_resize="false"
- height="480">
+ height="300">
<panel
class="panel_main_inventory"
filename="panel_main_inventory.xml"
@@ -44,14 +45,36 @@
name="panel_main_inventory"
top="0"
label=""
- height="480"
+ height="300"
width="330" />
</layout_panel>
- <layout_panel
+ <layout_panel
width="330"
+ layout="topleft"
auto_resize="true"
user_resize="false"
follows="bottom|left|right"
+ name="inbox_outbox_layout_panel"
+ visible="false"
+ min_dim="35"
+ max_dim="235"
+ expanded_min_dim="125"
+ height="235">
+ <layout_stack
+ follows="left|right|top|bottom"
+ layout="topleft"
+ left="0"
+ top="0"
+ orientation="vertical"
+ name="inbox_outbox_layout_stack"
+ height="235"
+ width="330">
+ <layout_panel
+ width="330"
+ layout="topleft"
+ auto_resize="true"
+ user_resize="false"
+ follows="left|right|top"
name="inbox_layout_panel"
visible="false"
min_dim="35"
@@ -72,6 +95,7 @@
<string name="InboxLabelNoArg">Received Items</string>
<button
label="Received Items"
+ font="SansSerifMedium"
name="inbox_btn"
height="35"
width="308"
@@ -96,7 +120,6 @@
name="inbox_fresh_new_count"
font="SansSerifMedium"
halign="right"
- text_color="EmphasisColor"
top_pad="0"
width="300">
[NUM] New
@@ -129,41 +152,45 @@
</panel>
</layout_panel>
<layout_panel
- width="330"
- auto_resize="true"
- user_resize="false"
- follows="bottom|left|right"
- name="outbox_layout_panel"
- visible="false"
- min_dim="35"
- max_dim="200"
- expanded_min_dim="90"
- height="200">
+ width="330"
+ layout="topleft"
+ auto_resize="true"
+ user_resize="false"
+ follows="all"
+ name="outbox_layout_panel"
+ visible="false"
+ min_dim="35"
+ max_dim="200"
+ expanded_min_dim="90"
+ height="200">
<panel
follows="all"
layout="topleft"
- left="10"
+ left="0"
name="marketplace_outbox"
class="panel_marketplace_outbox"
top="0"
label=""
height="200"
- width="310">
+ width="330">
+ <string name="OutboxLabelWithArg">Merchant Outbox ([NUM])</string>
+ <string name="OutboxLabelNoArg">Merchant Outbox</string>
<button
label="Merchant Outbox"
- is_toggle="true"
- handle_right_mouse="false"
+ font="SansSerifMedium"
name="outbox_btn"
- follows="top|left|right"
- image_unselected="MarketplaceBtn_Off"
- image_selected="MarketplaceBtn_Selected"
height="35"
- tab_stop="false"
width="308"
+ image_unselected="MarketplaceBtn_Off"
+ image_selected="MarketplaceBtn_Selected"
halign="left"
+ handle_right_mouse="false"
+ follows="top|left|right"
+ is_toggle="true"
+ tab_stop="false"
pad_left="35"
top="0"
- left="0" />
+ left="10" />
<button
image_unselected="OutboxPush_Off"
image_selected="OutboxPush_Selected"
@@ -213,24 +240,50 @@
bg_opaque_color="InventoryBackgroundColor"
background_visible="true"
background_opaque="true"
- tool_tip="Drag and drop items here to prepare them for sale on your storefront"
>
- <text
- name="outbox_inventory_placeholder"
- type="string"
+ <panel
+ name="outbox_inventory_placeholder_panel"
follows="all"
layout="topleft"
top="0"
left="0"
width="308"
height="165"
- wrap="true"
- halign="center">
- Set up your merchant account to use this feature.
- </text>
+ bg_opaque_color="InventoryBackgroundColor"
+ background_visible="true"
+ background_opaque="true"
+ >
+ <text
+ name="outbox_inventory_placeholder_title"
+ type="string"
+ follows="all"
+ layout="topleft"
+ top="10"
+ left="0"
+ width="308"
+ height="25"
+ wrap="true"
+ halign="center"
+ font="SansSerifBold">
+ Loading...
+ </text>
+ <text
+ name="outbox_inventory_placeholder_text"
+ type="string"
+ follows="all"
+ layout="topleft"
+ top="35"
+ left="0"
+ width="308"
+ height="130"
+ wrap="true"
+ halign="left" />
+ </panel>
</panel>
</panel>
</layout_panel>
+ </layout_stack>
+ </layout_panel>
</layout_stack>
<panel
follows="bottom|left|right"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 2094275bed..c0154ae9b3 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -164,12 +164,16 @@ Please try logging in again in a minute.</string>
<string name="TooltipLand">Land:</string>
<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
<string name="TooltipPrice" value="L$[AMOUNT]: "/>
-
+ <string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred to another user.</string>
+ <string name="TooltipOutboxWorn">You are wearing one or more of these objects. Remove them from your avatar and try moving them again.</string>
+ <string name="TooltipOutboxFolderLevels">This folder has too many levels of subfolders. Rearrange the interior folders to a maximum of 4 levels deep (Root Folder contains A contains B contains C).</string>
+ <string name="TooltipOutboxTooManyObjects">This folder contains more than 200 objects. Box some of the items to reduce the object count.</string>
+
<!-- tooltips for Urls -->
<string name="TooltipHttpUrl">Click to view this web page</string>
<string name="TooltipSLURL">Click to view this location's information</string>
<string name="TooltipAgentUrl">Click to view this Resident's profile</string>
- <string name="TooltipAgentInspect">Learn more about this Resident</string>
+ <string name="TooltipAgentInspect">Learn more about this Resident</string>
<string name="TooltipAgentMute">Click to mute this Resident</string>
<string name="TooltipAgentUnmute">Click to unmute this Resident</string>
<string name="TooltipAgentIM">Click to IM this Resident</string>
@@ -2025,8 +2029,29 @@ Returns a string with the requested data about the region
<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
<string name="InventoryInboxNoItems">Items purchased through the marketplace will be delivered here.</string>
- <string name="InventoryOutboxNoItems">Drag items here in preparation for listing on your marketplace storefront.</string>
- <!-- use value="" because they have preceding spaces -->
+ <string name="MarketplaceURL">http://marketplace.[DOMAIN_NAME]</string>
+ <string name="MarketplaceURL_CreateStore">http://marketplace.[DOMAIN_NAME]/create_store</string>
+ <string name="MarketplaceURL_LearnMore">http://marketplace.[DOMAIN_NAME]/learn_more</string>
+ <string name="InventoryOutboxCreationErrorTitle">Your Merchant Outbox is not properly configured</string>
+ <string name="InventoryOutboxCreationErrorTooltip">Merchant Outbox configuration error</string>
+ <string name="InventoryOutboxCreationError">Please contact Customer Service to correct the problem.</string>
+ <string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace</string>
+ <string name="InventoryOutboxNotMerchantTooltip">Become a merchant!</string>
+ <string name="InventoryOutboxNotMerchant">[[MARKETPLACE_URL] The Second Life Marketplace] offers more than one million virtual products for sale, all of them created by Residents. You, too, can sell items you create, as well as some of the items you have purchased. It’s easy and setup is free. [[LEARN_MORE_URL] Learn more] or [[CREATE_STORE_URL] create a store] on the Marketplace to get started.</string>
+ <string name="InventoryOutboxNoItemsTitle">A new way to send items to the Marketplace</string>
+ <string name="InventoryOutboxNoItemsTooltip">Drag and drop items here to prepare them for sale on the Marketplace</string>
+ <string name="InventoryOutboxNoItems">Drag items or folders that you wish to sell into this area. A copy of the item will appear, leaving your inventory unchanged, unless you have dragged a no-copy item. When you are ready to send the items to the Marketplace, click the Upload button. Once your items have been moved to your Marketplace Inventory, they will disappear from this folder.</string>
+
+ <string name="Marketplace Error None">No errors</string>
+ <string name="Marketplace Error Not Merchant">Error: Before sending items to the Marketplace you will need to set yourself up as a merchant (free of charge).</string>
+ <string name="Marketplace Error Empty Folder">Error: This folder has no contents.</string>
+ <string name="Marketplace Error Unassociated Products">Error: This item failed to upload because your merchant account has too many items unassociated with products. To fix this error, login to the marketplace website and reduce your unassociated item count.</string>
+ <string name="Marketplace Error Object Limit">Error: This item contains too many objects. Fix this error by placing objects together in boxes to reduce the total count to less than 200.</string>
+ <string name="Marketplace Error Folder Depth">Error: This item contains too many levels of nested folders. Reorganize it to a maximum of 3 levels of nested folders.</string>
+ <string name="Marketplace Error Unsellable Item">Error: This item can not be sold on the marketplace.</string>
+ <string name="Marketplace Error Internal Import">Error: There was a problem with this item. Try again later.</string>
+
+ <!-- use value="" because they have preceding spaces -->
<string name="no_transfer" value=" (no transfer)" />
<string name="no_modify" value=" (no modify)" />
<string name="no_copy" value=" (no copy)" />
diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml
index 2d4c02b092..738d150f64 100644
--- a/indra/newview/skins/default/xui/en/widgets/badge.xml
+++ b/indra/newview/skins/default/xui/en/widgets/badge.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Additional attributes:
-->
-<badge border_image="Badge_Border"
+<badge name="badge"
+ border_image="Badge_Border"
border_color="BadgeBorderColor"
font="SansSerifSmall"
image="Badge_Background"
diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml
index 302014eb24..61d36468d7 100644
--- a/indra/newview/skins/default/xui/en/widgets/button.xml
+++ b/indra/newview/skins/default/xui/en/widgets/button.xml
@@ -26,5 +26,6 @@
height="23"
scale_image="true"
handle_right_mouse="true"
- use_draw_context_alpha="true">
+ use_draw_context_alpha="true"
+ held_down_delay.seconds="0.5">
</button>
diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml
index 48b987d7e8..ab3de1eaab 100644
--- a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml
+++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<color_swatch alpha_background_image="color_swatch_alpha.tga"
border_color="ColorSwatchBorderColor"
- name="color_swatch">
+ name="colorswatch">
<color_swatch.caption_text name="caption"
halign="center"
follows="left|right|bottom"
diff --git a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml
index 0720621f0b..2cc4abdd30 100644
--- a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<filter_editor
+ name="filter_editor"
clear_button_visible="true"
search_button_visible="false"
text_pad_left="7"
diff --git a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
index e6bdcccfdf..6fa74f403d 100644
--- a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
@@ -5,4 +5,6 @@
item_height="20"
item_top_pad="4"
selection_image="Rounded_Square"
+ mouse_opaque="true"
+ follows="left|top|right"
/>
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
index 95f5cf2ecd..77d8024cb2 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
@@ -10,10 +10,12 @@
label="New"
label_offset_horiz="-1"
location="right"
- padding_horiz="4"
- padding_vert="1"
- location_percent_hcenter="70"
- border_image=""
- image="Badge_Background_New"
+ padding_horiz="12.5"
+ padding_vert="2"
+ location_offset_hcenter="-23"
+ border_image="New_Tag_Border"
+ border_color="DkGray2"
+ image="New_Tag_Background"
+ image_color="Black"
/>
</inbox_folder_view_folder>
diff --git a/indra/newview/skins/default/xui/en/widgets/layout_stack.xml b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml
new file mode 100644
index 0000000000..48bcb46533
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<!-- Global settings for all widgets ("UI Controls") -->
+<!-- The params in this file aren't currently getting loaded in OSX -->
+<layout_stack name="stack"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml
index 58543338f6..13ac84beb2 100644
--- a/indra/newview/skins/default/xui/en/widgets/menu.xml
+++ b/indra/newview/skins/default/xui/en/widgets/menu.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<menu bg_color="MenuDefaultBgColor"
+<menu name="menu"
+ bg_color="MenuDefaultBgColor"
bg_visible="true"
drop_shadow="true"
tear_off="false"
diff --git a/indra/newview/skins/default/xui/en/widgets/menu_bar.xml b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml
new file mode 100644
index 0000000000..ee3ef0cd7a
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<menu_bar
+ can_tear_off = "false"
+ keep_fixed_size = "true"
+ horizontal_layout = "true"
+ visible = "true"
+ drop_shadow = "false"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml
index e5cea476da..7452d685eb 100644
--- a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml
+++ b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<menu_item_separator enabled_color="MenuItemEnabledColor"
- disabled_color="MenuItemDisabledColor"
- highlight_bg_color="MenuItemHighlightBgColor"
- highlight_fg_color="MenuItemHighlightFgColor">
+ name="separator"
+ disabled_color="MenuItemDisabledColor"
+ highlight_bg_color="MenuItemHighlightBgColor"
+ highlight_fg_color="MenuItemHighlightFgColor"
+ label="-----------">
</menu_item_separator>
diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml
index 185ed6ee3e..72af3924c1 100644
--- a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml
+++ b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Use "disabled color" to make it look like menu separators -->
<menu_item_tear_off enabled_color="MenuItemDisabledColor"
- disabled_color="MenuItemDisabledColor"
- highlight_bg_color="MenuItemHighlightBgColor"
- highlight_fg_color="MenuItemHighlightFgColor">
-</menu_item_tear_off>
+ name="tear_off"
+ label = "~~~~~~~~~~~"
+ disabled_color="MenuItemDisabledColor"
+ highlight_bg_color="MenuItemHighlightBgColor"
+ highlight_fg_color="MenuItemHighlightFgColor"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml
index e0900b48f3..90b0625982 100644
--- a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml
+++ b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<multi_slider text_color="LabelTextColor"
- text_disabled_color="LabelDisabledColor"
- draw_track="true"
- use_triangle="false"
- font="SansSerifSmall"/>
+ mouse_opaque="true"
+ text_disabled_color="LabelDisabledColor"
+ draw_track="true"
+ use_triangle="false"
+ font="SansSerifSmall"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml
index 04a2cd635c..bbcb008df4 100644
--- a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<multi_slider_bar track_color="MultiSliderTrackColor"
+<multi_slider_bar name="multi_slider_bar"
+ track_color="MultiSliderTrackColor"
thumb_disabled_color="MultiSliderDisabledThumbColor"
thumb_outline_color="MultiSliderThumbOutlineColor"
thumb_center_color="MultiSliderThumbCenterColor"
@@ -7,4 +8,6 @@
triangle_color="MultiSliderTriangleColor"
draw_track="true"
use_triangle="false"
- thumb_width="8"/>
+ thumb_width="8"
+ mouse_opaque="true"
+ follows="left|top"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/name_list.xml b/indra/newview/skins/default/xui/en/widgets/name_list.xml
new file mode 100644
index 0000000000..3ae0f68227
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/name_list.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<name_list name="name_list"
+ />
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
new file mode 100644
index 0000000000..0792996107
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<outbox_folder_view_folder
+ folder_arrow_image="Folder_Arrow"
+ folder_indentation="8"
+ item_height="20"
+ item_top_pad="4"
+ selection_image="Rounded_Square"
+ >
+ <error_badge
+ label=" "
+ label_offset_horiz="-1"
+ location="right"
+ padding_horiz="12.5"
+ padding_vert="2"
+ location_offset_hcenter="-23"
+ image="Error_Tag_Background"
+ image_color="Black"
+ />
+</outbox_folder_view_folder>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
new file mode 100644
index 0000000000..e3f2072819
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<outbox_inventory_panel show_load_status="false" />
diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml
index 47a210d9b7..b36f723831 100644
--- a/indra/newview/skins/default/xui/en/widgets/panel.xml
+++ b/indra/newview/skins/default/xui/en/widgets/panel.xml
@@ -4,7 +4,8 @@
bg_opaque_image - image name for "in-front" panel look
bg_alpha_image - image name for "in-back" or transparent panel look
-->
-<panel bg_opaque_color="PanelFocusBackgroundColor"
+<panel name="panel"
+ bg_opaque_color="PanelFocusBackgroundColor"
bg_alpha_color="PanelDefaultBackgroundColor"
bg_opaque_image_overlay="White"
bg_alpha_image_overlay="White"
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
index e6d4bff8b5..682dcf40d8 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
@@ -5,7 +5,8 @@
track_image_horizontal ="ScrollTrack_Horiz"
track_color="ScrollbarTrackColor"
thumb_color="ScrollbarThumbColor"
- thickness="15">
+ thickness="15"
+ tab_stop="false">
<up_button name="up_button"
image_unselected="ScrollArrow_Up"
image_selected="ScrollArrow_Up"
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml
index f936a1e208..8a48fcb32d 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<scroll_column_header
- image_unselected="SegmentedBtn_Middle_Selected"
+<scroll_column_header name="column_header"
+ image_unselected="SegmentedBtn_Middle_Selected"
image_selected="SegmentedBtn_Middle_Selected"
- image_pressed="SegmentedBtn_Middle_Selected_Press"
+ image_pressed="SegmentedBtn_Middle_Selected_Press"
image_disabled="SegmentedBtn_Middle_Disabled"
image_disabled_selected="SegmentedBtn_Middle_Selected_Disabled"
image_overlay="DisclosureArrow_Opened_Off"
image_overlay_alignment="right"
halign="left"
+ tab_stop="false"
scale_image="true" />
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml
index 86356ff563..a6d096a964 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<scroll_container color="black"
+<scroll_container name="scroll_container"
+ color="black"
opaque="false"
min_auto_scroll_rate="120"
- max_auto_scroll_rate="500"/>
+ max_auto_scroll_rate="500"
+ tab_stop="false"
+ mouse_opaque="true" />
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml
index dd93675807..e43989c6c7 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<scroll_list fg_unselected_color="ScrollUnselectedColor"
+<scroll_list name="scroll_list"
+ fg_unselected_color="ScrollUnselectedColor"
fg_selected_color="ScrollSelectedFGColor"
bg_selected_color="ScrollSelectedBGColor"
fg_disable_color="ScrollDisabledColor"
@@ -13,6 +14,7 @@
scroll_bar_bg_visible="false"
scroll_bar_bg_color="black"
mouse_wheel_opaque="false"
+ mouse_opaque="true"
background_visible="true"
heading_height="23"
draw_border="false"
diff --git a/indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml b/indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml
new file mode 100644
index 0000000000..40cbf5977a
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<scrolling_panel_list name="scrolling_panel_list"/> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml
index 32e443a058..faa0404b35 100644
--- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<search_editor
+ name="search_editor"
clear_button_visible="false"
search_button_visible="true"
text_pad_left="6"
diff --git a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml
index ea63cac790..0335213ed6 100644
--- a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!--All horizontal sliders are configured to have no highlighted track. See EXT-5939. -->
-<slider_bar track_color="SliderTrackColor"
+<slider_bar follows="left|top"
+ track_color="SliderTrackColor"
thumb_outline_color="SliderThumbOutlineColor"
thumb_center_color="SliderThumbCenterColor"
thumb_image="SliderThumb_Off"
diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
index c37ead0be2..3e2202b20f 100644
--- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
@@ -3,7 +3,9 @@
label_pad_bottom - vertical padding under tab button labels
label_pad_left - padding to the left of tab button labels
-->
-<tab_container tab_min_width="60"
+<tab_container name="tab_container"
+ mouse_opaque="false"
+ tab_min_width="60"
tab_max_width="150"
use_custom_icon_ctrl="false"
halign="center"
diff --git a/indra/newview/skins/default/xui/en/widgets/text_editor.xml b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
index 0f7f50b312..100571cc01 100644
--- a/indra/newview/skins/default/xui/en/widgets/text_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Core parameters are in simple_text_editor.xml -->
<text_editor
+ name="text_editor"
parse_urls="false"
show_context_menu="true"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml
index 757f0f49d1..ba2fdf4f1f 100644
--- a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml
+++ b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<texture_picker border_color="DefaultHighlightLight">
+<texture_picker border_color="DefaultHighlightLight"
+ name="texture picker"
+ mouse_opaque="true"
+ follows="left|top"
+ >
<multiselect_text font="SansSerifSmall"/>
<caption_text text="Multiple"
halign="center"
diff --git a/indra/newview/skins/default/xui/en/widgets/view_border.xml b/indra/newview/skins/default/xui/en/widgets/view_border.xml
index 0b0a9beb95..bf40e3086b 100644
--- a/indra/newview/skins/default/xui/en/widgets/view_border.xml
+++ b/indra/newview/skins/default/xui/en/widgets/view_border.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<view_border highlight_light_color="DefaultHighlightLight"
+<view_border name="view_border"
+ highlight_light_color="DefaultHighlightLight"
highlight_dark_color="DefaultHighlightDark"
shadow_light_color="DefaultShadowLight"
shadow_dark_color="DefaultShadowDark"
border_thickness="1"
border_style="line"
- bevel_style="out"/> \ No newline at end of file
+ bevel_style="out"
+ mouse_opaque="false"
+ follows="all"/> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/widgets/web_browser.xml b/indra/newview/skins/default/xui/en/widgets/web_browser.xml
index 118d63bbf0..676fafd828 100644
--- a/indra/newview/skins/default/xui/en/widgets/web_browser.xml
+++ b/indra/newview/skins/default/xui/en/widgets/web_browser.xml
@@ -1,2 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<web_browser border_visible="true"/>
+<web_browser border_visible="true"
+ tab_stop="false"
+ />
diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester
index 52b1c8f31d..52b1c8f31d 100644..100755
--- a/scripts/gpu_table_tester
+++ b/scripts/gpu_table_tester