diff options
Diffstat (limited to 'indra')
60 files changed, 1142 insertions, 544 deletions
diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp index 16ba492669..44e3b4950f 100644 --- a/indra/llplugin/llplugininstance.cpp +++ b/indra/llplugin/llplugininstance.cpp @@ -37,13 +37,21 @@ #include "llapr.h" -//virtual +/** Virtual destructor. */ LLPluginInstanceMessageListener::~LLPluginInstanceMessageListener() { } +/** + * TODO:DOC describe how it's used + */ const char *LLPluginInstance::PLUGIN_INIT_FUNCTION_NAME = "LLPluginInitEntryPoint"; +/** + * Constructor. + * + * @param[in] owner Plugin instance. TODO:DOC is this a good description of what "owner" is? + */ LLPluginInstance::LLPluginInstance(LLPluginInstanceMessageListener *owner) : mDSOHandle(NULL), mPluginUserData(NULL), @@ -52,6 +60,9 @@ LLPluginInstance::LLPluginInstance(LLPluginInstanceMessageListener *owner) : mOwner = owner; } +/** + * Destructor. + */ LLPluginInstance::~LLPluginInstance() { if(mDSOHandle != NULL) @@ -61,6 +72,12 @@ LLPluginInstance::~LLPluginInstance() } } +/** + * Dynamically loads the plugin and runs the plugin's init function. + * + * @param[in] plugin_file Name of plugin dll/dylib/so. TODO:DOC is this correct? see .h + * @return 0 if successful, APR error code or error code from the plugin's init function on failure. + */ int LLPluginInstance::load(std::string &plugin_file) { pluginInitFunction init_function = NULL; @@ -102,6 +119,11 @@ int LLPluginInstance::load(std::string &plugin_file) return (int)result; } +/** + * Sends a message to the plugin. + * + * @param[in] message Message + */ void LLPluginInstance::sendMessage(const std::string &message) { if(mPluginSendMessageFunction) @@ -115,6 +137,10 @@ void LLPluginInstance::sendMessage(const std::string &message) } } +/** + * Idle. TODO:DOC what's the purpose of this? + * + */ void LLPluginInstance::idle(void) { } @@ -128,6 +154,11 @@ void LLPluginInstance::staticReceiveMessage(const char *message_string, void **u self->receiveMessage(message_string); } +/** + * Plugin receives message from plugin loader shell. + * + * @param[in] message_string Message + */ void LLPluginInstance::receiveMessage(const char *message_string) { if(mOwner) diff --git a/indra/llplugin/llplugininstance.h b/indra/llplugin/llplugininstance.h index 02936f65fb..c11d5ab5d4 100644 --- a/indra/llplugin/llplugininstance.h +++ b/indra/llplugin/llplugininstance.h @@ -1,6 +1,5 @@ /** * @file llplugininstance.h - * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. * * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ @@ -39,13 +38,20 @@ #include "apr_dso.h" +/** + * @brief LLPluginInstanceMessageListener receives messages sent from the plugin loader shell to the plugin. + */ class LLPluginInstanceMessageListener { public: virtual ~LLPluginInstanceMessageListener(); + /** Plugin receives message from plugin loader shell. */ virtual void receivePluginMessage(const std::string &message) = 0; }; +/** + * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. + */ class LLPluginInstance { LOG_CLASS(LLPluginInstance); @@ -60,19 +66,27 @@ public: // Sends a message to the plugin. void sendMessage(const std::string &message); + // TODO:DOC is this comment obsolete? can't find "send_count" anywhere in indra tree. // send_count is the maximum number of message to process from the send queue. If negative, it will drain the queue completely. // The receive queue is always drained completely. // Returns the total number of messages processed from both queues. void idle(void); - // this is the signature of the "send a message" function. - // message_string is a null-terminated C string - // user_data is the opaque reference that the callee supplied during setup. + /** The signature of the function for sending a message from plugin to plugin loader shell. + * + * @param[in] message_string Null-terminated C string + * @param[in] user_data The opaque reference that the callee supplied during setup. + */ typedef void (*sendMessageFunction) (const char *message_string, void **user_data); - // signature of the plugin init function + /** The signature of the plugin init function. TODO:DOC check direction (pluging loader shell to plugin?) + * + * @param[in] host_user_data Data from plugin loader shell. + * @param[in] plugin_send_function Function for sending from the plugin loader shell to plugin. + */ typedef int (*pluginInitFunction) (sendMessageFunction host_send_func, void *host_user_data, sendMessageFunction *plugin_send_func, void **plugin_user_data); + /** Name of plugin init function */ static const char *PLUGIN_INIT_FUNCTION_NAME; private: diff --git a/indra/llplugin/llpluginmessage.cpp b/indra/llplugin/llpluginmessage.cpp index d06f3cefa0..f76d848a70 100644 --- a/indra/llplugin/llpluginmessage.cpp +++ b/indra/llplugin/llpluginmessage.cpp @@ -387,12 +387,18 @@ int LLPluginMessage::parse(const std::string &message) } +/** + * Destructor + */ LLPluginMessageListener::~LLPluginMessageListener() { // TODO: should listeners have a way to ensure they're removed from dispatcher lists when deleted? } +/** + * Destructor + */ LLPluginMessageDispatcher::~LLPluginMessageDispatcher() { diff --git a/indra/llplugin/llpluginmessage.h b/indra/llplugin/llpluginmessage.h index e00022a245..cbd31e0964 100644 --- a/indra/llplugin/llpluginmessage.h +++ b/indra/llplugin/llpluginmessage.h @@ -1,6 +1,5 @@ /** * @file llpluginmessage.h - * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. * * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ @@ -36,7 +35,9 @@ #include "llsd.h" - +/** + * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. + */ class LLPluginMessage { LOG_CLASS(LLPluginMessage); @@ -105,12 +106,13 @@ private: }; /** - * @brief Listens for plugin messages. + * @brief Listener for plugin messages. */ class LLPluginMessageListener { public: virtual ~LLPluginMessageListener(); + /** Plugin receives message from plugin loader shell. */ virtual void receivePluginMessage(const LLPluginMessage &message) = 0; }; diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index fad2b7bc99..6fa99df82e 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -141,6 +141,15 @@ void LLSearchEditor::clear() } } +//virtual +void LLSearchEditor::setFocus( BOOL b ) +{ + if (mSearchEditor) + { + mSearchEditor->setFocus(b); + } +} + void LLSearchEditor::onClearButtonClick(const LLSD& data) { setText(LLStringUtil::null); diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index f395e7e816..bd2d595174 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -83,6 +83,7 @@ public: virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void setLabel( const LLStringExplicit &new_label ); virtual void clear(); + virtual void setFocus( BOOL b ); void setKeystrokeCallback( commit_callback_t cb ) { mKeystrokeCallback = cb; } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index af9a30cb25..86bbb0bcf8 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1441,7 +1441,7 @@ static void fixOrigin(void) ::GetPortBounds(port, &portrect); if((portrect.left != 0) || (portrect.top != 0)) { - // Mozilla sometimes changes our port origin. Fuckers. + // Mozilla sometimes changes our port origin. ::SetOrigin(0,0); } } diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 61aecdbfb6..9f525d82b9 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -453,7 +453,7 @@ set(viewer_SOURCE_FILES llviewerassettype.cpp llvieweraudio.cpp llviewercamera.cpp - llviewerchat.cpp + llviewerchat.cpp llviewercontrol.cpp llviewercontrollistener.cpp llviewerdisplay.cpp @@ -463,6 +463,7 @@ set(viewer_SOURCE_FILES llviewergesture.cpp llviewerhelp.cpp llviewerhelputil.cpp + llviewerhome.cpp llviewerinventory.cpp llviewerjoint.cpp llviewerjointattachment.cpp @@ -496,6 +497,7 @@ set(viewer_SOURCE_FILES llviewertextureanim.cpp llviewertexturelist.cpp llviewerthrottle.cpp + llviewerversion.cpp llviewervisualparam.cpp llviewerwindow.cpp llviewerwindowlistener.cpp @@ -955,9 +957,8 @@ set(viewer_HEADER_FILES llviewerassetstorage.h llviewerassettype.h llvieweraudio.h - llviewerbuild.h llviewercamera.h - llviewerchat.h + llviewerchat.h llviewercontrol.h llviewercontrollistener.h llviewerdisplay.h @@ -966,6 +967,7 @@ set(viewer_HEADER_FILES llviewergenericmessage.h llviewergesture.h llviewerhelp.h + llviewerhome.h llviewerinventory.h llviewerjoint.h llviewerjointattachment.h @@ -997,6 +999,7 @@ set(viewer_HEADER_FILES llviewertextureanim.h llviewertexturelist.h llviewerthrottle.h + llviewerversion.h llviewervisualparam.h llviewerwindow.h llviewerwindowlistener.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 08a65461b6..a647bc09f2 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3587,6 +3587,17 @@ <key>Value</key> <string>http://viewer-help.secondlife.com/[LANGUAGE]/[CHANNEL]/[VERSION]/[TOPIC]</string> </map> + <key>HomeSidePanelURL</key> + <map> + <key>Comment</key> + <string>URL for the web page to display in the Home side panel</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>http://www.secondlife.com/</string> + </map> <key>HighResSnapshot</key> <map> <key>Comment</key> diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c7f05d99f7..d91b9d7ea4 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -512,6 +512,21 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append) { const LLUUID cof = getCOF(); + // Deactivate currently active gestures in the COF, if replacing outfit + if (!append) + { + LLInventoryModel::item_array_t gest_items; + getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false); + for(S32 i = 0; i < gest_items.count(); ++i) + { + LLViewerInventoryItem *gest_item = gest_items.get(i); + if ( LLGestureManager::instance().isGestureActive( gest_item->getLinkedUUID()) ) + { + LLGestureManager::instance().deactivateGesture( gest_item->getLinkedUUID() ); + } + } + } + // Collect and filter descendents to determine new COF contents. // - Body parts: always include COF contents as a fallback in case any diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fd449d4190..9af25a90f1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -36,6 +36,7 @@ // Viewer includes #include "llversionviewer.h" +#include "llviewerversion.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -649,12 +650,9 @@ bool LLAppViewer::init() writeSystemInfo(); // Build a string representing the current version number. - gCurrentVersion = llformat("%s %d.%d.%d.%d", - gSavedSettings.getString("VersionChannelName").c_str(), - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VERSION_BUILD ); + gCurrentVersion = llformat("%s %s", + gSavedSettings.getString("VersionChannelName").c_str(), + llGetViewerVersion().c_str()); ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -2523,8 +2521,7 @@ void LLAppViewer::writeSystemInfo() // Dump some debugging info LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME") - << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH - << LL_ENDL; + << " version " << llGetViewerShortVersion() << LL_ENDL; // Dump the local time and time zone time_t now; diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 68fc69b4f7..b2588cc01b 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -46,7 +46,7 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llversionviewer.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llweb.h" // Linden library includes @@ -217,10 +217,7 @@ LLSD LLFloaterAbout::getInfo() version.append(LL_VERSION_PATCH); version.append(LL_VERSION_BUILD); info["VIEWER_VERSION"] = version; - info["VIEWER_VERSION_STR"] = STRINGIZE(version[0].asInteger() << '.' << - version[1].asInteger() << '.' << - version[2].asInteger() << '.' << - version[3].asInteger()); + info["VIEWER_VERSION_STR"] = llGetViewerVersion(); info["BUILD_DATE"] = __DATE__; info["BUILD_TIME"] = __TIME__; info["CHANNEL"] = gSavedSettings.getString("VersionChannelName"); @@ -286,15 +283,9 @@ LLSD LLFloaterAbout::getInfo() static std::string get_viewer_release_notes_url() { - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; - LLSD query; query["channel"] = gSavedSettings.getString("VersionChannelName"); - query["version"] = version.str(); + query["version"] = llGetViewerVersion(); std::ostringstream url; url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 1f3bd50d5b..be821ad43b 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -45,7 +45,6 @@ #include "llnotificationsutil.h" #include "llstring.h" #include "llsys.h" -#include "llversionviewer.h" #include "message.h" #include "v3math.h" @@ -76,7 +75,7 @@ #include "llfloateravatarpicker.h" #include "lldir.h" #include "llselectmgr.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "lluictrlfactory.h" #include "llviewernetwork.h" @@ -609,10 +608,7 @@ LLSD LLFloaterReporter::gatherReport() std::ostringstream details; - details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VIEWER_BUILD << std::endl << std::endl; + details << "V" << llGetViewerVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports std::string object_name = childGetText("object_name"); if (!object_name.empty() && !mOwnerName.empty()) @@ -629,10 +625,8 @@ LLSD LLFloaterReporter::gatherReport() std::string version_string; version_string = llformat( - "%d.%d.%d %s %s %s %s", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, + "%s %s %s %s %s", + llGetViewerShortVersion().c_str(), platform, gSysCPU.getFamily().c_str(), gGLManager.mGLRenderer.c_str(), diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 6a3462f201..4e77b42187 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2208,9 +2208,9 @@ void LLFolderView::setFilterPermMask( PermissionMask filter_perm_mask ) mFilter->setFilterPermissions(filter_perm_mask); } -U32 LLFolderView::getFilterTypes() const +U32 LLFolderView::getFilterObjectTypes() const { - return mFilter->getFilterTypes(); + return mFilter->getFilterObjectTypes(); } PermissionMask LLFolderView::getFilterPermissions() const diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index eaaba8c13d..4adf6c2fbf 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -71,9 +71,6 @@ class LLUICtrl; // that only work folders or only work on items, but I'll worry about // that later when it's determined to be too slow. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - class LLFolderViewFunctor { public: @@ -119,7 +116,7 @@ public: // filter is never null LLInventoryFilter* getFilter(); const std::string getFilterSubString(BOOL trim = FALSE); - U32 getFilterTypes() const; + U32 getFilterObjectTypes() const; PermissionMask getFilterPermissions() const; // JAMESDEBUG use getFilter()->getShowFolderState(); //LLInventoryFilter::EFolderShow getShowFolderState(); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 18ff53c127..4f487ddf04 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -57,6 +57,7 @@ #include "llvoavatarself.h" #include "llviewerstats.h" #include "llnearbychatbar.h" +#include "llappearancemgr.h" // Longest time, in seconds, to wait for all animations to stop playing const F32 MAX_WAIT_ANIM_SECS = 30.f; @@ -303,6 +304,8 @@ void LLGestureManager::deactivateGesture(const LLUUID& item_id) gAgent.sendReliableMessage(); + LLAppearanceManager::instance().removeCOFItemLinks(base_item_id, false); + notifyObservers(); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5bfad0695c..4c28d5e2df 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -512,37 +512,44 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector<std::string> &disabled_items, U32 flags) { const LLInventoryObject *obj = getInventoryObject(); - if (obj && obj->getIsLinkType()) - { - items.push_back(std::string("Find Original")); - if (isLinkedObjectMissing()) - { - disabled_items.push_back(std::string("Find Original")); - } - } - else + if (obj) { - items.push_back(std::string("Rename")); - if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0) - { - disabled_items.push_back(std::string("Rename")); - } - - if (show_asset_id) + if (obj->getIsLinkType()) { - items.push_back(std::string("Copy Asset UUID")); - if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) - || (flags & FIRST_SELECTED_ITEM) == 0) + items.push_back(std::string("Find Original")); + if (isLinkedObjectMissing()) { - disabled_items.push_back(std::string("Copy Asset UUID")); + disabled_items.push_back(std::string("Find Original")); } } - items.push_back(std::string("Copy Separator")); - - items.push_back(std::string("Copy")); - if (!isItemCopyable()) + else { - disabled_items.push_back(std::string("Copy")); + if (LLAssetType::lookupCanLink(obj->getType())) + { + items.push_back(std::string("Find Links")); + } + items.push_back(std::string("Rename")); + if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Rename")); + } + + if (show_asset_id) + { + items.push_back(std::string("Copy Asset UUID")); + if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) + || (flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Copy Asset UUID")); + } + } + items.push_back(std::string("Copy Separator")); + + items.push_back(std::string("Copy")); + if (!isItemCopyable()) + { + disabled_items.push_back(std::string("Copy")); + } } } @@ -931,6 +938,7 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model, { gotoItem(folder); } + if ("open" == action) { openItem(); @@ -3768,8 +3776,14 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) getClipboardEntries(true, items, disabled_items, flags); items.push_back(std::string("Gesture Separator")); - items.push_back(std::string("Activate")); - items.push_back(std::string("Deactivate")); + if (LLGestureManager::instance().isGestureActive(getUUID())) + { + items.push_back(std::string("Deactivate")); + } + else + { + items.push_back(std::string("Activate")); + } } hide_context_entries(menu, items, disabled_items); } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 67dfc5b6f9..63be9dcdb8 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -154,7 +154,6 @@ public: virtual std::string getLabelSuffix() const { return LLStringUtil::null; } virtual void openItem() {} virtual void closeItem() {} - virtual void gotoItem(LLFolderView *folder) {} // for links virtual void previewItem() {openItem();} virtual void showProperties(); virtual BOOL isItemRenameable() const { return TRUE; } @@ -241,7 +240,6 @@ public: virtual void restoreItem(); virtual void restoreToWorld(); virtual void gotoItem(LLFolderView *folder); - virtual LLUIImagePtr getIcon() const; virtual const std::string& getDisplayName() const; virtual std::string getLabelSuffix() const; diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 085c96c93d..4c5e4d5607 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -44,6 +44,19 @@ // linden library includes #include "lltrans.h" +LLInventoryFilter::FilterOps::FilterOps() : + mFilterObjectTypes(0xffffffffffffffffULL), + mFilterCategoryTypes(0xffffffffffffffffULL), + mMinDate(time_min()), + mMaxDate(time_max()), + mHoursAgo(0), + mShowFolderState(SHOW_NON_EMPTY_FOLDERS), + mPermissions(PERM_NONE), + mFilterTypes(FILTERTYPE_OBJECT), + mFilterUUID(LLUUID::null) +{ +} + ///---------------------------------------------------------------------------- /// Class LLInventoryFilter ///---------------------------------------------------------------------------- @@ -52,14 +65,6 @@ LLInventoryFilter::LLInventoryFilter(const std::string& name) mModified(FALSE), mNeedTextRebuild(TRUE) { - mFilterOps.mFilterTypes = 0xffffffffffffffffULL; - mFilterOps.mMinDate = time_min(); - mFilterOps.mMaxDate = time_max(); - mFilterOps.mHoursAgo = 0; - mFilterOps.mShowFolderState = SHOW_NON_EMPTY_FOLDERS; - mFilterOps.mPermissions = PERM_NONE; - mFilterOps.mFilterForCategories = FALSE; - mOrder = SO_FOLDERS_BY_NAME; // This gets overridden by a pref immediately mSubStringMatchOffset = 0; @@ -81,11 +86,17 @@ LLInventoryFilter::~LLInventoryFilter() { } -BOOL LLInventoryFilter::check(LLFolderViewItem* item) +BOOL LLInventoryFilter::check(const LLFolderViewItem* item) { - time_t earliest; + // If it's a folder and we're showing all folders, return TRUE automatically. + const BOOL is_folder = (dynamic_cast<const LLFolderViewFolder*>(item) != NULL); + if (is_folder && (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)) + { + return TRUE; + } - earliest = time_corrected() - mFilterOps.mHoursAgo * 3600; + const U16 HOURS_TO_SECONDS = 3600; + time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) { earliest = mFilterOps.mMinDate; @@ -94,59 +105,73 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) { earliest = 0; } - LLFolderViewEventListener* listener = item->getListener(); + + const LLFolderViewEventListener* listener = item->getListener(); mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; - bool passed_type = false; - if (mFilterOps.mFilterForCategories) + const BOOL passed_filtertype = checkAgainstFilterType(item); + const BOOL passed = passed_filtertype && + (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) && + ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) && + (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); + + return passed; +} + +BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) +{ + const LLFolderViewEventListener* listener = item->getListener(); + if (!listener) return FALSE; + + const LLInventoryType::EType object_type = listener->getInventoryType(); + const LLUUID object_id = listener->getUUID(); + const LLInventoryObject *object = gInventory.getObject(object_id); + + if (!object) return FALSE; + + const U32 filterTypes = mFilterOps.mFilterTypes; + + // Pass if this item's type is of the correct filter type + if (filterTypes & FILTERTYPE_OBJECT) { - // Pass if this item is a category of the filter type, or - // if its parent is a category of the filter type. - LLUUID uuid = listener->getUUID(); - if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) + // If it has no type, pass it, unless it's a link. + if (object_type == LLInventoryType::IT_NONE) { - const LLInventoryObject *obj = gInventory.getObject(uuid); - uuid = obj->getParentUUID(); - } - LLViewerInventoryCategory *cat = gInventory.getCategory(uuid); - if (cat) - { - passed_type |= ((1LL << cat->getPreferredType() & mFilterOps.mFilterTypes) != U64(0)); + if (object->getIsLinkType()) + return FALSE; } + if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) + return FALSE; } - else + + // Pass if this item is a category of the filter type, or + // if its parent is a category of the filter type. + if (filterTypes & FILTERTYPE_CATEGORY) { - LLInventoryType::EType type = listener->getInventoryType(); - passed_type |= ((1LL << type & mFilterOps.mFilterTypes) != U64(0)); - if (type == LLInventoryType::IT_NONE) + LLUUID cat_id = object_id; + if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) { - const LLInventoryObject *obj = gInventory.getObject(listener->getUUID()); - if (obj && obj->getIsLinkType()) - { - passed_type = FALSE; - } - else - { - passed_type = TRUE; - } + cat_id = object->getParentUUID(); } + const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); + if (!cat) + return FALSE; + if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) + return FALSE; } - BOOL passed = passed_type - && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) - && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) - && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); - - BOOL is_folder = (dynamic_cast<LLFolderViewFolder*>(item) != NULL); - if (is_folder && mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) + // Pass if this item is the target UUID or if it links to the target UUID + if (filterTypes & FILTERTYPE_UUID) { - passed = TRUE; + if (object->getLinkedUUID() != mFilterOps.mFilterUUID) + return FALSE; } - return passed; + return TRUE; } -const std::string LLInventoryFilter::getFilterSubString(BOOL trim) + +const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const { return mFilterSubString; } @@ -157,9 +182,9 @@ std::string::size_type LLInventoryFilter::getStringMatchOffset() const } // has user modified default filter params? -BOOL LLInventoryFilter::isNotDefault() +BOOL LLInventoryFilter::isNotDefault() const { - return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes + return mFilterOps.mFilterObjectTypes != mDefaultFilterOps.mFilterObjectTypes || mFilterSubString.size() || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate @@ -167,9 +192,9 @@ BOOL LLInventoryFilter::isNotDefault() || mFilterOps.mHoursAgo != mDefaultFilterOps.mHoursAgo; } -BOOL LLInventoryFilter::isActive() +BOOL LLInventoryFilter::isActive() const { - return mFilterOps.mFilterTypes != 0xffffffffffffffffULL + return mFilterOps.mFilterObjectTypes != 0xffffffffffffffffULL || mFilterSubString.size() || mFilterOps.mPermissions != PERM_NONE || mFilterOps.mMinDate != time_min() @@ -177,7 +202,7 @@ BOOL LLInventoryFilter::isActive() || mFilterOps.mHoursAgo != 0; } -BOOL LLInventoryFilter::isModified() +BOOL LLInventoryFilter::isModified() const { return mModified; } @@ -189,15 +214,43 @@ BOOL LLInventoryFilter::isModifiedAndClear() return ret; } -void LLInventoryFilter::setFilterTypes(U64 types, BOOL filter_for_categories) +void LLInventoryFilter::setFilterObjectTypes(U64 types) +{ + if (mFilterOps.mFilterObjectTypes != types) + { + // keep current items only if no type bits getting turned off + BOOL fewer_bits_set = (mFilterOps.mFilterObjectTypes & ~types); + BOOL more_bits_set = (~mFilterOps.mFilterObjectTypes & types); + + mFilterOps.mFilterObjectTypes = types; + if (more_bits_set && fewer_bits_set) + { + // neither less or more restrive, both simultaneously + // so we need to filter from scratch + setModified(FILTER_RESTART); + } + else if (more_bits_set) + { + // target is only one of all requested types so more type bits == less restrictive + setModified(FILTER_LESS_RESTRICTIVE); + } + else if (fewer_bits_set) + { + setModified(FILTER_MORE_RESTRICTIVE); + } + } + mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; +} + +void LLInventoryFilter::setFilterCategoryTypes(U64 types) { - if (mFilterOps.mFilterTypes != types) + if (mFilterOps.mFilterCategoryTypes != types) { // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterTypes & types); + BOOL fewer_bits_set = (mFilterOps.mFilterCategoryTypes & ~types); + BOOL more_bits_set = (~mFilterOps.mFilterCategoryTypes & types); - mFilterOps.mFilterTypes = types; + mFilterOps.mFilterCategoryTypes = types; if (more_bits_set && fewer_bits_set) { // neither less or more restrive, both simultaneously @@ -214,7 +267,21 @@ void LLInventoryFilter::setFilterTypes(U64 types, BOOL filter_for_categories) setModified(FILTER_MORE_RESTRICTIVE); } } - mFilterOps.mFilterForCategories = filter_for_categories; + mFilterOps.mFilterTypes |= FILTERTYPE_CATEGORY; +} + +void LLInventoryFilter::setFilterUUID(const LLUUID& object_id) +{ + if (mFilterOps.mFilterUUID == LLUUID::null) + { + setModified(FILTER_MORE_RESTRICTIVE); + } + else + { + setModified(FILTER_RESTART); + } + mFilterOps.mFilterUUID = object_id; + mFilterOps.mFilterTypes = FILTERTYPE_UUID; } void LLInventoryFilter::setFilterSubString(const std::string& string) @@ -222,9 +289,11 @@ void LLInventoryFilter::setFilterSubString(const std::string& string) if (mFilterSubString != string) { // hitting BACKSPACE, for example - BOOL less_restrictive = mFilterSubString.size() >= string.size() && !mFilterSubString.substr(0, string.size()).compare(string); + const BOOL less_restrictive = mFilterSubString.size() >= string.size() && !mFilterSubString.substr(0, string.size()).compare(string); + // appending new characters - BOOL more_restrictive = mFilterSubString.size() < string.size() && !string.substr(0, mFilterSubString.size()).compare(mFilterSubString); + const BOOL more_restrictive = mFilterSubString.size() < string.size() && !string.substr(0, mFilterSubString.size()).compare(mFilterSubString); + mFilterSubString = string; LLStringUtil::toUpper(mFilterSubString); LLStringUtil::trimHead(mFilterSubString); @@ -241,6 +310,14 @@ void LLInventoryFilter::setFilterSubString(const std::string& string) { setModified(FILTER_RESTART); } + + // Cancel out UUID once the search string is modified + if (mFilterOps.mFilterTypes == FILTERTYPE_UUID) + { + mFilterOps.mFilterTypes &= ~FILTERTYPE_UUID; + mFilterOps.mFilterUUID == LLUUID::null; + setModified(FILTER_RESTART); + } } } @@ -298,12 +375,18 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) } } -BOOL LLInventoryFilter::isSinceLogoff() +BOOL LLInventoryFilter::isSinceLogoff() const { return (mFilterOps.mMinDate == (time_t)mLastLogoff) && (mFilterOps.mMaxDate == time_max()); } +void LLInventoryFilter::clearModified() +{ + mModified = FALSE; + mFilterBehavior = FILTER_NONE; +} + void LLInventoryFilter::setHoursAgo(U32 hours) { if (mFilterOps.mHoursAgo != hours) @@ -417,12 +500,12 @@ void LLInventoryFilter::setModified(EFilterBehavior behavior) } } -BOOL LLInventoryFilter::isFilterWith(LLInventoryType::EType t) +BOOL LLInventoryFilter::isFilterObjectTypesWith(LLInventoryType::EType t) const { - return mFilterOps.mFilterTypes & (1LL << t); + return mFilterOps.mFilterObjectTypes & (1LL << t); } -std::string LLInventoryFilter::getFilterText() +const std::string& LLInventoryFilter::getFilterText() { if (!mNeedTextRebuild) { @@ -437,7 +520,7 @@ std::string LLInventoryFilter::getFilterText() S32 num_filter_types = 0; mFilterText.clear(); - if (isFilterWith(LLInventoryType::IT_ANIMATION)) + if (isFilterObjectTypesWith(LLInventoryType::IT_ANIMATION)) { //filtered_types += " Animations,"; filtered_types += LLTrans::getString("Animations"); @@ -452,7 +535,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_CALLINGCARD)) + if (isFilterObjectTypesWith(LLInventoryType::IT_CALLINGCARD)) { //filtered_types += " Calling Cards,"; filtered_types += LLTrans::getString("Calling Cards"); @@ -466,7 +549,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_WEARABLE)) + if (isFilterObjectTypesWith(LLInventoryType::IT_WEARABLE)) { //filtered_types += " Clothing,"; filtered_types += LLTrans::getString("Clothing"); @@ -480,7 +563,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_GESTURE)) + if (isFilterObjectTypesWith(LLInventoryType::IT_GESTURE)) { //filtered_types += " Gestures,"; filtered_types += LLTrans::getString("Gestures"); @@ -494,7 +577,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_LANDMARK)) + if (isFilterObjectTypesWith(LLInventoryType::IT_LANDMARK)) { //filtered_types += " Landmarks,"; filtered_types += LLTrans::getString("Landmarks"); @@ -508,7 +591,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_NOTECARD)) + if (isFilterObjectTypesWith(LLInventoryType::IT_NOTECARD)) { //filtered_types += " Notecards,"; filtered_types += LLTrans::getString("Notecards"); @@ -522,7 +605,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_OBJECT) && isFilterWith(LLInventoryType::IT_ATTACHMENT)) + if (isFilterObjectTypesWith(LLInventoryType::IT_OBJECT) && isFilterObjectTypesWith(LLInventoryType::IT_ATTACHMENT)) { //filtered_types += " Objects,"; filtered_types += LLTrans::getString("Objects"); @@ -536,7 +619,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_LSL)) + if (isFilterObjectTypesWith(LLInventoryType::IT_LSL)) { //filtered_types += " Scripts,"; filtered_types += LLTrans::getString("Scripts"); @@ -550,7 +633,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_SOUND)) + if (isFilterObjectTypesWith(LLInventoryType::IT_SOUND)) { //filtered_types += " Sounds,"; filtered_types += LLTrans::getString("Sounds"); @@ -564,7 +647,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_TEXTURE)) + if (isFilterObjectTypesWith(LLInventoryType::IT_TEXTURE)) { //filtered_types += " Textures,"; filtered_types += LLTrans::getString("Textures"); @@ -578,7 +661,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_SNAPSHOT)) + if (isFilterObjectTypesWith(LLInventoryType::IT_SNAPSHOT)) { //filtered_types += " Snapshots,"; filtered_types += LLTrans::getString("Snapshots"); @@ -619,9 +702,9 @@ std::string LLInventoryFilter::getFilterText() return mFilterText; } -void LLInventoryFilter::toLLSD(LLSD& data) +void LLInventoryFilter::toLLSD(LLSD& data) const { - data["filter_types"] = (LLSD::Integer)getFilterTypes(); + data["filter_types"] = (LLSD::Integer)getFilterObjectTypes(); data["min_date"] = (LLSD::Integer)getMinDate(); data["max_date"] = (LLSD::Integer)getMaxDate(); data["hours_ago"] = (LLSD::Integer)getHoursAgo(); @@ -636,7 +719,7 @@ void LLInventoryFilter::fromLLSD(LLSD& data) { if(data.has("filter_types")) { - setFilterTypes((U32)data["filter_types"].asInteger()); + setFilterObjectTypes((U32)data["filter_types"].asInteger()); } if(data.has("min_date") && data.has("max_date")) @@ -674,3 +757,71 @@ void LLInventoryFilter::fromLLSD(LLSD& data) setDateRangeLastLogoff((bool)data["since_logoff"].asBoolean()); } } + +U32 LLInventoryFilter::getFilterObjectTypes() const +{ + return mFilterOps.mFilterObjectTypes; +} + +BOOL LLInventoryFilter::hasFilterString() const +{ + return mFilterSubString.size() > 0; +} + +PermissionMask LLInventoryFilter::getFilterPermissions() const +{ + return mFilterOps.mPermissions; +} + +time_t LLInventoryFilter::getMinDate() const +{ + return mFilterOps.mMinDate; +} + +time_t LLInventoryFilter::getMaxDate() const +{ + return mFilterOps.mMaxDate; +} +U32 LLInventoryFilter::getHoursAgo() const +{ + return mFilterOps.mHoursAgo; +} +LLInventoryFilter::EFolderShow LLInventoryFilter::getShowFolderState() const +{ + return mFilterOps.mShowFolderState; +} +U32 LLInventoryFilter::getSortOrder() const +{ + return mOrder; +} +const std::string& LLInventoryFilter::getName() const +{ + return mName; +} + +void LLInventoryFilter::setFilterCount(S32 count) +{ + mFilterCount = count; +} +S32 LLInventoryFilter::getFilterCount() const +{ + return mFilterCount; +} + +void LLInventoryFilter::decrementFilterCount() +{ + mFilterCount--; +} + +S32 LLInventoryFilter::getCurrentGeneration() const +{ + return mFilterGeneration; +} +S32 LLInventoryFilter::getMinRequiredGeneration() const +{ + return mMinRequiredGeneration; +} +S32 LLInventoryFilter::getMustPassGeneration() const +{ + return mMustPassGeneration; +} diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index b803df110b..d65fb8f27c 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -33,30 +33,38 @@ #ifndef LLINVENTORYFILTER_H #define LLINVENTORYFILTER_H -// lots of includes here #include "llinventorytype.h" -#include "llpermissionsflags.h" // PermissionsMask +#include "llpermissionsflags.h" class LLFolderViewItem; class LLInventoryFilter { public: - typedef enum e_folder_show + enum EFolderShow { SHOW_ALL_FOLDERS, SHOW_NON_EMPTY_FOLDERS, SHOW_NO_FOLDERS - } EFolderShow; + }; - typedef enum e_filter_behavior + enum EFilterBehavior { FILTER_NONE, // nothing to do, already filtered FILTER_RESTART, // restart filtering from scratch FILTER_LESS_RESTRICTIVE, // existing filtered items will certainly pass this filter FILTER_MORE_RESTRICTIVE // if you didn't pass the previous filter, you definitely won't pass this one - } EFilterBehavior; + }; + + enum EFilterType + { + FILTERTYPE_NONE = 0, + FILTERTYPE_OBJECT = 1, // normal default search-by-object-type + FILTERTYPE_CATEGORY = 2, // search by folder type + FILTERTYPE_UUID = 4 // find the object with UUID and any links to it + }; + // REFACTOR: Change this to an enum. static const U32 SO_DATE = 1; static const U32 SO_FOLDERS_BY_NAME = 2; static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4; @@ -64,89 +72,121 @@ public: LLInventoryFilter(const std::string& name); virtual ~LLInventoryFilter(); - void setFilterTypes(U64 types, BOOL filter_for_categories = FALSE); // if filter_for_categories is true, operate on folder preferred asset type - U32 getFilterTypes() const { return mFilterOps.mFilterTypes; } - - void setFilterSubString(const std::string& string); - const std::string getFilterSubString(BOOL trim = FALSE); - - void setFilterPermissions(PermissionMask perms); - PermissionMask getFilterPermissions() const { return mFilterOps.mPermissions; } - - void setDateRange(time_t min_date, time_t max_date); - void setDateRangeLastLogoff(BOOL sl); - time_t getMinDate() const { return mFilterOps.mMinDate; } - time_t getMaxDate() const { return mFilterOps.mMaxDate; } - - void setHoursAgo(U32 hours); - U32 getHoursAgo() const { return mFilterOps.mHoursAgo; } - - void setShowFolderState( EFolderShow state); - EFolderShow getShowFolderState() { return mFilterOps.mShowFolderState; } - - void setSortOrder(U32 order); - U32 getSortOrder() { return mOrder; } - - BOOL check(LLFolderViewItem* item); + // +-------------------------------------------------------------------+ + // + Execution And Results + // +-------------------------------------------------------------------+ + BOOL check(const LLFolderViewItem* item); + BOOL checkAgainstFilterType(const LLFolderViewItem* item); std::string::size_type getStringMatchOffset() const; - BOOL isActive(); - BOOL isNotDefault(); - BOOL isModified(); - BOOL isModifiedAndClear(); - BOOL isSinceLogoff(); - bool hasFilterString() { return mFilterSubString.size() > 0; } - void clearModified() { mModified = FALSE; mFilterBehavior = FILTER_NONE; } - const std::string getName() const { return mName; } - std::string getFilterText(); - void setFilterCount(S32 count) { mFilterCount = count; } - S32 getFilterCount() { return mFilterCount; } - void decrementFilterCount() { mFilterCount--; } + // +-------------------------------------------------------------------+ + // + Parameters + // +-------------------------------------------------------------------+ + void setFilterObjectTypes(U64 types); + U32 getFilterObjectTypes() const; + BOOL isFilterObjectTypesWith(LLInventoryType::EType t) const; + void setFilterCategoryTypes(U64 types); + void setFilterUUID(const LLUUID &object_id); + + void setFilterSubString(const std::string& string); + const std::string& getFilterSubString(BOOL trim = FALSE) const; + BOOL hasFilterString() const; + + void setFilterPermissions(PermissionMask perms); + PermissionMask getFilterPermissions() const; + + void setDateRange(time_t min_date, time_t max_date); + void setDateRangeLastLogoff(BOOL sl); + time_t getMinDate() const; + time_t getMaxDate() const; + + void setHoursAgo(U32 hours); + U32 getHoursAgo() const; + + void setShowFolderState( EFolderShow state); + EFolderShow getShowFolderState() const; + + void setSortOrder(U32 order); + U32 getSortOrder() const; + + // +-------------------------------------------------------------------+ + // + Status + // +-------------------------------------------------------------------+ + BOOL isActive() const; + BOOL isModified() const; + BOOL isModifiedAndClear(); + BOOL isSinceLogoff() const; + void clearModified(); + const std::string& getName() const; + const std::string& getFilterText(); + //RN: this is public to allow system to externally force a global refilter + void setModified(EFilterBehavior behavior = FILTER_RESTART); + + // +-------------------------------------------------------------------+ + // + Count + // +-------------------------------------------------------------------+ + void setFilterCount(S32 count); + S32 getFilterCount() const; + void decrementFilterCount(); + + // +-------------------------------------------------------------------+ + // + Default + // +-------------------------------------------------------------------+ + BOOL isNotDefault() const; + void markDefault(); + void resetDefault(); + + // +-------------------------------------------------------------------+ + // + Generation + // +-------------------------------------------------------------------+ + S32 getCurrentGeneration() const; + S32 getMinRequiredGeneration() const; + S32 getMustPassGeneration() const; + + // +-------------------------------------------------------------------+ + // + Conversion + // +-------------------------------------------------------------------+ + void toLLSD(LLSD& data) const; + void fromLLSD(LLSD& data); - void markDefault(); - void resetDefault(); +private: + struct FilterOps + { + FilterOps(); + U32 mFilterTypes; - BOOL isFilterWith(LLInventoryType::EType t); + U64 mFilterObjectTypes; // For _ITEM + U64 mFilterCategoryTypes; // For _ITEM + LLUUID mFilterUUID; // for UUID - S32 getCurrentGeneration() const { return mFilterGeneration; } - S32 getMinRequiredGeneration() const { return mMinRequiredGeneration; } - S32 getMustPassGeneration() const { return mMustPassGeneration; } + time_t mMinDate; + time_t mMaxDate; + U32 mHoursAgo; + EFolderShow mShowFolderState; + PermissionMask mPermissions; + }; - //RN: this is public to allow system to externally force a global refilter - void setModified(EFilterBehavior behavior = FILTER_RESTART); + U32 mOrder; + U32 mLastLogoff; - void toLLSD(LLSD& data); - void fromLLSD(LLSD& data); + FilterOps mFilterOps; + FilterOps mDefaultFilterOps; -protected: - struct filter_ops - { - U64 mFilterTypes; - BOOL mFilterForCategories; - time_t mMinDate; - time_t mMaxDate; - U32 mHoursAgo; - EFolderShow mShowFolderState; - PermissionMask mPermissions; - }; - filter_ops mFilterOps; - filter_ops mDefaultFilterOps; std::string::size_type mSubStringMatchOffset; - std::string mFilterSubString; - U32 mOrder; - const std::string mName; - S32 mFilterGeneration; - S32 mMustPassGeneration; - S32 mMinRequiredGeneration; - S32 mFilterCount; - S32 mNextFilterGeneration; - EFilterBehavior mFilterBehavior; + std::string mFilterSubString; + const std::string mName; -private: - U32 mLastLogoff; - BOOL mModified; - BOOL mNeedTextRebuild; - std::string mFilterText; + S32 mFilterGeneration; + S32 mMustPassGeneration; + S32 mMinRequiredGeneration; + S32 mNextFilterGeneration; + + S32 mFilterCount; + EFilterBehavior mFilterBehavior; + + BOOL mModified; + BOOL mNeedTextRebuild; + std::string mFilterText; }; #endif diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 95cc68ddbe..9916a2351c 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -34,32 +34,9 @@ #ifndef LL_LLINVENTORYFUNCTIONS_H #define LL_LLINVENTORYFUNCTIONS_H -#include "llassetstorage.h" -#include "lldarray.h" -#include "llfloater.h" -#include "llinventory.h" -#include "llinventoryfilter.h" +#include "llinventorytype.h" #include "llfolderview.h" -#include "llinventorymodel.h" -#include "lluictrlfactory.h" -#include <set> - - -class LLFolderViewItem; -class LLInventoryFilter; -class LLInventoryModel; -class LLInventoryPanel; -class LLInvFVBridge; -class LLInventoryFVBridgeBuilder; -class LLMenuBarGL; -class LLCheckBoxCtrl; -class LLSpinCtrl; -class LLScrollContainer; -class LLTextBox; -class LLIconCtrl; -class LLSaveFolderState; -class LLFilterEditor; -class LLTabContainer; +#include "llfolderviewitem.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 29096ff718..fb9be1e04f 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -211,6 +211,25 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id, return FALSE; } +const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const +{ + const LLInventoryObject* obj = getObject(obj_id); + const LLUUID& parent_id = obj->getParentUUID(); + while (!parent_id.isNull()) + { + const LLViewerInventoryCategory *cat = getCategory(parent_id); + if (!cat) break; + const LLFolderType::EType folder_type = cat->getPreferredType(); + if (folder_type != LLFolderType::FT_NONE && + folder_type != LLFolderType::FT_ROOT_INVENTORY && + !LLFolderType::lookupIsEnsembleType(folder_type)) + { + return cat; + } + } + return NULL; +} + // Get the object by id. Returns NULL if not found. LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const { diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index c3e04ab93c..b744d821c7 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -108,10 +108,12 @@ public: // Accessors // - // This is a convenience function to check if one object has a - // parent chain up to the category specified by UUID. + // Check if one object has a parent chain up to the category specified by UUID. BOOL isObjectDescendentOf(const LLUUID& obj_id, const LLUUID& cat_id) const; + // Get whatever special folder this object is a child of, if any. + const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const; + // Get the object by id. Returns NULL if not found. // * WARNING: use the pointer returned for read operations - do // not modify the object values in place or you will break stuff. diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index b89a8bfd7d..4cbf27b725 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -169,7 +169,7 @@ BOOL LLInventoryPanel::postBuild() { setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } - mFolders->setSortOrder(mFolders->getFilter()->getSortOrder()); + mFolders->setSortOrder(getFilter()->getSortOrder()); return TRUE; } @@ -207,25 +207,28 @@ LLInventoryFilter* LLInventoryPanel::getFilter() return NULL; } -void LLInventoryPanel::setFilterTypes(U64 filter_types, BOOL filter_for_categories) +void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { - mFolders->getFilter()->setFilterTypes(filter_types, filter_for_categories); -} + if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) + getFilter()->setFilterObjectTypes(types); + if (filter_type == LLInventoryFilter::FILTERTYPE_CATEGORY) + getFilter()->setFilterCategoryTypes(types); +} void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { - mFolders->getFilter()->setFilterPermissions(filter_perm_mask); + getFilter()->setFilterPermissions(filter_perm_mask); } void LLInventoryPanel::setFilterSubString(const std::string& string) { - mFolders->getFilter()->setFilterSubString(string); + getFilter()->setFilterSubString(string); } void LLInventoryPanel::setSortOrder(U32 order) { - mFolders->getFilter()->setSortOrder(order); - if (mFolders->getFilter()->isModified()) + getFilter()->setSortOrder(order); + if (getFilter()->isModified()) { mFolders->setSortOrder(order); // try to keep selection onscreen, even if it wasn't to start with @@ -235,22 +238,22 @@ void LLInventoryPanel::setSortOrder(U32 order) void LLInventoryPanel::setSinceLogoff(BOOL sl) { - mFolders->getFilter()->setDateRangeLastLogoff(sl); + getFilter()->setDateRangeLastLogoff(sl); } void LLInventoryPanel::setHoursAgo(U32 hours) { - mFolders->getFilter()->setHoursAgo(hours); + getFilter()->setHoursAgo(hours); } void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show) { - mFolders->getFilter()->setShowFolderState(show); + getFilter()->setShowFolderState(show); } LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState() { - return mFolders->getFilter()->getShowFolderState(); + return getFilter()->getShowFolderState(); } void LLInventoryPanel::modelChanged(U32 mask) @@ -845,7 +848,7 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata) BOOL LLInventoryPanel::getSinceLogoff() { - return mFolders->getFilter()->isSinceLogoff(); + return getFilter()->isSinceLogoff(); } // DEBUG ONLY @@ -856,14 +859,31 @@ void LLInventoryPanel::dumpSelectionInformation(void* user_data) iv->mFolders->dumpSelectionInformation(); } -// static -LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() +BOOL is_inventorysp_active() { - LLInventoryPanel* res = NULL; + if (!LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")) return FALSE; + LLSidepanelInventory *inventorySP = dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + if (!inventorySP) return FALSE; + return inventorySP->isMainInventoryPanelActive(); +} - // Iterate through the inventory floaters and return whichever is on top. +// static +LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) +{ + // A. If the inventory side panel is open, use that preferably. + if (is_inventorysp_active()) + { + LLSidepanelInventory *inventorySP = dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + if (inventorySP) + { + return inventorySP->getActivePanel(); + } + } + + // B. Iterate through the inventory floaters and return whichever is on top. LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); S32 z_min = S32_MAX; + LLInventoryPanel* res = NULL; for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) { LLFloaterInventory* iv = dynamic_cast<LLFloaterInventory*>(*iter); @@ -877,25 +897,22 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() } } } + if (res) return res; + + // C. If no panels are open and we don't want to force open a panel, then just abort out. + if (!auto_open) return NULL; + + // D. Open the inventory side panel and use that. + LLSideTray *side_tray = LLSideTray::getInstance(); + LLSidepanelInventory *sidepanel_inventory = + dynamic_cast<LLSidepanelInventory *>(side_tray->getPanel("sidepanel_inventory")); - // Otherwise, open the inventorySP and use that. - if (!res) + // Use the inventory side panel only if it is already active. + // Activating it may unexpectedly switch off the currently active tab in some cases. + if (sidepanel_inventory && (LLPanel*)side_tray->getActiveTab() == (LLPanel*)sidepanel_inventory) { - LLSideTray *side_tray = LLSideTray::getInstance(); - LLSidepanelInventory *sidepanel_inventory = - dynamic_cast<LLSidepanelInventory *>(side_tray->getPanel("sidepanel_inventory")); - - // Use the inventory side panel only if it is already active. - // Activating it may unexpectedly switch off the currently active tab in some cases. - if (sidepanel_inventory && (LLPanel*)side_tray->getActiveTab() == (LLPanel*)sidepanel_inventory) - { - res = sidepanel_inventory->getActivePanel(); - if (res) - { - return res; - } - } + return sidepanel_inventory->getActivePanel(); } - return res; + return NULL; } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index d65fe53812..cbbd433c1d 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -126,8 +126,8 @@ public: void setSelectCallback(const LLFolderView::signal_t::slot_type& cb) { if (mFolders) mFolders->setSelectCallback(cb); } void clearSelection(); LLInventoryFilter* getFilter(); - void setFilterTypes(U64 filter, BOOL filter_for_categories = FALSE); // if filter_for_categories is true, operate on folder preferred asset type - U32 getFilterTypes() const { return mFolders->getFilterTypes(); } + void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); + U32 getFilterObjectTypes() const { return mFolders->getFilterObjectTypes(); } void setFilterPermMask(PermissionMask filter_perm_mask); U32 getFilterPermMask() const { return mFolders->getFilterPermissions(); } void setFilterSubString(const std::string& string); @@ -163,7 +163,8 @@ public: static void onIdle(void* user_data); // Find whichever inventory panel is active / on top. - static LLInventoryPanel *getActiveInventoryPanel(); + // "Auto_open" determines if we open an inventory panel if none are open. + static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); protected: void defaultOpenInventory(); // open the first level of inventory diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 955347bce2..7d3da152c1 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -189,8 +189,7 @@ void LLLoginInstance::constructAuthParams(const LLSD& credentials) bool LLLoginInstance::handleLoginEvent(const LLSD& event) { - std::cout << "LoginListener called!: \n"; - std::cout << event << "\n"; + LL_DEBUGS("Login") << "LoginListener called!: \n" << event << LL_ENDL; if(!(event.has("state") && event.has("change") && event.has("progress"))) { diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index de7a85836d..92b6d2f619 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -35,6 +35,7 @@ #include "llpanelhome.h" #include "llmediactrl.h" +#include "llviewerhome.h" static LLRegisterPanelClassWrapper<LLPanelHome> t_people("panel_sidetray_home"); @@ -62,51 +63,17 @@ BOOL LLPanelHome::postBuild() mBrowser = getChild<LLMediaCtrl>("browser"); if (mBrowser) { + // read the URL to display from settings.xml + std::string url = LLViewerHome::getHomeURL(); + mBrowser->addObserver(this); mBrowser->setTrusted(true); - mBrowser->setHomePageUrl("http://www.secondlife.com/"); - - childSetAction("back", onClickBack, this); - childSetAction("forward", onClickForward, this); - childSetAction("home", onClickHome, this); + mBrowser->setHomePageUrl(url); } return TRUE; } -//static -void LLPanelHome::onClickBack(void* user_data) -{ - LLPanelHome *self = (LLPanelHome*)user_data; - if (self && self->mBrowser) - { - self->mBrowser->navigateBack(); - } -} - -//static -void LLPanelHome::onClickForward(void* user_data) -{ - LLPanelHome *self = (LLPanelHome*)user_data; - if (self && self->mBrowser) - { - self->mBrowser->navigateForward(); - } -} - -//static -void LLPanelHome::onClickHome(void* user_data) -{ - LLPanelHome *self = (LLPanelHome*)user_data; - if (self && self->mBrowser) - { - self->mBrowser->navigateHome(); - } -} - void LLPanelHome::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) { - // update back/forward button state - childSetEnabled("back", mBrowser->canNavigateBack()); - childSetEnabled("forward", mBrowser->canNavigateForward()); } diff --git a/indra/newview/llpanelhome.h b/indra/newview/llpanelhome.h index b5ca48b23f..dfeca45b29 100644 --- a/indra/newview/llpanelhome.h +++ b/indra/newview/llpanelhome.h @@ -53,10 +53,6 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - static void onClickBack(void* user_data); - static void onClickForward(void* user_data); - static void onClickHome(void* user_data); - private: // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4bae6af12e..e73c65e252 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -57,7 +57,7 @@ #include "llui.h" #include "lluiconstants.h" #include "llurlsimstring.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llviewerhelp.h" #include "llviewertexturelist.h" #include "llviewermenu.h" // for handle_preferences() @@ -71,7 +71,6 @@ #include "llmediactrl.h" #include "llrootview.h" - #include "llfloatertos.h" #include "lltrans.h" #include "llglheaders.h" @@ -248,11 +247,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, getChild<LLPanel>("login_widgets")->setDefaultBtn("connect_btn"); std::string channel = gSavedSettings.getString("VersionChannelName"); - std::string version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VIEWER_BUILD ); + std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), + llGetViewerBuildVersion().c_str()); LLTextBox* channel_text = getChild<LLTextBox>("channel_text"); channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[VERSION]", version); @@ -263,6 +259,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLTextBox* create_new_account_text = getChild<LLTextBox>("create_new_account_text"); create_new_account_text->setClickedCallback(onClickNewAccount, NULL); + + LLTextBox* need_help_text = getChild<LLTextBox>("login_help"); + need_help_text->setClickedCallback(onClickHelp, NULL); #endif // get the web browser control @@ -741,8 +740,8 @@ void LLPanelLogin::loadLoginPage() } // Channel and Version - std::string version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD); + std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), + llGetViewerBuildVersion().c_str()); char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0); char* curl_version = curl_escape(version.c_str(), 0); @@ -966,6 +965,16 @@ void LLPanelLogin::onClickForgotPassword(void*) } } +//static +void LLPanelLogin::onClickHelp(void*) +{ + if (sInstance) + { + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + vhelp->showTopic(vhelp->getTopicFromFocus()); + } +} + // static void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index acb2001c22..e3d30d7d0c 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -96,6 +96,7 @@ private: // static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response); static void onClickVersion(void*); static void onClickForgotPassword(void*); + static void onClickHelp(void*); static void onPassKey(LLLineEditor* caller, void* user_data); static void onSelectServer(LLUICtrl*, void*); static void onServerComboLostFocus(LLFocusableElement*); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 74c1420cf3..9fd92725dc 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -653,7 +653,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() return; // Get data needed for filter display - U32 filter_types = mFilter->getFilterTypes(); + U32 filter_types = mFilter->getFilterObjectTypes(); std::string filter_string = mFilter->getFilterSubString(); LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); U32 hours = mFilter->getHoursAgo(); @@ -966,6 +966,46 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) preview_texture->openToSave(); } } + // This doesn't currently work, since the viewer can't change an assetID an item. + if (command_name == "regenerate_link") + { + LLInventoryPanel *active_panel = getActivePanel(); + LLFolderViewItem* current_item = active_panel->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + const LLUUID item_id = current_item->getListener()->getUUID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + item->regenerateLink(); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); + } + if (command_name == "find_original") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + current_item->getListener()->performAction(getActivePanel()->getRootFolder(), getActivePanel()->getModel(), "goto"); + } + + if (command_name == "find_links") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + const LLUUID& item_id = current_item->getListener()->getUUID(); + const std::string &item_name = current_item->getListener()->getName(); + LLInventoryFilter *filter = mActivePanel->getFilter(); + filter->setFilterSubString(item_name); + mFilterEditor->setText(item_name); + mFilterEditor->setFocus(TRUE); + filter->setFilterUUID(item_id); + filter->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + } } BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) @@ -1001,6 +1041,45 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) } return FALSE; } + if (command_name == "find_original") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item && item->getIsLinkType() && !item->getIsBrokenLink()) + { + return TRUE; + } + return FALSE; + } + + if (command_name == "find_links") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLInventoryObject *obj = gInventory.getObject(item_id); + if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType())) + { + return TRUE; + } + return FALSE; + } + // This doesn't currently work, since the viewer can't change an assetID an item. + if (command_name == "regenerate_link") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item && item->getIsBrokenLink()) + { + return TRUE; + } + return FALSE; + } + return TRUE; } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 0012f22cdd..4f8aff6f78 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -50,6 +50,7 @@ #include "llfloaterbuycurrency.h" #include "llfloaterreg.h" #include "llinventorybridge.h" +#include "llinventoryfilter.h" #include "llinventoryfunctions.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 951e74abf9..6aba8c0ebb 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -353,7 +353,7 @@ void LLPanelOutfitsInventory::initAccordionPanels() mAccordionPanels.resize(2); LLInventoryPanel *myoutfits_panel = getChild<LLInventoryPanel>("outfitslist_accordionpanel"); - myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, TRUE); + myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, LLInventoryFilter::FILTERTYPE_CATEGORY); myoutfits_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mAccordionPanels[0] = myoutfits_panel; mActivePanel = myoutfits_panel; diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index a1ea7aeb96..64f57f24f9 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -141,7 +141,7 @@ void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_wo S32 right_delta = old_world_rect.mRight - new_world_rect.mRight; LLRect this_rect = getRect(); - this_rect.mTop = new_world_rect.getHeight() * getHeightRatio(); + this_rect.mTop = (S32) (new_world_rect.getHeight() * getHeightRatio()); switch(mChannelAlignment) { case CA_LEFT : diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 9ab459080e..ca7a3b663a 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -128,10 +128,6 @@ void LLSidepanelInventory::onOpen(const LLSD& key) mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); showTaskInfoPanel(); } - if (key.has("select")) - { - mPanelMainInventory->getPanel()->setSelection(key["select"].asUUID(), TAKE_FOCUS_NO); - } } void LLSidepanelInventory::onInfoButtonClicked() @@ -290,3 +286,8 @@ LLInventoryPanel *LLSidepanelInventory::getActivePanel() } return NULL; } + +BOOL LLSidepanelInventory::isMainInventoryPanelActive() const +{ + return mInventoryPanel->getVisible(); +} diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index c2ce3badb8..231cdac9e1 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -51,6 +51,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. + BOOL isMainInventoryPanelActive() const; protected: // Tracks highlighted (selected) item in inventory panel. diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 9333465052..a1af2e5411 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -128,6 +128,7 @@ public: void onOpen (const LLSD& key); + LLPanel *getPanel(); private: std::string mTabTitle; std::string mImage; @@ -199,11 +200,17 @@ void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) void LLSideTrayTab::onOpen (const LLSD& key) { - LLPanel* panel = dynamic_cast<LLPanel*>(mMainPanel); + LLPanel *panel = getPanel(); if(panel) panel->onOpen(key); } +LLPanel* LLSideTrayTab::getPanel() +{ + LLPanel* panel = dynamic_cast<LLPanel*>(mMainPanel); + return panel; +} + LLSideTrayTab* LLSideTrayTab::createInstance () { LLSideTrayTab::Params tab_params; @@ -653,6 +660,23 @@ LLPanel* LLSideTray::getPanel (const std::string& panel_name) return NULL; } +LLPanel* LLSideTray::getActivePanel() +{ + if (mActiveTab && !mCollapsed) + { + return mActiveTab->getPanel(); + } + return NULL; +} + +bool LLSideTray::isPanelActive(const std::string& panel_name) +{ + LLPanel *panel = getActivePanel(); + if (!panel) return false; + return (panel->getName() == panel_name); +} + + // *TODO: Eliminate magic constants. static const S32 fake_offset = 132; static const S32 fake_top_offset = 18; diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index c90b2d7f8c..de2cfe9711 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -100,7 +100,8 @@ public: * get the panel (don't show it or do anything else with it) */ LLPanel* getPanel (const std::string& panel_name); - + LLPanel* getActivePanel (); + bool isPanelActive (const std::string& panel_name); /* * get currently active tab */ diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index c32e67ef90..a041f3ac98 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -36,7 +36,6 @@ #include "llagent.h" #include "llviewerassetstorage.h" -#include "llviewerbuild.h" #include "llvfile.h" #include "llvfs.h" diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 6aabcb11b8..db54a79610 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -43,12 +43,14 @@ struct ViewerFolderEntry : public LLDictionaryEntry { // Constructor for non-ensembles ViewerFolderEntry(const std::string &new_category_name, // default name when creating a new category of this type - const std::string &icon_name // name of the folder icon + const std::string &icon_name, // name of the folder icon + BOOL is_quiet // folder doesn't need a UI update when changed ) : LLDictionaryEntry(empty_string), // no reverse lookup needed on non-ensembles, so just leave this blank mIconName(icon_name), - mNewCategoryName(new_category_name) + mNewCategoryName(new_category_name), + mIsQuiet(is_quiet) { mAllowedNames.clear(); } @@ -62,7 +64,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry : LLDictionaryEntry(xui_name), mIconName(icon_name), - mNewCategoryName(new_category_name) + mNewCategoryName(new_category_name), + mIsQuiet(FALSE) { const std::string delims (","); LLStringUtilBase<char>::getTokens(allowed_names, mAllowedNames, delims); @@ -85,6 +88,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry const std::string mNewCategoryName; typedef std::vector<std::string> name_vec_t; name_vec_t mAllowedNames; + BOOL mIsQuiet; }; class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>, @@ -100,31 +104,31 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() { initEnsemblesFromFile(); - // NEW CATEGORY NAME FOLDER ICON NAME - // |-------------------------|---------------------------| - addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "inv_folder_texture.tga")); - addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "inv_folder_sound.tga")); - addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "inv_folder_callingcard.tga")); - addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "inv_folder_landmark.tga")); - addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "inv_folder_clothing.tga")); - addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "inv_folder_object.tga")); - addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "inv_folder_notecard.tga")); - addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "")); - addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "inv_folder_script.tga")); - addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "inv_folder_bodypart.tga")); - addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "inv_folder_trash.tga")); - addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "inv_folder_snapshot.tga")); - addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "inv_folder_lostandfound.tga")); - addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "inv_folder_animation.tga")); - addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "inv_folder_gesture.tga")); - addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorite", "inv_folder_plain_closed.tga")); + // NEW CATEGORY NAME FOLDER ICON NAME QUIET? + // |-------------------------|-------------------------------|-----------| + addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "inv_folder_texture.tga", FALSE)); + addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "inv_folder_sound.tga", FALSE)); + addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "inv_folder_callingcard.tga", FALSE)); + addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "inv_folder_landmark.tga", FALSE)); + addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "inv_folder_clothing.tga", FALSE)); + addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "inv_folder_object.tga", FALSE)); + addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "inv_folder_notecard.tga", FALSE)); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "", FALSE)); + addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "inv_folder_script.tga", FALSE)); + addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "inv_folder_bodypart.tga", FALSE)); + addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "inv_folder_trash.tga", TRUE)); + addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "inv_folder_snapshot.tga", FALSE)); + addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "inv_folder_lostandfound.tga", TRUE)); + addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "inv_folder_animation.tga", FALSE)); + addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "inv_folder_gesture.tga", FALSE)); + addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorite", "inv_folder_plain_closed.tga", FALSE)); - addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "inv_folder_current_outfit.tga")); - addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "inv_folder_outfit.tga")); - addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "inv_folder_my_outfits.tga")); - addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "inv_folder_inbox.tga")); + addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "inv_folder_current_outfit.tga",TRUE)); + addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "inv_folder_outfit.tga", TRUE)); + addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "inv_folder_my_outfits.tga", TRUE)); + addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "inv_folder_inbox.tga", FALSE)); - addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "inv_folder_plain_closed.tga")); + addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "inv_folder_plain_closed.tga", FALSE)); } bool LLViewerFolderDictionary::initEnsemblesFromFile() @@ -219,6 +223,17 @@ const std::string &LLViewerFolderType::lookupIconName(LLFolderType::EType folder return badLookup(); } +BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type) +{ + const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); + if (entry) + { + return entry->mIsQuiet; + } + return FALSE; +} + + const std::string &LLViewerFolderType::lookupNewCategoryName(LLFolderType::EType folder_type) { const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); diff --git a/indra/newview/llviewerfoldertype.h b/indra/newview/llviewerfoldertype.h index a6aea62b2a..dd9360da90 100644 --- a/indra/newview/llviewerfoldertype.h +++ b/indra/newview/llviewerfoldertype.h @@ -44,11 +44,13 @@ public: static const std::string& lookupXUIName(EType folder_type); // name used by the UI static LLFolderType::EType lookupTypeFromXUIName(const std::string& name); - static const std::string& lookupIconName(EType asset_type); // folder icon name + static const std::string& lookupIconName(EType folder_type); // folder icon name + static BOOL lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured static const std::string& lookupNewCategoryName(EType folder_type); // default name when creating new category static LLFolderType::EType lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category static U64 lookupValidFolderTypes(const std::string& item_name); // which folders allow an item of this type? + protected: LLViewerFolderType() {} ~LLViewerFolderType() {} diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp index c1555eacdc..0a03012af6 100644 --- a/indra/newview/llviewerhelputil.cpp +++ b/indra/newview/llviewerhelputil.cpp @@ -32,22 +32,14 @@ */ #include "llviewerprecompiledheaders.h" +#include "llviewerhelputil.h" -#include "llversionviewer.h" - -//#include "llfloaterhelpbrowser.h" -//#include "llfloaterreg.h" -//#include "llfocusmgr.h" -//#include "llviewercontrol.h" -//#include "llappviewer.h" - +#include "llcontrol.h" #include "llstring.h" -#include "lluri.h" #include "llsys.h" - -#include "llcontrol.h" - -#include "llviewerhelputil.h" +#include "lluri.h" +#include "llversionviewer.h" +#include "llviewerversion.h" ////////////////////////////////////////////// @@ -86,14 +78,7 @@ std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic, substitution["CHANNEL"] = helpURLEncode(savedSettings.getString("VersionChannelName")); - // *TODO: We should put this version pattern in a central place; this and near - // equivalents are replicated in other code - what's a good location? - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; - substitution["VERSION"] = helpURLEncode(version.str()); + substitution["VERSION"] = helpURLEncode(llGetViewerVersion()); substitution["VERSION_MAJOR"] = buildHelpVersion(LL_VERSION_MAJOR); substitution["VERSION_MINOR"] = buildHelpVersion(LL_VERSION_MINOR); substitution["VERSION_PATCH"] = buildHelpVersion(LL_VERSION_PATCH); diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp new file mode 100644 index 0000000000..4556c3c5b1 --- /dev/null +++ b/indra/newview/llviewerhome.cpp @@ -0,0 +1,73 @@ +/** + * @file llviewerhome.cpp + * @brief Model (non-View) component for the web-based Home side panel + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llviewerhome.h" + +#include "lllogininstance.h" +#include "llui.h" +#include "lluri.h" +#include "llsd.h" +#include "llviewerversion.h" +#include "llviewercontrol.h" +#include "llviewernetwork.h" + +//static +std::string LLViewerHome::getHomeURL() +{ + // Return the URL to display in the Home side tray. We read + // this value from settings.xml and support various substitutions + + LLSD substitution; + substitution["VERSION"] = llGetViewerVersion(); + substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName")); + substitution["LANGUAGE"] = LLUI::getLanguage(); + substitution["AUTH_KEY"] = LLURI::escape(getAuthKey()); + substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel(); + + std::string homeURL = gSavedSettings.getString("HomeSidePanelURL"); + LLStringUtil::format(homeURL, substitution); + + return homeURL; +} + +//static +std::string LLViewerHome::getAuthKey() +{ + // return the value of the (optional) auth token returned by login.cgi + // this lets the server provide an authentication token that we can + // blindly pass to the Home web page for it to perform authentication. + static const std::string authKeyName("home_sidetray_token"); + return LLLoginInstance::getInstance()->getResponse(authKeyName); +} + diff --git a/indra/newview/llviewerhome.h b/indra/newview/llviewerhome.h new file mode 100644 index 0000000000..50454a71b7 --- /dev/null +++ b/indra/newview/llviewerhome.h @@ -0,0 +1,49 @@ +/** + * @file llviewerhome.h + * @brief Model (non-View) component for the web-based Home side panel + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLVIEWERHOME_H +#define LL_LLVIEWERHOME_H + +#include <string> + +class LLViewerHome +{ +public: + /// return the URL to use for the web-based Home side panel + static std::string getHomeURL(); + + /// return the authentication key for the Home web site + static std::string getAuthKey(); +}; + +#endif diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 839e035272..4482683400 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -510,11 +510,13 @@ bool LLViewerInventoryCategory::fetchDescendents() // This comes from LLInventoryFilter from llfolderview.h U32 sort_order = gSavedSettings.getU32("InventorySortOrder") & 0x1; - // *NOTE - // Temporary workaround for bug EXT-2879, see ticket for details. - // Commented gAgent.getRegion()->getCapability in order to use the old system. - std::string url;//= gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); - + // *NOTE: For bug EXT-2879, originally commented out + // gAgent.getRegion()->getCapability in order to use the old + // message-based system. This has been uncommented now that + // AIS folks are aware of the issue and have a fix in process. + // see ticket for details. + + std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); if (!url.empty()) //Capability found. Build up LLSD and use it. { LLInventoryModel::startBackgroundFetch(mUUID); @@ -1436,3 +1438,74 @@ void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std: gInventory.notifyObservers(); } +class LLRegenerateLinkCollector : public LLInventoryCollectFunctor +{ +public: + LLRegenerateLinkCollector(const LLViewerInventoryItem *target_item) : mTargetItem(target_item) {} + virtual ~LLRegenerateLinkCollector() {} + virtual bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) + { + if (item) + { + if ((item->getName() == mTargetItem->getName()) && + (item->getInventoryType() == mTargetItem->getInventoryType()) && + (!item->getIsLinkType())) + { + return true; + } + } + return false; + } +protected: + const LLViewerInventoryItem* mTargetItem; +}; + +LLUUID find_possible_item_for_regeneration(const LLViewerInventoryItem *target_item) +{ + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + + LLRegenerateLinkCollector candidate_matches(target_item); + gInventory.collectDescendentsIf(gInventory.getRootFolderID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + candidate_matches); + for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items.begin(); + item_iter != items.end(); + ++item_iter) + { + const LLViewerInventoryItem *item = (*item_iter); + if (true) return item->getUUID(); + } + return LLUUID::null; +} + +// This currently dosen't work, because the sim does not allow us +// to change an item's assetID. +BOOL LLViewerInventoryItem::regenerateLink() +{ + const LLUUID target_item_id = find_possible_item_for_regeneration(this); + if (target_item_id.isNull()) + return FALSE; + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(getAssetUUID()); + gInventory.collectDescendentsIf(gInventory.getRootFolderID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + asset_id_matches); + for (LLViewerInventoryItem::item_array_t::iterator item_iter = items.begin(); + item_iter != items.end(); + item_iter++) + { + LLViewerInventoryItem *item = (*item_iter); + item->setAssetUUID(target_item_id); + item->updateServer(FALSE); + gInventory.addChangedMask(LLInventoryObserver::REBUILD, item->getUUID()); + } + gInventory.notifyObservers(); + return TRUE; +} diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index d27faffdd9..0156e7dab1 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -161,7 +161,10 @@ public: // callback void onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name); - + + // If this is a broken link, try to fix it and any other identical link. + BOOL regenerateLink(); + public: BOOL mIsComplete; LLTransactionID mTransactionID; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f6db661489..a206768d33 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -41,7 +41,7 @@ #include "llviewertexture.h" #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" -#include "llversionviewer.h" +#include "llviewerversion.h" #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" @@ -446,7 +446,7 @@ std::string LLViewerMedia::getCurrentUserAgent() // http://www.mozilla.org/build/revised-user-agent-strings.html std::ostringstream codec; codec << "SecondLife/"; - codec << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD; + codec << llGetViewerVersion(); codec << " (" << channel << "; " << skin_name << " skin)"; llinfos << codec.str() << llendl; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e68594ed6f..bf4d0c78e6 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5521,11 +5521,6 @@ class LLShowFloater : public view_listener_t { LLFloaterScriptDebug::show(LLUUID::null); } - else if (floater_name == "help f1") - { - LLViewerHelp* vhelp = LLViewerHelp::getInstance(); - vhelp->showTopic(vhelp->getTopicFromFocus()); - } else if (floater_name == "complaint reporter") { // Prevent menu from appearing in screen shot. @@ -5562,6 +5557,26 @@ class LLFloaterVisible : public view_listener_t } }; +class LLShowHelp : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string help_topic = userdata.asString(); + + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + if (help_topic.empty()) + { + vhelp->showTopic(vhelp->getTopicFromFocus()); + } + else + { + vhelp->showTopic(help_topic); + } + + return true; + } +}; + class LLShowSidetrayPanel : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7925,6 +7940,7 @@ void initialize_menus() // Generic actions view_listener_t::addMenu(new LLShowFloater(), "ShowFloater"); + view_listener_t::addMenu(new LLShowHelp(), "ShowHelp"); view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL"); view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); view_listener_t::addMenu(new LLToggleControl(), "ToggleControl"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c4a2e88db5..8c0529e344 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -73,6 +73,7 @@ #include "llstatusbar.h" #include "llimview.h" #include "lltrans.h" +#include "llviewerfoldertype.h" #include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" @@ -825,41 +826,50 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& from_name) { - std::vector<LLUUID>::const_iterator it = items.begin(); - std::vector<LLUUID>::const_iterator end = items.end(); - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - BOOL user_is_away = gAwayTimer.getStarted(); - LLInventoryItem* item; - for(; it != end; ++it) - { - const LLUUID& id = *it; - item = gInventory.getItem(id); + for (std::vector<LLUUID>::const_iterator item_iter = items.begin(); + item_iter != items.end(); + ++item_iter) + { + const LLUUID& item_id = (*item_iter); + LLInventoryItem* item = gInventory.getItem(item_id); if(!item) { - LL_WARNS("Messaging") << "Unable to show inventory item: " << id << LL_ENDL; + LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL; continue; } - // don't select trash or lost and found items if the user is active - if(gInventory.isObjectDescendentOf(id, trash_id) || - (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) - && !user_is_away) ) + + //////////////////////////////////////////////////////////////////////////////// + // Don't highlight if it's in certain "quiet" folders which don't need UI + // notification (e.g. trash, cof, lost-and-found). + const BOOL user_is_away = gAwayTimer.getStarted(); + if(!user_is_away) { - continue; + const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(item_id); + if (parent) + { + const LLFolderType::EType parent_type = parent->getPreferredType(); + if (LLViewerFolderType::lookupIsQuietType(parent_type)) + { + continue; + } + } } - LLAssetType::EType asset_type = item->getType(); - //if we are throttled, don't display them - if (check_offer_throttle(from_name, false)) + //////////////////////////////////////////////////////////////////////////////// + // Special handling for various types. + const LLAssetType::EType asset_type = item->getType(); + if (check_offer_throttle(from_name, false)) // If we are throttled, don't display { LL_DEBUGS("Messaging") << "Highlighting inventory item: " << item->getUUID() << LL_ENDL; // If we opened this ourselves, focus it - BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; + const BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; switch(asset_type) { case LLAssetType::AT_NOTECARD: - LLFloaterReg::showInstance("preview_notecard", LLSD(id), take_focus); - break; + { + LLFloaterReg::showInstance("preview_notecard", LLSD(item_id), take_focus); + break; + } case LLAssetType::AT_LANDMARK: { LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID()); @@ -878,29 +888,38 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f LLNotificationsUtil::add("LandmarkCreated", args); // Created landmark is passed to Places panel to allow its editing. In fact panel should be already displayed. //TODO*:: dserduk(7/12/09) remove LLPanelPlaces dependency from here - LLPanelPlaces *panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); - if (panel) + LLPanelPlaces *places_panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); + if (places_panel) { - panel->setItem(item); + places_panel->setItem(item); } } } break; case LLAssetType::AT_TEXTURE: - LLFloaterReg::showInstance("preview_texture", LLSD(id), take_focus); - break; + { + LLFloaterReg::showInstance("preview_texture", LLSD(item_id), take_focus); + break; + } default: - if(gSavedSettings.getBOOL("ShowInInventory") && - asset_type != LLAssetType::AT_CALLINGCARD && - item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && - !from_name.empty()) - { - LLSideTray::getInstance()->showPanel("sidepanel_inventory", - LLSD().with("select", item->getUUID())); - } break; } } + + //////////////////////////////////////////////////////////////////////////////// + // Highlight item if it's not in the trash, lost+found, or COF + const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") && + (asset_type != LLAssetType::AT_CALLINGCARD) && + (item->getInventoryType() != LLInventoryType::IT_ATTACHMENT) && + !from_name.empty(); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + if(active_panel) + { + LL_DEBUGS("Messaging") << "Highlighting" << item_id << LL_ENDL; + LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); + gFocusMgr.setKeyboardFocus(focus_ctrl); + } } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a9194c0c3b..93b0ad4a5b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3834,15 +3834,6 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } - bool should_alpha_mask = shouldAlphaMask(); - - LLGLState test(GL_ALPHA_TEST, should_alpha_mask); - - if (should_alpha_mask) - { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); - } - if (isTextureVisible(TEX_HEAD_BAKED)) { num_indices += mMeshLOD[MESH_ID_EYELASH]->render(mAdjustedPixelArea, first_pass, mIsDummy); @@ -6011,8 +6002,7 @@ void LLVOAvatar::updateMeshTextures() } } else if (mBakedTextureDatas[i].mTexLayerSet - && !other_culled - && (i != BAKED_HAIR || mSupportsAlphaLayers)) // ! BACKWARDS COMPATIBILITY ! workaround for old viewers. + && !other_culled) { mBakedTextureDatas[i].mTexLayerSet->createComposite(); mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled( TRUE ); @@ -6024,9 +6014,10 @@ void LLVOAvatar::updateMeshTextures() } } - // ! BACKWARDS COMPATIBILITY ! - // Workaround for viewing avatars from old viewers that haven't baked hair textures. - if (!mSupportsAlphaLayers) + // set texture and color of hair manually if we are not using a baked image. + // This can happen while loading hair for yourself, or for clients that did not + // bake a hair texture. Still needed for yourself after 1.22 is depricated. + if (!is_layer_baked[BAKED_HAIR] || self_customizing) { const LLColor4 color = mTexHairColor ? mTexHairColor->getColor() : LLColor4(1,1,1,1); LLViewerTexture* hair_img = getImage( TEX_HAIR, 0 ); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 7e309d2bad..6f9801491a 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -194,8 +194,8 @@ with the same filename but different name <texture name="Icon_Gear_Foreground" file_name="windows/Icon_Gear_Foreground.png" preload="false" /> <texture name="Icon_Gear_Press" file_name="windows/Icon_Gear_Press.png" preload="false" /> - <texture name="Icon_Help_Foreground" file_name="windows/Icon_Help_Foreground.png" preload="false" /> - <texture name="Icon_Help_Press" file_name="windows/Icon_Help_Press.png" preload="false" /> + <texture name="Icon_Help_Foreground" file_name="windows/Icon_Help_Foreground.png" preload="true" /> + <texture name="Icon_Help_Press" file_name="windows/Icon_Help_Press.png" preload="true" /> <texture name="Icon_Info" file_name="windows/Icon_Info.png" preload="false" /> <texture name="Icon_Minimize_Foreground" file_name="windows/Icon_Minimize_Foreground.png" preload="true" /> diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index c5d6f885d3..82e4d87b28 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -14,7 +14,7 @@ width="670"> <floater.string name="search_url"> - http://eniac21.lindenlab.com:10001/viewer + http://int.searchwww-phx0.damballah.lindenlab.com/viewer </floater.string> <floater.string name="loading_text"> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml index 435a3e6d34..4e6a07d020 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml @@ -76,7 +76,9 @@ function="Inventory.GearDefault.Custom.Action" parameter="empty_lostnfound" /> </menu_item_call> - <menu_item_call + <menu_item_separator + layout="topleft" /> + <menu_item_call label="Save Texture As" layout="topleft" name="Save Texture As"> @@ -87,4 +89,26 @@ function="Inventory.GearDefault.Enable" parameter="save_texture" /> </menu_item_call> + <menu_item_call + label="Find Original" + layout="topleft" + name="Find Original"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="find_original" /> + <on_enable + function="Inventory.GearDefault.Enable" + parameter="find_original" /> + </menu_item_call> + <menu_item_call + label="Find All Links" + layout="topleft" + name="Find All Links"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="find_links" /> + <on_enable + function="Inventory.GearDefault.Enable" + parameter="find_links" /> + </menu_item_call> </menu> diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index a22dc80f4e..9b439c16e0 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -45,8 +45,7 @@ name="Second Life Help" shortcut="F1"> <menu_item_call.on_click - function="ShowFloater" - parameter="help f1" /> + function="ShowHelp" /> </menu_item_call> <menu_item_separator /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/menu_navbar.xml b/indra/newview/skins/default/xui/en/menu_navbar.xml index e17eeb46f6..b71b866c4b 100644 --- a/indra/newview/skins/default/xui/en/menu_navbar.xml +++ b/indra/newview/skins/default/xui/en/menu_navbar.xml @@ -27,6 +27,8 @@ <menu_item_check.on_check control="NavBarShowParcelProperties" /> </menu_item_check> + <menu_item_separator + name="Separator" /> <!-- Label of 'Landmark' item is changing in runtime, see AddLandmarkNavBarMenu/EditLandmarkNavBarMenu in strings.xml --> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 37136af680..2b3f3c79e0 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1060,8 +1060,7 @@ name="Second Life Help" shortcut="F1"> <menu_item_call.on_click - function="ShowFloater" - parameter="help f1" /> + function="ShowHelp" /> </menu_item_call> <menu_item_call label="Tutorial" @@ -1081,6 +1080,14 @@ function="ShowFloater" parameter="complaint reporter" /> </menu_item_call> + <menu_item_call + label="Report Bug" + layout="topleft" + name="Report Bug"> + <menu_item_call.on_click + function="ShowHelp" + parameter="report_bug" /> + </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index efe26d3887..22977b2274 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -167,8 +167,8 @@ text_color="EmphasisColor" halign="right" height="16" - top="17" - left_pad="10" + top="12" + left_pad="5" right="-10" name="create_new_account_text" width="180"> @@ -188,6 +188,17 @@ <text follows="right|bottom" font="SansSerifSmall" + text_color="EmphasisColor" + halign="right" + height="16" + name="login_help" + top_pad="2" + width="180"> + Need help logging in? + </text> + <text + follows="right|bottom" + font="SansSerifSmall" halign="right" height="28" top_pad="2" diff --git a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml index 4b841b0a09..1dd4eb095c 100644 --- a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml +++ b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml @@ -20,58 +20,7 @@ top_pad="10" width="313"> <layout_panel - auto_resize="false" - height="20" - layout="topleft" - left="0" - name="nav_controls" - top="0" - user_resize="false" - width="313"> - <button - follows="left|top" - enabled="false" - height="20" - label="Back" - layout="topleft" - tab_stop="false" - left="0" - name="back" - top="0" - width="70"> - <button.commit_callback - function="MediaBrowser.Back" /> - </button> - <button - follows="left|top" - height="20" - enabled="false" - label="Forward" - layout="topleft" - tab_stop="false" - left_pad="3" - name="forward" - top_delta="0" - width="70"> - <button.commit_callback - function="MediaBrowser.Forward" /> - </button> - <button - follows="left|top" - height="20" - label="Home" - layout="topleft" - tab_stop="false" - left_pad="2" - name="home" - top_delta="0" - width="70"> - <button.commit_callback - function="MediaBrowser.Home" /> - </button> - </layout_panel> - <layout_panel - height="530" + height="550" layout="topleft" left_delta="0" name="browser_layout" @@ -80,7 +29,7 @@ <web_browser border_visible="false" follows="all" - height="530" + height="550" layout="topleft" left="0" name="browser" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e72cacc8d5..3b32912fbf 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1881,6 +1881,7 @@ this texture in your inventory <string name="InvFolder All">All</string> <!-- inventory FVBridge --> + <!-- This is used in llpanelinventory.cpp when constructing a context menu for an item for Sale --> <string name="Buy">Buy</string> <string name="BuyforL$">Buy for L$</string> @@ -2007,8 +2008,8 @@ this texture in your inventory <!-- groups --> <string name="GroupsNone">none</string> - <string name="Group" value=" (group)" /> - <string name="Unknown">(Unknown)</string> + <string name="Group" value=" (group)" /> + <string name="Unknown">(Unknown)</string> <string name="SummaryForTheWeek" value="Summary for this week, beginning on " /> <string name="NextStipendDay" value="The next stipend day is " /> <string name="GroupIndividualShare" value=" Group Individual Share" /> @@ -2018,7 +2019,8 @@ this texture in your inventory <string name="Total">Total</string> <string name="NoGroupDataFound">No group data found for group </string> - <!-- floater IM --> + <!-- floater IM bonus_info: When a Linden with Admin/god status receives a new IM this displays the estate (Mainland vs. teen grid) of the source avatar. + This is to help Lindens when answering questions. --> <string name="IMParentEstate">parent estate</string> <string name="IMMainland">mainland</string> <string name="IMTeen">teen</string> @@ -2107,8 +2109,8 @@ this texture in your inventory Unknown file extension .%s Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh </string> - <string name="AddLandmarkNavBarMenu">Add Landmark...</string> - <string name="EditLandmarkNavBarMenu">Edit Landmark...</string> + <string name="AddLandmarkNavBarMenu">Add to My Landmarks...</string> + <string name="EditLandmarkNavBarMenu">Edit my Landmark...</string> <!-- menu accelerators --> <string name="accel-mac-control">⌃</string> @@ -2387,8 +2389,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Eyes Bugged">Eyes Bugged</string> -<string name="Eyes Shear Left Up">Eyes Shear Left Up</string> -<string name="Eyes Shear Right Up">Eyes Shear Right Up</string> + + @@ -2779,7 +2781,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <!-- Navigation bar location input control. Strings are here because widget xml is not localizable --> <string name="LocationCtrlAddLandmarkTooltip">Add to My Landmarks</string> - <string name="LocationCtrlEditLandmarkTooltip">Edit My Landmark</string> + <string name="LocationCtrlEditLandmarkTooltip">Edit my Landmark</string> <string name="LocationCtrlInfoBtnTooltip">See more info about the current location</string> <string name="LocationCtrlComboBtnTooltip">My location history</string> <string name="LocationCtrlForSaleTooltip">Buy this land</string> diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 988d28c301..90e3e7a7e0 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -36,6 +36,7 @@ #include "../test/lltut.h" #include "../llviewerhelputil.h" +#include "../llviewerversion.h" #include "llcontrol.h" #include "llsys.h" @@ -75,6 +76,12 @@ std::string LLControlGroup::getString(const std::string& name) return test_stringvec[name]; } +const std::string &llGetViewerVersion() +{ + static std::string version = "2.0.0.200099"; + return version; +} + //---------------------------------------------------------------------------- namespace tut |