summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt6
-rw-r--r--indra/newview/app_settings/settings.xml6
-rw-r--r--indra/newview/llagentwearablesfetch.cpp48
-rw-r--r--indra/newview/llappearancemgr.cpp10
-rw-r--r--indra/newview/llappearancemgr.h7
-rw-r--r--indra/newview/llappviewer.cpp13
-rw-r--r--indra/newview/llbottomtray.cpp6
-rw-r--r--indra/newview/llcofwearables.cpp16
-rw-r--r--indra/newview/llcofwearables.h3
-rw-r--r--indra/newview/llfilteredwearablelist.cpp46
-rw-r--r--indra/newview/llfilteredwearablelist.h9
-rw-r--r--indra/newview/llfloatersnapshot.cpp2
-rw-r--r--indra/newview/llinventoryfunctions.cpp5
-rw-r--r--indra/newview/llinventoryfunctions.h35
-rw-r--r--indra/newview/llinventoryitemslist.h3
-rw-r--r--indra/newview/llmachineid.cpp269
-rw-r--r--indra/newview/llmachineid.h56
-rw-r--r--indra/newview/llnearbychatbar.cpp7
-rw-r--r--indra/newview/llnearbychatbar.h1
-rw-r--r--indra/newview/lloutfitslist.cpp78
-rw-r--r--indra/newview/lloutfitslist.h7
-rw-r--r--indra/newview/llpanellogin.cpp3
-rw-r--r--indra/newview/llpaneloutfitedit.cpp101
-rw-r--r--indra/newview/llpaneloutfitedit.h16
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp11
-rw-r--r--indra/newview/llpaneloutfitsinventory.h4
-rw-r--r--indra/newview/llsaveoutfitcombobtn.cpp97
-rw-r--r--indra/newview/llsaveoutfitcombobtn.h60
-rw-r--r--indra/newview/llsecapi.cpp2
-rw-r--r--indra/newview/llsecapi.h31
-rw-r--r--indra/newview/llsechandler_basic.cpp138
-rw-r--r--indra/newview/llsechandler_basic.h23
-rw-r--r--indra/newview/llsidepanelappearance.cpp23
-rw-r--r--indra/newview/llsidepanelappearance.h1
-rw-r--r--indra/newview/llstartup.cpp3
-rw-r--r--indra/newview/lltexlayer.cpp33
-rw-r--r--indra/newview/lltexlayer.h4
-rw-r--r--indra/newview/lltexturefetch.cpp16
-rw-r--r--indra/newview/lltextureview.cpp18
-rw-r--r--indra/newview/llurldispatcher.cpp3
-rw-r--r--indra/newview/llviewernetwork.cpp211
-rw-r--r--indra/newview/llviewernetwork.h20
-rw-r--r--indra/newview/llviewertexture.h4
-rw-r--r--indra/newview/llviewertexturelist.cpp2
-rw-r--r--indra/newview/llvoavatarself.cpp67
-rw-r--r--indra/newview/llvoavatarself.h31
-rw-r--r--indra/newview/llwearableitemslist.cpp5
-rw-r--r--indra/newview/llwearableitemslist.h1
-rw-r--r--indra/newview/llxmlrpctransaction.cpp6
-rw-r--r--indra/newview/skins/default/textures/containers/Toolbar_Left_Flash.pngbin0 -> 356 bytes
-rw-r--r--indra/newview/skins/default/textures/containers/Toolbar_Middle_Flash.pngbin0 -> 316 bytes
-rw-r--r--indra/newview/skins/default/textures/containers/Toolbar_Right_Flash.pngbin0 -> 428 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Generic_Group_Large.pngbin7905 -> 7061 bytes
-rw-r--r--indra/newview/skins/default/textures/textures.xml3
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_container.xml9
-rw-r--r--indra/newview/skins/default/xui/en/floater_search.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_snapshot.xml1
-rw-r--r--indra/newview/skins/default/xui/en/menu_save_outfit.xml4
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml46
-rw-r--r--indra/newview/skins/default/xui/en/outfit_accordion_tab.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_edit_tattoo.xml33
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfit_edit.xml204
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfits_inventory.xml33
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml24
-rw-r--r--indra/newview/skins/default/xui/en/widgets/button.xml1
-rw-r--r--indra/newview/skins/default/xui/en/widgets/tab_container.xml15
-rw-r--r--indra/newview/skins/default/xui/ja/strings.xml20
-rw-r--r--indra/newview/tests/llsechandler_basic_test.cpp76
-rw-r--r--indra/newview/tests/llviewernetwork_test.cpp220
69 files changed, 1682 insertions, 577 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index d6f23c1d67..4d07d436b0 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -276,6 +276,7 @@ set(viewer_SOURCE_FILES
lllogchat.cpp
llloginhandler.cpp
lllogininstance.cpp
+ llmachineid.cpp
llmanip.cpp
llmaniprotate.cpp
llmanipscale.cpp
@@ -380,6 +381,7 @@ set(viewer_SOURCE_FILES
llregionposition.cpp
llremoteparcelrequest.cpp
llsavedsettingsglue.cpp
+ llsaveoutfitcombobtn.cpp
llscreenchannel.cpp
llscriptfloater.cpp
llscrollingpanelparam.cpp
@@ -795,6 +797,7 @@ set(viewer_HEADER_FILES
lllogchat.h
llloginhandler.h
lllogininstance.h
+ llmachineid.h
llmanip.h
llmaniprotate.h
llmanipscale.h
@@ -896,6 +899,7 @@ set(viewer_HEADER_FILES
llresourcedata.h
llrootview.h
llsavedsettingsglue.h
+ llsaveoutfitcombobtn.h
llscreenchannel.h
llscriptfloater.h
llscrollingpanelparam.h
@@ -1845,7 +1849,7 @@ if (LL_TESTS)
)
LL_ADD_INTEGRATION_TEST(llsechandler_basic
- llsechandler_basic.cpp
+ llsechandler_basic.cpp
"${test_libs}"
)
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 8c32536ff0..8cfd8c4d2d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -574,14 +574,14 @@
<key>Value</key>
<integer>2</integer>
</map>
- <key>AvatarUseBakedTextureTimeout</key>
+ <key>AvatarBakedTextureTimeout</key>
<map>
<key>Comment</key>
- <string>Specifes whether to send your baked textures for avatar appearance even before textures are fully ressed in case of timeout</string>
+ <string>Specifes the maximum time in seconds to wait before sending your baked textures for avatar appearance. Set to 0 to disable and wait until all baked textures are at highest resolution.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
- <string>Boolean</string>
+ <string>U32</string>
<key>Value</key>
<integer>0</integer>
</map>
diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
index 43a0d48d8b..ef0b97d376 100644
--- a/indra/newview/llagentwearablesfetch.cpp
+++ b/indra/newview/llagentwearablesfetch.cpp
@@ -40,6 +40,50 @@
#include "llstartup.h"
#include "llvoavatarself.h"
+
+class LLOrderMyOutfitsOnDestroy: public LLInventoryCallback
+{
+public:
+ LLOrderMyOutfitsOnDestroy() {};
+
+ virtual ~LLOrderMyOutfitsOnDestroy()
+ {
+ const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
+ if (my_outfits_id.isNull()) return;
+
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+ gInventory.getDirectDescendentsOf(my_outfits_id, cats, items);
+ if (!cats) return;
+
+ //My Outfits should at least contain saved initial outfit and one another outfit
+ if (cats->size() < 2)
+ {
+ llwarning("My Outfits category was not populated properly", 0);
+ return;
+ }
+
+ llinfos << "Starting updating My Outfits with wearables ordering information" << llendl;
+
+ for (LLInventoryModel::cat_array_t::iterator outfit_iter = cats->begin();
+ outfit_iter != cats->end(); ++outfit_iter)
+ {
+ const LLUUID& cat_id = (*outfit_iter)->getUUID();
+ if (cat_id.isNull()) continue;
+
+ // saved initial outfit already contains wearables ordering information
+ if (cat_id == LLAppearanceMgr::getInstance()->getBaseOutfitUUID()) continue;
+
+ LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(cat_id);
+ }
+
+ llinfos << "Finished updating My Outfits with wearables ordering information" << llendl;
+ }
+
+ /* virtual */ void fire(const LLUUID& inv_item) {};
+};
+
+
LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) :
LLInventoryFetchDescendentsObserver(cof_id)
{
@@ -483,6 +527,8 @@ void LLLibraryOutfitsFetch::contentsDone()
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t wearable_array;
+ LLPointer<LLOrderMyOutfitsOnDestroy> order_myoutfits_on_destroy = new LLOrderMyOutfitsOnDestroy;
+
for (uuid_vec_t::const_iterator folder_iter = mImportedClothingFolders.begin();
folder_iter != mImportedClothingFolders.end();
++folder_iter)
@@ -518,7 +564,7 @@ void LLLibraryOutfitsFetch::contentsDone()
item->getName(),
item->getDescription(),
LLAssetType::AT_LINK,
- NULL);
+ order_myoutfits_on_destroy);
}
}
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index c417f8bdf5..f27e632180 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1790,10 +1790,16 @@ struct WearablesOrderComparator
U32 mControlSize;
};
-void LLAppearanceMgr::updateClothingOrderingInfo()
+void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id)
{
+ if (cat_id.isNull())
+ {
+ cat_id = getCOF();
+ }
+
+ // COF is processed if cat_id is not specified
LLInventoryModel::item_array_t wear_items;
- getDescendentsOfAssetType(getCOF(), wear_items, LLAssetType::AT_CLOTHING, false);
+ getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING, false);
wearables_by_type_t items_by_type(LLWearableType::WT_COUNT);
divvyWearablesByType(wear_items, items_by_type);
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 96541beb7d..dbde055c3a 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -154,15 +154,16 @@ public:
//Divvy items into arrays by wearable type
static void divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type);
+ //Check ordering information on wearables stored in links' descriptions and update if it is invalid
+ // COF is processed if cat_id is not specified
+ void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null);
+
protected:
LLAppearanceMgr();
~LLAppearanceMgr();
private:
- //Check ordering information on wearables stored in links' descriptions and update if it is invalid
- void updateClothingOrderingInfo();
-
void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type);
void getDescendentsOfAssetType(const LLUUID& category,
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 475a075d7e..deafb20af7 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -195,6 +195,7 @@
// Include for security api initialization
#include "llsecapi.h"
+#include "llmachineid.h"
// *FIX: These extern globals should be cleaned up.
// The globals either represent state/config/resource-storage of either
@@ -619,6 +620,7 @@ bool LLAppViewer::init()
// *NOTE:Mani - LLCurl::initClass is not thread safe.
// Called before threads are created.
LLCurl::initClass();
+ LLMachineID::init();
initThreads();
writeSystemInfo();
@@ -890,7 +892,16 @@ bool LLAppViewer::init()
}
LLViewerMedia::initClass();
-
+
+ LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
+ LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
+ LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames"));
+ LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames"));
+ LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat"));
+
+ LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+ LLStringOps::sPM = LLTrans::getString("dateTimePM");
+
return true;
}
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index a057421135..ff1e8a9657 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -198,6 +198,12 @@ LLBottomTray::~LLBottomTray()
S32 custom_width = mNearbyChatBar->getRect().getWidth();
gSavedSettings.setS32("ChatBarCustomWidth", custom_width);
}
+
+ // emulate previous floater behavior to be hidden on startup.
+ // override effect of save_visibility=true.
+ // this attribute is necessary to button.initial_callback=Button.SetFloaterToggle works properly:
+ // i.g when floater changes its visibility - button changes its toggle state.
+ getChild<LLUICtrl>("search_btn")->setControlValue(false);
}
// *TODO Vadim: why void* ?
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 0864d63919..ee366f4e3c 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -43,6 +43,8 @@
#include "llmenugl.h"
#include "llviewermenu.h"
#include "llwearableitemslist.h"
+#include "llpaneloutfitedit.h"
+#include "llsidetray.h"
static LLRegisterPanelClassWrapper<LLCOFAccordionListAdaptor> t_cof_accodion_list_adaptor("accordion_list_adaptor");
@@ -135,8 +137,10 @@ protected:
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
LLUUID selected_id = mUUIDs.back();
- registrar.add("BodyPart.Replace", boost::bind(&LLAppearanceMgr::wearItemOnAvatar,
- LLAppearanceMgr::getInstance(), selected_id, true, true));
+ // *HACK* need to pass pointer to LLPanelOutfitEdit instead of LLSideTray::getInstance()->getPanel().
+ // LLSideTray::getInstance()->getPanel() is rather slow variant
+ LLPanelOutfitEdit* panel_oe = dynamic_cast<LLPanelOutfitEdit*>(LLSideTray::getInstance()->getPanel("panel_outfit_edit"));
+ registrar.add("BodyPart.Replace", boost::bind(&LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked, panel_oe, selected_id));
registrar.add("BodyPart.Edit", boost::bind(LLAgentWearables::editWearable, selected_id));
enable_registrar.add("BodyPart.OnEnable", boost::bind(&CofBodyPartContextMenu::onEnable, this, _2));
@@ -419,6 +423,7 @@ void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by
LLWearableType::EType w_type = static_cast<LLWearableType::EType>(type);
LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type);
if(!item_panel) continue;
+ item_panel->childSetAction("btn_add", mCOFCallbacks.mAddWearable);
mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false);
}
}
@@ -438,6 +443,13 @@ bool LLCOFWearables::getSelectedUUIDs(uuid_vec_t& selected_ids)
return selected_ids.size() != 0;
}
+LLPanel* LLCOFWearables::getSelectedItem()
+{
+ if (!mLastSelectedList) return NULL;
+
+ return mLastSelectedList->getSelectedItem();
+}
+
void LLCOFWearables::clear()
{
mAttachments->clear();
diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h
index 590aa709dd..8f8bda2be8 100644
--- a/indra/newview/llcofwearables.h
+++ b/indra/newview/llcofwearables.h
@@ -107,6 +107,7 @@ public:
typedef boost::function<void (void*)> cof_callback_t;
+ cof_callback_t mAddWearable;
cof_callback_t mMoveWearableCloser;
cof_callback_t mMoveWearableFurther;
cof_callback_t mEditWearable;
@@ -123,6 +124,8 @@ public:
LLUUID getSelectedUUID();
bool getSelectedUUIDs(uuid_vec_t& selected_ids);
+ LLPanel* getSelectedItem();
+
void refresh();
void clear();
diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp
index fd99f673e0..28e159421c 100644
--- a/indra/newview/llfilteredwearablelist.cpp
+++ b/indra/newview/llfilteredwearablelist.cpp
@@ -37,32 +37,10 @@
#include "llinventoryitemslist.h"
#include "llinventorymodel.h"
-class LLFindNonLinksByMask : public LLInventoryCollectFunctor
-{
-public:
- LLFindNonLinksByMask(U64 mask)
- : mFilterMask(mask)
- {}
-
- virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
- {
- if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) )
- {
- return true;
- }
-
- return false;
- }
-private:
- U64 mFilterMask;
-};
-
-//////////////////////////////////////////////////////////////////////////
-
-LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, U64 filter_mask)
+LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector)
: mWearableList(list)
-, mFilterMask(filter_mask)
+, mCollector(collector)
{
llassert(mWearableList);
gInventory.addObserver(this);
@@ -84,9 +62,9 @@ void LLFilteredWearableListManager::changed(U32 mask)
populateList();
}
-void LLFilteredWearableListManager::setFilterMask(U64 mask)
+void LLFilteredWearableListManager::setFilterCollector(LLInventoryCollectFunctor* collector)
{
- mFilterMask = mask;
+ mCollector = collector;
populateList();
}
@@ -94,14 +72,16 @@ void LLFilteredWearableListManager::populateList()
{
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
- LLFindNonLinksByMask collector(mFilterMask);
- gInventory.collectDescendentsIf(
- gInventory.getRootFolderID(),
- cat_array,
- item_array,
- LLInventoryModel::EXCLUDE_TRASH,
- collector);
+ if(mCollector)
+ {
+ gInventory.collectDescendentsIf(
+ gInventory.getRootFolderID(),
+ cat_array,
+ item_array,
+ LLInventoryModel::EXCLUDE_TRASH,
+ *mCollector);
+ }
// Probably will also need to get items from Library (waiting for reply in EXT-6724).
diff --git a/indra/newview/llfilteredwearablelist.h b/indra/newview/llfilteredwearablelist.h
index 0780c02442..b7825c07af 100644
--- a/indra/newview/llfilteredwearablelist.h
+++ b/indra/newview/llfilteredwearablelist.h
@@ -32,6 +32,7 @@
#ifndef LL_LLFILTEREDWEARABLELIST_H
#define LL_LLFILTEREDWEARABLELIST_H
+#include "llinventoryfunctions.h"
#include "llinventoryobserver.h"
class LLInventoryItemsList;
@@ -42,7 +43,7 @@ class LLFilteredWearableListManager : public LLInventoryObserver
LOG_CLASS(LLFilteredWearableListManager);
public:
- LLFilteredWearableListManager(LLInventoryItemsList* list, U64 filter_mask);
+ LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector);
~LLFilteredWearableListManager();
/** LLInventoryObserver implementation
@@ -51,9 +52,9 @@ public:
/*virtual*/ void changed(U32 mask);
/**
- * Sets new filter and applies it immediately
+ * Sets new collector and applies it immediately
*/
- void setFilterMask(U64 mask);
+ void setFilterCollector(LLInventoryCollectFunctor* collector);
/**
* Populates wearable list with filtered data.
@@ -62,7 +63,7 @@ public:
private:
LLInventoryItemsList* mWearableList;
- U64 mFilterMask;
+ LLInventoryCollectFunctor* mCollector;
};
#endif //LL_LLFILTEREDWEARABLELIST_H
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index b9008fa53b..5bea3325a8 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -2196,7 +2196,7 @@ bool LLFloaterSnapshot::updateButtons(ESnapshotMode mode)
childSetVisible("save", mode == SNAPSHOT_MAIN);
childSetVisible("set_profile_pic", mode == SNAPSHOT_MAIN);
- childSetVisible("share_to_web", mode == SNAPSHOT_SHARE);
+// childSetVisible("share_to_web", mode == SNAPSHOT_SHARE);
childSetVisible("share_to_email", mode == SNAPSHOT_SHARE);
childSetVisible("save_to_inventory", mode == SNAPSHOT_SAVE);
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index f67d91cfa5..0cc4b0e389 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -371,6 +371,11 @@ bool LLFindWearablesOfType::operator()(LLInventoryCategory* cat, LLInventoryItem
return true;
}
+void LLFindWearablesOfType::setType(LLWearableType::EType type)
+{
+ mWearableType = type;
+}
+
///----------------------------------------------------------------------------
/// LLAssetIDMatches
///----------------------------------------------------------------------------
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 8b96ba29d9..bb365573d7 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -252,6 +252,37 @@ public:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLFindNonLinksByMask
+//
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLFindNonLinksByMask : public LLInventoryCollectFunctor
+{
+public:
+ LLFindNonLinksByMask(U64 mask)
+ : mFilterMask(mask)
+ {}
+
+ virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
+ {
+ if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) )
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ void setFilterMask(U64 mask)
+ {
+ mFilterMask = mask;
+ }
+
+private:
+ U64 mFilterMask;
+};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFindWearables
//
// Collects wearables based on item type.
@@ -272,8 +303,10 @@ public:
LLFindWearablesOfType(LLWearableType::EType type) : mWearableType(type) {}
virtual ~LLFindWearablesOfType() {}
virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item);
+ void setType(LLWearableType::EType type);
- const LLWearableType::EType mWearableType;
+private:
+ LLWearableType::EType mWearableType;
};
/** Inventory Collector Functions
diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h
index 807952948b..03ad7c2184 100644
--- a/indra/newview/llinventoryitemslist.h
+++ b/indra/newview/llinventoryitemslist.h
@@ -133,6 +133,9 @@ public:
/** Get the description of a corresponding inventory item */
const std::string& getDescription() const { return mItem->getDescription(); }
+ /** Get the associated inventory item */
+ LLViewerInventoryItem* getItem() const { return mItem; }
+
virtual ~LLPanelInventoryListItemBase(){}
protected:
diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp
new file mode 100644
index 0000000000..53243e9807
--- /dev/null
+++ b/indra/newview/llmachineid.cpp
@@ -0,0 +1,269 @@
+/**
+ * @file llmachineid.cpp
+ * @brief retrieves unique machine ids
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
+ * Copyright (c) 2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "lluuid.h"
+#include "llmachineid.h"
+#if LL_WINDOWS
+#define _WIN32_DCOM
+#include <iostream>
+using namespace std;
+#include <comdef.h>
+#include <Wbemidl.h>
+#endif
+unsigned char static_unique_id[] = {0,0,0,0,0,0};
+bool static has_static_unique_id = false;
+
+// get an unique machine id.
+// NOT THREAD SAFE - do before setting up threads.
+// MAC Address doesn't work for Windows 7 since the first returned hardware MAC address changes with each reboot, Go figure??
+
+S32 LLMachineID::init()
+{
+ memset(static_unique_id,0,sizeof(static_unique_id));
+ S32 ret_code = 0;
+#if LL_WINDOWS
+# pragma comment(lib, "wbemuuid.lib")
+ size_t len = sizeof(static_unique_id);
+
+ // algorithm to detect BIOS serial number found at:
+ // http://msdn.microsoft.com/en-us/library/aa394077%28VS.85%29.aspx
+ // we can't use the MAC address since on Windows 7, the first returned MAC address changes with every reboot.
+
+
+ HRESULT hres;
+
+ // Step 1: --------------------------------------------------
+ // Initialize COM. ------------------------------------------
+
+ hres = CoInitializeEx(0, COINIT_MULTITHREADED);
+ if (FAILED(hres))
+ {
+ LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << hres << LL_ENDL;
+ return 1; // Program has failed.
+ }
+
+ // Step 2: --------------------------------------------------
+ // Set general COM security levels --------------------------
+ // Note: If you are using Windows 2000, you need to specify -
+ // the default authentication credentials for a user by using
+ // a SOLE_AUTHENTICATION_LIST structure in the pAuthList ----
+ // parameter of CoInitializeSecurity ------------------------
+
+ hres = CoInitializeSecurity(
+ NULL,
+ -1, // COM authentication
+ NULL, // Authentication services
+ NULL, // Reserved
+ RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication
+ RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation
+ NULL, // Authentication info
+ EOAC_NONE, // Additional capabilities
+ NULL // Reserved
+ );
+
+
+ if (FAILED(hres))
+ {
+ LL_DEBUGS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << hres << LL_ENDL;
+ CoUninitialize();
+ return 1; // Program has failed.
+ }
+
+ // Step 3: ---------------------------------------------------
+ // Obtain the initial locator to WMI -------------------------
+
+ IWbemLocator *pLoc = NULL;
+
+ hres = CoCreateInstance(
+ CLSID_WbemLocator,
+ 0,
+ CLSCTX_INPROC_SERVER,
+ IID_IWbemLocator, (LPVOID *) &pLoc);
+
+ if (FAILED(hres))
+ {
+ LL_DEBUGS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL;
+ CoUninitialize();
+ return 1; // Program has failed.
+ }
+
+ // Step 4: -----------------------------------------------------
+ // Connect to WMI through the IWbemLocator::ConnectServer method
+
+ IWbemServices *pSvc = NULL;
+
+ // Connect to the root\cimv2 namespace with
+ // the current user and obtain pointer pSvc
+ // to make IWbemServices calls.
+ hres = pLoc->ConnectServer(
+ _bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace
+ NULL, // User name. NULL = current user
+ NULL, // User password. NULL = current
+ 0, // Locale. NULL indicates current
+ NULL, // Security flags.
+ 0, // Authority (e.g. Kerberos)
+ 0, // Context object
+ &pSvc // pointer to IWbemServices proxy
+ );
+
+ if (FAILED(hres))
+ {
+ LL_DEBUGS("AppInit") << "Could not connect. Error code = 0x" << hex << hres << LL_ENDL;
+ pLoc->Release();
+ CoUninitialize();
+ return 1; // Program has failed.
+ }
+
+ LL_DEBUGS("AppInit") << "Connected to ROOT\\CIMV2 WMI namespace" << LL_ENDL;
+
+
+ // Step 5: --------------------------------------------------
+ // Set security levels on the proxy -------------------------
+
+ hres = CoSetProxyBlanket(
+ pSvc, // Indicates the proxy to set
+ RPC_C_AUTHN_WINNT, // RPC_C_AUTHN_xxx
+ RPC_C_AUTHZ_NONE, // RPC_C_AUTHZ_xxx
+ NULL, // Server principal name
+ RPC_C_AUTHN_LEVEL_CALL, // RPC_C_AUTHN_LEVEL_xxx
+ RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx
+ NULL, // client identity
+ EOAC_NONE // proxy capabilities
+ );
+
+ if (FAILED(hres))
+ {
+ LL_DEBUGS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << hres << LL_ENDL;
+ pSvc->Release();
+ pLoc->Release();
+ CoUninitialize();
+ return 1; // Program has failed.
+ }
+
+ // Step 6: --------------------------------------------------
+ // Use the IWbemServices pointer to make requests of WMI ----
+
+ // For example, get the name of the operating system
+ IEnumWbemClassObject* pEnumerator = NULL;
+ hres = pSvc->ExecQuery(
+ bstr_t("WQL"),
+ bstr_t("SELECT * FROM Win32_OperatingSystem"),
+ WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
+ NULL,
+ &pEnumerator);
+
+ if (FAILED(hres))
+ {
+ LL_DEBUGS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL;
+ pSvc->Release();
+ pLoc->Release();
+ CoUninitialize();
+ return 1; // Program has failed.
+ }
+
+ // Step 7: -------------------------------------------------
+ // Get the data from the query in step 6 -------------------
+
+ IWbemClassObject *pclsObj = NULL;
+ ULONG uReturn = 0;
+
+ while (pEnumerator)
+ {
+ HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,
+ &pclsObj, &uReturn);
+
+ if(0 == uReturn)
+ {
+ break;
+ }
+
+ VARIANT vtProp;
+
+ // Get the value of the Name property
+ hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0);
+ LL_DEBUGS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL;
+ // use characters in the returned Serial Number to create a byte array of size len
+ BSTR serialNumber ( vtProp.bstrVal);
+ unsigned int j = 0;
+ while( vtProp.bstrVal[j] != 0)
+ {
+ for (unsigned int i = 0; i < len; i++)
+ {
+ if (vtProp.bstrVal[j] == 0)
+ break;
+
+ static_unique_id[i] = (unsigned int)(static_unique_id[i] + serialNumber[j]);
+ j++;
+ }
+ }
+ VariantClear(&vtProp);
+
+ pclsObj->Release();
+ pclsObj = NULL;
+ break;
+ }
+
+ // Cleanup
+ // ========
+
+ if (pSvc)
+ pSvc->Release();
+ if (pLoc)
+ pLoc->Release();
+ if (pEnumerator)
+ pEnumerator->Release();
+ CoUninitialize();
+ ret_code=0;
+#else
+ unsigned char * staticPtr = (unsigned char *)(&static_unique_id[0]);
+ ret_code = LLUUID::getNodeID(staticPtr);
+#endif
+ has_static_unique_id = true;
+ return ret_code;
+}
+
+
+S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len)
+{
+ if (has_static_unique_id)
+ {
+ memcpy ( unique_id, &static_unique_id, len);
+ LL_DEBUGS("AppInit") << "UniqueID: " << unique_id[0] << unique_id[1]<< unique_id[2] << unique_id[3] << unique_id[4] << unique_id [5] << LL_ENDL;
+ return 1;
+ }
+ return 0;
+}
+
+
+
+
diff --git a/indra/newview/llmachineid.h b/indra/newview/llmachineid.h
new file mode 100644
index 0000000000..8160309b47
--- /dev/null
+++ b/indra/newview/llmachineid.h
@@ -0,0 +1,56 @@
+/**
+ * @file llmachineid.h
+ * @brief retrieves unique machine ids
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLMACHINEID_H
+#define LL_LLMACHINEID_H
+
+
+class LLMachineID
+{
+public:
+ LLMachineID();
+ virtual ~LLMachineID();
+ static S32 getUniqueID(unsigned char *unique_id, size_t len);
+ static S32 init();
+
+protected:
+
+private:
+
+
+};
+
+
+
+
+
+#endif // LL_LLMACHINEID_H
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 680ed35fa2..46f531fdd9 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -34,6 +34,7 @@
#include "message.h"
+#include "llappviewer.h"
#include "llfloaterreg.h"
#include "lltrans.h"
@@ -388,6 +389,7 @@ BOOL LLNearbyChatBar::postBuild()
mChatBox->setCommitCallback(boost::bind(&LLNearbyChatBar::onChatBoxCommit, this));
mChatBox->setKeystrokeCallback(&onChatBoxKeystroke, this);
mChatBox->setFocusLostCallback(boost::bind(&onChatBoxFocusLost, _1, this));
+ mChatBox->setFocusReceivedCallback(boost::bind(&LLNearbyChatBar::onChatBoxFocusReceived, this));
mChatBox->setIgnoreArrowKeys( FALSE );
mChatBox->setCommitOnFocusLost( FALSE );
@@ -545,6 +547,11 @@ void LLNearbyChatBar::onChatBoxFocusLost(LLFocusableElement* caller, void* userd
gAgent.stopTyping();
}
+void LLNearbyChatBar::onChatBoxFocusReceived()
+{
+ mChatBox->setEnabled(!gDisconnected);
+}
+
EChatType LLNearbyChatBar::processChatTypeTriggers(EChatType type, std::string &str)
{
U32 length = str.length();
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index 5af3152662..83c174fd10 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -122,6 +122,7 @@ protected:
static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str);
static void onChatBoxKeystroke(LLLineEditor* caller, void* userdata);
static void onChatBoxFocusLost(LLFocusableElement* caller, void* userdata);
+ void onChatBoxFocusReceived();
void sendChat( EChatType type );
void onChatBoxCommit();
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 17a2db7a43..8f189a1e9f 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -82,7 +82,6 @@ LLOutfitsList::LLOutfitsList()
: LLPanel()
, mAccordion(NULL)
, mListCommands(NULL)
- , mSelectedList(NULL)
{
mCategoriesObserver = new LLInventoryCategoriesObserver();
gInventory.addObserver(mCategoriesObserver);
@@ -208,6 +207,8 @@ void LLOutfitsList::refreshList(const LLUUID& category_id)
// Setting list refresh callback to apply filter on list change.
list->setRefreshCompleteCallback(boost::bind(&LLOutfitsList::onFilteredWearableItemsListRefresh, this, _1));
+ list->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onWearableItemsListRightClick, this, _1, _2, _3));
+
// Fetch the new outfit contents.
cat->fetch();
@@ -237,23 +238,27 @@ void LLOutfitsList::refreshList(const LLUUID& category_id)
outfits_map_t::iterator outfits_iter = mOutfitsMap.find((*iter));
if (outfits_iter != mOutfitsMap.end())
{
- // An outfit is removed from the list. Do the following:
- // 1. Remove outfit accordion tab from accordion.
- mAccordion->removeCollapsibleCtrl(outfits_iter->second);
-
const LLUUID& outfit_id = outfits_iter->first;
+ LLAccordionCtrlTab* tab = outfits_iter->second;
- // 2. Remove outfit category from observer to stop monitoring its changes.
+ // An outfit is removed from the list. Do the following:
+ // 1. Remove outfit category from observer to stop monitoring its changes.
mCategoriesObserver->removeCategory(outfit_id);
- // 3. Reset selection if selected outfit is being removed.
- if (mSelectedOutfitUUID == outfit_id)
+ // 2. Remove selected lists map entry.
+ mSelectedListsMap.erase(outfit_id);
+
+ // 3. Reset currently selected outfit id if it is being removed.
+ if (outfit_id == mSelectedOutfitUUID)
{
- changeOutfitSelection(NULL, LLUUID());
+ mSelectedOutfitUUID = LLUUID();
}
// 4. Remove category UUID to accordion tab mapping.
mOutfitsMap.erase(outfits_iter);
+
+ // 5. Remove outfit tab from accordion.
+ mAccordion->removeCollapsibleCtrl(tab);
}
}
@@ -283,6 +288,8 @@ void LLOutfitsList::onSelectionChange(LLUICtrl* ctrl)
void LLOutfitsList::performAction(std::string action)
{
+ if (mSelectedOutfitUUID.isNull()) return;
+
LLViewerInventoryCategory* cat = gInventory.getCategory(mSelectedOutfitUUID);
if (!cat) return;
@@ -367,14 +374,28 @@ void LLOutfitsList::updateOutfitTab(const LLUUID& category_id)
void LLOutfitsList::changeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id)
{
- // Reset selection in previously selected tab
- // if a new one is selected.
- if (list && mSelectedList && mSelectedList != list)
+ MASK mask = gKeyboard->currentMask(TRUE);
+
+ // Reset selection in all previously selected tabs except for the current
+ // if new selection is started.
+ if (list && !(mask & MASK_CONTROL))
{
- mSelectedList->resetSelection();
+ for (wearables_lists_map_t::iterator iter = mSelectedListsMap.begin();
+ iter != mSelectedListsMap.end();
+ ++iter)
+ {
+ LLWearableItemsList* selected_list = (*iter).second;
+ if (selected_list != list)
+ {
+ selected_list->resetSelection();
+ }
+ }
+
+ // Clear current selection.
+ mSelectedListsMap.clear();
}
- mSelectedList = list;
+ mSelectedListsMap.insert(wearables_lists_map_value_t(category_id, list));
mSelectedOutfitUUID = category_id;
}
@@ -494,6 +515,13 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const
S32 header_bottom = tab->getLocalRect().getHeight() - tab->getHeaderHeight();
if(y >= header_bottom)
{
+ // Focus tab header to trigger tab selection change.
+ LLUICtrl* header = tab->findChild<LLUICtrl>("dd_header");
+ if (header)
+ {
+ header->setFocus(TRUE);
+ }
+
uuid_vec_t selected_uuids;
selected_uuids.push_back(cat_id);
mOutfitMenu->show(ctrl, selected_uuids, x, y);
@@ -501,4 +529,26 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const
}
}
+void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y)
+{
+ LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(ctrl);
+ if (!list) return;
+
+ uuid_vec_t selected_uuids;
+
+ // Collect seleted items from all selected lists.
+ for (wearables_lists_map_t::iterator iter = mSelectedListsMap.begin();
+ iter != mSelectedListsMap.end();
+ ++iter)
+ {
+ uuid_vec_t uuids;
+ (*iter).second->getSelectedUUIDs(uuids);
+
+ S32 prev_size = selected_uuids.size();
+ selected_uuids.resize(prev_size + uuids.size());
+ std::copy(uuids.begin(), uuids.end(), selected_uuids.begin() + prev_size);
+ }
+
+ LLWearableItemsList::ContextMenu::instance().show(list, selected_uuids, x, y);
+}
// EOF
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index b6b3d6ae46..1da7360c2e 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -108,12 +108,17 @@ private:
void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id);
+ void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
+
LLInventoryCategoriesObserver* mCategoriesObserver;
LLAccordionCtrl* mAccordion;
LLPanel* mListCommands;
- LLWearableItemsList* mSelectedList;
+ typedef std::map<LLUUID, LLWearableItemsList*> wearables_lists_map_t;
+ typedef wearables_lists_map_t::value_type wearables_lists_map_value_t;
+ wearables_lists_map_t mSelectedListsMap;
+
LLUUID mSelectedOutfitUUID;
std::string mFilterSubString;
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 0009f7203a..c8dae024cf 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -1164,7 +1164,8 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe)
void LLPanelLogin::updateLoginPanelLinks()
{
- LLSD grid_data = LLGridManager::getInstance()->getGridInfo();
+ LLSD grid_data;
+ LLGridManager::getInstance()->getGridInfo(grid_data);
bool system_grid = grid_data.has(GRID_IS_SYSTEM_GRID_VALUE);
// need to call through sInstance, as it's called from onSelectServer, which
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index ae4b288588..78de384cdc 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -36,6 +36,7 @@
// *TODO: reorder includes to match the coding standard
#include "llagent.h"
+#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llappearancemgr.h"
#include "llcofwearables.h"
@@ -60,6 +61,7 @@
#include "llinventorymodelbackgroundfetch.h"
#include "llpaneloutfitsinventory.h"
#include "lluiconstants.h"
+#include "llsaveoutfitcombobtn.h"
#include "llscrolllistctrl.h"
#include "lltextbox.h"
#include "lluictrlfactory.h"
@@ -67,6 +69,7 @@
#include "llsidepanelappearance.h"
#include "lltoggleablemenu.h"
#include "llwearablelist.h"
+#include "llwearableitemslist.h"
static LLRegisterPanelClassWrapper<LLPanelOutfitEdit> t_outfit_edit("panel_outfit_edit");
@@ -74,7 +77,6 @@ const U64 WEARABLE_MASK = (1LL << LLInventoryType::IT_WEARABLE);
const U64 ATTACHMENT_MASK = (1LL << LLInventoryType::IT_ATTACHMENT) | (1LL << LLInventoryType::IT_OBJECT);
const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK;
-static const std::string SAVE_BTN("save_btn");
static const std::string REVERT_BTN("revert_btn");
class LLCOFObserver : public LLInventoryObserver
@@ -214,7 +216,10 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()
mCOFObserver(NULL),
mGearMenu(NULL),
mCOFDragAndDropObserver(NULL),
- mInitialized(false)
+ mInitialized(false),
+ mAddWearablesPanel(NULL),
+ mWearableListMaskCollector(NULL),
+ mWearableListTypeCollector(NULL)
{
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
@@ -236,6 +241,9 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit()
delete mCOFObserver;
delete mCOFDragAndDropObserver;
+
+ delete mWearableListMaskCollector;
+ delete mWearableListTypeCollector;
}
BOOL LLPanelOutfitEdit::postBuild()
@@ -251,16 +259,17 @@ BOOL LLPanelOutfitEdit::postBuild()
mFolderViewBtn = getChild<LLButton>("folder_view_btn");
mListViewBtn = getChild<LLButton>("list_view_btn");
+ mAddToOutfitBtn = getChild<LLButton>("add_to_outfit_btn");
childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL);
childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredFolderWearablesPanel, this), NULL);
childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredWearablesPanel, this), NULL);
- childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL);
childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL);
mCOFWearables = getChild<LLCOFWearables>("cof_wearables_list");
mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onOutfitItemSelectionChange, this));
+ mCOFWearables->getCOFCallbacks().mAddWearable = boost::bind(&LLPanelOutfitEdit::onAddWearableClicked, this);
mCOFWearables->getCOFCallbacks().mEditWearable = boost::bind(&LLPanelOutfitEdit::onEditWearableClicked, this);
mCOFWearables->getCOFCallbacks().mDeleteWearable = boost::bind(&LLPanelOutfitEdit::onRemoveFromOutfitClicked, this);
mCOFWearables->getCOFCallbacks().mMoveWearableCloser = boost::bind(&LLPanelOutfitEdit::moveWearable, this, true);
@@ -268,6 +277,7 @@ BOOL LLPanelOutfitEdit::postBuild()
mCOFWearables->childSetAction("add_btn", boost::bind(&LLPanelOutfitEdit::toggleAddWearablesPanel, this));
+ mAddWearablesPanel = getChild<LLPanel>("add_wearables_panel");
mInventoryItemsPanel = getChild<LLInventoryPanel>("inventory_items");
mInventoryItemsPanel->setFilterTypes(ALL_ITEMS_MASK);
@@ -298,18 +308,14 @@ BOOL LLPanelOutfitEdit::postBuild()
childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance()));
- childSetAction(SAVE_BTN, boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false));
- childSetAction("save_flyout_btn", boost::bind(&LLPanelOutfitEdit::showSaveMenu, this));
-
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar;
- save_registar.add("Outfit.Save.Action", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false));
- save_registar.add("Outfit.SaveAsNew.Action", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true));
- mSaveMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_save_outfit.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ mWearableListMaskCollector = new LLFindNonLinksByMask(ALL_ITEMS_MASK);
+ mWearableListTypeCollector = new LLFindWearablesOfType(LLWearableType::WT_NONE);
mWearableItemsPanel = getChild<LLPanel>("filtered_wearables_panel");
mWearableItemsList = getChild<LLInventoryItemsList>("filtered_wearables_list");
- mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, ALL_ITEMS_MASK);
+ mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, mWearableListMaskCollector);
+ mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this));
return TRUE;
}
@@ -334,7 +340,16 @@ void LLPanelOutfitEdit::moveWearable(bool closer_to_body)
void LLPanelOutfitEdit::toggleAddWearablesPanel()
{
- childSetVisible("add_wearables_panel", !childIsVisible("add_wearables_panel"));
+ BOOL current_visibility = mAddWearablesPanel->getVisible();
+ mAddWearablesPanel->setVisible(!current_visibility);
+
+ mFolderViewBtn->setVisible(!current_visibility);
+ mListViewBtn->setVisible(!current_visibility);
+ mAddToOutfitBtn->setVisible(!current_visibility);
+
+ // Change right dummy icon to fill the toggled buttons space.
+ childSetVisible("add_wearables_dummy_icon", !current_visibility);
+ childSetVisible("dummy_right_icon", current_visibility);
}
void LLPanelOutfitEdit::showWearablesFilter()
@@ -372,33 +387,6 @@ void LLPanelOutfitEdit::showFilteredFolderWearablesPanel()
mFolderViewBtn->setToggleState(TRUE);
}
-void LLPanelOutfitEdit::saveOutfit(bool as_new)
-{
- if (!as_new && LLAppearanceMgr::getInstance()->updateBaseOutfit())
- {
- // we don't need to ask for an outfit name, and updateBaseOutfit() successfully saved.
- // If updateBaseOutfit fails, ask for an outfit name anyways
- return;
- }
-
- LLPanelOutfitsInventory* panel_outfits_inventory = LLPanelOutfitsInventory::findInstance();
- if (panel_outfits_inventory)
- {
- panel_outfits_inventory->onSave();
- }
-
- //*TODO how to get to know when base outfit is updated or new outfit is created?
-}
-
-void LLPanelOutfitEdit::showSaveMenu()
-{
- S32 x, y;
- LLUI::getMousePositionLocal(this, &x, &y);
-
- mSaveMenu->updateParent(LLMenuGL::sMenuContainer);
- LLMenuGL::showPopup(this, mSaveMenu, x, y);
-}
-
void LLPanelOutfitEdit::onTypeFilterChanged(LLUICtrl* ctrl)
{
LLComboBox* type_filter = dynamic_cast<LLComboBox*>(ctrl);
@@ -407,7 +395,9 @@ void LLPanelOutfitEdit::onTypeFilterChanged(LLUICtrl* ctrl)
{
U32 curr_filter_type = type_filter->getCurrentIndex();
mInventoryItemsPanel->setFilterTypes(mLookItemTypes[curr_filter_type].inventoryMask);
- mWearableListManager->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask);
+
+ mWearableListMaskCollector->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask);
+ mWearableListManager->setFilterCollector(mWearableListMaskCollector);
}
mSavedFolderState->setApply(TRUE);
@@ -487,6 +477,25 @@ void LLPanelOutfitEdit::onAddToOutfitClicked(void)
LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id);
}
+void LLPanelOutfitEdit::onAddWearableClicked(void)
+{
+ LLPanelDummyClothingListItem* item = dynamic_cast<LLPanelDummyClothingListItem*>(mCOFWearables->getSelectedItem());
+
+ if(item)
+ {
+ showFilteredWearableItemsList(item->getWearableType());
+ }
+}
+
+void LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id)
+{
+ LLViewerInventoryItem* item = gInventory.getLinkedItem(selected_item_id);
+
+ if (item && item->getType() == LLAssetType::AT_BODYPART)
+ {
+ showFilteredWearableItemsList(item->getWearableType());
+ }
+}
void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void)
{
@@ -675,10 +684,10 @@ void LLPanelOutfitEdit::updateVerbs()
bool outfit_is_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty();
bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull();
- childSetEnabled(SAVE_BTN, outfit_is_dirty);
+ mSaveComboBtn->setSaveBtnEnabled(outfit_is_dirty);
childSetEnabled(REVERT_BTN, outfit_is_dirty && has_baseoutfit);
- mSaveMenu->setItemEnabled("save_outfit", outfit_is_dirty);
+ mSaveComboBtn->setMenuItemEnabled("save_outfit", outfit_is_dirty);
mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing"));
@@ -722,4 +731,12 @@ void LLPanelOutfitEdit::onGearMenuItemClick(const LLSD& data)
}
}
+void LLPanelOutfitEdit::showFilteredWearableItemsList(LLWearableType::EType type)
+{
+ mWearableListTypeCollector->setType(type);
+ mWearableListManager->setFilterCollector(mWearableListTypeCollector);
+ mAddWearablesPanel->setVisible(TRUE);
+ showFilteredWearablesPanel();
+}
+
// EOF
diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h
index 1bf69c5606..1569c55732 100644
--- a/indra/newview/llpaneloutfitedit.h
+++ b/indra/newview/llpaneloutfitedit.h
@@ -59,6 +59,9 @@ class LLToggleableMenu;
class LLFilterEditor;
class LLFilteredWearableListManager;
class LLMenuGL;
+class LLFindNonLinksByMask;
+class LLFindWearablesOfType;
+class LLSaveOutfitComboBtn;
class LLPanelOutfitEdit : public LLPanel
{
@@ -93,8 +96,6 @@ public:
void showWearablesFilter();
void showFilteredWearablesPanel();
void showFilteredFolderWearablesPanel();
- void saveOutfit(bool as_new = false);
- void showSaveMenu();
void onTypeFilterChanged(LLUICtrl* ctrl);
void onSearchEdit(const std::string& string);
@@ -103,6 +104,8 @@ public:
void onOutfitItemSelectionChange(void);
void onRemoveFromOutfitClicked(void);
void onEditWearableClicked(void);
+ void onAddWearableClicked(void);
+ void onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id);
void displayCurrentOutfit();
void updateCurrentOutfitName();
@@ -129,6 +132,7 @@ private:
void onGearButtonClick(LLUICtrl* clicked_button);
void onGearMenuItemClick(const LLSD& data);
+ void showFilteredWearableItemsList(LLWearableType::EType type);
LLTextBox* mCurrentOutfitName;
@@ -140,7 +144,11 @@ private:
LLButton* mEditWearableBtn;
LLButton* mFolderViewBtn;
LLButton* mListViewBtn;
- LLToggleableMenu* mSaveMenu;
+ LLButton* mAddToOutfitBtn;
+ LLPanel* mAddWearablesPanel;
+
+ LLFindNonLinksByMask* mWearableListMaskCollector;
+ LLFindWearablesOfType* mWearableListTypeCollector;
LLFilteredWearableListManager* mWearableListManager;
LLInventoryItemsList* mWearableItemsList;
@@ -154,6 +162,8 @@ private:
LLCOFWearables* mCOFWearables;
LLMenuGL* mGearMenu;
bool mInitialized;
+ std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
+
};
#endif // LL_LLPANELOUTFITEDIT_H
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index a7e8f497d9..21f69d3470 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -50,6 +50,7 @@
#include "llmodaldialog.h"
#include "llnotificationsutil.h"
#include "lloutfitslist.h"
+#include "llsaveoutfitcombobtn.h"
#include "llsidepanelappearance.h"
#include "llsidetray.h"
#include "lltabcontainer.h"
@@ -101,6 +102,8 @@ BOOL LLPanelOutfitsInventory::postBuild()
LLInventoryModelBackgroundFetch::instance().start(outfits_cat);
}
+ mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this, true));
+
return TRUE;
}
@@ -373,7 +376,6 @@ void LLPanelOutfitsInventory::initListCommandsHandlers()
mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::onGearButtonClick, this));
mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
- mListCommands->childSetAction("make_outfit_btn", boost::bind(&LLPanelOutfitsInventory::onAddButtonClick, this));
mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this));
LLDragAndDropButton* trash_btn = mListCommands->getChild<LLDragAndDropButton>("trash_btn");
@@ -396,7 +398,7 @@ void LLPanelOutfitsInventory::updateListCommands()
mListCommands->childSetEnabled("trash_btn", trash_enabled);
mListCommands->childSetEnabled("wear_btn", wear_enabled);
mListCommands->childSetVisible("wear_btn", wear_enabled);
- mListCommands->childSetEnabled("make_outfit_btn", make_outfit_enabled);
+ mSaveComboBtn->setSaveBtnEnabled(make_outfit_enabled);
}
void LLPanelOutfitsInventory::onGearButtonClick()
@@ -404,11 +406,6 @@ void LLPanelOutfitsInventory::onGearButtonClick()
showActionMenu(mMenuGearDefault,"options_gear_btn");
}
-void LLPanelOutfitsInventory::onAddButtonClick()
-{
- onSave();
-}
-
void LLPanelOutfitsInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name)
{
if (menu)
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index a0fe91cd80..7bdd37c16c 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -46,6 +46,7 @@ class LLButton;
class LLMenuGL;
class LLSidepanelAppearance;
class LLTabContainer;
+class LLSaveOutfitComboBtn;
class LLPanelOutfitsInventory : public LLPanel
{
@@ -86,7 +87,7 @@ private:
LLSaveFolderState* mSavedFolderState;
LLTabContainer* mAppearanceTabs;
std::string mFilterSubString;
-
+ std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
public:
//////////////////////////////////////////////////////////////////////////////////
// tab panels
@@ -117,7 +118,6 @@ protected:
void updateListCommands();
void onGearButtonClick();
void onWearButtonClick();
- void onAddButtonClick();
void showActionMenu(LLMenuGL* menu, std::string spawning_view_name);
void onTrashButtonClick();
void onClipboardAction(const LLSD& userdata);
diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp
new file mode 100644
index 0000000000..b9b577084b
--- /dev/null
+++ b/indra/newview/llsaveoutfitcombobtn.cpp
@@ -0,0 +1,97 @@
+/**
+ * @file llsaveoutfitcombobtn.cpp
+ * @brief Represents outfit save/save as combo button.
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llappearancemgr.h"
+#include "llpaneloutfitsinventory.h"
+#include "llsaveoutfitcombobtn.h"
+#include "llviewermenu.h"
+
+static const std::string SAVE_BTN("save_btn");
+static const std::string SAVE_FLYOUT_BTN("save_flyout_btn");
+
+LLSaveOutfitComboBtn::LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAction):
+ mParent(parent), mSaveAsDefaultAction(saveAsDefaultAction)
+{
+ // register action mapping before creating menu
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar;
+ save_registar.add("Outfit.Save.Action", boost::bind(
+ &LLSaveOutfitComboBtn::saveOutfit, this, false));
+ save_registar.add("Outfit.SaveAs.Action", boost::bind(
+ &LLSaveOutfitComboBtn::saveOutfit, this, true));
+
+ mParent->childSetAction(SAVE_BTN, boost::bind(&LLSaveOutfitComboBtn::saveOutfit, this, mSaveAsDefaultAction));
+ mParent->childSetAction(SAVE_FLYOUT_BTN, boost::bind(&LLSaveOutfitComboBtn::showSaveMenu, this));
+
+ mSaveMenu = LLUICtrlFactory::getInstance()->createFromFile<
+ LLToggleableMenu> ("menu_save_outfit.xml", gMenuHolder,
+ LLViewerMenuHolderGL::child_registry_t::instance());
+}
+
+void LLSaveOutfitComboBtn::showSaveMenu()
+{
+ S32 x, y;
+ LLUI::getMousePositionLocal(mParent, &x, &y);
+
+ mSaveMenu->updateParent(LLMenuGL::sMenuContainer);
+ LLMenuGL::showPopup(mParent, mSaveMenu, x, y);
+}
+
+void LLSaveOutfitComboBtn::saveOutfit(bool as_new)
+{
+ if (!as_new && LLAppearanceMgr::getInstance()->updateBaseOutfit())
+ {
+ // we don't need to ask for an outfit name, and updateBaseOutfit() successfully saved.
+ // If updateBaseOutfit fails, ask for an outfit name anyways
+ return;
+ }
+
+ LLPanelOutfitsInventory* panel_outfits_inventory =
+ LLPanelOutfitsInventory::findInstance();
+ if (panel_outfits_inventory)
+ {
+ panel_outfits_inventory->onSave();
+ }
+
+ //*TODO how to get to know when base outfit is updated or new outfit is created?
+}
+
+void LLSaveOutfitComboBtn::setMenuItemEnabled(const std::string& item, bool enabled)
+{
+ mSaveMenu->setItemEnabled("save_outfit", enabled);
+}
+
+void LLSaveOutfitComboBtn::setSaveBtnEnabled(bool enabled)
+{
+ mParent->childSetEnabled(SAVE_BTN, enabled);
+}
diff --git a/indra/newview/llsaveoutfitcombobtn.h b/indra/newview/llsaveoutfitcombobtn.h
new file mode 100644
index 0000000000..fec7122194
--- /dev/null
+++ b/indra/newview/llsaveoutfitcombobtn.h
@@ -0,0 +1,60 @@
+/**
+ * @file llsaveoutfitcombobtn.h
+ * @brief Represents outfit save/save as combo button.
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLSAVEOUTFITCOMBOBTN_H
+#define LL_LLSAVEOUTFITCOMBOBTN_H
+
+class LLButton;
+
+#include "lltoggleablemenu.h"
+
+/**
+ * Represents outfit Save/Save As combo button.
+ */
+class LLSaveOutfitComboBtn
+{
+ LOG_CLASS(LLSaveOutfitComboBtn);
+public:
+ LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAction = false);
+
+ void showSaveMenu();
+ void saveOutfit(bool as_new = false);
+ void setMenuItemEnabled(const std::string& item, bool enabled);
+ void setSaveBtnEnabled(bool enabled);
+
+private:
+ bool mSaveAsDefaultAction;
+ LLPanel* mParent;
+ LLToggleableMenu* mSaveMenu;
+};
+
+#endif // LL_LLSAVEOUTFITCOMBOBTN_H
diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp
index 1caeec5b04..9e636f38c0 100644
--- a/indra/newview/llsecapi.cpp
+++ b/indra/newview/llsecapi.cpp
@@ -124,7 +124,7 @@ int secapiSSLCertVerifyCallback(X509_STORE_CTX *ctx, void *param)
// we rely on libcurl to validate the hostname, as libcurl does more extensive validation
// leaving our hostname validation call mechanism for future additions with respect to
// OS native (Mac keyring, windows CAPI) validation.
- chain->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), store, validation_params);
+ store->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), chain, validation_params);
}
catch (LLCertValidationTrustException& cert_exception)
{
diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h
index 59a1e1eff0..5a1a3879d4 100644
--- a/indra/newview/llsecapi.h
+++ b/indra/newview/llsecapi.h
@@ -154,7 +154,7 @@ public:
// return an LLSD object containing information about the certificate
// such as its name, signature, expiry time, serial number
- virtual LLSD getLLSD() const=0;
+ virtual void getLLSD(LLSD& llsd)=0;
// return an openSSL X509 struct for the certificate
virtual X509* getOpenSSLX509() const=0;
@@ -231,6 +231,18 @@ public:
virtual LLPointer<LLCertificate> erase(iterator cert)=0;
};
+// class LLCertificateChain
+// Class representing a chain of certificates in order, with the
+// first element being the child cert.
+class LLCertificateChain : virtual public LLCertificateVector
+{
+
+public:
+ LLCertificateChain() {}
+
+ virtual ~LLCertificateChain() {}
+
+};
// class LLCertificateStore
// represents a store of certificates, typically a store of root CA
@@ -250,30 +262,17 @@ public:
// return the store id
virtual std::string storeId() const=0;
-};
-
-// class LLCertificateChain
-// Class representing a chain of certificates in order, with the
-// first element being the child cert.
-class LLCertificateChain : virtual public LLCertificateVector
-{
-
-public:
- LLCertificateChain() {}
- virtual ~LLCertificateChain() {}
-
// validate a certificate chain given the params.
// Will throw exceptions on error
virtual void validate(int validation_policy,
- LLPointer<LLCertificateStore> ca_store,
+ LLPointer<LLCertificateChain> cert_chain,
const LLSD& validation_params) =0;
+
};
-
-
inline
bool operator==(const LLCertificateVector::iterator& _lhs, const LLCertificateVector::iterator& _rhs)
{
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index c4c13ccdca..e191e50c4b 100644
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -52,6 +52,7 @@ LLS * By copying, modifying or distributing this software, you acknowledge
#include <iostream>
#include <iomanip>
#include <time.h>
+#include "llmachineid.h"
@@ -85,7 +86,6 @@ LLBasicCertificate::LLBasicCertificate(const std::string& pem_cert)
{
throw LLInvalidCertificate(this);
}
- _initLLSD();
}
@@ -96,7 +96,6 @@ LLBasicCertificate::LLBasicCertificate(X509* pCert)
throw LLInvalidCertificate(this);
}
mCert = X509_dup(pCert);
- _initLLSD();
}
LLBasicCertificate::~LLBasicCertificate()
@@ -150,9 +149,13 @@ std::vector<U8> LLBasicCertificate::getBinary() const
}
-LLSD LLBasicCertificate::getLLSD() const
+void LLBasicCertificate::getLLSD(LLSD &llsd)
{
- return mLLSDInfo;
+ if (mLLSDInfo.isUndefined())
+ {
+ _initLLSD();
+ }
+ llsd = mLLSDInfo;
}
// Initialize the LLSD info for the certificate
@@ -516,8 +519,9 @@ LLBasicCertificateVector::iterator LLBasicCertificateVector::find(const LLSD& pa
cert++)
{
- found= TRUE;
- LLSD cert_info = (*cert)->getLLSD();
+ found= TRUE;
+ LLSD cert_info;
+ (*cert)->getLLSD(cert_info);
for (LLSD::map_const_iterator param = params.beginMap();
param != params.endMap();
param++)
@@ -543,7 +547,8 @@ LLBasicCertificateVector::iterator LLBasicCertificateVector::find(const LLSD& pa
void LLBasicCertificateVector::insert(iterator _iter,
LLPointer<LLCertificate> cert)
{
- LLSD cert_info = cert->getLLSD();
+ LLSD cert_info;
+ cert->getLLSD(cert_info);
if (cert_info.isMap() && cert_info.has(CERT_SHA1_DIGEST))
{
LLSD existing_cert_info = LLSD::emptyMap();
@@ -695,7 +700,8 @@ LLBasicCertificateChain::LLBasicCertificateChain(const X509_STORE_CTX* store)
while(untrusted_certs.size() > 0)
{
LLSD find_data = LLSD::emptyMap();
- LLSD cert_data = current->getLLSD();
+ LLSD cert_data;
+ current->getLLSD(cert_data);
// we simply build the chain via subject/issuer name as the
// client should not have passed in multiple CA's with the same
// subject name. If they did, it'll come out in the wash during
@@ -854,12 +860,13 @@ bool _LLSDArrayIncludesValue(const LLSD& llsd_set, LLSD llsd_value)
}
void _validateCert(int validation_policy,
- const LLPointer<LLCertificate> cert,
+ LLPointer<LLCertificate> cert,
const LLSD& validation_params,
int depth)
{
- LLSD current_cert_info = cert->getLLSD();
+ LLSD current_cert_info;
+ cert->getLLSD(current_cert_info);
// check basic properties exist in the cert
if(!current_cert_info.has(CERT_SUBJECT_NAME) || !current_cert_info.has(CERT_SUBJECT_NAME_STRING))
{
@@ -947,8 +954,9 @@ bool _verify_signature(LLPointer<LLCertificate> parent,
LLPointer<LLCertificate> child)
{
bool verify_result = FALSE;
- LLSD cert1 = parent->getLLSD();
- LLSD cert2 = child->getLLSD();
+ LLSD cert1, cert2;
+ parent->getLLSD(cert1);
+ child->getLLSD(cert2);
X509 *signing_cert = parent->getOpenSSLX509();
X509 *child_cert = child->getOpenSSLX509();
if((signing_cert != NULL) && (child_cert != NULL))
@@ -983,6 +991,7 @@ bool _verify_signature(LLPointer<LLCertificate> parent,
return verify_result;
}
+
// validate the certificate chain against a store.
// There are many aspects of cert validatioin policy involved in
// trust validation. The policies in this validation algorithm include
@@ -997,17 +1006,17 @@ bool _verify_signature(LLPointer<LLCertificate> parent,
// and verify the last cert is in the certificate store, or points
// to a cert in the store. It validates whether any cert in the chain
// is trusted in the store, even if it's not the last one.
-void LLBasicCertificateChain::validate(int validation_policy,
- LLPointer<LLCertificateStore> ca_store,
+void LLBasicCertificateStore::validate(int validation_policy,
+ LLPointer<LLCertificateChain> cert_chain,
const LLSD& validation_params)
{
- if(size() < 1)
+ if(cert_chain->size() < 1)
{
throw LLCertException(NULL, "No certs in chain");
}
- iterator current_cert = begin();
- LLSD current_cert_info = (*current_cert)->getLLSD();
+ iterator current_cert = cert_chain->begin();
+ LLSD current_cert_info;
LLSD validation_date;
if (validation_params.has(CERT_VALIDATION_DATE))
{
@@ -1016,6 +1025,7 @@ void LLBasicCertificateChain::validate(int validation_policy,
if (validation_policy & VALIDATION_POLICY_HOSTNAME)
{
+ (*current_cert)->getLLSD(current_cert_info);
if(!validation_params.has(CERT_HOSTNAME))
{
throw LLCertException((*current_cert), "No hostname passed in for validation");
@@ -1025,7 +1035,7 @@ void LLBasicCertificateChain::validate(int validation_policy,
throw LLInvalidCertificate((*current_cert));
}
- LL_INFOS("SECAPI") << "Validating the hostname " << validation_params[CERT_HOSTNAME].asString() <<
+ LL_DEBUGS("SECAPI") << "Validating the hostname " << validation_params[CERT_HOSTNAME].asString() <<
"against the cert CN " << current_cert_info[CERT_SUBJECT_NAME][CERT_NAME_CN].asString() << LL_ENDL;
if(!_cert_hostname_wildcard_match(validation_params[CERT_HOSTNAME].asString(),
current_cert_info[CERT_SUBJECT_NAME][CERT_NAME_CN].asString()))
@@ -1034,16 +1044,50 @@ void LLBasicCertificateChain::validate(int validation_policy,
(*current_cert));
}
}
-
+ // check the cache of already validated certs
+ X509* cert_x509 = (*current_cert)->getOpenSSLX509();
+ if(!cert_x509)
+ {
+ throw LLInvalidCertificate((*current_cert));
+ }
+ std::string sha1_hash((const char *)cert_x509->sha1_hash, SHA_DIGEST_LENGTH);
+ t_cert_cache::iterator cache_entry = mTrustedCertCache.find(sha1_hash);
+ if(cache_entry != mTrustedCertCache.end())
+ {
+ LL_DEBUGS("SECAPI") << "Found cert in cache" << LL_ENDL;
+ // this cert is in the cache, so validate the time.
+ if (validation_policy & VALIDATION_POLICY_TIME)
+ {
+ LLDate validation_date(time(NULL));
+ if(validation_params.has(CERT_VALIDATION_DATE))
+ {
+ validation_date = validation_params[CERT_VALIDATION_DATE];
+ }
+
+ if((validation_date < cache_entry->second.first) ||
+ (validation_date > cache_entry->second.second))
+ {
+ throw LLCertValidationExpirationException((*current_cert), validation_date);
+ }
+ }
+ // successfully found in cache
+ return;
+ }
+ if(current_cert_info.isUndefined())
+ {
+ (*current_cert)->getLLSD(current_cert_info);
+ }
+ LLDate from_time = current_cert_info[CERT_VALID_FROM].asDate();
+ LLDate to_time = current_cert_info[CERT_VALID_TO].asDate();
int depth = 0;
LLPointer<LLCertificate> previous_cert;
// loop through the cert chain, validating the current cert against the next one.
- while(current_cert != end())
+ while(current_cert != cert_chain->end())
{
int local_validation_policy = validation_policy;
- if(current_cert == begin())
+ if(current_cert == cert_chain->begin())
{
// for the child cert, we don't validate CA stuff
local_validation_policy &= ~(VALIDATION_POLICY_CA_KU |
@@ -1065,23 +1109,23 @@ void LLBasicCertificateChain::validate(int validation_policy,
depth);
// look for a CA in the CA store that may belong to this chain.
- LLSD cert_llsd = (*current_cert)->getLLSD();
LLSD cert_search_params = LLSD::emptyMap();
// is the cert itself in the store?
- cert_search_params[CERT_SHA1_DIGEST] = cert_llsd[CERT_SHA1_DIGEST];
- LLCertificateStore::iterator found_store_cert = ca_store->find(cert_search_params);
- if(found_store_cert != ca_store->end())
+ cert_search_params[CERT_SHA1_DIGEST] = current_cert_info[CERT_SHA1_DIGEST];
+ LLCertificateStore::iterator found_store_cert = find(cert_search_params);
+ if(found_store_cert != end())
{
+ mTrustedCertCache[sha1_hash] = std::pair<LLDate, LLDate>(from_time, to_time);
return;
}
// is the parent in the cert store?
cert_search_params = LLSD::emptyMap();
- cert_search_params[CERT_SUBJECT_NAME_STRING] = cert_llsd[CERT_ISSUER_NAME_STRING];
- if (cert_llsd.has(CERT_AUTHORITY_KEY_IDENTIFIER))
+ cert_search_params[CERT_SUBJECT_NAME_STRING] = current_cert_info[CERT_ISSUER_NAME_STRING];
+ if (current_cert_info.has(CERT_AUTHORITY_KEY_IDENTIFIER))
{
- LLSD cert_aki = cert_llsd[CERT_AUTHORITY_KEY_IDENTIFIER];
+ LLSD cert_aki = current_cert_info[CERT_AUTHORITY_KEY_IDENTIFIER];
if(cert_aki.has(CERT_AUTHORITY_KEY_IDENTIFIER_ID))
{
cert_search_params[CERT_SUBJECT_KEY_IDENTFIER] = cert_aki[CERT_AUTHORITY_KEY_IDENTIFIER_ID];
@@ -1091,11 +1135,10 @@ void LLBasicCertificateChain::validate(int validation_policy,
cert_search_params[CERT_SERIAL_NUMBER] = cert_aki[CERT_AUTHORITY_KEY_IDENTIFIER_SERIAL];
}
}
- found_store_cert = ca_store->find(cert_search_params);
+ found_store_cert = find(cert_search_params);
- if(found_store_cert != ca_store->end())
+ if(found_store_cert != end())
{
- LLSD foo = (*found_store_cert)->getLLSD();
// validate the store cert against the depth
_validateCert(validation_policy & VALIDATION_POLICY_CA_BASIC_CONSTRAINTS,
(*found_store_cert),
@@ -1109,19 +1152,24 @@ void LLBasicCertificateChain::validate(int validation_policy,
throw LLCertValidationInvalidSignatureException(*current_cert);
}
// successfully validated.
+ mTrustedCertCache[sha1_hash] = std::pair<LLDate, LLDate>(from_time, to_time);
return;
}
previous_cert = (*current_cert);
current_cert++;
- depth++;
+ depth++;
+ if(current_cert != cert_chain->end())
+ {
+ (*current_cert)->getLLSD(current_cert_info);
+ }
}
if (validation_policy & VALIDATION_POLICY_TRUSTED)
{
- LLPointer<LLCertificate> untrusted_ca_cert = (*this)[size()-1];
// we reached the end without finding a trusted cert.
- throw LLCertValidationTrustException((*this)[size()-1]);
+ throw LLCertValidationTrustException((*cert_chain)[cert_chain->size()-1]);
}
+ mTrustedCertCache[sha1_hash] = std::pair<LLDate, LLDate>(from_time, to_time);
}
@@ -1159,7 +1207,7 @@ void LLSecAPIBasicHandler::init()
"CA.pem");
- LL_INFOS("SECAPI") << "Loading certificate store from " << store_file << LL_ENDL;
+ LL_DEBUGS("SECAPI") << "Loading certificate store from " << store_file << LL_ENDL;
mStore = new LLBasicCertificateStore(store_file);
// grab the application CA.pem file that contains the well-known certs shipped
@@ -1199,9 +1247,9 @@ void LLSecAPIBasicHandler::_readProtectedData()
U8 buffer[BUFFER_READ_SIZE];
U8 decrypted_buffer[BUFFER_READ_SIZE];
int decrypted_length;
- unsigned char MACAddress[MAC_ADDRESS_BYTES];
- LLUUID::getNodeID(MACAddress);
- LLXORCipher cipher(MACAddress, MAC_ADDRESS_BYTES);
+ unsigned char unique_id[MAC_ADDRESS_BYTES];
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ LLXORCipher cipher(unique_id, sizeof(unique_id));
// read in the salt and key
protected_data_stream.read((char *)salt, STORE_SALT_SIZE);
@@ -1285,9 +1333,9 @@ void LLSecAPIBasicHandler::_writeProtectedData()
EVP_CIPHER_CTX ctx;
EVP_CIPHER_CTX_init(&ctx);
EVP_EncryptInit(&ctx, EVP_rc4(), salt, NULL);
- unsigned char MACAddress[MAC_ADDRESS_BYTES];
- LLUUID::getNodeID(MACAddress);
- LLXORCipher cipher(MACAddress, MAC_ADDRESS_BYTES);
+ unsigned char unique_id[MAC_ADDRESS_BYTES];
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ LLXORCipher cipher(unique_id, sizeof(unique_id));
cipher.encrypt(salt, STORE_SALT_SIZE);
protected_data_stream.write((const char *)salt, STORE_SALT_SIZE);
@@ -1469,7 +1517,7 @@ void LLSecAPIBasicHandler::saveCredential(LLPointer<LLCredential> cred, bool sav
{
credential["authenticator"] = cred->getAuthenticator();
}
- LL_INFOS("SECAPI") << "Saving Credential " << cred->getGrid() << ":" << cred->userID() << " " << save_authenticator << LL_ENDL;
+ LL_DEBUGS("SECAPI") << "Saving Credential " << cred->getGrid() << ":" << cred->userID() << " " << save_authenticator << LL_ENDL;
setProtectedData("credential", cred->getGrid(), credential);
//*TODO: If we're saving Agni credentials, should we write the
// credentials to the legacy password.dat/etc?
@@ -1505,9 +1553,9 @@ std::string LLSecAPIBasicHandler::_legacyLoadPassword()
}
// Decipher with MAC address
- unsigned char MACAddress[MAC_ADDRESS_BYTES];
- LLUUID::getNodeID(MACAddress);
- LLXORCipher cipher(MACAddress, 6);
+ unsigned char unique_id[MAC_ADDRESS_BYTES];
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ LLXORCipher cipher(unique_id, sizeof(unique_id));
cipher.decrypt(&buffer[0], buffer.size());
return std::string((const char*)&buffer[0], buffer.size());
diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h
index 407e74ad00..356ea7efcb 100644
--- a/indra/newview/llsechandler_basic.h
+++ b/indra/newview/llsechandler_basic.h
@@ -59,12 +59,13 @@ public:
virtual std::string getPem() const;
virtual std::vector<U8> getBinary() const;
- virtual LLSD getLLSD() const;
+ virtual void getLLSD(LLSD &llsd);
virtual X509* getOpenSSLX509() const;
// set llsd elements for testing
void setLLSD(const std::string name, const LLSD& value) { mLLSDInfo[name] = value; }
+
protected:
// certificates are stored as X509 objects, as validation and
@@ -175,8 +176,21 @@ public:
// return the store id
virtual std::string storeId() const;
+ // validate a certificate chain against a certificate store, using the
+ // given validation policy.
+ virtual void validate(int validation_policy,
+ LLPointer<LLCertificateChain> ca_chain,
+ const LLSD& validation_params);
+
protected:
- std::vector<LLPointer<LLCertificate> >mCerts;
+ std::vector<LLPointer<LLCertificate> > mCerts;
+
+ // cache of cert sha1 hashes to from/to date pairs, to improve
+ // performance of cert trust. Note, these are not the CA certs,
+ // but the certs that have been validated against this store.
+ typedef std::map<std::string, std::pair<LLDate, LLDate> > t_cert_cache;
+ t_cert_cache mTrustedCertCache;
+
std::string mFilename;
};
@@ -191,11 +205,6 @@ public:
virtual ~LLBasicCertificateChain() {}
- // validate a certificate chain against a certificate store, using the
- // given validation policy.
- virtual void validate(int validation_policy,
- LLPointer<LLCertificateStore> ca_store,
- const LLSD& validation_params);
};
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 3719313c14..b66789448f 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -163,6 +163,8 @@ BOOL LLSidepanelAppearance::postBuild()
mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this);
gInventory.addObserver(mOutfitRenameWatcher);
+ setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2));
+
return TRUE;
}
@@ -201,6 +203,27 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
mOpened = true;
}
+void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
+{
+ if (new_visibility.asBoolean())
+ {
+ if ((mOutfitEdit && mOutfitEdit->getVisible()) || (mEditWearable && mEditWearable->getVisible()))
+ {
+ if (!gAgentCamera.cameraCustomizeAvatar())
+ {
+ gAgentCamera.changeCameraToCustomizeAvatar();
+ }
+ }
+ }
+ else
+ {
+ if (gAgentCamera.cameraCustomizeAvatar())
+ {
+ gAgentCamera.changeCameraToDefault();
+ }
+ }
+}
+
void LLSidepanelAppearance::onFilterEdit(const std::string& search_string)
{
if (mFilterSubString != search_string)
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index 5bde962c8d..30022ae375 100644
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -72,6 +72,7 @@ public:
private:
void onFilterEdit(const std::string& search_string);
+ void onVisibilityChange ( const LLSD& new_visibility );
void onOpenOutfitButtonClicked();
void onEditAppearanceButtonClicked();
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index d8b5618d8f..6418551517 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2732,7 +2732,8 @@ LLSD transform_cert_args(LLPointer<LLCertificate> cert)
{
LLSD args = LLSD::emptyMap();
std::string value;
- LLSD cert_info = cert->getLLSD();
+ LLSD cert_info;
+ cert->getLLSD(cert_info);
// convert all of the elements in the cert into
// args for the xml dialog, so we have flexability to
// display various parts of the cert by only modifying
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 3f3aefa4b5..7290849fca 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -138,21 +138,22 @@ void LLTexLayerSetBuffer::requestUpdate()
void LLTexLayerSetBuffer::requestUpload()
{
- // New upload request
- if (!mNeedsUpload)
+ // If we requested a new upload but haven't even uploaded
+ // a low res version of our last upload request, then
+ // keep the timer ticking instead of resetting it.
+ if (mNeedsUpload && mNeedsLowResUpload)
{
- mNeedsUploadTimer.start();
+ mNeedsUploadTimer.reset();
}
-
mNeedsUpload = TRUE;
mNeedsLowResUpload = TRUE;
mUploadPending = TRUE;
+ mNeedsUploadTimer.unpause();
}
void LLTexLayerSetBuffer::cancelUpload()
{
mNeedsUpload = FALSE;
- mNeedsLowResUpload = FALSE;
mUploadPending = FALSE;
mNeedsUploadTimer.pause();
}
@@ -254,7 +255,6 @@ BOOL LLTexLayerSetBuffer::render()
{
mUploadPending = FALSE;
mNeedsUpload = FALSE;
- mNeedsLowResUpload = FALSE;
mNeedsUploadTimer.pause();
mTexLayerSet->getAvatar()->setNewBakedTexture(mTexLayerSet->getBakedTexIndex(),IMG_INVISIBLE);
}
@@ -286,12 +286,13 @@ BOOL LLTexLayerSetBuffer::isReadyToUpload() const
const BOOL can_highest_lod = mTexLayerSet->isLocalTextureDataFinal();
if (can_highest_lod) return TRUE;
- if (gSavedSettings.getBOOL("AvatarUseBakedTextureTimeout"))
+ const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureTimeout");
+ if (texture_timeout)
{
// If we hit our timeout and have textures available at even lower resolution, then upload.
- const BOOL is_upload_textures_timeout = isUploadTimeout();
- const BOOL can_lower_lod = mTexLayerSet->isLocalTextureDataAvailable();
- if (can_lower_lod && is_upload_textures_timeout && mNeedsLowResUpload) return TRUE;
+ const BOOL is_upload_textures_timeout = mNeedsUploadTimer.getElapsedTimeF32() >= texture_timeout;
+ const BOOL has_lower_lod = mTexLayerSet->isLocalTextureDataAvailable();
+ if (has_lower_lod && is_upload_textures_timeout && mNeedsLowResUpload) return TRUE;
}
return FALSE;
}
@@ -437,7 +438,9 @@ void LLTexLayerSetBuffer::readBackAndUpload()
mNeedsUploadTimer.pause();
}
else
+ {
mNeedsLowResUpload = FALSE;
+ }
}
else
{
@@ -1089,7 +1092,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
}
if (mLocalTexture == TEX_NUM_INDICES)
{
- llwarns << "<texture> element has invalid local_texure attribute: " << mName << " " << local_texture_name << llendl;
+ llwarns << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << llendl;
return FALSE;
}
}
@@ -2227,14 +2230,6 @@ BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLIma
return success;
}
-BOOL LLTexLayerSetBuffer::isUploadTimeout() const
-{
- //const F32 BAKED_TEXTURES_TIMEOUT_THRESHOLD__SECONDS = 20.f;
- const F32 UPLOAD_TEXTURES_TIMEOUT_THRESHOLD__SECONDS = 5.f; // SERAPH Reduced timeout for testing.
-
- return (mNeedsUploadTimer.getElapsedTimeF32() >= UPLOAD_TEXTURES_TIMEOUT_THRESHOLD__SECONDS);
-}
-
const std::string LLTexLayerSetBuffer::dumpTextureInfo() const
{
if (!isAgentAvatarValid()) return "";
diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h
index f2d86032fb..8f386b5a19 100644
--- a/indra/newview/lltexlayer.h
+++ b/indra/newview/lltexlayer.h
@@ -366,10 +366,6 @@ private:
static S32 sGLByteCount;
- // Low res upload methods
-protected:
- BOOL isUploadTimeout() const;
-private:
LLFrameTimer mNeedsUploadTimer; // Tracks time since upload was requested
};
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 7fa04ce574..cf3bce2ec1 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -260,6 +260,7 @@ private:
BOOL mHaveAllData;
BOOL mInLocalCache;
bool mCanUseHTTP ;
+ bool mCanUseNET ; //can get from asset server.
S32 mHTTPFailCount;
S32 mRetryAttempt;
S32 mActiveCount;
@@ -426,6 +427,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
mTotalPackets(0),
mImageCodec(IMG_CODEC_INVALID)
{
+ mCanUseNET = mUrl.empty() ;
+
calcWorkPriority();
mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL;
// llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << llendl;
@@ -904,13 +907,16 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mGetStatus == HTTP_NOT_FOUND)
{
mHTTPFailCount = max_attempts = 1; // Don't retry
- //llinfos << "Texture missing from server (404): " << mUrl << llendl;
+ //llwarns << "Texture missing from server (404): " << mUrl << llendl;
//roll back to try UDP
- mState = INIT ;
- mCanUseHTTP = false ;
- setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
- return false ;
+ if(mCanUseNET)
+ {
+ mState = INIT ;
+ mCanUseHTTP = false ;
+ setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
+ return false ;
+ }
}
else if (mGetStatus == HTTP_SERVICE_UNAVAILABLE)
{
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index e04568d4ed..7a8b6557bb 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -418,7 +418,7 @@ void LLAvatarTexBar::draw()
const S32 v_offset = (S32)((texture_bar_height + 2.5f) * mTextureView->mNumTextureBars + 2.5f);
//----------------------------------------------------------------------------
LLGLSUIDefault gls_ui;
- LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
+ LLColor4 text_color(1.f, 1.f, 1.f, 1.f);
LLColor4 color;
U32 line_num = 6;
@@ -433,15 +433,17 @@ void LLAvatarTexBar::draw()
if (!layerset_buffer) continue;
std::string text = layerset_buffer->dumpTextureInfo();
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*line_num,
- text_color, LLFontGL::LEFT, LLFontGL::TOP);
+ text_color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT);
line_num++;
}
- /*
- std::string text = "Baked Textures:";
- LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*line_num,
- text_color, LLFontGL::LEFT, LLFontGL::TOP);
- */
-
+ const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureTimeout");
+ const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
+
+ const std::string texture_timeout_str = texture_timeout ? llformat("%d",texture_timeout) : "Disabled";
+ const std::string override_tex_discard_level_str = override_tex_discard_level ? llformat("%d",override_tex_discard_level) : "Disabled";
+ std::string header_text = llformat("[ Timeout('AvatarBakedTextureTimeout'):%s ] [ LOD_Override('TextureDiscardLevel'):%s ]", texture_timeout_str.c_str(), override_tex_discard_level_str.c_str());
+ LLFontGL::getFontMonospace()->renderUTF8(header_text, 0, 0, v_offset + line_height*line_num,
+ text_color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT);
}
BOOL LLAvatarTexBar::handleMouseDown(S32 x, S32 y, MASK mask)
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index 9efa6c4108..cbaa7248a2 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -215,7 +215,8 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
LLSD args;
args["SLURL"] = slurl.getLocationString();
args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel();
- LLSD grid_info = LLGridManager::getInstance()->getGridInfo(slurl.getGrid());
+ LLSD grid_info;
+ LLGridManager::getInstance()->getGridInfo(slurl.getGrid(), grid_info);
if(grid_info.has(GRID_LABEL_VALUE))
{
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index c76eee80f7..fec112b9e7 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -226,11 +226,11 @@ void LLGridManager::initialize(const std::string& grid_file)
LLSD grid = grid_itr->second;
// TODO: Make sure gridfile specified label is not
// a system grid label
- LL_INFOS("GridManager") << "reading: " << key_name << LL_ENDL;
+ LL_DEBUGS("GridManager") << "reading: " << key_name << LL_ENDL;
if (mGridList.has(key_name) &&
mGridList[key_name].has(GRID_IS_SYSTEM_GRID_VALUE))
{
- LL_INFOS("GridManager") << "Cannot override grid " << key_name << " as it's a system grid" << LL_ENDL;
+ LL_DEBUGS("GridManager") << "Cannot override grid " << key_name << " as it's a system grid" << LL_ENDL;
// If the system grid does exist in the grids file, and it's marked as a favorite, set it as a favorite.
if(grid_itr->second.has(GRID_IS_FAVORITE_VALUE) && grid_itr->second[GRID_IS_FAVORITE_VALUE].asBoolean() )
{
@@ -242,7 +242,7 @@ void LLGridManager::initialize(const std::string& grid_file)
try
{
addGrid(grid);
- LL_INFOS("GridManager") << "Added grid: " << key_name << LL_ENDL;
+ LL_DEBUGS("GridManager") << "Added grid: " << key_name << LL_ENDL;
}
catch (...)
{
@@ -260,84 +260,60 @@ void LLGridManager::initialize(const std::string& grid_file)
std::string cmd_line_grid = gSavedSettings.getString("CmdLineGridChoice");
if(!cmd_line_grid.empty())
{
+ // try to find the grid assuming the command line parameter is
+ // the case-insensitive 'label' of the grid. ie 'Agni'
mGrid = getGridByLabel(cmd_line_grid);
+ if(mGrid.empty())
+ {
+ // if we couldn't find it, assume the
+ // requested grid is the actual grid 'name' or index,
+ // which would be the dns name of the grid (for non
+ // linden hosted grids)
+ // If the grid isn't there, that's ok, as it will be
+ // automatically added later.
+ mGrid = cmd_line_grid;
+ }
+
+ }
+ else
+ {
+ // if a grid was not passed in via the command line, grab it from the CurrentGrid setting.
+ // if there's no current grid, that's ok as it'll be either set by the value passed
+ // in via the login uri if that's specified, or will default to maingrid
+ mGrid = gSavedSettings.getString("CurrentGrid");
}
- LL_INFOS("GridManager") << "Grid Name: " << mGrid << LL_ENDL;
- // If a command line login URI was passed in, so we should add the command
- // line grid to the list of grids
-
- LLSD cmd_line_login_uri = gSavedSettings.getLLSD("CmdLineLoginURI");
- if (cmd_line_login_uri.isString())
+ if(mGrid.empty())
{
- LL_INFOS("GridManager") << "adding cmd line login uri" << LL_ENDL;
- // grab the other related URI values
- std::string cmd_line_helper_uri = gSavedSettings.getString("CmdLineHelperURI");
- std::string cmd_line_login_page = gSavedSettings.getString("LoginPage");
+ // no grid was specified so default to maingrid
+ LL_DEBUGS("GridManager") << "Setting grid to MAINGRID as no grid has been specified " << LL_ENDL;
+ mGrid = MAINGRID;
- // we've a cmd line login, so add a grid for the command line,
- // overwriting any existing grids
- LLSD grid = LLSD::emptyMap();
- grid[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
- grid[GRID_LOGIN_URI_VALUE].append(cmd_line_login_uri);
- LL_INFOS("GridManager") << "cmd line login uri: " << cmd_line_login_uri.asString() << LL_ENDL;
- LLURI uri(cmd_line_login_uri.asString());
- if (mGrid.empty())
- {
- // if a grid name was not passed in via the command line,
- // then set the grid name based on the hostname of the
- // login uri
- mGrid = uri.hostName();
- }
-
- grid[GRID_VALUE] = mGrid;
-
- if (mGridList.has(mGrid) && mGridList[mGrid].has(GRID_LABEL_VALUE))
- {
- grid[GRID_LABEL_VALUE] = mGridList[mGrid][GRID_LABEL_VALUE];
- }
- else
- {
- grid[GRID_LABEL_VALUE] = mGrid;
- }
- if(!cmd_line_helper_uri.empty())
- {
- grid[GRID_HELPER_URI_VALUE] = cmd_line_helper_uri;
- }
-
- if(!cmd_line_login_page.empty())
- {
- grid[GRID_LOGIN_PAGE_VALUE] = cmd_line_login_page;
- }
- // if the login page, helper URI value, and so on are not specified,
- // add grid will generate them.
-
- // Also, we will override a system grid if values are passed in via the command
- // line, for testing. These values will not be remembered though.
- if (mGridList.has(mGrid) && mGridList[mGrid].has(GRID_IS_SYSTEM_GRID_VALUE))
- {
- grid[GRID_IS_SYSTEM_GRID_VALUE] = TRUE;
- }
- addGrid(grid);
}
- // if a grid was not passed in via the command line, grab it from the CurrentGrid setting.
- if (mGrid.empty())
+ // generate a 'grid list' entry for any command line parameter overrides
+ // or setting overides that we'll add to the grid list or override
+ // any grid list entries with.
+ LLSD grid = LLSD::emptyMap();
+
+ if(mGridList.has(mGrid))
{
-
- mGrid = gSavedSettings.getString("CurrentGrid");
+ grid = mGridList[mGrid];
}
-
- if (mGrid.empty() || !mGridList.has(mGrid))
+ else
{
- // the grid name was empty, or the grid isn't actually in the list, then set it to the
- // appropriate default.
- LL_INFOS("GridManager") << "Resetting grid as grid name " << mGrid << " is not in the list" << LL_ENDL;
- mGrid = MAINGRID;
+ grid[GRID_VALUE] = mGrid;
+ // add the grid with the additional values, or update the
+ // existing grid if it exists with the given values
+ addGrid(grid);
}
- LL_INFOS("GridManager") << "Selected grid is " << mGrid << LL_ENDL;
- gSavedSettings.setString("CurrentGrid", mGrid);
+ LL_DEBUGS("GridManager") << "Selected grid is " << mGrid << LL_ENDL;
+ setGridChoice(mGrid);
+ if(mGridList[mGrid][GRID_LOGIN_URI_VALUE].isArray())
+ {
+ llinfos << "is array" << llendl;
+ }
}
LLGridManager::~LLGridManager()
@@ -345,6 +321,36 @@ LLGridManager::~LLGridManager()
saveFavorites();
}
+void LLGridManager::getGridInfo(const std::string &grid, LLSD& grid_info)
+{
+
+ grid_info = mGridList[grid];
+
+ // override any grid data with the command line info.
+
+ LLSD cmd_line_login_uri = gSavedSettings.getLLSD("CmdLineLoginURI");
+ if (cmd_line_login_uri.isString())
+ {
+ grid_info[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
+ grid_info[GRID_LOGIN_URI_VALUE].append(cmd_line_login_uri);
+ }
+
+ // override the helper uri if it was passed in
+ std::string cmd_line_helper_uri = gSavedSettings.getString("CmdLineHelperURI");
+ if(!cmd_line_helper_uri.empty())
+ {
+ grid_info[GRID_HELPER_URI_VALUE] = cmd_line_helper_uri;
+ }
+
+ // override the login page if it was passed in
+ std::string cmd_line_login_page = gSavedSettings.getString("LoginPage");
+ if(!cmd_line_login_page.empty())
+ {
+ grid_info[GRID_LOGIN_PAGE_VALUE] = cmd_line_login_page;
+ }
+}
+
+
//
// LLGridManager::addGrid - add a grid to the grid list, populating the needed values
// if they're not populated yet.
@@ -401,7 +407,7 @@ void LLGridManager::addGrid(LLSD& grid_data)
grid_data[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_ACCOUNT);
}
- LL_INFOS("GridManager") << "ADDING: " << grid << LL_ENDL;
+ LL_DEBUGS("GridManager") << "ADDING: " << grid << LL_ENDL;
mGridList[grid] = grid_data;
}
}
@@ -467,6 +473,7 @@ std::map<std::string, std::string> LLGridManager::getKnownGrids(bool favorite_on
return result;
}
+
void LLGridManager::setGridChoice(const std::string& grid)
{
// Set the grid choice based on a string.
@@ -477,35 +484,37 @@ void LLGridManager::setGridChoice(const std::string& grid)
// loop through. We could do just a hash lookup but we also want to match
// on label
- for(LLSD::map_iterator grid_iter = mGridList.beginMap();
- grid_iter != mGridList.endMap();
- grid_iter++)
+ std::string grid_name = grid;
+ if(!mGridList.has(grid_name))
{
- if((grid == grid_iter->first) ||
- (grid == grid_iter->second[GRID_LABEL_VALUE].asString()))
- {
- mGrid = grid_iter->second[GRID_VALUE].asString();
- gSavedSettings.setString("CurrentGrid", grid_iter->second[GRID_VALUE]);
- return;
-
- }
+ // case insensitive
+ grid_name = getGridByLabel(grid);
+ }
+
+ if(grid_name.empty())
+ {
+ // the grid was not in the list of grids.
+ LLSD grid_data = LLSD::emptyMap();
+ grid_data[GRID_VALUE] = grid;
+ addGrid(grid_data);
}
- LLSD grid_data = LLSD::emptyMap();
- grid_data[GRID_VALUE] = grid;
- addGrid(grid_data);
mGrid = grid;
gSavedSettings.setString("CurrentGrid", grid);
}
-std::string LLGridManager::getGridByLabel( const std::string &grid_label)
+std::string LLGridManager::getGridByLabel( const std::string &grid_label, bool case_sensitive)
{
for(LLSD::map_iterator grid_iter = mGridList.beginMap();
grid_iter != mGridList.endMap();
grid_iter++)
{
- if (grid_iter->second.has(GRID_LABEL_VALUE) && (grid_iter->second[GRID_LABEL_VALUE].asString() == grid_label))
+ if (grid_iter->second.has(GRID_LABEL_VALUE))
{
- return grid_iter->first;
+ if (0 == (case_sensitive?LLStringUtil::compareStrings(grid_label, grid_iter->second[GRID_LABEL_VALUE].asString()):
+ LLStringUtil::compareInsensitive(grid_label, grid_iter->second[GRID_LABEL_VALUE].asString())))
+ {
+ return grid_iter->first;
+ }
}
}
return std::string();
@@ -514,6 +523,12 @@ std::string LLGridManager::getGridByLabel( const std::string &grid_label)
void LLGridManager::getLoginURIs(std::vector<std::string>& uris)
{
uris.clear();
+ LLSD cmd_line_login_uri = gSavedSettings.getLLSD("CmdLineLoginURI");
+ if (cmd_line_login_uri.isString())
+ {
+ uris.push_back(cmd_line_login_uri);
+ return;
+ }
for (LLSD::array_iterator llsd_uri = mGridList[mGrid][GRID_LOGIN_URI_VALUE].beginArray();
llsd_uri != mGridList[mGrid][GRID_LOGIN_URI_VALUE].endArray();
llsd_uri++)
@@ -522,6 +537,28 @@ void LLGridManager::getLoginURIs(std::vector<std::string>& uris)
}
}
+std::string LLGridManager::getHelperURI()
+{
+ std::string cmd_line_helper_uri = gSavedSettings.getString("CmdLineHelperURI");
+ if(!cmd_line_helper_uri.empty())
+ {
+ return cmd_line_helper_uri;
+ }
+ return mGridList[mGrid][GRID_HELPER_URI_VALUE];
+}
+
+std::string LLGridManager::getLoginPage()
+{
+ // override the login page if it was passed in
+ std::string cmd_line_login_page = gSavedSettings.getString("LoginPage");
+ if(!cmd_line_login_page.empty())
+ {
+ return cmd_line_login_page;
+ }
+
+ return mGridList[mGrid][GRID_LOGIN_PAGE_VALUE];
+}
+
bool LLGridManager::isInProductionGrid()
{
// *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice,
diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h
index 0271e7a7a5..8c3a15b7cf 100644
--- a/indra/newview/llviewernetwork.h
+++ b/indra/newview/llviewernetwork.h
@@ -89,17 +89,7 @@ public:
// by default only return the user visible grids
std::map<std::string, std::string> getKnownGrids(bool favorites_only=FALSE);
- LLSD getGridInfo(const std::string& grid)
- {
- if(mGridList.has(grid))
- {
- return mGridList[grid];
- }
- else
- {
- return LLSD();
- }
- }
+ void getGridInfo(const std::string& grid, LLSD &grid_info);
// current grid management
@@ -112,8 +102,8 @@ public:
std::string getGridLabel() { return mGridList[mGrid][GRID_LABEL_VALUE]; }
std::string getGrid() const { return mGrid; }
void getLoginURIs(std::vector<std::string>& uris);
- std::string getHelperURI() {return mGridList[mGrid][GRID_HELPER_URI_VALUE];}
- std::string getLoginPage() {return mGridList[mGrid][GRID_LOGIN_PAGE_VALUE];}
+ std::string getHelperURI();
+ std::string getLoginPage();
std::string getGridLoginID() { return mGridList[mGrid][GRID_ID_VALUE]; }
std::string getLoginPage(const std::string& grid) { return mGridList[grid][GRID_LOGIN_PAGE_VALUE]; }
void getLoginIdentifierTypes(LLSD& idTypes) { idTypes = mGridList[mGrid][GRID_LOGIN_IDENTIFIER_TYPES]; }
@@ -125,9 +115,9 @@ public:
std::string getAppSLURLBase(const std::string& grid);
std::string getAppSLURLBase() { return getAppSLURLBase(mGrid); }
- LLSD getGridInfo() { return mGridList[mGrid]; }
+ void getGridInfo(LLSD &grid_info) { getGridInfo(mGrid, grid_info); }
- std::string getGridByLabel( const std::string &grid_label);
+ std::string getGridByLabel( const std::string &grid_label, bool case_sensitive = false);
bool isSystemGrid(const std::string& grid)
{
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 74c46f3070..1bd4cc793d 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -293,8 +293,8 @@ protected:
INACTIVE, //not be used for the last certain period (i.e., 30 seconds).
ACTIVE, //just being used, can become inactive if not being used for a certain time (10 seconds).
NO_DELETE = 99 //stay in memory, can not be removed.
- } LLGLTexureState;
- LLGLTexureState mTextureState ;
+ } LLGLTextureState;
+ LLGLTextureState mTextureState ;
public:
static const U32 sCurrentFileVersion;
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index d8918bdb73..1e3311dafe 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -478,7 +478,7 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,
}
else
{
- //by default, the texure can not be removed from memory even if it is not used.
+ //by default, the texture can not be removed from memory even if it is not used.
//here turn this off
//if this texture should be set to NO_DELETE, call setNoDelete() afterwards.
imagep->forceActive() ;
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 9df5abd38c..ce8f64404e 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -1302,6 +1302,32 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLTexLayerSet* layerset) cons
return FALSE;
}
+BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const
+{
+ const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
+
+ for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
+ {
+ const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i);
+ for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
+ local_tex_iter != baked_dict->mLocalTextures.end();
+ ++local_tex_iter)
+ {
+ const ETextureIndex tex_index = *local_tex_iter;
+ const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(tex_index);
+ const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type);
+ for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++)
+ {
+ if (getLocalDiscardLevel(*local_tex_iter, wearable_index) > (S32)(override_tex_discard_level))
+ {
+ return FALSE;
+ }
+ }
+ }
+ }
+ return TRUE;
+}
+
BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index) const
{
LLUUID id;
@@ -1831,7 +1857,7 @@ void LLVOAvatarSelf::debugBakedTextureUpload(EBakedTextureIndex index, BOOL fini
mDebugBakedTextureTimes[index][done] = mDebugSelfLoadTimer.getElapsedTimeF32();
}
-std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLTexLayerSet* layerset) const
+const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLTexLayerSet* layerset) const
{
std::string text="";
@@ -1847,7 +1873,7 @@ std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLTexLayerSet* l
if (layerset == mBakedTextureDatas[baked_index].mTexLayerSet)
{
const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second;
- text += llformat("[%d] '%s' ",baked_index, baked_dict->mName.c_str());
+ text += llformat("[%d] '%s' ( ",baked_index, baked_dict->mName.c_str());
for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
local_tex_iter != baked_dict->mLocalTextures.end();
++local_tex_iter)
@@ -1866,12 +1892,39 @@ std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLTexLayerSet* l
}
}
}
+ text += ")";
break;
}
}
return text;
}
+const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const
+{
+ std::string text;
+ const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
+
+ for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
+ {
+ const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i);
+ BOOL is_texture_final = TRUE;
+ for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
+ local_tex_iter != baked_dict->mLocalTextures.end();
+ ++local_tex_iter)
+ {
+ const ETextureIndex tex_index = *local_tex_iter;
+ const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(tex_index);
+ const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type);
+ for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++)
+ {
+ is_texture_final &= (getLocalDiscardLevel(*local_tex_iter, wearable_index) <= (S32)(override_tex_discard_level));
+ }
+ }
+ text += llformat("%s:%d ",baked_dict->mName.c_str(),is_texture_final);
+ }
+ return text;
+}
+
const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const
{
if (canGrabBakedTexture(baked_index))
@@ -2053,7 +2106,15 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid )
LLSD args;
args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
args["TIME"] = llformat("%d",(U32)mDebugSelfLoadTimer.getElapsedTimeF32());
- LLNotificationsUtil::add("AvatarRezSelfNotification",args);
+ if (isAllLocalTextureDataFinal())
+ {
+ LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args);
+ }
+ else
+ {
+ args["STATUS"] = debugDumpAllLocalTextureDataInfo();
+ LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args);
+ }
}
outputRezDiagnostics();
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index ad92807a72..e461dc07da 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -349,21 +349,24 @@ public:
LLUUID mAvatarID;
LLVOAvatarDefines::ETextureIndex mIndex;
};
- void debugWearablesLoaded() { mDebugTimeWearablesLoaded = mDebugSelfLoadTimer.getElapsedTimeF32(); }
- void debugAvatarVisible() { mDebugTimeAvatarVisible = mDebugSelfLoadTimer.getElapsedTimeF32(); }
- void outputRezDiagnostics() const;
- void debugBakedTextureUpload(LLVOAvatarDefines::EBakedTextureIndex index, BOOL finished);
- static void debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
-
- const LLTexLayerSet* debugGetLayerSet(LLVOAvatarDefines::EBakedTextureIndex index) const { return mBakedTextureDatas[index].mTexLayerSet; }
- std::string debugDumpLocalTextureDataInfo(const LLTexLayerSet* layerset) const;
+ void debugWearablesLoaded() { mDebugTimeWearablesLoaded = mDebugSelfLoadTimer.getElapsedTimeF32(); }
+ void debugAvatarVisible() { mDebugTimeAvatarVisible = mDebugSelfLoadTimer.getElapsedTimeF32(); }
+ void outputRezDiagnostics() const;
+ void debugBakedTextureUpload(LLVOAvatarDefines::EBakedTextureIndex index, BOOL finished);
+ static void debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
+
+ BOOL isAllLocalTextureDataFinal() const;
+
+ const LLTexLayerSet* debugGetLayerSet(LLVOAvatarDefines::EBakedTextureIndex index) const { return mBakedTextureDatas[index].mTexLayerSet; }
+ const std::string debugDumpLocalTextureDataInfo(const LLTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer
+ const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD
private:
- LLFrameTimer mDebugSelfLoadTimer;
- F32 mDebugTimeWearablesLoaded;
- F32 mDebugTimeAvatarVisible;
- F32 mDebugTextureLoadTimes[LLVOAvatarDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level
- F32 mDebugBakedTextureTimes[LLVOAvatarDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture
- void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
+ LLFrameTimer mDebugSelfLoadTimer;
+ F32 mDebugTimeWearablesLoaded;
+ F32 mDebugTimeAvatarVisible;
+ F32 mDebugTextureLoadTimes[LLVOAvatarDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level
+ F32 mDebugBakedTextureTimes[LLVOAvatarDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture
+ void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
/** Diagnostics
** **
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index fb7577c008..161cd40cfc 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -251,6 +251,11 @@ BOOL LLPanelDummyClothingListItem::postBuild()
return TRUE;
}
+LLWearableType::EType LLPanelDummyClothingListItem::getWearableType() const
+{
+ return mWearableType;
+}
+
LLPanelDummyClothingListItem::LLPanelDummyClothingListItem(LLWearableType::EType w_type)
: LLPanelWearableListItem(NULL)
, mWearableType(w_type)
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index 7ad1b5a3ad..de024ed220 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -162,6 +162,7 @@ public:
/*virtual*/ void updateItem();
/*virtual*/ BOOL postBuild();
+ LLWearableType::EType getWearableType() const;
protected:
LLPanelDummyClothingListItem(LLWearableType::EType w_type);
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index bc7f8ec854..a8ac0c0c90 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -248,7 +248,8 @@ int LLXMLRPCTransaction::Impl::_sslCertVerifyCallback(X509_STORE_CTX *ctx, void
validation_params[CERT_HOSTNAME] = uri.hostName();
try
{
- chain->validate(VALIDATION_POLICY_SSL, store, validation_params);
+ // don't validate hostname. Let libcurl do it instead. That way, it'll handle redirects
+ store->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), chain, validation_params);
}
catch (LLCertValidationTrustException& cert_exception)
{
@@ -512,7 +513,6 @@ void LLXMLRPCTransaction::Impl::setStatus(EStatus status,
// Usually this means that there's a problem with the login server,
// not with the client. Direct user to status page.
mStatusMessage = LLTrans::getString("server_is_down");
-
mStatusURI = "http://secondlife.com/status/";
}
}
@@ -547,7 +547,7 @@ void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code)
"Often this means that your computer\'s clock is set incorrectly.\n"
"Please go to Control Panels and make sure the time and date\n"
"are set correctly.\n"
- "\n"
+ "Also check that your network and firewall are set up correctly.\n"
"If you continue to receive this error, please go\n"
"to the Support section of the SecondLife.com web site\n"
"and report the problem.";
diff --git a/indra/newview/skins/default/textures/containers/Toolbar_Left_Flash.png b/indra/newview/skins/default/textures/containers/Toolbar_Left_Flash.png
new file mode 100644
index 0000000000..9f1e2a469d
--- /dev/null
+++ b/indra/newview/skins/default/textures/containers/Toolbar_Left_Flash.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/containers/Toolbar_Middle_Flash.png b/indra/newview/skins/default/textures/containers/Toolbar_Middle_Flash.png
new file mode 100644
index 0000000000..dd73d655e9
--- /dev/null
+++ b/indra/newview/skins/default/textures/containers/Toolbar_Middle_Flash.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/containers/Toolbar_Right_Flash.png b/indra/newview/skins/default/textures/containers/Toolbar_Right_Flash.png
new file mode 100644
index 0000000000..f6b775c2a0
--- /dev/null
+++ b/indra/newview/skins/default/textures/containers/Toolbar_Right_Flash.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Generic_Group_Large.png b/indra/newview/skins/default/textures/icons/Generic_Group_Large.png
index c067646c65..de8a39fc8a 100644
--- a/indra/newview/skins/default/textures/icons/Generic_Group_Large.png
+++ b/indra/newview/skins/default/textures/icons/Generic_Group_Large.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 29c72a414b..072ea40ee4 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -527,15 +527,18 @@ with the same filename but different name
<texture name="Tool_Grab" file_name="build/Tool_Grab.png" preload="false" />
<texture name="Tool_Zoom" file_name="build/Tool_Zoom.png" preload="false" />
+ <texture name="Toolbar_Left_Flash" file_name="containers/Toolbar_Left_Flash.png" preload="false" scale.left="5" scale.bottom="4" scale.top="24" scale.right="30" />
<texture name="Toolbar_Left_Off" file_name="containers/Toolbar_Left_Off.png" preload="false" scale.left="5" scale.bottom="4" scale.top="24" scale.right="30" />
<texture name="Toolbar_Left_Over" file_name="containers/Toolbar_Left_Over.png" preload="false" scale.left="5" scale.bottom="4" scale.top="24" scale.right="30" />
<texture name="Toolbar_Left_Selected" file_name="containers/Toolbar_Left_Selected.png" preload="false" scale.left="5" scale.bottom="4" scale.top="24" scale.right="30" />
<texture name="Toolbar_Middle_Off" file_name="containers/Toolbar_Middle_Off.png" preload="false" scale.left="1" scale.bottom="2" scale.top="24" scale.right="30" />
<texture name="Toolbar_Middle_Over" file_name="containers/Toolbar_Middle_Over.png" preload="false" scale.left="1" scale.bottom="2" scale.top="24" scale.right="30" />
<texture name="Toolbar_Middle_Selected" file_name="containers/Toolbar_Middle_Selected.png" preload="false" scale.left="1" scale.bottom="2" scale.top="24" scale.right="30" />
+ <texture name="Toolbar_Middle_Flash" file_name="containers/Toolbar_Middle_Flash.png" preload="false" scale.left="5" scale.bottom="4" scale.top="24" scale.right="30" />
<texture name="Toolbar_Right_Off" file_name="containers/Toolbar_Right_Off.png" preload="false" scale.left="1" scale.bottom="4" scale.top="24" scale.right="26" />
<texture name="Toolbar_Right_Over" file_name="containers/Toolbar_Right_Over.png" preload="false" scale.left="1" scale.bottom="4" scale.top="24" scale.right="26" />
<texture name="Toolbar_Right_Selected" file_name="containers/Toolbar_Right_Selected.png" preload="false" scale.left="1" scale.bottom="4" scale.top="24" scale.right="26" />
+ <texture name="Toolbar_Right_Flash" file_name="containers/Toolbar_Right_Flash.png" preload="false" scale.left="1" scale.bottom="4" scale.top="24" scale.right="26" />
<texture name="Tooltip" file_name="widgets/Tooltip.png" preload="true" scale.left="2" scale.top="16" scale.right="100" scale.bottom="3" />
diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml
index ced8c29199..e123de46c2 100644
--- a/indra/newview/skins/default/xui/en/floater_im_container.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -27,7 +27,14 @@
halign="left"
use_ellipses="true"
top="0"
- width="394" />
+ width="394">
+ <first_tab
+ tab_bottom_image_flash="Toolbar_Left_Flash"/>
+ <middle_tab
+ tab_bottom_image_flash="Toolbar_Middle_Flash"/>
+ <last_tab
+ tab_bottom_image_flash="Toolbar_Right_Flash"/>
+ </tab_container>
<icon
color="DefaultShadowLight"
enabled="false"
diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml
index 9ca18d455b..49b3b58113 100644
--- a/indra/newview/skins/default/xui/en/floater_search.xml
+++ b/indra/newview/skins/default/xui/en/floater_search.xml
@@ -9,6 +9,7 @@
name="floater_search"
help_topic="floater_search"
save_rect="true"
+ save_visibility="true"
single_instance="true"
title="FIND"
width="650">
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 7dcf2aab99..f3d297c303 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -62,6 +62,7 @@
name="share_to_web"
top_delta="0"
left="10"
+ visible="false"
width="130"/>
<button
label="Save to My Inventory"
diff --git a/indra/newview/skins/default/xui/en/menu_save_outfit.xml b/indra/newview/skins/default/xui/en/menu_save_outfit.xml
index a8778df7f6..6285bf7417 100644
--- a/indra/newview/skins/default/xui/en/menu_save_outfit.xml
+++ b/indra/newview/skins/default/xui/en/menu_save_outfit.xml
@@ -14,9 +14,9 @@
</menu_item_call>
<menu_item_call
name="save_as_new_outfit"
- label="Save As New">
+ label="Save As">
<menu_item_call.on_click
- function="Outfit.SaveAsNew.Action"
+ function="Outfit.SaveAs.Action"
userdata="" />
</menu_item_call>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 49154c68a0..791bec9701 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6174,15 +6174,24 @@ Deed to group failed.
name="AvatarRezNotification"
type="notifytip">
( [EXISTENCE] seconds alive )
-Avatar '[NAME]' declouded in [TIME] seconds.
+Avatar '[NAME]' declouded after [TIME] seconds.
</notification>
<notification
icon="notifytip.tga"
- name="AvatarRezSelfNotification"
+ name="AvatarRezSelfBakedDoneNotification"
type="notifytip">
( [EXISTENCE] seconds alive )
-You finished baking your outfit in [TIME] seconds.
+You finished baking your outfit after [TIME] seconds.
+ </notification>
+
+ <notification
+ icon="notifytip.tga"
+ name="AvatarRezSelfBakedUpdateNotification"
+ type="notifytip">
+( [EXISTENCE] seconds alive )
+You sent out an update of your appearance after [TIME] seconds.
+[STATUS]
</notification>
@@ -6226,6 +6235,37 @@ Avatar '[NAME]' entered appearance mode.
Avatar '[NAME]' left appearance mode.
</notification>
+ <notification
+ icon="alertmodal.tga"
+ name="NoConnect"
+ type="alertmodal">
+ We're having trouble connecting using [PROTOCOL] [HOSTID].
+ Please check your network and firewall setup.
+ <form name="form">
+ <button
+ default="true"
+ index="0"
+ name="OK"
+ text="OK"/>
+ </form>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="NoVoiceConnect"
+ type="alertmodal">
+ We're having trouble connecting your voiceserver using [HOSTID].
+ Voice communications will not be available.
+ Please check your network and firewall setup.
+ <form name="form">
+ <button
+ default="true"
+ index="0"
+ name="OK"
+ text="OK"/>
+ </form>
+ </notification>
+
<notification
icon="notifytip.tga"
name="AvatarRezLeftNotification"
diff --git a/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml b/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml
index 066992b25d..44437d01eb 100644
--- a/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml
+++ b/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml
@@ -8,6 +8,7 @@
height="45"
layout="topleft"
name="Mockup Tab"
+ selection_enabled="true"
title="Mockup Tab"
translate="false"
width="0">
@@ -18,5 +19,6 @@
multi_select="true"
name="wearable_items_list"
translate="false"
+ use_internal_context_menu="false"
/>
</accordion_tab>
diff --git a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml
index 6d02dd41de..23a08344ea 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml
@@ -25,49 +25,58 @@
can_apply_immediately="true"
default_image_name="Default"
follows="left|top"
- height="100"
+ height="115"
label="Head Tattoo"
layout="topleft"
- left="30"
+ left="20"
name="Head Tattoo"
tool_tip="Click to choose a picture"
top="10"
- width="94" />
+ width="115" >
+ <texture_picker.commit_callback
+ function="TexturePicker.Commit" />
+ </texture_picker>
<texture_picker
can_apply_immediately="true"
default_image_name="Default"
follows="left|top"
- height="100"
+ height="115"
label="Upper Tattoo"
layout="topleft"
left_pad="30"
name="Upper Tattoo"
tool_tip="Click to choose a picture"
top="10"
- width="94" />
+ width="115" >
+ <texture_picker.commit_callback
+ function="TexturePicker.Commit" />
+ </texture_picker>
<texture_picker
can_apply_immediately="true"
default_image_name="Default"
follows="left|top"
- height="100"
+ height="115"
label="Lower Tattoo"
layout="topleft"
- left="30"
+ left="20"
name="Lower Tattoo"
tool_tip="Click to choose a picture"
top_pad="10"
- width="94" />
+ width="115" >
+ <texture_picker.commit_callback
+ function="TexturePicker.Commit" />
+ </texture_picker>
<color_swatch
can_apply_immediately="true"
follows="left|top"
- height="80"
+ height="115"
label="Color/Tint"
layout="topleft"
- left_pad="20"
+ left_pad="30"
name="Color/Tint"
tool_tip="Click to open color picker"
- top="10"
- width="64" >
+ top_delta="0"
+ width="115" >
<color_swatch.commit_callback
function="ColorSwatch.Commit" />
</color_swatch>
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
index bc984ccc44..abd96c89e7 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
@@ -160,7 +160,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
clip="false"
default_tab_group="2"
follows="all"
- height="495"
+ height="468"
width="313"
layout="topleft"
orientation="vertical"
@@ -170,7 +170,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
left="5">
<layout_panel
layout="topleft"
- height="220"
+ height="193"
label="IM Control Panel"
min_height="100"
name="outfit_wearables_panel"
@@ -190,40 +190,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap
name="cof_wearables_list"
top="0"
width="311" />
-
- <!-- Button bar -->
- <panel
- background_visible="true"
- bevel_style="none"
- follows="bottom|left|right"
- height="27"
- label="bottom_panel"
- layout="topleft"
- left="0"
- name="edit_panel"
- top="193"
- width="313">
- <button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="gear_menu_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_right_icon"
- width="281" />
- </panel>
</layout_panel>
@@ -232,7 +198,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
bg_alpha_color="DkGray2"
auto_resize="true"
default_tab_group="3"
- height="211"
+ height="184"
min_height="210"
name="add_wearables_panel"
width="313"
@@ -360,82 +326,98 @@ It is calculated as border_size + 2*UIResizeBarOverlap
</panel>
</layout_panel>
</layout_stack>
-
- <panel
- background_visible="true"
- bevel_style="none"
- follows="left|right|bottom"
- height="27"
- label="add_wearables_button_bar"
- layout="topleft"
- left="0"
- name="add_wearables_button_bar"
- top_pad="0"
- width="313">
- <button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="wearables_gear_menu_btn"
- top="1"
- width="31" />
- <button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Middle_Over"
- image_overlay="Hierarchy_View_Disabled"
- image_selected="Toolbar_Middle_Selected"
- image_unselected="Toolbar_Middle_Off"
- is_toggle="true"
- layout="topleft"
- left_pad="1"
- name="folder_view_btn"
- top="1"
- width="31" />
- <button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Middle_Over"
- image_overlay="List_View_On"
- image_selected="Toolbar_Middle_Selected"
- image_unselected="Toolbar_Middle_Off"
- is_toggle="true"
- layout="topleft"
- left_pad="1"
- name="list_view_btn"
- top="1"
- width="31" />
- <button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Middle_Over"
- image_overlay="AddItem_Off"
- image_selected="Toolbar_Middle_Selected"
- image_unselected="Toolbar_Middle_Off"
- label=""
- layout="topleft"
- left_pad="1"
- name="add_to_outfit_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_right_icon"
- width="184" >
- </icon>
- </panel>
- </layout_panel>
+ </layout_panel>
</layout_stack>
+ <!-- Button bar -->
+ <panel
+ background_visible="true"
+ bevel_style="none"
+ follows="left|right|bottom"
+ height="27"
+ label="add_wearables_button_bar"
+ layout="topleft"
+ left="4"
+ name="add_wearables_button_bar"
+ top_pad="0"
+ width="313">
+ <button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Left_Over"
+ image_overlay="OptionsMenu_Off"
+ image_selected="Toolbar_Left_Selected"
+ image_unselected="Toolbar_Left_Off"
+ layout="topleft"
+ left="0"
+ name="wearables_gear_menu_btn"
+ top="1"
+ width="31" />
+ <button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Hierarchy_View_Disabled"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ is_toggle="true"
+ layout="topleft"
+ left_pad="1"
+ name="folder_view_btn"
+ top="1"
+ visible="false"
+ width="31" />
+ <button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="List_View_On"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ is_toggle="true"
+ layout="topleft"
+ left_pad="1"
+ name="list_view_btn"
+ top="1"
+ visible="false"
+ width="31" />
+ <button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="AddItem_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ label=""
+ layout="topleft"
+ left_pad="1"
+ name="add_to_outfit_btn"
+ top="1"
+ visible="false"
+ width="31" />
+ <icon
+ follows="bottom|left|right"
+ height="25"
+ image_name="Toolbar_Right_Off"
+ layout="topleft"
+ left_pad="1"
+ name="add_wearables_dummy_icon"
+ top="1"
+ visible="false"
+ width="184" >
+ </icon>
+ <icon
+ follows="bottom|left|right"
+ height="25"
+ image_name="Toolbar_Right_Off"
+ layout="topleft"
+ left="32"
+ name="dummy_right_icon"
+ top="1"
+ width="281" >
+ </icon>
+ </panel>
+
<panel
follows="left|right|bottom"
height="30"
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
index 9e59651bd1..13e1f5ba5c 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
@@ -93,17 +93,30 @@
left_pad="1"
name="trash_btn"
tool_tip="Remove selected item"
- width="31"/>
- <button
- follows="bottom|left"
- height="23"
- label="Save Outfit"
- layout="topleft"
- name="make_outfit_btn"
- tool_tip="Save appearance as an outfit"
+ width="31"/>
+ <button
+ follows="bottom|left"
+ height="23"
+ label="Save As"
+ left="0"
+ layout="topleft"
+ name="save_btn"
top_pad="6"
- left="0"
- width="153" />
+ width="155" />
+ <button
+ follows="bottom|left"
+ height="23"
+ name="save_flyout_btn"
+ label=""
+ layout="topleft"
+ left_pad="-20"
+ tab_stop="false"
+ image_selected="SegmentedBtn_Right_Selected_Press"
+ image_unselected="SegmentedBtn_Right_Off"
+ image_pressed="SegmentedBtn_Right_Press"
+ image_pressed_selected="SegmentedBtn_Right_Selected_Press"
+ image_overlay="Arrow_Small_Up"
+ width="20"/>
<button
follows="bottom|left|right"
height="23"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c67ba4ec76..9e0e5b087d 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -48,12 +48,10 @@
<string name="LoginDownloadingClothing">Downloading clothing...</string>
<string name="InvalidCertificate">The server returned an invalid or corrupt certificate. Please contact the Grid administrator.</string>
<string name="CertInvalidHostname">An invalid hostname was used to access the server, please check your SLURL or Grid hostname.</string>
- <string name="CertExpired">The certificate returned by the Grid appears to be expired. Please check your system clock, or contact your Grid administr\
-ator.</string>
+ <string name="CertExpired">The certificate returned by the Grid appears to be expired. Please check your system clock, or contact your Grid administrator.</string>
<string name="CertKeyUsage">The certificate returned by the server could not be used for SSL. Please contact your Grid administrator.</string>
<string name="CertBasicConstraints">Too many certificates were in the servers Certificate chain. Please contact your Grid administrator.</string>
- <string name="CertInvalidSignature">The certificate signature returned by the Grid server could not be verified. Please contact your Grid administrat
-or.</string>
+ <string name="CertInvalidSignature">The certificate signature returned by the Grid server could not be verified. Please contact your Grid administrator.</string>
<string name="LoginFailedNoNetwork">Network Error: Could not establish connection, please check your network connection.</string>
<string name="LoginFailed">Login failed.</string>
@@ -3182,7 +3180,23 @@ Abuse Report</string>
<string name="server_is_down">
Despite our best efforts, something unexpected has gone wrong.
- Please check secondlife.com/status to see if there is a known problem with the service.
+ Please check secondlife.com/status to see if there is a known problem with the service.
+ If you continue to experience problems, please check your network and firewall setup.
</string>
+ <!-- overriding datetime formating.
+ leave emtpy in for current localization this is not needed
+ list of values should be separated with ':'
+ example:
+ <string name="dateTimeWeekdaysShortNames">
+ Son:Mon:Tue:Wed:Thu:Fri:Sat
+ </string>
+ -->
+ <string name="dateTimeWeekdaysNames"></string>
+ <string name="dateTimeWeekdaysShortNames"></string>
+ <string name="dateTimeMonthNames"></string>
+ <string name="dateTimeMonthShortNames"></string>
+ <string name="dateTimeDayFormat"></string>
+ <string name="dateTimeAM"></string>
+ <string name="dateTimePM"></string>
</strings>
diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml
index c4f0fe5208..6dcc27b469 100644
--- a/indra/newview/skins/default/xui/en/widgets/button.xml
+++ b/indra/newview/skins/default/xui/en/widgets/button.xml
@@ -7,6 +7,7 @@
image_selected="PushButton_Selected"
image_disabled_selected="PushButton_Selected_Disabled"
image_disabled="PushButton_Disabled"
+ image_flash="FlashIconAbsent"
image_top_pad="0"
image_bottom_pad="0"
imgoverlay_label_space="1"
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 8d6b0c1cfe..30b0a8462a 100644
--- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
@@ -13,20 +13,29 @@ label_pad_left - padding to the left of tab button labels
label_pad_left="4">
<first_tab tab_top_image_unselected="TabTop_Left_Off"
tab_top_image_selected="TabTop_Left_Selected"
+ tab_top_image_flash="FlashIconAbsent"
tab_bottom_image_unselected="Toolbar_Left_Off"
tab_bottom_image_selected="Toolbar_Left_Selected"
+ tab_bottom_image_flash="FlashIconAbsent"
tab_left_image_unselected="SegmentedBtn_Left_Disabled"
- tab_left_image_selected="SegmentedBtn_Left_Selected_Over"/>
+ tab_left_image_selected="SegmentedBtn_Left_Selected_Over"
+ tab_left_image_flash="FlashIconAbsent"/>
<middle_tab tab_top_image_unselected="TabTop_Middle_Off"
tab_top_image_selected="TabTop_Middle_Selected"
+ tab_top_image_flash="FlashIconAbsent"
tab_bottom_image_unselected="Toolbar_Middle_Off"
tab_bottom_image_selected="Toolbar_Middle_Selected"
+ tab_bottom_image_flash="FlashIconAbsent"
tab_left_image_unselected="SegmentedBtn_Left_Disabled"
- tab_left_image_selected="SegmentedBtn_Left_Selected_Over"/>
+ tab_left_image_selected="SegmentedBtn_Left_Selected_Over"
+ tab_left_image_flash="FlashIconAbsent"/>
<last_tab tab_top_image_unselected="TabTop_Right_Off"
tab_top_image_selected="TabTop_Right_Selected"
+ tab_top_image_flash="FlashIconAbsent"
tab_bottom_image_unselected="Toolbar_Right_Off"
tab_bottom_image_selected="Toolbar_Right_Selected"
+ tab_bottom_image_flash="FlashIconAbsent"
tab_left_image_unselected="SegmentedBtn_Left_Disabled"
- tab_left_image_selected="SegmentedBtn_Left_Selected_Over"/>
+ tab_left_image_selected="SegmentedBtn_Left_Selected_Over"
+ tab_left_image_flash="FlashIconAbsent"/>
</tab_container>
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index c0bb14afba..dfc12bc1cb 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- This file contains strings that used to be hardcoded in the source.
It is only for those strings which do not belong in a floater.
For example, the strings used in avatar chat bubbles, and strings
@@ -3762,4 +3762,22 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
<string name="texture_load_dimensions_error">
[WIDTH]*[HEIGHT] 以上の画像は読み込めません
</string>
+ <!-- overriding datetime formating. leave emtpy in for current localization this is not needed -->
+ <string name="dateTimeWeekdaysNames">
+ Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday
+ </string>
+ <string name="dateTimeWeekdaysShortNames">
+ Son:Mon:Tue:Wed:Thu:Fri:Sat
+ </string>
+ <string name="dateTimeMonthNames">
+ January:February:March:April:May:June:July:August:September:October:November:December
+ </string>
+ <string name="dateTimeMonthNames">
+ Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec
+ </string>
+ <string name="dateTimeDayFormat">
+ [MDAY] D
+ </string>
+ <string name="dateTimeAM">AM</string>
+ <string name="dateTimePM">PM</string>
</strings>
diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp
index fd680b24f0..fa9fff3ac9 100644
--- a/indra/newview/tests/llsechandler_basic_test.cpp
+++ b/indra/newview/tests/llsechandler_basic_test.cpp
@@ -54,7 +54,7 @@
#include <openssl/asn1.h>
#include <openssl/rand.h>
#include <openssl/err.h>
-
+#include "../llmachineid.h"
#define ensure_throws(str, exc_type, cert, func, ...) \
try \
@@ -115,6 +115,15 @@ void LLCredential::authenticatorType(std::string &idType)
LLControlGroup gSavedSettings("test");
unsigned char gMACAddress[MAC_ADDRESS_BYTES] = {77,21,46,31,89,2};
+
+S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len)
+{
+ memcpy(unique_id, gMACAddress, len);
+ return 1;
+}
+S32 LLMachineID::init() { return 1; }
+
+
// -------------------------------------------------------------------------------------------
// TUT
// -------------------------------------------------------------------------------------------
@@ -129,6 +138,7 @@ namespace tut
sechandler_basic_test()
{
+ LLMachineID::init();
OpenSSL_add_all_algorithms();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
@@ -328,7 +338,8 @@ namespace tut
ensure_equals("Der Format is correct", memcmp(buffer, mDerFormat.c_str(), mDerFormat.length()), 0);
- LLSD llsd_cert = test_cert->getLLSD();
+ LLSD llsd_cert;
+ test_cert->getLLSD(llsd_cert);
std::ostringstream llsd_value;
llsd_value << LLSDOStreamer<LLSDNotationFormatter>(llsd_cert) << std::endl;
std::string llsd_cert_str = llsd_value.str();
@@ -376,8 +387,6 @@ namespace tut
void sechandler_basic_test_object::test<2>()
{
- unsigned char MACAddress[MAC_ADDRESS_BYTES];
- LLUUID::getNodeID(MACAddress);
std::string protected_data = "sUSh3wj77NG9oAMyt3XIhaej3KLZhLZWFZvI6rIGmwUUOmmelrRg0NI9rkOj8ZDpTPxpwToaBT5u"
"GQhakdaGLJznr9bHr4/6HIC1bouKj4n2rs4TL6j2WSjto114QdlNfLsE8cbbE+ghww58g8SeyLQO"
@@ -390,7 +399,9 @@ namespace tut
LLXORCipher cipher(gMACAddress, MAC_ADDRESS_BYTES);
cipher.decrypt(&binary_data[0], 16);
- LLXORCipher cipher2(MACAddress, MAC_ADDRESS_BYTES);
+ unsigned char unique_id[MAC_ADDRESS_BYTES];
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ LLXORCipher cipher2(unique_id, sizeof(unique_id));
cipher2.encrypt(&binary_data[0], 16);
std::ofstream temp_file("sechandler_settings.tmp", std::ofstream::binary);
temp_file.write((const char *)&binary_data[0], binary_data.size());
@@ -571,11 +582,11 @@ namespace tut
int length = apr_base64_decode_len(hashed_password.c_str());
std::vector<char> decoded_password(length);
apr_base64_decode(&decoded_password[0], hashed_password.c_str());
- unsigned char MACAddress[MAC_ADDRESS_BYTES];
- LLUUID::getNodeID(MACAddress);
LLXORCipher cipher(gMACAddress, MAC_ADDRESS_BYTES);
cipher.decrypt((U8*)&decoded_password[0], length);
- LLXORCipher cipher2(MACAddress, MAC_ADDRESS_BYTES);
+ unsigned char unique_id[MAC_ADDRESS_BYTES];
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ LLXORCipher cipher2(unique_id, sizeof(unique_id));
cipher2.encrypt((U8*)&decoded_password[0], length);
llofstream password_file("test_password.dat", std::ofstream::binary);
password_file.write(&decoded_password[0], length);
@@ -950,31 +961,38 @@ namespace tut
test_chain->add(new LLBasicCertificate(mX509IntermediateCert));
- test_chain->validate(0, test_store, validation_params);
+ test_store->validate(0, test_chain, validation_params);
// add the root certificate to the chain and revalidate
test_chain->add(new LLBasicCertificate(mX509RootCert));
- test_chain->validate(0, test_store, validation_params);
+ test_store->validate(0, test_chain, validation_params);
// add the child cert at the head of the chain, and revalidate (3 deep chain)
test_chain->insert(test_chain->begin(), new LLBasicCertificate(mX509ChildCert));
- test_chain->validate(0, test_store, validation_params);
+ test_store->validate(0, test_chain, validation_params);
// basic failure cases
test_chain = new LLBasicCertificateChain(NULL);
- //validate with only the child cert
+ //validate with only the child cert in chain, but child cert was previously
+ // trusted
test_chain->add(new LLBasicCertificate(mX509ChildCert));
+
+ // validate without the trust flag.
+ test_store->validate(VALIDATION_POLICY_TRUSTED, test_chain, validation_params);
+
+ // Validate with child cert but no parent, and no parent in CA store
+ test_store = new LLBasicCertificateStore("mycertstore.pem");
ensure_throws("no CA, with only a child cert",
LLCertValidationTrustException,
(*test_chain)[0],
- test_chain->validate,
+ test_store->validate,
VALIDATION_POLICY_TRUSTED,
- test_store,
+ test_chain,
validation_params);
// validate without the trust flag.
- test_chain->validate(0, test_store, validation_params);
+ test_store->validate(0, test_chain, validation_params);
// clear out the store
test_store = new LLBasicCertificateStore("mycertstore.pem");
@@ -983,18 +1001,19 @@ namespace tut
ensure_throws("no CA, with child and intermediate certs",
LLCertValidationTrustException,
(*test_chain)[1],
- test_chain->validate,
+ test_store->validate,
VALIDATION_POLICY_TRUSTED,
- test_store,
+ test_chain,
validation_params);
// validate without the trust flag
- test_chain->validate(0, test_store, validation_params);
+ test_store->validate(0, test_chain, validation_params);
// Test time validity
- LLSD child_info = (*test_chain)[0]->getLLSD();
+ LLSD child_info;
+ ((*test_chain)[0])->getLLSD(child_info);
validation_params = LLSD::emptyMap();
validation_params[CERT_VALIDATION_DATE] = LLDate(child_info[CERT_VALID_FROM].asDate().secondsSinceEpoch() + 1.0);
- test_chain->validate(VALIDATION_POLICY_TIME, test_store, validation_params);
+ test_store->validate(VALIDATION_POLICY_TIME, test_chain, validation_params);
validation_params = LLSD::emptyMap();
validation_params[CERT_VALIDATION_DATE] = child_info[CERT_VALID_FROM].asDate();
@@ -1005,9 +1024,9 @@ namespace tut
ensure_throws("Child cert not yet valid" ,
LLCertValidationExpirationException,
(*test_chain)[0],
- test_chain->validate,
+ test_store->validate,
VALIDATION_POLICY_TIME,
- test_store,
+ test_chain,
validation_params);
validation_params = LLSD::emptyMap();
validation_params[CERT_VALIDATION_DATE] = LLDate(child_info[CERT_VALID_TO].asDate().secondsSinceEpoch() + 1.0);
@@ -1016,9 +1035,9 @@ namespace tut
ensure_throws("Child cert expired",
LLCertValidationExpirationException,
(*test_chain)[0],
- test_chain->validate,
+ test_store->validate,
VALIDATION_POLICY_TIME,
- test_store,
+ test_chain,
validation_params);
// test SSL KU
@@ -1026,17 +1045,18 @@ namespace tut
test_chain = new LLBasicCertificateChain(NULL);
test_chain->add(new LLBasicCertificate(mX509ChildCert));
test_chain->add(new LLBasicCertificate(mX509IntermediateCert));
- test_chain->validate(VALIDATION_POLICY_SSL_KU, test_store, validation_params);
+ test_store->validate(VALIDATION_POLICY_SSL_KU, test_chain, validation_params);
test_chain = new LLBasicCertificateChain(NULL);
test_chain->add(new LLBasicCertificate(mX509TestCert));
+ test_store = new LLBasicCertificateStore("mycertstore.pem");
ensure_throws("Cert doesn't have ku",
LLCertKeyUsageValidationException,
(*test_chain)[0],
- test_chain->validate,
+ test_store->validate,
VALIDATION_POLICY_SSL_KU,
- test_store,
+ test_chain,
validation_params);
// test sha1RSA validation
@@ -1044,7 +1064,7 @@ namespace tut
test_chain->add(new LLBasicCertificate(mSha1RSATestCert));
test_chain->add(new LLBasicCertificate(mSha1RSATestCA));
- test_chain->validate(0, test_store, validation_params);
+ test_store->validate(0, test_chain, validation_params);
}
};
diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp
index d819b44564..5fba5eb69c 100644
--- a/indra/newview/tests/llviewernetwork_test.cpp
+++ b/indra/newview/tests/llviewernetwork_test.cpp
@@ -148,7 +148,8 @@ namespace tut
known_grids[std::string("util.agni.lindenlab.com")], std::string("Agni"));
ensure_equals("None exists", known_grids[""], "None");
- LLSD grid = LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com");
+ LLSD grid;
+ LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com", grid);
ensure("Grid info for agni is a map", grid.isMap());
ensure_equals("name is correct for agni",
grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com"));
@@ -190,7 +191,8 @@ namespace tut
// assure Agni doesn't get overwritten
- LLSD grid = LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com");
+ LLSD grid;
+ LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com", grid);
ensure_equals("Agni grid label was not modified by grid file",
grid[GRID_LABEL_VALUE].asString(), std::string("Agni"));
@@ -215,7 +217,7 @@ namespace tut
ensure_equals("Grid file adds to name<->label map",
known_grids["grid1"], std::string("mylabel"));
- grid = LLGridManager::getInstance()->getGridInfo("grid1");
+ LLGridManager::getInstance()->getGridInfo("grid1", grid);
ensure_equals("grid file grid name is set",
grid[GRID_VALUE].asString(), std::string("grid1"));
ensure_equals("grid file label is set",
@@ -244,35 +246,20 @@ namespace tut
template<> template<>
void viewerNetworkTestObject::test<3>()
{
- gCmdLineLoginURI = "https://my.login.uri/cgi-bin/login.cgi";
-
+ // USE --grid command line
+ // initialize with a known grid
+ LLSD grid;
+ gCmdLineGridChoice = "Aditi";
LLGridManager::getInstance()->initialize("grid_test.xml");
// with single login uri specified.
std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
- ensure_equals("adding a command line grid increases known grid size",
- known_grids.size(), 24);
- ensure_equals("Command line grid is added to the list of grids",
- known_grids["my.login.uri"], std::string("my.login.uri"));
- LLSD grid = LLGridManager::getInstance()->getGridInfo("my.login.uri");
- ensure_equals("Command line grid name is set",
- grid[GRID_VALUE].asString(), std::string("my.login.uri"));
- ensure_equals("Command line grid label is set",
- grid[GRID_LABEL_VALUE].asString(), std::string("my.login.uri"));
- ensure("Command line grid login uri is an array",
- grid[GRID_LOGIN_URI_VALUE].isArray());
- ensure_equals("Command line grid login uri is set",
- grid[GRID_LOGIN_URI_VALUE][0].asString(),
- std::string("https://my.login.uri/cgi-bin/login.cgi"));
- ensure_equals("Command line grid helper uri is set",
- grid[GRID_HELPER_URI_VALUE].asString(),
- std::string("https://my.login.uri/helpers/"));
- ensure_equals("Command line grid login page is set",
- grid[GRID_LOGIN_PAGE_VALUE].asString(),
- std::string("http://my.login.uri/app/login/"));
- ensure("Command line grid favorite is set",
- !grid.has(GRID_IS_FAVORITE_VALUE));
- ensure("Command line grid isn't a system grid",
- !grid.has(GRID_IS_SYSTEM_GRID_VALUE));
+ ensure_equals("Using a known grid via command line doesn't increase number of known grids",
+ known_grids.size(), 23);
+ ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Aditi"));
+ // initialize with a known grid in lowercase
+ gCmdLineGridChoice = "agni";
+ LLGridManager::getInstance()->initialize("grid_test.xml");
+ ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Agni"));
// now try a command line with a custom grid identifier
gCmdLineGridChoice = "mycustomgridchoice";
@@ -282,7 +269,7 @@ namespace tut
known_grids.size(), 24);
ensure_equals("Custom Command line grid is added to the list of grids",
known_grids["mycustomgridchoice"], std::string("mycustomgridchoice"));
- grid = LLGridManager::getInstance()->getGridInfo("mycustomgridchoice");
+ LLGridManager::getInstance()->getGridInfo("mycustomgridchoice", grid);
ensure_equals("Custom Command line grid name is set",
grid[GRID_VALUE].asString(), std::string("mycustomgridchoice"));
ensure_equals("Custom Command line grid label is set",
@@ -291,26 +278,165 @@ namespace tut
grid[GRID_LOGIN_URI_VALUE].isArray());
ensure_equals("Custom Command line grid login uri is set",
grid[GRID_LOGIN_URI_VALUE][0].asString(),
+ std::string("https://mycustomgridchoice/cgi-bin/login.cgi"));
+ ensure_equals("Custom Command line grid helper uri is set",
+ grid[GRID_HELPER_URI_VALUE].asString(),
+ std::string("https://mycustomgridchoice/helpers/"));
+ ensure_equals("Custom Command line grid login page is set",
+ grid[GRID_LOGIN_PAGE_VALUE].asString(),
+ std::string("http://mycustomgridchoice/app/login/"));
+ }
+
+ // validate override of login uri with cmd line
+ template<> template<>
+ void viewerNetworkTestObject::test<4>()
+ {
+ // Override with loginuri
+ // override known grid
+ LLSD grid;
+ gCmdLineGridChoice = "Aditi";
+ gCmdLineLoginURI = "https://my.login.uri/cgi-bin/login.cgi";
+ LLGridManager::getInstance()->initialize("grid_test.xml");
+ std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
+ ensure_equals("Override known grid login uri: No grids are added",
+ known_grids.size(), 23);
+ LLGridManager::getInstance()->getGridInfo(grid);
+ ensure("Override known grid login uri: login uri is an array",
+ grid[GRID_LOGIN_URI_VALUE].isArray());
+ ensure_equals("Override known grid login uri: Command line grid login uri is set",
+ grid[GRID_LOGIN_URI_VALUE][0].asString(),
std::string("https://my.login.uri/cgi-bin/login.cgi"));
+ ensure_equals("Override known grid login uri: helper uri is not changed",
+ grid[GRID_HELPER_URI_VALUE].asString(),
+ std::string("http://aditi-secondlife.webdev.lindenlab.com/helpers/"));
+ ensure_equals("Override known grid login uri: login page is not set",
+ grid[GRID_LOGIN_PAGE_VALUE].asString(),
+ std::string("http://secondlife.com/app/login/"));
- // add a helperuri
- gCmdLineHelperURI = "myhelperuri";
- LLGridManager::getInstance()->initialize("grid_test.xml");
- grid = LLGridManager::getInstance()->getGridInfo("mycustomgridchoice");
- ensure_equals("Validate command line helper uri",
- grid[GRID_HELPER_URI_VALUE].asString(), std::string("myhelperuri"));
+ // Override with loginuri
+ // override custom grid
+ gCmdLineGridChoice = "mycustomgridchoice";
+ gCmdLineLoginURI = "https://my.login.uri/cgi-bin/login.cgi";
+ LLGridManager::getInstance()->initialize("grid_test.xml");
+ known_grids = LLGridManager::getInstance()->getKnownGrids();
+ LLGridManager::getInstance()->getGridInfo(grid);
+ ensure_equals("Override custom grid login uri: Grid is added",
+ known_grids.size(), 24);
+ ensure("Override custom grid login uri: login uri is an array",
+ grid[GRID_LOGIN_URI_VALUE].isArray());
+ ensure_equals("Override custom grid login uri: login uri is set",
+ grid[GRID_LOGIN_URI_VALUE][0].asString(),
+ std::string("https://my.login.uri/cgi-bin/login.cgi"));
+ ensure_equals("Override custom grid login uri: Helper uri is not set",
+ grid[GRID_HELPER_URI_VALUE].asString(),
+ std::string("https://mycustomgridchoice/helpers/"));
+ ensure_equals("Override custom grid login uri: Login page is not set",
+ grid[GRID_LOGIN_PAGE_VALUE].asString(),
+ std::string("http://mycustomgridchoice/app/login/"));
+ }
+
+ // validate override of helper uri with cmd line
+ template<> template<>
+ void viewerNetworkTestObject::test<5>()
+ {
+ // Override with helperuri
+ // override known grid
+ LLSD grid;
+ gCmdLineGridChoice = "Aditi";
+ gCmdLineLoginURI = "";
+ gCmdLineHelperURI = "https://my.helper.uri/mycustomhelpers";
+ LLGridManager::getInstance()->initialize("grid_test.xml");
+ std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
+ ensure_equals("Override known grid helper uri: No grids are added",
+ known_grids.size(), 23);
+ LLGridManager::getInstance()->getGridInfo(grid);
+ ensure("Override known known helper uri: login uri is an array",
+ grid[GRID_LOGIN_URI_VALUE].isArray());
+ ensure_equals("Override known grid helper uri: login uri is not changed",
+ grid[GRID_LOGIN_URI_VALUE][0].asString(),
+ std::string("https://login.aditi.lindenlab.com/cgi-bin/login.cgi"));
+ ensure_equals("Override known grid helper uri: helper uri is changed",
+ grid[GRID_HELPER_URI_VALUE].asString(),
+ std::string("https://my.helper.uri/mycustomhelpers"));
+ ensure_equals("Override known grid helper uri: login page is not changed",
+ grid[GRID_LOGIN_PAGE_VALUE].asString(),
+ std::string("http://secondlife.com/app/login/"));
+
+ // Override with helperuri
+ // override custom grid
+ gCmdLineGridChoice = "mycustomgridchoice";
+ gCmdLineHelperURI = "https://my.helper.uri/mycustomhelpers";
+ LLGridManager::getInstance()->initialize("grid_test.xml");
+ known_grids = LLGridManager::getInstance()->getKnownGrids();
+ ensure_equals("Override custom grid helper uri: grids is added",
+ known_grids.size(), 24);
+ LLGridManager::getInstance()->getGridInfo(grid);
+ ensure("Override custom helper uri: login uri is an array",
+ grid[GRID_LOGIN_URI_VALUE].isArray());
+ ensure_equals("Override custom grid helper uri: login uri is not changed",
+ grid[GRID_LOGIN_URI_VALUE][0].asString(),
+ std::string("https://mycustomgridchoice/cgi-bin/login.cgi"));
+ ensure_equals("Override custom grid helper uri: helper uri is changed",
+ grid[GRID_HELPER_URI_VALUE].asString(),
+ std::string("https://my.helper.uri/mycustomhelpers"));
+ ensure_equals("Override custom grid helper uri: login page is not changed",
+ grid[GRID_LOGIN_PAGE_VALUE].asString(),
+ std::string("http://mycustomgridchoice/app/login/"));
+ }
+
+ // validate overriding of login page via cmd line
+ template<> template<>
+ void viewerNetworkTestObject::test<6>()
+ {
+ // Override with login page
+ // override known grid
+ LLSD grid;
+ gCmdLineGridChoice = "Aditi";
+ gCmdLineHelperURI = "";
+ gLoginPage = "myloginpage";
+ LLGridManager::getInstance()->initialize("grid_test.xml");
+ std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
+ ensure_equals("Override known grid login page: No grids are added",
+ known_grids.size(), 23);
+ LLGridManager::getInstance()->getGridInfo(grid);
+ ensure("Override known grid login page: Command line grid login uri is an array",
+ grid[GRID_LOGIN_URI_VALUE].isArray());
+ ensure_equals("Override known grid login page: login uri is not changed",
+ grid[GRID_LOGIN_URI_VALUE][0].asString(),
+ std::string("https://login.aditi.lindenlab.com/cgi-bin/login.cgi"));
+ ensure_equals("Override known grid login page: helper uri is not changed",
+ grid[GRID_HELPER_URI_VALUE].asString(),
+ std::string("http://aditi-secondlife.webdev.lindenlab.com/helpers/"));
+ ensure_equals("Override known grid login page: login page is changed",
+ grid[GRID_LOGIN_PAGE_VALUE].asString(),
+ std::string("myloginpage"));
- // add a login page
+ // Override with login page
+ // override custom grid
+ gCmdLineGridChoice = "mycustomgridchoice";
gLoginPage = "myloginpage";
- LLGridManager::getInstance()->initialize("grid_test.xml");
- grid = LLGridManager::getInstance()->getGridInfo("mycustomgridchoice");
- ensure_equals("Validate command line helper uri",
- grid[GRID_LOGIN_PAGE_VALUE].asString(), std::string("myloginpage"));
+ LLGridManager::getInstance()->initialize("grid_test.xml");
+ known_grids = LLGridManager::getInstance()->getKnownGrids();
+ ensure_equals("Override custom grid login page: grids are added",
+ known_grids.size(), 24);
+ LLGridManager::getInstance()->getGridInfo(grid);
+ ensure("Override custom grid login page: Command line grid login uri is an array",
+ grid[GRID_LOGIN_URI_VALUE].isArray());
+ ensure_equals("Override custom grid login page: login uri is not changed",
+ grid[GRID_LOGIN_URI_VALUE][0].asString(),
+ std::string("https://mycustomgridchoice/cgi-bin/login.cgi"));
+ ensure_equals("Override custom grid login page: helper uri is not changed",
+ grid[GRID_HELPER_URI_VALUE].asString(),
+ std::string("https://mycustomgridchoice/helpers/"));
+ ensure_equals("Override custom grid login page: login page is changed",
+ grid[GRID_LOGIN_PAGE_VALUE].asString(),
+ std::string("myloginpage"));
+
}
// validate grid selection
template<> template<>
- void viewerNetworkTestObject::test<4>()
+ void viewerNetworkTestObject::test<7>()
{
LLSD loginURI = LLSD::emptyArray();
LLSD grid = LLSD::emptyMap();
@@ -340,20 +466,20 @@ namespace tut
ensure("Is myaddedgrid a production grid", !LLGridManager::getInstance()->isInProductionGrid());
LLGridManager::getInstance()->setFavorite();
- grid = LLGridManager::getInstance()->getGridInfo("myaddedgrid");
+ LLGridManager::getInstance()->getGridInfo("myaddedgrid", grid);
ensure("setting favorite", grid.has(GRID_IS_FAVORITE_VALUE));
}
// name based grid population
template<> template<>
- void viewerNetworkTestObject::test<5>()
+ void viewerNetworkTestObject::test<8>()
{
LLGridManager::getInstance()->initialize("grid_test.xml");
LLSD grid = LLSD::emptyMap();
// adding a grid with simply a name will populate the values.
grid[GRID_VALUE] = "myaddedgrid";
LLGridManager::getInstance()->addGrid(grid);
- grid = LLGridManager::getInstance()->getGridInfo("myaddedgrid");
+ LLGridManager::getInstance()->getGridInfo("myaddedgrid", grid);
ensure_equals("name based grid has name value",
grid[GRID_VALUE].asString(),
@@ -386,7 +512,7 @@ namespace tut
// persistence of the grid list with an empty gridfile.
template<> template<>
- void viewerNetworkTestObject::test<6>()
+ void viewerNetworkTestObject::test<9>()
{
// try with initial grid list without a grid file,
// without setting the grid to a saveable favorite.
@@ -420,7 +546,7 @@ namespace tut
// persistence of the grid file with existing gridfile
template<> template<>
- void viewerNetworkTestObject::test<7>()
+ void viewerNetworkTestObject::test<10>()
{
llofstream gridfile("grid_test.xml");