diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llurlentry.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llsidepaneliteminfo.cpp | 102 | ||||
-rw-r--r-- | indra/newview/llsidepaneliteminfo.h | 6 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 27 | ||||
-rw-r--r-- | indra/newview/lltoolpie.h | 3 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 3 |
7 files changed, 100 insertions, 47 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 99eb992ddd..f7528bc62a 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -202,8 +202,9 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol() { mPattern = boost::regex("(" - "\\bwww\\.\\S+\\.\\S+" // www.FOO.BAR - "|\\b[^ \t\n\r\f\v:/]+.(?:com|net|edu|org)[^[:space:][:alnum:]]*$" // FOO.net + "\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR + "|" // or + "\\b[^ \\t\\n\\r\\f\\v:/]+\\.(?:com|net|edu|org)[^[:space:][:alnum:]]*\\>" // i.e. FOO.net ")", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 814508daa9..94fe95d215 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -157,11 +157,12 @@ void LLSidepanelItemInfo::reset() void LLSidepanelItemInfo::refresh() { - LLInventoryItem* item = findItem(); + LLViewerInventoryItem* item = findItem(); if(item) { refreshFromItem(item); updateVerbs(); + return; } else { @@ -170,11 +171,8 @@ void LLSidepanelItemInfo::refresh() setIsEditing(FALSE); } } - - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - bool is_editable = item && (item->getUUID() != trash_id) && !gInventory.isObjectDescendentOf(item->getUUID(), trash_id); - if (!getIsEditing() || !is_editable) + if (!getIsEditing()) { const std::string no_item_names[]={ "LabelItemName", @@ -212,7 +210,7 @@ void LLSidepanelItemInfo::refresh() } } - if (!is_editable) + if (!item) { const std::string no_edit_mode_names[]={ "BtnCreator", @@ -227,24 +225,26 @@ void LLSidepanelItemInfo::refresh() updateVerbs(); } -void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) +void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { //////////////////////// // PERMISSIONS LOOKUP // //////////////////////// // do not enable the UI for incomplete items. - LLViewerInventoryItem* i = (LLViewerInventoryItem*)item; - BOOL is_complete = i->isComplete(); - const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(i->getInventoryType()); - const BOOL is_calling_card = (i->getInventoryType() == LLInventoryType::IT_CALLINGCARD); + BOOL is_complete = item->isComplete(); + const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(item->getInventoryType()); + const BOOL is_calling_card = (item->getInventoryType() == LLInventoryType::IT_CALLINGCARD); const LLPermissions& perm = item->getPermissions(); const BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); const BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_SET_SALE) && !cannot_restrict_permissions; - const BOOL is_link = i->getIsLinkType(); + const BOOL is_link = item->getIsLinkType(); + + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + bool not_in_trash = item && (item->getUUID() != trash_id) && !gInventory.isObjectDescendentOf(item->getUUID(), trash_id); // You need permission to modify the object to modify an inventory // item in it. @@ -261,7 +261,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) ////////////////////// BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE) - && is_obj_modify && is_complete; + && is_obj_modify && is_complete && not_in_trash; childSetEnabled("LabelItemNameTitle",TRUE); childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards @@ -338,6 +338,64 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) LLStringUtil::format (timeStr, substitution); childSetText ("LabelAcquiredDate", timeStr); } + + ///////////////////////////////////// + // PERMISSIONS AND SALE ITEM HIDING + ///////////////////////////////////// + + const std::string perm_and_sale_items[]={ + "perms_inv", + "OwnerLabel", + "perm_modify", + "CheckOwnerModify", + "CheckOwnerCopy", + "CheckOwnerTransfer", + "GroupLabel", + "CheckShareWithGroup", + "AnyoneLabel", + "CheckEveryoneCopy", + "NextOwnerLabel", + "CheckNextOwnerModify", + "CheckNextOwnerCopy", + "CheckNextOwnerTransfer", + "CheckPurchase", + "SaleLabel", + "RadioSaleType", + "combobox sale copy", + "Edit Cost", + "TextPrice" + }; + + const std::string debug_items[]={ + "BaseMaskDebug", + "OwnerMaskDebug", + "GroupMaskDebug", + "EveryoneMaskDebug", + "NextMaskDebug" + }; + + // Hide permissions checkboxes and labels and for sale info if in the trash + // or ui elements don't apply to these objects and return from function + if (!not_in_trash || cannot_restrict_permissions) + { + for(size_t t=0; t<LL_ARRAY_SIZE(perm_and_sale_items); ++t) + { + childSetVisible(perm_and_sale_items[t],false); + } + + for(size_t t=0; t<LL_ARRAY_SIZE(debug_items); ++t) + { + childSetVisible(debug_items[t],false); + } + return; + } + else // Make sure perms and sale ui elements are visible + { + for(size_t t=0; t<LL_ARRAY_SIZE(perm_and_sale_items); ++t) + { + childSetVisible(perm_and_sale_items[t],true); + } + } /////////////////////// // OWNER PERMISSIONS // @@ -541,7 +599,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) void LLSidepanelItemInfo::onClickCreator() { - LLInventoryItem* item = findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; if(!item->getCreatorUUID().isNull()) { @@ -552,7 +610,7 @@ void LLSidepanelItemInfo::onClickCreator() // static void LLSidepanelItemInfo::onClickOwner() { - LLInventoryItem* item = findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; if(item->getPermissions().isGroupOwned()) { @@ -568,7 +626,7 @@ void LLSidepanelItemInfo::onClickOwner() void LLSidepanelItemInfo::onCommitName() { //llinfos << "LLSidepanelItemInfo::onCommitName()" << llendl; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) { return; @@ -604,7 +662,7 @@ void LLSidepanelItemInfo::onCommitName() void LLSidepanelItemInfo::onCommitDescription() { //llinfos << "LLSidepanelItemInfo::onCommitDescription()" << llendl; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; LLLineEditor* labelItemDesc = getChild<LLLineEditor>("LabelItemDesc"); @@ -642,7 +700,7 @@ void LLSidepanelItemInfo::onCommitDescription() void LLSidepanelItemInfo::onCommitPermissions() { //llinfos << "LLSidepanelItemInfo::onCommitPermissions()" << llendl; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; LLPermissions perm(item->getPermissions()); @@ -751,7 +809,7 @@ void LLSidepanelItemInfo::onCommitSaleType() void LLSidepanelItemInfo::updateSaleInfo() { - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; LLSaleInfo sale_info(item->getSaleInfo()); if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE)) @@ -851,9 +909,9 @@ void LLSidepanelItemInfo::updateSaleInfo() } } -LLInventoryItem* LLSidepanelItemInfo::findItem() const +LLViewerInventoryItem* LLSidepanelItemInfo::findItem() const { - LLInventoryItem* item = NULL; + LLViewerInventoryItem* item = NULL; if(mObjectID.isNull()) { // it is in agent inventory @@ -864,7 +922,7 @@ LLInventoryItem* LLSidepanelItemInfo::findItem() const LLViewerObject* object = gObjectList.findObject(mObjectID); if(object) { - item = (LLInventoryItem*)object->getInventoryObject(mItemID); + item = static_cast<LLViewerInventoryItem*>(object->getInventoryObject(mItemID)); } } return item; diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h index 21002327bc..e6dbf400ee 100644 --- a/indra/newview/llsidepaneliteminfo.h +++ b/indra/newview/llsidepaneliteminfo.h @@ -41,7 +41,7 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLButton; -class LLInventoryItem; +class LLViewerInventoryItem; class LLItemPropertiesObserver; class LLViewerObject; class LLPermissions; @@ -63,10 +63,10 @@ protected: /*virtual*/ void refresh(); /*virtual*/ void save(); - LLInventoryItem* findItem() const; + LLViewerInventoryItem* findItem() const; LLViewerObject* findObject() const; - void refreshFromItem(LLInventoryItem* item); + void refreshFromItem(LLViewerInventoryItem* item); private: LLUUID mItemID; // inventory UUID for the inventory item. diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index b1d09eccba..5f66e6b409 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -101,16 +101,13 @@ BOOL LLToolPie::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktyp BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) { //left mouse down always picks transparent - gViewerWindow->pickAsync(x, y, mask, leftMouseCallback, TRUE); + mPick = gViewerWindow->pickImmediate(x, y, TRUE); + mPick.mKeyMask = mask; mGrabMouseButtonDown = TRUE; - return TRUE; -} + + pickLeftMouseDownCallback(); -// static -void LLToolPie::leftMouseCallback(const LLPickInfo& pick_info) -{ - LLToolPie::getInstance()->mPick = pick_info; - LLToolPie::getInstance()->pickLeftMouseDownCallback(); + return TRUE; } // Spawn context menus on right mouse down so you can drag over and select @@ -118,8 +115,13 @@ void LLToolPie::leftMouseCallback(const LLPickInfo& pick_info) BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) { // don't pick transparent so users can't "pay" transparent objects - gViewerWindow->pickAsync(x, y, mask, rightMouseCallback, FALSE); + mPick = gViewerWindow->pickImmediate(x, y, FALSE); + mPick.mKeyMask = mask; + // claim not handled so UI focus stays same + + pickRightMouseDownCallback(); + return FALSE; } @@ -134,13 +136,6 @@ BOOL LLToolPie::handleScrollWheel(S32 x, S32 y, S32 clicks) return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks); } -// static -void LLToolPie::rightMouseCallback(const LLPickInfo& pick_info) -{ - LLToolPie::getInstance()->mPick = pick_info; - LLToolPie::getInstance()->pickRightMouseDownCallback(); -} - // True if you selected an object. BOOL LLToolPie::pickLeftMouseDownCallback() { diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 3660c68552..5f0e28fa95 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -71,9 +71,6 @@ public: LLObjectSelection* getLeftClickSelection() { return (LLObjectSelection*)mLeftClickSelection; } void resetSelection(); - static void leftMouseCallback(const LLPickInfo& pick_info); - static void rightMouseCallback(const LLPickInfo& pick_info); - static void selectionPropertiesReceived(); static void showAvatarInspector(const LLUUID& avatar_id); diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 28fb379960..63f461b4c4 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -187,6 +187,7 @@ public: std::string getMediaURL() const { return mMediaURL; } std::string getCurrentMediaURL(); std::string getHomeURL() { return mHomeURL; } + std::string getMediaEntryURL() { return mMediaEntryURL; } void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }; void clearCache(); std::string getMimeType() { return mMimeType; } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 15855f154d..5445a79137 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2466,7 +2466,7 @@ class LLViewJoystickFlycam : public view_listener_t class LLViewCheckJoystickFlycam : public view_listener_t { bool handleEvent(const LLSD& userdata) - { + { bool new_value = LLViewerJoystick::getInstance()->getOverrideCamera(); return new_value; } @@ -3704,6 +3704,7 @@ void reset_view_final( BOOL proceed ) } gAgent.resetView(TRUE, TRUE); + gAgent.setLookAt(LOOKAT_TARGET_CLEAR); } class LLViewLookAtLastChatter : public view_listener_t |