diff options
65 files changed, 1741 insertions, 299 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 920d8c0977..37370e44e7 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -291,8 +291,8 @@ LLMutex::LLMutex(apr_pool_t *poolp) : LLMutex::~LLMutex() { -#if _DEBUG - llassert(!isLocked()); // better not be locked! +#if MUTEX_DEBUG + llassert_always(!isLocked()); // better not be locked! #endif apr_thread_mutex_destroy(mAPRMutexp); mAPRMutexp = NULL; @@ -306,10 +306,24 @@ LLMutex::~LLMutex() void LLMutex::lock() { apr_thread_mutex_lock(mAPRMutexp); +#if MUTEX_DEBUG + // Have to have the lock before we can access the debug info + U32 id = LLThread::currentID(); + if (mIsLocked[id] != FALSE) + llerrs << "Already locked in Thread: " << id << llendl; + mIsLocked[id] = TRUE; +#endif } void LLMutex::unlock() { +#if MUTEX_DEBUG + // Access the debug info while we have the lock + U32 id = LLThread::currentID(); + if (mIsLocked[id] != TRUE) + llerrs << "Not locked in Thread: " << id << llendl; + mIsLocked[id] = FALSE; +#endif apr_thread_mutex_unlock(mAPRMutexp); } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 932d96d940..d8aa90de2e 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -128,6 +128,8 @@ protected: //============================================================================ +#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO) + class LL_COMMON_API LLMutex { public: @@ -142,6 +144,9 @@ protected: apr_thread_mutex_t *mAPRMutexp; apr_pool_t *mAPRPoolp; BOOL mIsLocalPool; +#if MUTEX_DEBUG + std::map<U32, BOOL> mIsLocked; +#endif }; // Actually a condition/mutex pair (since each condition needs to be associated with a mutex). diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index a403c44b71..3078d80552 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -189,6 +189,7 @@ typedef std::set<LLUUID> AskQueue; typedef std::list<PendingReply*> ReplyQueue; typedef std::map<LLUUID,U32> PendingQueue; typedef std::map<LLUUID, LLCacheNameEntry*> Cache; +typedef std::map<std::string, LLUUID> ReverseCache; class LLCacheName::Impl { @@ -198,7 +199,9 @@ public: Cache mCache; // the map of UUIDs to names - + ReverseCache mReverseCache; + // map of names to UUIDs + AskQueue mAskNameQueue; AskQueue mAskGroupQueue; // UUIDs to ask our upstream host about @@ -371,7 +374,9 @@ void LLCacheName::importFile(LLFILE* fp) entry->mFirstName = firstname; entry->mLastName = lastname; impl.mCache[id] = entry; - + std::string fullname = entry->mFirstName + " " + entry->mLastName; + impl.mReverseCache[fullname] = id; + count++; } @@ -407,6 +412,8 @@ bool LLCacheName::importFile(std::istream& istr) entry->mFirstName = agent[FIRST].asString(); entry->mLastName = agent[LAST].asString(); impl.mCache[id] = entry; + std::string fullname = entry->mFirstName + " " + entry->mLastName; + impl.mReverseCache[fullname] = id; ++count; } @@ -428,6 +435,7 @@ bool LLCacheName::importFile(std::istream& istr) entry->mCreateTime = ctime; entry->mGroupName = group[NAME].asString(); impl.mCache[id] = entry; + impl.mReverseCache[entry->mGroupName] = id; ++count; } llinfos << "LLCacheName loaded " << count << " group names" << llendl; @@ -548,6 +556,27 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) return FALSE; } } + +BOOL LLCacheName::getUUID(const std::string& first, const std::string& last, LLUUID& id) +{ + std::string fullname = first + " " + last; + return getUUID(fullname, id); +} + +BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id) +{ + ReverseCache::iterator iter = impl.mReverseCache.find(fullname); + if (iter != impl.mReverseCache.end()) + { + id = iter->second; + return TRUE; + } + else + { + return FALSE; + } +} + // This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. // The reason it is a slot is so that the legacy get() function below can bind an old callback // and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior @@ -897,10 +926,13 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) if (!isGroup) { mSignal(id, entry->mFirstName, entry->mLastName, FALSE); + std::string fullname = entry->mFirstName + " " + entry->mLastName; + mReverseCache[fullname] = id; } else { mSignal(id, entry->mGroupName, "", TRUE); + mReverseCache[entry->mGroupName] = id; } } } diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 8641437d86..111cc8b650 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -86,6 +86,10 @@ public: BOOL getName(const LLUUID& id, std::string& first, std::string& last); BOOL getFullName(const LLUUID& id, std::string& fullname); + // Reverse lookup of UUID from name + BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); + BOOL getUUID(const std::string& fullname, LLUUID& id); + // If available, this method copies the group name into the string // provided. The caller must allocate at least // DB_GROUP_NAME_BUF_SIZE characters. If not available, this diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index eac947a0d7..3867e910c0 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -50,7 +50,7 @@ class LLTextBox; * is ignored. The option "keep_one_selected" forces at least one item to be selected at any time (only for mouse events on items) * since any item of the list was selected. * - * Examples of using this control are presented in Picks panel (Me Profile and Profile View), where this control is used to + * Examples of using this control are presented in Picks panel (My Profile and Profile View), where this control is used to * manage the list of pick items. * * ASSUMPTIONS AND STUFF diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 95c8dd84f6..1b98dddddc 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -195,6 +195,7 @@ public: /// The static isShown() can accept a NULL pointer (which of course /// returns false). When non-NULL, it calls the non-static isShown(). static bool isShown(const LLFloater* floater); + BOOL isFirstLook() { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts BOOL isFrontmost(); BOOL isDependent() { return !mDependeeHandle.isDead(); } void setCanMinimize(BOOL can_minimize); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e210667764..ab1006ffd7 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2060,16 +2060,16 @@ void LLTextBase::updateRects() mContentsRect.unionWith(line_iter->mRect); } - mContentsRect.mLeft = 0; + S32 delta_pos_x = -mContentsRect.mLeft; mContentsRect.mTop += mVPad; S32 delta_pos = -mContentsRect.mBottom; // move line segments to fit new document rect for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) { - it->mRect.translate(0, delta_pos); + it->mRect.translate(delta_pos_x, delta_pos); } - mContentsRect.translate(0, delta_pos); + mContentsRect.translate(delta_pos_x, delta_pos); } // update document container dimensions according to text contents diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 46dd045f61..e632cbaaf2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -239,6 +239,7 @@ set(viewer_SOURCE_FILES llhudtext.cpp llhudview.cpp llimfloater.cpp + llimfloatercontainer.cpp llimhandler.cpp llimpanel.cpp llimview.cpp @@ -324,7 +325,7 @@ set(viewer_SOURCE_FILES llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp - llpanelmeprofile.cpp + llpanelme.cpp llpanelobject.cpp llpanelobjectinventory.cpp llpaneloutfitsinventory.cpp @@ -738,6 +739,7 @@ set(viewer_HEADER_FILES llhudtext.h llhudview.h llimfloater.h + llimfloatercontainer.h llimpanel.h llimview.h llinspect.h @@ -819,7 +821,7 @@ set(viewer_HEADER_FILES llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h - llpanelmeprofile.h + llpanelme.h llpanelobject.h llpanelobjectinventory.h llpaneloutfitsinventory.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c7279a2e33..994e546bd0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3585,7 +3585,7 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>http://docs.lindenlab.com/help/helpfloater.php?topic=[TOPIC]&channel=[CHANNEL]&version=[VERSION]&os=[OS]&language=[LANGUAGE]&version_major=[VERSION_MAJOR]&version_minor=[VERSION_MINOR]&version_patch=[VERSION_PATCH]&version_build=[VERSION_BUILD]</string> + <string>http://viewer-help.secondlife.com/[LANGUAGE]/[CHANNEL]/[VERSION]/[TOPIC]</string> </map> <key>HighResSnapshot</key> <map> @@ -5371,6 +5371,19 @@ <key>Value</key> <real>1.0</real> </map> + + <key>PlainTextChatHistory</key> + <map> + <key>Comment</key> + <string>Enable/Disable plain text chat history style</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>PluginInstancesLow</key> <map> <key>Comment</key> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4f2d3e9645..fa0ea557ba 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1360,19 +1360,25 @@ bool LLAppViewer::cleanup() llinfos << "Waiting for pending IO to finish: " << pending << llendflush; ms_sleep(100); } - llinfos << "Shutting down." << llendflush; + llinfos << "Shutting down Views" << llendflush; // Destroy the UI if( gViewerWindow) gViewerWindow->shutdownViews(); + + llinfos << "Cleaning up Inevntory" << llendflush; // Cleanup Inventory after the UI since it will delete any remaining observers // (Deleted observers should have already removed themselves) gInventory.cleanupInventory(); + + llinfos << "Cleaning up Selections" << llendflush; // Clean up selection managers after UI is destroyed, as UI may be observing them. // Clean up before GL is shut down because we might be holding on to objects with texture references LLSelectMgr::cleanupGlobals(); + + llinfos << "Shutting down OpenGL" << llendflush; // Shut down OpenGL if( gViewerWindow) @@ -1386,11 +1392,18 @@ bool LLAppViewer::cleanup() gViewerWindow = NULL; llinfos << "ViewerWindow deleted" << llendflush; } + + llinfos << "Cleaning up Keyboard & Joystick" << llendflush; // viewer UI relies on keyboard so keep it aound until viewer UI isa gone delete gKeyboard; gKeyboard = NULL; + // Turn off Space Navigator and similar devices + LLViewerJoystick::getInstance()->terminate(); + + llinfos << "Cleaning up Objects" << llendflush; + LLViewerObject::cleanupVOClasses(); LLWaterParamManager::cleanupClass(); @@ -1413,6 +1426,8 @@ bool LLAppViewer::cleanup() } LLPrimitive::cleanupVolumeManager(); + llinfos << "Additional Cleanup..." << llendflush; + LLViewerParcelMgr::cleanupGlobals(); // *Note: this is where gViewerStats used to be deleted. @@ -1432,9 +1447,11 @@ bool LLAppViewer::cleanup() // Also after shutting down the messaging system since it has VFS dependencies // + llinfos << "Cleaning up VFS" << llendflush; LLVFile::cleanupClass(); - llinfos << "VFS cleaned up" << llendflush; + llinfos << "Saving Data" << llendflush; + // Quitting with "Remember Password" turned off should always stomp your // saved password, whether or not you successfully logged in. JC if (!gSavedSettings.getBOOL("RememberPassword")) @@ -1476,13 +1493,16 @@ bool LLAppViewer::cleanup() gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask); } - // Turn off Space Navigator and similar devices - LLViewerJoystick::getInstance()->terminate(); - removeMarkerFile(); // Any crashes from here on we'll just have to ignore writeDebugInfo(); + LLLocationHistory::getInstance()->save(); + + LLAvatarIconIDCache::getInstance()->save(); + + llinfos << "Shutting down Threads" << llendflush; + // Let threads finish LLTimer idleTimer; idleTimer.reset(); @@ -1515,14 +1535,9 @@ bool LLAppViewer::cleanup() sTextureFetch = NULL; delete sImageDecodeThread; sImageDecodeThread = NULL; - - LLLocationHistory::getInstance()->save(); - - LLAvatarIconIDCache::getInstance()->save(); - delete mFastTimerLogThread; mFastTimerLogThread = NULL; - + if (LLFastTimerView::sAnalyzePerformance) { llinfos << "Analyzing performance" << llendl; @@ -1544,6 +1559,8 @@ bool LLAppViewer::cleanup() } LLMetricPerformanceTester::cleanClass() ; + llinfos << "Cleaning up Media and Textures" << llendflush; + //Note: //LLViewerMedia::cleanupClass() has to be put before gTextureList.shutdown() //because some new image might be generated during cleaning up media. --bao @@ -1557,13 +1574,13 @@ bool LLAppViewer::cleanup() LLVFSThread::cleanupClass(); LLLFSThread::cleanupClass(); - llinfos << "VFS Thread finished" << llendflush; - #ifndef LL_RELEASE_FOR_DOWNLOAD llinfos << "Auditing VFS" << llendl; gVFS->audit(); #endif + llinfos << "Misc Cleanup" << llendflush; + // For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up. // (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve delete gStaticVFS; @@ -1577,12 +1594,11 @@ bool LLAppViewer::cleanup() LLWatchdog::getInstance()->cleanup(); + llinfos << "Shutting down message system" << llendflush; end_messaging_system(); - llinfos << "Message system deleted." << llendflush; // *NOTE:Mani - The following call is not thread safe. LLCurl::cleanupClass(); - llinfos << "LLCurl cleaned up." << llendflush; // If we're exiting to launch an URL, do that here so the screen // is at the right resolution before we launch IE. @@ -1603,7 +1619,7 @@ bool LLAppViewer::cleanup() ll_close_fail_log(); - llinfos << "Goodbye" << llendflush; + llinfos << "Goodbye!" << llendflush; // return 0; return true; diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 0844cca766..839a84f2d2 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -297,7 +297,7 @@ void LLAvatarActions::showProfile(const LLUUID& id) //Show own profile if(gAgent.getID() == id) { - LLSideTray::getInstance()->showPanel("panel_me_profile", params); + LLSideTray::getInstance()->showPanel("panel_me", params); } //Show other user profile else @@ -347,9 +347,9 @@ void LLAvatarActions::inviteToGroup(const LLUUID& id) LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(id)); if (widget) { - widget->removeNoneOption(); widget->center(); widget->setPowersMask(GP_MEMBER_INVITE); + widget->removeNoneOption(); widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, id)); } } diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index bb03f47f46..7f3f869e5d 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -363,37 +363,6 @@ void LLAvatarList::computeDifference( vadded.erase(it, vadded.end()); } -static std::string format_secs(S32 secs) -{ - // *TODO: reinventing the wheel? - // *TODO: i18n - static const int LL_AL_MIN = 60; - static const int LL_AL_HOUR = LL_AL_MIN * 60; - static const int LL_AL_DAY = LL_AL_HOUR * 24; - static const int LL_AL_WEEK = LL_AL_DAY * 7; - static const int LL_AL_MONTH = LL_AL_DAY * 31; - static const int LL_AL_YEAR = LL_AL_DAY * 365; - - std::string s; - - if (secs >= LL_AL_YEAR) - s = llformat("%dy", secs / LL_AL_YEAR); - else if (secs >= LL_AL_MONTH) - s = llformat("%dmon", secs / LL_AL_MONTH); - else if (secs >= LL_AL_WEEK) - s = llformat("%dw", secs / LL_AL_WEEK); - else if (secs >= LL_AL_DAY) - s = llformat("%dd", secs / LL_AL_DAY); - else if (secs >= LL_AL_HOUR) - s = llformat("%dh", secs / LL_AL_HOUR); - else if (secs >= LL_AL_MIN) - s = llformat("%dm", secs / LL_AL_MIN); - else - s = llformat("%ds", secs); - - return s; -} - // Refresh shown time of our last interaction with all listed avatars. void LLAvatarList::updateLastInteractionTimes() { @@ -407,7 +376,7 @@ void LLAvatarList::updateLastInteractionTimes() LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it); S32 secs_since = now - (S32) LLRecentPeople::instance().getDate(item->getAvatarId()).secondsSinceEpoch(); if (secs_since >= 0) - item->setLastInteractionTime(format_secs(secs_since)); + item->setLastInteractionTime(secs_since); } } diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index c670a65bcc..efc9538fa6 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -198,9 +198,9 @@ void LLAvatarListItem::showLastInteractionTime(bool show) mAvatarName->setRect(name_rect); } -void LLAvatarListItem::setLastInteractionTime(const std::string& val) +void LLAvatarListItem::setLastInteractionTime(U32 secs_since) { - mLastInteractionTime->setValue(val); + mLastInteractionTime->setValue(formatSeconds(secs_since)); } void LLAvatarListItem::setShowInfoBtn(bool show) @@ -326,3 +326,51 @@ void LLAvatarListItem::reshapeAvatarName() mAvatarName->reshape(width, height); } + +// Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", +// taking i18n into account. The format string to use is taken from the panel XML. +std::string LLAvatarListItem::formatSeconds(U32 secs) +{ + static const U32 LL_ALI_MIN = 60; + static const U32 LL_ALI_HOUR = LL_ALI_MIN * 60; + static const U32 LL_ALI_DAY = LL_ALI_HOUR * 24; + static const U32 LL_ALI_WEEK = LL_ALI_DAY * 7; + static const U32 LL_ALI_MONTH = LL_ALI_DAY * 30; + static const U32 LL_ALI_YEAR = LL_ALI_DAY * 365; + + std::string fmt; + U32 count = 0; + + if (secs >= LL_ALI_YEAR) + { + fmt = "FormatYears"; count = secs / LL_ALI_YEAR; + } + else if (secs >= LL_ALI_MONTH) + { + fmt = "FormatMonths"; count = secs / LL_ALI_MONTH; + } + else if (secs >= LL_ALI_WEEK) + { + fmt = "FormatWeeks"; count = secs / LL_ALI_WEEK; + } + else if (secs >= LL_ALI_DAY) + { + fmt = "FormatDays"; count = secs / LL_ALI_DAY; + } + else if (secs >= LL_ALI_HOUR) + { + fmt = "FormatHours"; count = secs / LL_ALI_HOUR; + } + else if (secs >= LL_ALI_MIN) + { + fmt = "FormatMinutes"; count = secs / LL_ALI_MIN; + } + else + { + fmt = "FormatSeconds"; count = secs; + } + + LLStringUtil::format_map_t args; + args["[COUNT]"] = llformat("%u", count); + return getString(fmt, args); +} diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 9d48101a44..341f5a6bcf 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -63,7 +63,7 @@ public: void setOnline(bool online); void setName(const std::string& name); void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); - void setLastInteractionTime(const std::string& val); + void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); @@ -94,6 +94,8 @@ private: void onNameCache(const std::string& first_name, const std::string& last_name); + std::string formatSeconds(U32 secs); + LLAvatarIconCtrl* mAvatarIcon; LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 4ce3b50ed5..533940943e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -202,10 +202,8 @@ public: userName->setValue(SL); } + setTimeField(chat.mTimeStr); - LLTextBox* timeBox = getChild<LLTextBox>("time_box"); - timeBox->setValue(chat.mTimeStr); - LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); if(mSourceType != CHAT_SOURCE_AGENT) @@ -271,7 +269,28 @@ protected: } } - +private: + void setTimeField(const std::string& time_value) + { + LLTextBox* time_box = getChild<LLTextBox>("time_box"); + + LLRect rect_before = time_box->getRect(); + time_box->setValue(time_value); + + // set necessary textbox width to fit all text + time_box->reshapeToFitText(); + LLRect rect_after = time_box->getRect(); + + // move rect to the left to correct position... + S32 delta_pos_x = rect_before.getWidth() - rect_after.getWidth(); + S32 delta_pos_y = rect_before.getHeight() - rect_after.getHeight(); + time_box->translate(delta_pos_x, delta_pos_y); + + //... & change width of the name control + LLTextBox* user_name = getChild<LLTextBox>("user_name"); + const LLRect& user_rect = user_name->getRect(); + user_name->reshape(user_rect.getWidth() + delta_pos_x, user_rect.getHeight()); + } protected: LLHandle<LLView> mPopupMenuHandleAvatar; @@ -334,20 +353,14 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style return header; } -void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params) +void LLChatHistory::clear() { - LLView* view = NULL; - std::string view_text = "\n[" + chat.mTimeStr + "] "; - if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - view_text += chat.mFromName + ": "; - - - LLInlineViewSegment::Params p; - p.force_newline = true; - p.left_pad = mLeftWidgetPad; - p.right_pad = mRightWidgetPad; + mLastFromName.clear(); + LLTextEditor::clear(); +} - +void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_chat_history, const LLStyle::Params& input_append_params) +{ LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); LLViewerChat::getChatColor(chat,txt_color); LLFontGL* fontp = LLViewerChat::getChatFont(); @@ -360,39 +373,63 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Param style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); - + std::string header_text = "[" + chat.mTimeStr + "] "; + if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) + header_text += chat.mFromName + ": "; - if (mLastFromName == chat.mFromName) + if (use_plain_text_chat_history) { - view = getSeparator(); - p.top_pad = mTopSeparatorPad; - p.bottom_pad = mBottomSeparatorPad; + appendText(header_text, getText().size() != 0, style_params); } else { - view = getHeader(chat,style_params); - if (getText().size() == 0) - p.top_pad = 0; + LLView* view = NULL; + LLInlineViewSegment::Params p; + p.force_newline = true; + p.left_pad = mLeftWidgetPad; + p.right_pad = mRightWidgetPad; + + if (mLastFromName == chat.mFromName) + { + view = getSeparator(); + p.top_pad = mTopSeparatorPad; + p.bottom_pad = mBottomSeparatorPad; + } else - p.top_pad = mTopHeaderPad; - p.bottom_pad = mBottomHeaderPad; - + { + view = getHeader(chat, style_params); + if (getText().size() == 0) + p.top_pad = 0; + else + p.top_pad = mTopHeaderPad; + p.bottom_pad = mBottomHeaderPad; + + } + p.view = view; + + //Prepare the rect for the view + LLRect target_rect = getDocumentView()->getRect(); + // squeeze down the widget by subtracting padding off left and right + target_rect.mLeft += mLeftWidgetPad + mHPad; + target_rect.mRight -= mRightWidgetPad; + view->reshape(target_rect.getWidth(), view->getRect().getHeight()); + view->setOrigin(target_rect.mLeft, view->getRect().mBottom); + + appendWidget(p, header_text, false); + mLastFromName = chat.mFromName; } - p.view = view; - - //Prepare the rect for the view - LLRect target_rect = getDocumentView()->getRect(); - // squeeze down the widget by subtracting padding off left and right - target_rect.mLeft += mLeftWidgetPad + mHPad; - target_rect.mRight -= mRightWidgetPad; - view->reshape(target_rect.getWidth(), view->getRect().getHeight()); - view->setOrigin(target_rect.mLeft, view->getRect().mBottom); - - appendWidget(p, view_text, false); - - //Append the text message - appendText(chat.mText, FALSE, style_params); + //Handle IRC styled /me messages. + std::string prefix = chat.mText.substr(0, 4); + if (prefix == "/me " || prefix == "/me'") + { + style_params.font.style = "ITALIC"; - mLastFromName = chat.mFromName; + if (chat.mFromName.size() > 0) + appendText(chat.mFromName + " ", TRUE, style_params); + appendText(chat.mText.substr(4), FALSE, style_params); + } + else + appendText(chat.mText, FALSE, style_params); blockUndo(); } + diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index c89d4b4ec6..ef5839ff2f 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -106,10 +106,11 @@ class LLChatHistory : public LLTextEditor * If last user appended message, concurs with current user, * separator is added before the message, otherwise header is added. * @param chat - base chat message. - * @param time time of a message. - * @param message message itself. + * @param use_plain_text_chat_history - whether to add message as plain text. + * @param input_append_params - font style. */ - void appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params = LLStyle::Params()); + void appendMessage(const LLChat& chat, const bool use_plain_text_chat_history = false, const LLStyle::Params& input_append_params = LLStyle::Params()); + /*virtual*/ void clear(); private: std::string mLastFromName; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7fc207d395..e20249a737 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -56,6 +56,7 @@ #include "llfloaterabout.h" #include "llfloaterhardwaresettings.h" #include "llfloatervoicedevicesettings.h" +#include "llimfloater.h" #include "llkeyboard.h" #include "llmodaldialog.h" #include "llnavigationbar.h" @@ -164,7 +165,6 @@ BOOL LLVoiceSetKeyDialog::handleKeyHere(KEY key, MASK mask) { mParent->setKey(key); } - closeFloater(); return result; } @@ -310,7 +310,8 @@ F32 LLFloaterPreference::sAspectRatio = 0.0; LLFloaterPreference::LLFloaterPreference(const LLSD& key) : LLFloater(key), mGotPersonalInfo(false), - mOriginalIMViaEmail(false) + mOriginalIMViaEmail(false), + mCancelOnClose(true) { //Build Floater is now Called from LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); @@ -357,6 +358,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) BOOL LLFloaterPreference::postBuild() { + gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLIMFloater::processChatHistoryStyleUpdate, _2)); + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); @@ -390,6 +393,20 @@ void LLFloaterPreference::draw() LLFloater::draw(); } +void LLFloaterPreference::saveSettings() +{ + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); + child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + child_list_t::const_iterator end = tabcontainer->getChildList()->end(); + for ( ; iter != end; ++iter) + { + LLView* view = *iter; + LLPanelPreference* panel = dynamic_cast<LLPanelPreference*>(view); + if (panel) + panel->saveSettings(); + } +} + void LLFloaterPreference::apply() { LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); @@ -444,6 +461,8 @@ void LLFloaterPreference::apply() // LLWString busy_response = utf8str_to_wstring(getChild<LLUICtrl>("busy_response")->getValue().asString()); // LLWStringUtil::replaceTabsWithSpaces(busy_response, 4); + + gSavedSettings.setBOOL("PlainTextChatHistory", childGetValue("plain_text_chat_history").asBoolean()); if(mGotPersonalInfo) { @@ -551,6 +570,11 @@ void LLFloaterPreference::onOpen(const LLSD& key) LLPanelLogin::setAlwaysRefresh(true); refresh(); + + // Make sure the current state of prefs are saved away when + // when the floater is opened. That will make cancel do its + // job + saveSettings(); } void LLFloaterPreference::onVertexShaderEnable() @@ -569,7 +593,7 @@ void LLFloaterPreference::onClose(bool app_quitting) { gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex()); LLPanelLogin::setAlwaysRefresh(false); - cancel(); // will be a no-op if OK or apply was performed just prior. + if (mCancelOnClose) cancel(); } void LLFloaterPreference::onOpenHardwareSettings() @@ -592,7 +616,11 @@ void LLFloaterPreference::onBtnOK() if (canClose()) { apply(); + // Here we do not want to cancel on close, so we do this funny thing + // that prevents cancel from undoing our changes when we hit OK + mCancelOnClose = false; closeFloater(false); + mCancelOnClose = true; gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); LLUIColorTable::instance().saveUserSettings(); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); @@ -620,6 +648,7 @@ void LLFloaterPreference::onBtnApply( ) } } apply(); + saveSettings(); LLPanelLogin::refreshLocation( false ); } @@ -636,7 +665,8 @@ void LLFloaterPreference::onBtnCancel() } refresh(); } - closeFloater(); // side effect will also cancel any unsaved changes. + cancel(); + closeFloater(); } // static @@ -1161,6 +1191,8 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); childEnable("send_im_to_email"); childSetValue("send_im_to_email", im_via_email); + childEnable("plain_text_chat_history"); + childSetValue("plain_text_chat_history", gSavedSettings.getBOOL("PlainTextChatHistory")); childEnable("log_instant_messages"); // childEnable("log_chat"); // childEnable("busy_response"); @@ -1493,6 +1525,11 @@ BOOL LLPanelPreference::postBuild() void LLPanelPreference::apply() { + // no-op +} + +void LLPanelPreference::saveSettings() +{ // Save the value of all controls in the hierarchy mSavedValues.clear(); std::list<LLView*> view_stack; diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 41c8bb7124..a30422564a 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -97,6 +97,10 @@ protected: // callback for when client turns on shaders void onVertexShaderEnable(); + // This function squirrels away the current values of the controls so that + // cancel() can restore them. + void saveSettings(); + public: @@ -145,6 +149,7 @@ private: static std::string sSkin; bool mGotPersonalInfo; bool mOriginalIMViaEmail; + bool mCancelOnClose; bool mOriginalHideOnlineStatus; std::string mDirectoryVisibility; @@ -161,6 +166,10 @@ public: virtual void cancel(); void setControlFalse(const LLSD& user_data); + // This function squirrels away the current values of the controls so that + // cancel() can restore them. + virtual void saveSettings(); + private: typedef std::map<LLControlVariable*, LLSD> control_values_map_t; control_values_map_t mSavedValues; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 4a487bd5a7..ee93a9349a 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -53,6 +53,10 @@ #include "lltransientfloatermgr.h" #include "llinventorymodel.h" +#ifdef USE_IM_CONTAINER + #include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container +#endif + LLIMFloater::LLIMFloater(const LLUUID& session_id) @@ -257,7 +261,11 @@ BOOL LLIMFloater::postBuild() //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) +#ifdef USE_IM_CONTAINER + return LLFloater::postBuild(); +#else return LLDockableFloater::postBuild(); +#endif } // virtual @@ -318,6 +326,11 @@ void LLIMFloater::onSlide() //static LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { +#ifdef USE_IM_CONTAINER + LLIMFloater* target_floater = findInstance(session_id); + bool not_existed = NULL == target_floater; + +#else //hide all LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); @@ -329,12 +342,25 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->setVisible(false); } } +#endif LLIMFloater* floater = LLFloaterReg::showTypedInstance<LLIMFloater>("impanel", session_id); floater->updateMessages(); floater->mInputEditor->setFocus(TRUE); +#ifdef USE_IM_CONTAINER + // do not add existed floaters to avoid adding torn off instances + if (not_existed) + { + // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; + // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists + LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; + + LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container"); + floater_container->addFloater(floater, TRUE, i_pt); + } +#else if (floater->getDockControl() == NULL) { LLChiclet* chiclet = @@ -352,13 +378,14 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } +#endif return floater; } void LLIMFloater::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRectScaled(); + rect = gViewerWindow->getWorldViewRectRaw(); } void LLIMFloater::setDocked(bool docked, bool pop_on_undock) @@ -368,7 +395,9 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); +#ifndef USE_IM_CONTAINER LLTransientDockableFloater::setDocked(docked, pop_on_undock); +#endif // update notification channel state if(channel) @@ -394,6 +423,7 @@ void LLIMFloater::setVisible(BOOL visible) //static bool LLIMFloater::toggle(const LLUUID& session_id) { +#ifndef USE_IM_CONTAINER LLIMFloater* floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id); if (floater && floater->getVisible() && floater->isDocked()) { @@ -409,6 +439,7 @@ bool LLIMFloater::toggle(const LLUUID& session_id) return true; } else +#endif { // ensure the list of messages is updated when floater is made visible show(session_id); @@ -451,6 +482,8 @@ void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) void LLIMFloater::updateMessages() { + bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory"); + std::list<LLSD> messages; LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex+1); @@ -476,39 +509,7 @@ void LLIMFloater::updateMessages() chat.mText = message; chat.mTimeStr = time; - //Handle IRC styled /me messages. - std::string prefix = message.substr(0, 4); - if (prefix == "/me " || prefix == "/me'") - { - - LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); - LLViewerChat::getChatColor(chat,txt_color); - LLFontGL* fontp = LLViewerChat::getChatFont(); - std::string font_name = LLFontGL::nameFromFont(fontp); - std::string font_size = LLFontGL::sizeFromFont(fontp); - LLStyle::Params append_style_params; - append_style_params.color(txt_color); - append_style_params.readonly_color(txt_color); - append_style_params.font.name(font_name); - append_style_params.font.size(font_size); - - if (from.size() > 0) - { - append_style_params.font.style = "ITALIC"; - chat.mText = from; - mChatHistory->appendWidgetMessage(chat, append_style_params); - } - - message = message.substr(3); - append_style_params.font.style = "ITALIC"; - mChatHistory->appendText(message, FALSE, append_style_params); - } - else - { - chat.mText = message; - mChatHistory->appendWidgetMessage(chat); - } - + mChatHistory->appendMessage(chat, use_plain_text_chat_history); mLastMessageIndex = msg["index"].asInteger(); } } @@ -639,6 +640,28 @@ void LLIMFloater::processAgentListUpdates(const LLSD& body) } } +void LLIMFloater::updateChatHistoryStyle() +{ + mChatHistory->clear(); + mLastMessageIndex = -1; + updateMessages(); +} + +void LLIMFloater::processChatHistoryStyleUpdate(const LLSD& newvalue) +{ + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); + iter != inst_list.end(); ++iter) + { + LLIMFloater* floater = dynamic_cast<LLIMFloater*>(*iter); + if (floater) + { + floater->updateChatHistoryStyle(); + } + } + +} + void LLIMFloater::processSessionUpdate(const LLSD& session_update) { // *TODO : verify following code when moderated mode will be implemented diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index e2d500d821..9e1330ff49 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -33,6 +33,11 @@ #ifndef LL_IMFLOATER_H #define LL_IMFLOATER_H +// This variable is used to show floaters related to chiclets in a Multi Floater Container +// So, this functionality does not require to have IM Floaters as Dockable & Transient +// See EXT-2640. +#define USE_IM_CONTAINER + #include "lltransientdockablefloater.h" #include "lllogchat.h" #include "lltooldraganddrop.h" @@ -92,6 +97,9 @@ public: void processAgentListUpdates(const LLSD& body); void processSessionUpdate(const LLSD& session_update); + void updateChatHistoryStyle(); + static void processChatHistoryStyleUpdate(const LLSD& newvalue); + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp new file mode 100644 index 0000000000..6e4b3ae214 --- /dev/null +++ b/indra/newview/llimfloatercontainer.cpp @@ -0,0 +1,96 @@ +/**
+ * @file llimfloatercontainer.cpp
+ * @brief Multifloater containing active IM sessions in separate tab container tabs
+ *
+ * $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 "llimfloatercontainer.h"
+
+//
+// LLIMFloaterContainer
+//
+LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
+: LLMultiFloater(seed),
+ mActiveVoiceFloater(NULL)
+{
+ mAutoResize = FALSE;
+}
+
+LLIMFloaterContainer::~LLIMFloaterContainer()
+{
+}
+
+BOOL LLIMFloaterContainer::postBuild()
+{
+ // Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button
+ // mTabContainer will be initialized in LLMultiFloater::addChild()
+ return TRUE;
+}
+
+void LLIMFloaterContainer::onOpen(const LLSD& key)
+{
+ LLMultiFloater::onOpen(key);
+/*
+ if (key.isDefined())
+ {
+ LLIMFloater* im_floater = LLIMFloater::findInstance(key.asUUID());
+ if (im_floater)
+ {
+ im_floater->openFloater();
+ }
+ }
+*/
+}
+
+void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
+ BOOL select_added_floater,
+ LLTabContainer::eInsertionPoint insertion_point)
+{
+ if(!floaterp) return;
+
+ // already here
+ if (floaterp->getHost() == this)
+ {
+ openFloater(floaterp->getKey());
+ return;
+ }
+
+ LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
+
+ // make sure active voice icon shows up for new tab
+ if (floaterp == mActiveVoiceFloater)
+ {
+ mTabContainer->setTabImage(floaterp, "active_voice_tab.tga");
+ }
+}
+
+// EOF
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h new file mode 100644 index 0000000000..10cde56c6e --- /dev/null +++ b/indra/newview/llimfloatercontainer.h @@ -0,0 +1,61 @@ +/**
+ * @file llimfloatercontainer.h
+ * @brief Multifloater containing active IM sessions in separate tab container tabs
+ *
+ * $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_LLIMFLOATERCONTAINER_H
+#define LL_LLIMFLOATERCONTAINER_H
+
+#include "llfloater.h"
+#include "llmultifloater.h"
+
+class LLTabContainer;
+
+class LLIMFloaterContainer : public LLMultiFloater
+{
+public:
+ LLIMFloaterContainer(const LLSD& seed);
+ virtual ~LLIMFloaterContainer();
+
+ /*virtual*/ BOOL postBuild();
+ /*virtual*/ void onOpen(const LLSD& key);
+
+ /*virtual*/ void addFloater(LLFloater* floaterp,
+ BOOL select_added_floater,
+ LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
+
+ static LLFloater* getCurrentVoiceFloater();
+
+protected:
+
+ LLFloater* mActiveVoiceFloater;
+};
+
+#endif // LL_LLIMFLOATERCONTAINER_H
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c066f1f77a..ffa943092f 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -71,6 +71,7 @@ #include "llviewermessage.h" #include "llviewerwindow.h" #include "llnotify.h" +#include "llnearbychat.h" #include "llviewerregion.h" #include "llvoicechannel.h" #include "lltrans.h" @@ -1611,6 +1612,12 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess LLChat chat(message); chat.mSourceType = CHAT_SOURCE_SYSTEM; LLFloaterChat::addChatHistory(chat); + + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + { + nearby_chat->addMessage(chat); + } } else // going to IM session { diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 09fd9b2949..80a6cc343f 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -173,7 +173,7 @@ void LLNearbyChat::addMessage(const LLChat& chat) append_style_params.font.style = "ITALIC"; LLChat add_chat=chat; add_chat.mText = chat.mFromName + " "; - mChatHistory->appendWidgetMessage(add_chat, append_style_params); + mChatHistory->appendMessage(add_chat, false, append_style_params); } message = message.substr(3); @@ -182,7 +182,7 @@ void LLNearbyChat::addMessage(const LLChat& chat) } else { - mChatHistory->appendWidgetMessage(chat); + mChatHistory->appendMessage(chat); } } } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 03401d934f..2c27808f03 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -120,7 +120,7 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, static LLDefaultChildRegistry::Register<LLDropTarget> r("drop_target"); static LLRegisterPanelClassWrapper<LLPanelAvatarProfile> t_panel_profile("panel_profile"); -static LLRegisterPanelClassWrapper<LLPanelAvatarMeProfile> t_panel_me_profile("panel_me_profile"); +static LLRegisterPanelClassWrapper<LLPanelMyProfile> t_panel_my_profile("panel_my_profile"); static LLRegisterPanelClassWrapper<LLPanelAvatarNotes> t_panel_notes("panel_notes"); //----------------------------------------------------------------------------- @@ -359,7 +359,7 @@ void LLPanelAvatarProfile::onOpen(const LLSD& key) { LLPanelProfileTab::onOpen(key); - mGroups.erase(); + mGroups.clear(); //Disable "Add Friend" button for friends. childSetEnabled("add_friend", !LLAvatarActions::isFriend(getAvatarId())); @@ -391,7 +391,7 @@ void LLPanelAvatarProfile::resetControls() void LLPanelAvatarProfile::resetData() { - mGroups.erase(); + mGroups.clear(); childSetValue("2nd_life_pic",LLUUID::null); childSetValue("real_world_pic",LLUUID::null); childSetValue("online_status",LLStringUtil::null); @@ -443,23 +443,29 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g // Group properties may arrive in two callbacks, we need to save them across // different calls. We can't do that in textbox as textbox may change the text. - std::string groups = mGroups; LLAvatarGroups::group_list_t::const_iterator it = avatar_groups->group_list.begin(); const LLAvatarGroups::group_list_t::const_iterator it_end = avatar_groups->group_list.end(); - if(groups.empty() && it_end != it) - { - groups = (*it).group_name; - ++it; - } for(; it_end != it; ++it) { LLAvatarGroups::LLGroupData group_data = *it; - groups += ", "; - groups += group_data.group_name; + + // Check if there is no duplicates for this group + if (std::find(mGroups.begin(), mGroups.end(), group_data.group_name) == mGroups.end()) + mGroups.push_back(group_data.group_name); + } + + // Creating string, containing group list + std::string groups = ""; + for (group_list_t::const_iterator it = mGroups.begin(); it != mGroups.end(); ++it) + { + if (it != mGroups.begin()) + groups += ", "; + + groups += *it; } - mGroups = groups; - childSetValue("sl_groups",mGroups); + + childSetValue("sl_groups", groups); } void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) @@ -589,19 +595,19 @@ void LLPanelAvatarProfile::onOverflowButtonClicked() ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -LLPanelAvatarMeProfile::LLPanelAvatarMeProfile() +LLPanelMyProfile::LLPanelMyProfile() : LLPanelAvatarProfile() { } -BOOL LLPanelAvatarMeProfile::postBuild() +BOOL LLPanelMyProfile::postBuild() { LLPanelAvatarProfile::postBuild(); mStatusCombobox = getChild<LLComboBox>("status_combo"); - childSetCommitCallback("status_combo", boost::bind(&LLPanelAvatarMeProfile::onStatusChanged, this), NULL); - childSetCommitCallback("status_me_message_text", boost::bind(&LLPanelAvatarMeProfile::onStatusMessageChanged, this), NULL); + childSetCommitCallback("status_combo", boost::bind(&LLPanelMyProfile::onStatusChanged, this), NULL); + childSetCommitCallback("status_me_message_text", boost::bind(&LLPanelMyProfile::onStatusMessageChanged, this), NULL); resetControls(); resetData(); @@ -609,12 +615,12 @@ BOOL LLPanelAvatarMeProfile::postBuild() return TRUE; } -void LLPanelAvatarMeProfile::onOpen(const LLSD& key) +void LLPanelMyProfile::onOpen(const LLSD& key) { LLPanelProfileTab::onOpen(key); } -void LLPanelAvatarMeProfile::processProfileProperties(const LLAvatarData* avatar_data) +void LLPanelMyProfile::processProfileProperties(const LLAvatarData* avatar_data) { fillCommonData(avatar_data); @@ -625,7 +631,7 @@ void LLPanelAvatarMeProfile::processProfileProperties(const LLAvatarData* avatar fillAccountStatus(avatar_data); } -void LLPanelAvatarMeProfile::fillStatusData(const LLAvatarData* avatar_data) +void LLPanelMyProfile::fillStatusData(const LLAvatarData* avatar_data) { std::string status; if (gAgent.getAFK()) @@ -644,7 +650,7 @@ void LLPanelAvatarMeProfile::fillStatusData(const LLAvatarData* avatar_data) mStatusCombobox->setValue(status); } -void LLPanelAvatarMeProfile::resetControls() +void LLPanelMyProfile::resetControls() { childSetVisible("status_panel", false); childSetVisible("profile_buttons_panel", false); @@ -654,7 +660,7 @@ void LLPanelAvatarMeProfile::resetControls() childSetVisible("profile_me_buttons_panel", true); } -void LLPanelAvatarMeProfile::onStatusChanged() +void LLPanelMyProfile::onStatusChanged() { LLSD::String status = mStatusCombobox->getValue().asString(); @@ -676,7 +682,7 @@ void LLPanelAvatarMeProfile::onStatusChanged() } } -void LLPanelAvatarMeProfile::onStatusMessageChanged() +void LLPanelMyProfile::onStatusMessageChanged() { updateData(); } diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index a0caf0c915..716bb29d45 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -47,7 +47,7 @@ enum EOnlineStatus }; /** -* Base class for any Profile View or Me Profile Panel. +* Base class for any Profile View or My Profile Panel. */ class LLPanelProfileTab : public LLPanel @@ -148,7 +148,7 @@ protected: virtual void processGroupProperties(const LLAvatarGroups* avatar_groups); /** - * Fills common for Avatar profile and Me Profile fields. + * Fills common for Avatar profile and My Profile fields. */ virtual void fillCommonData(const LLAvatarData* avatar_data); @@ -183,18 +183,20 @@ protected: private: - std::string mGroups; + typedef std::list<std::string> group_list_t; + group_list_t mGroups; + LLToggleableMenu* mProfileMenu; }; /** * Panel for displaying own first and second life related info. */ -class LLPanelAvatarMeProfile +class LLPanelMyProfile : public LLPanelAvatarProfile { public: - LLPanelAvatarMeProfile(); + LLPanelMyProfile(); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 10b419dfdb..e24fa14e1e 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -67,6 +67,27 @@ static const std::string TRASH_BUTTON_NAME = "trash_btn"; // helper functions static void filter_list(LLInventorySubTreePanel* inventory_list, const std::string& string); +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLLandmarksPanelObserver +// +// Bridge to support knowing when the inventory has changed to update +// landmarks accordions visibility. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLLandmarksPanelObserver : public LLInventoryObserver +{ +public: + LLLandmarksPanelObserver(LLLandmarksPanel* lp) : mLP(lp) {} + virtual ~LLLandmarksPanelObserver() {} + /*virtual*/ void changed(U32 mask); + +private: + LLLandmarksPanel* mLP; +}; + +void LLLandmarksPanelObserver::changed(U32 mask) +{ + mLP->updateFilteredAccordions(); +} LLLandmarksPanel::LLLandmarksPanel() : LLPanelPlacesTab() @@ -80,11 +101,16 @@ LLLandmarksPanel::LLLandmarksPanel() , mGearLandmarkMenu(NULL) , mDirtyFilter(false) { + mInventoryObserver = new LLLandmarksPanelObserver(this); + gInventory.addObserver(mInventoryObserver); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_landmarks.xml"); } LLLandmarksPanel::~LLLandmarksPanel() { + if (gInventory.containsObserver(mInventoryObserver)) + gInventory.removeObserver(mInventoryObserver); } BOOL LLLandmarksPanel::postBuild() @@ -135,8 +161,14 @@ void LLLandmarksPanel::onSearchEdit(const std::string& string) LLAccordionCtrlTab* tab = *iter; tab->setVisible(true); - // expand accordion to see matched items in all ones. See EXT-2014. + // expand accordion to see matched items in each one. See EXT-2014. tab->changeOpenClose(false); + + // refresh all accordions to display their contents in case of less restrictive filter + LLInventorySubTreePanel* inventory_list = dynamic_cast<LLInventorySubTreePanel*>(tab->getAccordionView()); + if (NULL == inventory_list) continue; + LLFolderView* fv = inventory_list->getRootFolder(); + fv->refresh(); } } @@ -223,6 +255,31 @@ void LLLandmarksPanel::onSelectorButtonClicked() } } +void LLLandmarksPanel::updateFilteredAccordions() +{ + LLInventoryPanel* inventory_list = NULL; + LLAccordionCtrlTab* accordion_tab = NULL; + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + accordion_tab = *iter; + inventory_list = dynamic_cast<LLInventorySubTreePanel*> (accordion_tab->getAccordionView()); + if (NULL == inventory_list) continue; + LLFolderView* fv = inventory_list->getRootFolder(); + + bool has_descendants = fv->hasFilteredDescendants(); + + accordion_tab->setVisible(has_descendants); + } + + // we have to arrange accordion tabs for cases when filter string is less restrictive but + // all items are still filtered. + static LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion"); + accordion->arrange(); + + // now filter state is applied to accordion tabs + mDirtyFilter = false; +} + ////////////////////////////////////////////////////////////////////////// // PROTECTED METHODS ////////////////////////////////////////////////////////////////////////// @@ -833,31 +890,6 @@ void LLLandmarksPanel::doIdle(void* landmarks_panel) } -void LLLandmarksPanel::updateFilteredAccordions() -{ - LLInventoryPanel* inventory_list = NULL; - LLAccordionCtrlTab* accordion_tab = NULL; - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - accordion_tab = *iter; - inventory_list = dynamic_cast<LLInventorySubTreePanel*> (accordion_tab->getAccordionView()); - if (NULL == inventory_list) continue; - LLFolderView* fv = inventory_list->getRootFolder(); - - bool has_visible_children = fv->hasVisibleChildren(); - - accordion_tab->setVisible(has_visible_children); - } - - // we have to arrange accordion tabs for cases when filter string is less restrictive but - // all items are still filtered. - static LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion"); - accordion->arrange(); - - // now filter state is applied to accordion tabs - mDirtyFilter = false; -} - void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark) { LLVector3d landmark_global_pos; diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 777ee562d2..c65abc178b 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -46,6 +46,7 @@ class LLAccordionCtrlTab; class LLFolderViewItem; class LLMenuGL; class LLInventoryPanel; +class LLInventoryObserver; class LLInventorySubTreePanel; class LLLandmarksPanel : public LLPanelPlacesTab, LLRemoteParcelInfoObserver @@ -62,7 +63,14 @@ public: void onSelectionChange(LLInventorySubTreePanel* inventory_list, const std::deque<LLFolderViewItem*> &items, BOOL user_action); void onSelectorButtonClicked(); - + + /** + * Updates accordions according to filtered items in lists. + * + * It hides accordion for empty lists + */ + void updateFilteredAccordions(); + protected: /** * @return true - if current selected panel is not null and selected item is a landmark @@ -122,13 +130,6 @@ private: static void doIdle(void* landmarks_panel); /** - * Updates accordions according to filtered items in lists. - * - * It hides accordion for empty lists - */ - void updateFilteredAccordions(); - - /** * Landmark actions callbacks. Fire when a landmark is loaded from the list. */ void doShowOnMap(LLLandmark* landmark); @@ -147,6 +148,7 @@ private: LLMenuGL* mGearFolderMenu; LLMenuGL* mMenuAdd; LLInventorySubTreePanel* mCurrentSelectedList; + LLInventoryObserver* mInventoryObserver; LLPanel* mListCommands; bool mSortByDate; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 78f3469f0e..ec0f8e303c 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -391,6 +391,10 @@ LLPanelLogin::~LLPanelLogin() //// We know we're done with the image, so be rid of it. //gTextureList.deleteImage( mLogoImage ); + + // Controls having keyboard focus by default + // must reset it on destroy. (EXT-2748) + gFocusMgr.setDefaultKeyboardFocus(NULL); } // virtual @@ -682,8 +686,6 @@ void LLPanelLogin::closePanel() if (sInstance) { gViewerWindow->getRootView()->removeChild( LLPanelLogin::sInstance ); - - gFocusMgr.setDefaultKeyboardFocus(NULL); delete sInstance; sInstance = NULL; diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp new file mode 100644 index 0000000000..046118cf75 --- /dev/null +++ b/indra/newview/llpanelme.cpp @@ -0,0 +1,272 @@ +/** + * @file llpanelme.cpp + * @brief Side tray "Me" (My Profile) panel + * + * $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 "llpanelprofile.h" +#include "llavatarconstants.h" +#include "llpanelme.h" +#include "llagent.h" +#include "llagentwearables.h" +#include "lliconctrl.h" +#include "llsidetray.h" +#include "lltabcontainer.h" +#include "lltexturectrl.h" + +#define PICKER_SECOND_LIFE "2nd_life_pic" +#define PICKER_FIRST_LIFE "real_world_pic" +#define PANEL_PROFILE "panel_profile" + +static LLRegisterPanelClassWrapper<LLPanelMyProfileEdit> t_panel_me_profile_edit("edit_profile_panel"); +static LLRegisterPanelClassWrapper<LLPanelMe> t_panel_me_profile("panel_me"); + +LLPanelMe::LLPanelMe(void) + : LLPanelProfile() + , mEditPanel(NULL) +{ + setAvatarId(gAgent.getID()); +} + +BOOL LLPanelMe::postBuild() +{ + LLPanelProfile::postBuild(); + + getTabContainer()[PANEL_PROFILE]->childSetAction("edit_profile_btn", boost::bind(&LLPanelMe::onEditProfileClicked, this), this); + getTabContainer()[PANEL_PROFILE]->childSetAction("edit_appearance_btn", boost::bind(&LLPanelMe::onEditAppearanceClicked, this), this); + + return TRUE; +} + +void LLPanelMe::onOpen(const LLSD& key) +{ + LLPanelProfile::onOpen(key); +} + +void LLPanelMe::notifyChildren(const LLSD& info) +{ + if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state") + { + // Implement task panel tri-state behavior. + // + // When the button of an active open task panel is clicked, side tray + // calls notifyChildren() on the panel, passing task-panel-action=>handle-tri-state as an argument. + // The task panel is supposed to handle this by reverting to the default view, + // i.e. closing any dependent panels like "pick info" or "profile edit". + + bool on_default_view = true; + + const LLRect& task_panel_rect = getRect(); + for (LLView* child = getFirstChild(); child; child = findNextSibling(child)) + { + LLPanel* panel = dynamic_cast<LLPanel*>(child); + if (!panel) + continue; + + // *HACK: implement panel stack instead (e.g. me->pick_info->pick_edit). + if (panel->getRect().getWidth() == task_panel_rect.getWidth() && + panel->getRect().getHeight() == task_panel_rect.getHeight() && + panel->getVisible()) + { + panel->setVisible(FALSE); + on_default_view = false; + } + } + + if (on_default_view) + LLSideTray::getInstance()->collapseSideBar(); + + return; // this notification is only supposed to be handled by task panels + } + + LLPanel::notifyChildren(info); +} + +void LLPanelMe::buildEditPanel() +{ + if (NULL == mEditPanel) + { + mEditPanel = new LLPanelMyProfileEdit(); + mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this); + mEditPanel->childSetAction("cancel_btn", boost::bind(&LLPanelMe::onCancelClicked, this), this); + } +} + + +void LLPanelMe::onEditProfileClicked() +{ + buildEditPanel(); + togglePanel(mEditPanel, getAvatarId()); // open +} + +void LLPanelMe::onEditAppearanceClicked() +{ + if (gAgentWearables.areWearablesLoaded()) + { + gAgent.changeCameraToCustomizeAvatar(); + } +} + +void LLPanelMe::onSaveChangesClicked() +{ + LLAvatarData data = LLAvatarData(); + data.avatar_id = gAgent.getID(); + data.image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_SECOND_LIFE)->getImageAssetID(); + data.fl_image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_FIRST_LIFE)->getImageAssetID(); + data.about_text = mEditPanel->childGetValue("sl_description_edit").asString(); + data.fl_about_text = mEditPanel->childGetValue("fl_description_edit").asString(); + data.profile_url = mEditPanel->childGetValue("homepage_edit").asString(); + data.allow_publish = mEditPanel->childGetValue("show_in_search_checkbox"); + + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&data); + togglePanel(mEditPanel); // close + onOpen(getAvatarId()); +} + +void LLPanelMe::onCancelClicked() +{ + togglePanel(mEditPanel); // close +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLPanelMyProfileEdit::LLPanelMyProfileEdit() + : LLPanelMyProfile() +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_edit_profile.xml"); + + setAvatarId(gAgent.getID()); +} + +void LLPanelMyProfileEdit::onOpen(const LLSD& key) +{ + resetData(); + + // Disable editing until data is loaded, or edited fields will be overwritten when data + // is loaded. + enableEditing(false); + LLPanelMyProfile::onOpen(getAvatarId()); +} + +void LLPanelMyProfileEdit::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_PROPERTIES == type) + { + const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data); + if(avatar_data && getAvatarId() == avatar_data->avatar_id) + { + // *TODO dzaporozhan + // Workaround for ticket EXT-1099, waiting for fix for ticket EXT-1128 + enableEditing(true); + processProfileProperties(avatar_data); + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); + } + } +} + +void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_data) +{ + fillCommonData(avatar_data); + + fillOnlineStatus(avatar_data); + + fillPartnerData(avatar_data); + + fillAccountStatus(avatar_data); + + childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); + + std::string first, last; + BOOL found = gCacheName->getName(avatar_data->avatar_id, first, last); + if (found) + { + childSetTextArg("name_text", "[FIRST]", first); + childSetTextArg("name_text", "[LAST]", last); + } +} + +BOOL LLPanelMyProfileEdit::postBuild() +{ + initTexturePickerMouseEvents(); + + childSetTextArg("partner_edit_link", "[URL]", getString("partner_edit_link_url")); + + return LLPanelAvatarProfile::postBuild(); +} +/** + * Inits map with texture picker and appropriate edit icon. + * Sets callbacks of Mouse Enter and Mouse Leave signals of Texture Pickers + */ +void LLPanelMyProfileEdit::initTexturePickerMouseEvents() +{ + LLTextureCtrl* text_pic = getChild<LLTextureCtrl>(PICKER_SECOND_LIFE); + LLIconCtrl* text_icon = getChild<LLIconCtrl>("2nd_life_edit_icon"); + mTextureEditIconMap[text_pic->getName()] = text_icon; + text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1)); + text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1)); + text_icon->setVisible(FALSE); + + text_pic = getChild<LLTextureCtrl>(PICKER_FIRST_LIFE); + text_icon = getChild<LLIconCtrl>("real_world_edit_icon"); + mTextureEditIconMap[text_pic->getName()] = text_icon; + text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1)); + text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1)); + text_icon->setVisible(FALSE); +} + +void LLPanelMyProfileEdit::resetData() +{ + LLPanelMyProfile::resetData(); + + childSetTextArg("name_text", "[FIRST]", LLStringUtil::null); + childSetTextArg("name_text", "[LAST]", LLStringUtil::null); +} + +void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) +{ + mTextureEditIconMap[ctrl->getName()]->setVisible(TRUE); +} +void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) +{ + mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE); +} + +void LLPanelMyProfileEdit::enableEditing(bool enable) +{ + childSetEnabled("2nd_life_pic", enable); + childSetEnabled("real_world_pic", enable); + childSetEnabled("sl_description_edit", enable); + childSetEnabled("fl_description_edit", enable); + childSetEnabled("homepage_edit", enable); + childSetEnabled("show_in_search_checkbox", enable); +} diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h new file mode 100644 index 0000000000..17d367132e --- /dev/null +++ b/indra/newview/llpanelme.h @@ -0,0 +1,111 @@ +/** + * @file llpanelme.h + * @brief Side tray "Me" (My Profile) panel + * + * $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_LLPANELMEPROFILE_H +#define LL_LLPANELMEPROFILE_H + +#include "llpanel.h" +#include "llpanelavatar.h" + +class LLPanelMyProfileEdit; +class LLPanelProfile; +class LLIconCtrl; + +/** +* Panel for displaying Agent's profile, it consists of two sub panels - Profile +* and Picks. +* LLPanelMe allows user to edit his profile and picks. +*/ +class LLPanelMe : public LLPanelProfile +{ + LOG_CLASS(LLPanelMe); + +public: + + LLPanelMe(); + + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void notifyChildren(const LLSD& info); + + /*virtual*/ BOOL postBuild(); + +private: + + void buildEditPanel(); + + void onEditProfileClicked(); + void onEditAppearanceClicked(); + void onSaveChangesClicked(); + void onCancelClicked(); + + LLPanelMyProfileEdit * mEditPanel; + +}; + +class LLPanelMyProfileEdit : public LLPanelMyProfile +{ + LOG_CLASS(LLPanelMyProfileEdit); + +public: + + LLPanelMyProfileEdit(); + + /*virtual*/void processProperties(void* data, EAvatarProcessorType type); + + /*virtual*/BOOL postBuild(); + + /*virtual*/ void onOpen(const LLSD& key); + +protected: + + /*virtual*/void resetData(); + + void processProfileProperties(const LLAvatarData* avatar_data); + +private: + void initTexturePickerMouseEvents(); + void onTexturePickerMouseEnter(LLUICtrl* ctrl); + void onTexturePickerMouseLeave(LLUICtrl* ctrl); + + /** + * Enabled/disables controls to prevent overwriting edited data upon receiving + * current data from server. + */ + void enableEditing(bool enable); + +private: + // map TexturePicker name => Edit Icon pointer should be visible while hovering Texture Picker + typedef std::map<std::string, LLIconCtrl*> texture_edit_icon_map_t; + texture_edit_icon_map_t mTextureEditIconMap; +}; + +#endif // LL_LLPANELMEPROFILE_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index c0a4dabc28..b74d566f3e 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -56,6 +56,8 @@ #include "llgrouplist.h" #include "llinventoryobserver.h" #include "llpanelpeoplemenus.h" +#include "llsidetray.h" +#include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings #include "llviewermenu.h" // for gMenuHolder @@ -1281,6 +1283,31 @@ void LLPanelPeople::onOpen(const LLSD& key) reSelectedCurrentTab(); } +void LLPanelPeople::notifyChildren(const LLSD& info) +{ + if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state") + { + LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); + if (!container) + { + llwarns << "Cannot find People panel container" << llendl; + return; + } + + if (container->getCurrentPanelIndex() > 0) + { + // if not on the default panel, switch to it + container->onOpen(LLSD().insert(LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME, getName())); + } + else + LLSideTray::getInstance()->collapseSideBar(); + + return; // this notification is only supposed to be handled by task panels + } + + LLPanel::notifyChildren(info); +} + void LLPanelPeople::showAccordion(const std::string name, bool show) { if(name.empty()) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 9d9c75486c..5ac5bcc1d7 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -50,8 +50,8 @@ public: virtual ~LLPanelPeople(); /*virtual*/ BOOL postBuild(); - - virtual void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void notifyChildren(const LLSD& info); // internals class Updater; diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 4b90ea5048..b17b6d6fe9 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -83,7 +83,7 @@ public: LLClassifiedItem* getSelectedClassifiedItem(); //*NOTE top down approch when panel toggling is done only by - // parent panels failed to work (picks related code was in me profile panel) + // parent panels failed to work (picks related code was in my profile panel) void setProfilePanel(LLPanelProfile* profile_panel); private: diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 02f45c1b48..4d152a13f3 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -158,28 +158,14 @@ void LLPanelProfile::onOpen(const LLSD& key) } //*TODO redo panel toggling -void LLPanelProfile::togglePanel(LLPanel* panel) +void LLPanelProfile::togglePanel(LLPanel* panel, const LLSD& key) { // TRUE - we need to open/expand "panel" bool expand = getChildList()->front() != panel; // mTabCtrl->getVisible(); if (expand) { - if (panel->getParent() != this) - { - addChild(panel); - } - else - { - sendChildToFront(panel); - } - - panel->setVisible(TRUE); - - LLRect new_rect = getRect(); - panel->reshape(new_rect.getWidth(), new_rect.getHeight()); - new_rect.setLeftTopAndSize(0, new_rect.getHeight(), new_rect.getWidth(), new_rect.getHeight()); - panel->setRect(new_rect); + openPanel(panel, key); } else { diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index e0b827c986..067beb248b 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -40,7 +40,7 @@ class LLTabContainer; /** -* Base class for Profile View and Me Profile. +* Base class for Profile View and My Profile. */ class LLPanelProfile : public LLPanel { @@ -51,7 +51,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); - virtual void togglePanel(LLPanel*); + virtual void togglePanel(LLPanel*, const LLSD& key = LLSD()); virtual void openPanel(LLPanel* panel, const LLSD& params); diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index d4ab5013f9..08aea8cfd8 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -193,8 +193,10 @@ void LLPanelProfileView::onAvatarNameCached(const LLUUID& id, const std::string& getChild<LLTextBox>("user_name", FALSE)->setValue(first_name + " " + last_name); } -void LLPanelProfileView::togglePanel(LLPanel* panel) +void LLPanelProfileView::togglePanel(LLPanel* panel, const LLSD& key) { + // *TODO: unused method? + LLPanelProfile::togglePanel(panel); if(FALSE == panel->getVisible()) { diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h index 45c2fc116e..5dc617d4a0 100644 --- a/indra/newview/llpanelprofileview.h +++ b/indra/newview/llpanelprofileview.h @@ -64,7 +64,7 @@ public: /*virtual*/ BOOL postBuild(); - /*virtual*/ void togglePanel(LLPanel* panel); + /*virtual*/ void togglePanel(LLPanel* panel, const LLSD& key = LLSD()); BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 057cdde6f0..67d0e13786 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -262,6 +262,7 @@ BOOL LLTeleportHistoryPanel::postBuild() fl->setCommitOnSelectionChange(true); fl->setDoubleClickCallback(boost::bind(&LLTeleportHistoryPanel::onDoubleClickItem, this)); fl->setCommitCallback(boost::bind(&LLTeleportHistoryPanel::handleItemSelect, this, fl)); + fl->setReturnCallback(boost::bind(&LLTeleportHistoryPanel::onReturnKeyPressed, this)); } } } @@ -636,6 +637,12 @@ void LLTeleportHistoryPanel::handleItemSelect(LLFlatListView* selected) updateVerbs(); } +void LLTeleportHistoryPanel::onReturnKeyPressed() +{ + // Teleport to selected region as default action on return key pressed + onTeleport(); +} + void LLTeleportHistoryPanel::onDoubleClickItem() { // If item got doubleclick, then that item is already selected diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index b34d9e876c..a31ff34cb6 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -80,6 +80,7 @@ public: private: void onDoubleClickItem(); + void onReturnKeyPressed(); void onAccordionTabRightClick(LLView *view, S32 x, S32 y, MASK mask); void onAccordionTabOpen(LLAccordionCtrlTab *tab); void onAccordionTabClose(LLAccordionCtrlTab *tab); diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index fb9db42cf6..24ba288c49 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -115,7 +115,9 @@ void LLScreenChannelBase::init(S32 channel_left, S32 channel_right) // LLScreenChannel ////////////////////// //-------------------------------------------------------------------------- -LLScreenChannel::LLScreenChannel(LLUUID& id): LLScreenChannelBase(id) +LLScreenChannel::LLScreenChannel(LLUUID& id): +LLScreenChannelBase(id) +,mStartUpToastPanel(NULL) { } @@ -358,8 +360,6 @@ void LLScreenChannel::redrawToasts() if(mToastList.size() == 0 || isHovering()) return; - hideToastsFromScreen(); - switch(mToastAlignment) { case NA_TOP : @@ -383,6 +383,8 @@ void LLScreenChannel::showToastsBottom() S32 toast_margin = 0; std::vector<ToastElem>::reverse_iterator it; + closeOverflowToastPanel(); + for(it = mToastList.rbegin(); it != mToastList.rend(); ++it) { if(it != mToastList.rbegin()) @@ -408,7 +410,20 @@ void LLScreenChannel::showToastsBottom() if(stop_showing_toasts) break; - (*it).toast->setVisible(TRUE); + if( !(*it).toast->getVisible() ) + { + if((*it).toast->isFirstLook()) + { + (*it).toast->setVisible(TRUE); + } + else + { + // HACK + // EXT-2653: it is necessary to prevent overlapping for secondary showed toasts + (*it).toast->setVisible(TRUE); + gFloaterView->sendChildToBack((*it).toast); + } + } } if(it != mToastList.rend() && !mOverflowToastHidden) @@ -417,6 +432,7 @@ void LLScreenChannel::showToastsBottom() for(; it != mToastList.rend(); it++) { (*it).toast->stopTimer(); + (*it).toast->setVisible(FALSE); mHiddenToastsNum++; } createOverflowToast(bottom, gSavedSettings.getS32("NotificationTipToastLifeTime")); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 7711f3c733..0b832a8239 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -435,35 +435,16 @@ void LLSideTray::processTriState () expandSideBar(); else { - //!!!!!!!!!!!!!!!!! - //** HARDCODED!!!!! - //!!!!!!!!!!!!!!!!! - - //there is no common way to determine "default" panel for tab - //so default panels for now will be hardcoded - - //hardcoded for people tab and profile tab - - /*if(mActiveTab == getTab("sidebar_people")) - { - LLSideTrayPanelContainer* container = findChild<LLSideTrayPanelContainer>("panel_container"); - if(container && container->getCurrentPanelIndex()>0) - { - container->onOpen(LLSD().insert("sub_panel_name","panel_people")); - } - else - collapseSideBar(); - } - else if(mActiveTab == getTab("sidebar_me")) - { - LLTabContainer* tab_container = findChild<LLTabContainer>("tabs"); - if(tab_container && tab_container->getCurrentPanelIndex()>0) - tab_container->selectFirstTab(); - else - collapseSideBar(); - } - else*/ - collapseSideBar(); +#if 0 // *TODO: EXT-2092 + + // Tell the active task panel to switch to its default view + // or collapse side tray if already on the default view. + LLSD info; + info["task-panel-action"] = "handle-tri-state"; + mActiveTab->notifyChildren(info); +#else + collapseSideBar(); +#endif } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d36ff1605e..736be67710 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2153,7 +2153,7 @@ void login_callback(S32 option, void *userdata) LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); return; } - else if (QUIT_OPTION == option) + else if (QUIT_OPTION == option) // *TODO: THIS CODE SEEMS TO BE UNREACHABLE!!!!! login_callback is never called with option equal to QUIT_OPTION { // Make sure we don't save the password if the user is trying to clear it. std::string first, last, password; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 6f3dabe5a7..9bb2a4ad0a 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -931,6 +931,14 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == DECODE_IMAGE) { + if (mDesiredDiscard < 0) + { + // We aborted, don't decode + mState = DONE; + setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); + return true; + } + if (mFormattedImage->getDataSize() <= 0) { llerrs << "Decode entered with invalid mFormattedImage. ID = " << mID << llendl; diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index ed2cedbd10..f9cbdc20d6 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -227,7 +227,7 @@ void LLToast::setVisible(BOOL show) } LLModalDialog::setFrontmost(FALSE); } - LLPanel::setVisible(show); + LLFloater::setVisible(show); if(mPanel) { if(!mPanel->isDead()) diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 812107dd72..642df92379 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -109,6 +109,7 @@ #include "llfloaterwhitelistentry.h" #include "llfloaterwindlight.h" #include "llfloaterworldmap.h" +#include "llimfloatercontainer.h" #include "llinspectavatar.h" #include "llinspectgroup.h" #include "llinspectobject.h" @@ -172,6 +173,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>); LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>); + LLFloaterReg::add("im_container", "floater_im_container.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloaterContainer>); LLFloaterReg::add("script_floater", "floater_script.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLScriptFloater>); LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>); LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventory>); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c67af994a4..625b816125 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5678,6 +5678,16 @@ class LLFloaterVisible : public view_listener_t } }; +class LLShowSidetrayPanel : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string panel_name = userdata.asString(); + LLSideTray::getInstance()->showPanel(panel_name, LLSD()); + return true; + } +}; + bool callback_show_url(const LLSD& notification, const LLSD& response) { S32 option = LLNotification::getSelectedOption(notification, response); @@ -8039,6 +8049,7 @@ void initialize_menus() visible.add("Object.VisibleEdit", boost::bind(&enable_object_edit)); view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible"); + view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel"); view_listener_t::addMenu(new LLSomethingSelected(), "SomethingSelected"); view_listener_t::addMenu(new LLSomethingSelectedNoHUD(), "SomethingSelectedNoHUD"); view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index db66faef81..3840f337d4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1347,6 +1347,7 @@ LLViewerWindow::LLViewerWindow( mDebugText = new LLDebugText(this); + mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale); } void LLViewerWindow::initGLDefaults() @@ -2867,19 +2868,17 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window) if (mWorldViewRectRaw != new_world_rect) { - // sending a signal with a new WorldView rect - mOnWorldViewRectUpdated(mWorldViewRectRaw, new_world_rect); - + LLRect old_world_rect = mWorldViewRectRaw; mWorldViewRectRaw = new_world_rect; gResizeScreenTexture = TRUE; LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); - mWorldViewRectScaled = mWorldViewRectRaw; - mWorldViewRectScaled.mLeft = llround((F32)mWorldViewRectScaled.mLeft / mDisplayScale.mV[VX]); - mWorldViewRectScaled.mRight = llround((F32)mWorldViewRectScaled.mRight / mDisplayScale.mV[VX]); - mWorldViewRectScaled.mBottom = llround((F32)mWorldViewRectScaled.mBottom / mDisplayScale.mV[VY]); - mWorldViewRectScaled.mTop = llround((F32)mWorldViewRectScaled.mTop / mDisplayScale.mV[VY]); + mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale); + + // sending a signal with a new WorldView rect + old_world_rect = calcScaledRect(old_world_rect, mDisplayScale); + mOnWorldViewRectUpdated(old_world_rect, mWorldViewRectScaled); } } @@ -4794,6 +4793,18 @@ void LLViewerWindow::calcDisplayScale() } } +//static +LLRect LLViewerWindow::calcScaledRect(const LLRect & rect, const LLVector2& display_scale) +{ + LLRect res = rect; + res.mLeft = llround((F32)res.mLeft / display_scale.mV[VX]); + res.mRight = llround((F32)res.mRight / display_scale.mV[VX]); + res.mBottom = llround((F32)res.mBottom / display_scale.mV[VY]); + res.mTop = llround((F32)res.mTop / display_scale.mV[VY]); + + return res; +} + S32 LLViewerWindow::getChatConsoleBottomPad() { S32 offset = 0; diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 517993182b..747fd3b253 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -391,6 +391,7 @@ public: F32 getWorldViewAspectRatio() const; const LLVector2& getDisplayScale() const { return mDisplayScale; } void calcDisplayScale(); + static LLRect calcScaledRect(const LLRect & rect, const LLVector2& display_scale); private: bool shouldShowToolTipFor(LLMouseHandler *mh); diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 639585de55..a3495b9588 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -52,7 +52,7 @@ public: STATE_CONNECTED } EState; - typedef boost::function<void(const EState& old_state, const EState& new_state)> state_changed_callback_t; + typedef boost::signals2::signal<void(const EState& old_state, const EState& new_state)> state_changed_signal_t; // on current channel changed signal typedef boost::function<void(const LLUUID& session_id)> channel_changed_callback_t; @@ -78,7 +78,8 @@ public: virtual BOOL callStarted(); const std::string& getSessionName() const { return mSessionName; } - void setStateChangedCallback(state_changed_callback_t callback) { mStateChangedCallback = callback; } + boost::signals2::connection setStateChangedCallback(const state_changed_signal_t::slot_type& callback) + { return mStateChangedCallback.connect(callback); } const LLUUID getSessionID() { return mSessionID; } EState getState() { return mState; } @@ -124,7 +125,7 @@ protected: static BOOL sSuspended; private: - state_changed_callback_t mStateChangedCallback; + state_changed_signal_t mStateChangedCallback; }; class LLVoiceChannelGroup : public LLVoiceChannel diff --git a/indra/newview/skins/default/xui/de/panel_me.xml b/indra/newview/skins/default/xui/de/panel_me.xml new file mode 100644 index 0000000000..a685a430f0 --- /dev/null +++ b/indra/newview/skins/default/xui/de/panel_me.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Ich" name="panel_me"> + <tab_container name="tabs"> + <panel label="Mein Profil" name="panel_profile"/> + <panel label="Auswahl" name="panel_picks"/> + </tab_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml new file mode 100644 index 0000000000..cf6a4e45bd --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<multi_floater
+background_visible="true"
+bg_color="yellow"
+ can_resize="true"
+ height="390"
+ layout="topleft"
+ name="floater_im_box"
+ help_topic="floater_im_box"
+ save_rect="true"
+ save_visibility="true"
+ single_instance="true"
+ title="Instant Messages"
+ width="392">
+ <tab_container
+ follows="left|right|top|bottom"
+ height="390"
+ layout="topleft"
+ left="1"
+ name="im_box_tab_container"
+ tab_position="bottom"
+ tab_width="80"
+ top="0"
+ width="390" />
+ <icon
+ color="DefaultShadowLight"
+ enabled="false"
+ follows="left|right|bottom"
+ height="17"
+ image_name="tabarea.tga"
+ layout="bottomleft"
+ left="1"
+ name="im_box_tab_container_icon"
+ bottom="10"
+ width="390" />
+</multi_floater>
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 01713cc003..645c2973d8 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -9,7 +9,7 @@ name="panel_im" top="0" can_close="true" - can_dock="true" + can_dock="false" can_minimize="false" visible="true" width="300" @@ -18,7 +18,7 @@ min_height="350"> <layout_stack follows="all" - height="350" + height="320" width="300" layout="topleft" orientation="horizontal" @@ -35,7 +35,8 @@ <layout_panel left="0" top="0" - width="180" + height="200" + width="185" user_resize="false"> <button height="20" @@ -55,10 +56,9 @@ width="25" name="slide_right_btn" /> <chat_history - length="1" font="SansSerifSmall" - follows="left|right|top" - height="280" + follows="left|right|top|bottom" + height="150" name="chat_history" parse_highlights="true" allow_html="true" @@ -66,12 +66,13 @@ width="180"> </chat_history> <line_editor - follows="left|right|top" + bottom="0" + follows="left|right|bottom" font="SansSerifSmall" height="20" label="To" + layout="bottomleft" name="chat_editor" - top_pad="1" width="180"> </line_editor> </layout_panel> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 8ab5fb1659..e19e11a1b8 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -59,7 +59,7 @@ label="My Inventory" layout="topleft" name="Inventory" - shortcut="control|I"> + shortcut="control|shift|I"> <menu_item_check.on_check function="Floater.Visible" parameter="inventory" /> @@ -68,6 +68,15 @@ parameter="inventory" /> </menu_item_check> <menu_item_call + label="Show Sidetray Inventory" + name="ShowSidetrayInventory" + shortcut="control|I" + visible="false"> + <menu_item_call.on_click + function="ShowSidetrayPanel" + parameter="sidepanel_inventory" /> + </menu_item_call> + <menu_item_call label="My Gestures" layout="topleft" name="Gestures" diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml index a283cff5b3..368ab17689 100644 --- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel border="false" + follows="all" height="215" name="panel_im_control_panel" width="180"> @@ -23,7 +24,7 @@ bg_alpha_color="DkGray2" border="false" bottom="1" - follows="left|bottom" + follows="left|right|bottom" height="70" left="0" left_pad="0" @@ -32,6 +33,7 @@ width="180"> <button bottom="10" + follows="all" height="20" label="Call" left_delta="40" @@ -39,6 +41,7 @@ width="100" /> <button bottom="40" + follows="all" height="20" label="Leave Call" name="end_call_btn" @@ -46,6 +49,7 @@ width="100" /> <button enabled="false" + follows="all" bottom="10" height="20" label="Voice Controls" diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index 2eaa3a94ee..45f9d9c7b6 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -7,6 +7,18 @@ name="avatar_list_item" top="0" width="320"> + <!-- + Strings used to localize last interaction time. + See last_interaction textbox below. + --> + <string name="FormatSeconds">[COUNT]s</string> + <string name="FormatMinutes">[COUNT]m</string> + <string name="FormatHours">[COUNT]h</string> + <string name="FormatDays">[COUNT]d</string> + <string name="FormatWeeks">[COUNT]w</string> + <string name="FormatMonths">[COUNT]mon</string> + <string name="FormatYears">[COUNT]y</string> + <icon follows="top|right|left" height="24" diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml index 7a3eae35a9..96e5b4d413 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_header.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml @@ -25,7 +25,7 @@ height="12" layout="topleft" left_pad="5" - right="-50" + right="-60" name="user_name" text_color="white" top="8" @@ -39,7 +39,7 @@ layout="topleft" left_pad="5" name="time_box" - right="-10" + right="-5" top="8" value="23:30" width="50" /> diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml index 2fee2033f6..41b210557e 100644 --- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel border="false" + follows="left|top|right|bottom" height="238" name="panel_im_control_panel" width="180"> @@ -22,6 +23,7 @@ <button bottom_pad="0" + follows="left|right|bottom" height="20" label="Group Info" left_delta="28" @@ -32,7 +34,7 @@ background_visible="true" bg_alpha_color="0.2 0.2 0.2 1" border="false" - follows="left|bottom" + follows="left|right|bottom" height="70" left="0" left_pad="0" @@ -42,6 +44,7 @@ <button bottom="10" + follows="all" height="20" label="Call Group" left_delta="28" @@ -50,6 +53,7 @@ <button bottom="40" + follows="all" height="20" label="Leave Call" name="end_call_btn" @@ -59,6 +63,7 @@ <button enabled="false" bottom="10" + follows="all" height="20" label="Open Voice Controls" name="voice_ctrls_btn" diff --git a/indra/newview/skins/default/xui/en/panel_me.xml b/indra/newview/skins/default/xui/en/panel_me.xml new file mode 100644 index 0000000000..a99777848b --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_me.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + border="false" + follows="all" + height="570" + label="My Profile" + layout="topleft" + left="0" + name="panel_me" + top="0" + width="333"> + <!--<text + type="string" + follows="top|left|right" + font="SansSerifHugeBold" + height="20" + layout="topleft" + left="15" + name="user_name" + text_color="white" + top="0" + mouse_opaque="true" + width="280"> + (Loading...) + </text> --> + <tab_container + follows="all" + height="575" + halign="center" + layout="topleft" + left="10" + name="tabs" + tab_min_width="95" + tab_height="30" + tab_position="top" + top_pad="10" + width="313"> + <panel + class="panel_my_profile" + filename="panel_my_profile.xml" + label="PROFILE" + help_topic="panel_my_profile_tab" + name="panel_profile" /> + <panel + class="panel_picks" + filename="panel_picks.xml" + label="PICKS" + help_topic="panel_my_picks_tab" + name="panel_picks" /> + </tab_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml new file mode 100644 index 0000000000..d259623c0b --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -0,0 +1,427 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="all" + height="535" + label="Profile" + layout="topleft" + left="0" + name="panel_profile" + top="0" + width="313"> + <string + name="CaptionTextAcctInfo"> + [ACCTTYPE] +[PAYMENTINFO] [AGEVERIFICATION] + </string> + <string + name="payment_update_link_url"> + http://www.secondlife.com/account/billing.php?lang=en + </string> + <string + name="partner_edit_link_url"> + http://www.secondlife.com/account/partners.php?lang=en + </string> + <string + name="my_account_link_url" + value="http://secondlife.com/account" /> + <string + name="no_partner_text" + value="None" /> + <string name="RegisterDateFormat">[REG_DATE] ([AGE])</string> + <scroll_container + color="DkGray2" + follows="all" + height="485" + layout="topleft" + name="profile_scroll" + reserve_scroll_corner="true" + opaque="true" + top="0" + width="313"> + <panel + name="scroll_content_panel" + follows="left|top|right" + height="485" + layout="topleft" + top="0" + left="0" + width="313"> + <panel + follows="left|top" + height="117" + layout="topleft" + left="10" + name="second_life_image_panel" + top="0" + width="280"> + <texture_picker + allow_no_texture="true" + default_image_name="None" + enabled="false" + follows="top|left" + height="117" + layout="topleft" + left="0" + name="2nd_life_pic" + top="10" + width="102" /> + <icon + height="102" + image_name="Blank" + layout="topleft" + name="2nd_life_edit_icon" + label="" + left="0" + tool_tip="Click the Edit Profile button below to change image" + top="10" + width="102" /> + <text + follows="left|top|right" + font.style="BOLD" + height="15" + layout="topleft" + left_pad="10" + name="title_sl_descr_text" + text_color="white" + top_delta="0" + value="[SECOND_LIFE]:" + width="165" /> + <expandable_text + follows="left|top|right" + height="95" + layout="topleft" + left="107" + textbox.max_length="512" + name="sl_description_edit" + top_pad="-3" + width="173" + expanded_bg_visible="true" + expanded_bg_color="DkGray"> + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. + </expandable_text> + </panel> + <panel + follows="left|top" + height="117" + layout="topleft" + top_pad="10" + left="10" + name="first_life_image_panel" + width="280"> + <texture_picker + allow_no_texture="true" + default_image_name="None" + enabled="false" + follows="top|left" + height="117" + layout="topleft" + left="0" + name="real_world_pic" + width="102" /> + <icon + height="102" + image_name="Blank" + layout="topleft" + name="real_world_edit_icon" + label="" + left="0" + tool_tip="Click the Edit Profile button below to change image" + top="4" + width="102" /> + <text + follows="left|top|right" + font.style="BOLD" + height="15" + layout="topleft" + left_pad="10" + name="title_rw_descr_text" + text_color="white" + top_delta="0" + value="Real World:" + width="165" /> + <expandable_text + follows="left|top|right" + height="95" + layout="topleft" + left="107" + textbox.max_length="512" + name="fl_description_edit" + top_pad="-3" + width="173" + expanded_bg_visible="true" + expanded_bg_color="DkGray"> + Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. + </expandable_text> + </panel> + + + <!-- <panel + name="lifes_images_panel" + follows="left|top|right" + height="244" + layout="topleft" + top="0" + left="0" + width="285"> + <panel + follows="left|top" + height="117" + layout="topleft" + left="10" + name="second_life_image_panel" + top="0" + width="285"> + <text + follows="left|top|right" + font.style="BOLD" + height="15" + layout="topleft" + left="0" + name="second_life_photo_title_text" + text_color="white" + value="[SECOND_LIFE]:" + width="170" /> + <texture_picker + allow_no_texture="true" + default_image_name="None" + enabled="false" + follows="top|left" + height="117" + layout="topleft" + left="0" + name="2nd_life_pic" + top_pad="0" + width="102" /> + </panel> + <icon + height="18" + image_name="AddItem_Off" + layout="topleft" + name="2nd_life_edit_icon" + label="" + left="87" + tool_tip="Click to select an image" + top="25" + width="18" /> + </panel> --> + + + + + <text + type="string" + follows="left|top" + font="SansSerifSmall" + font.style="BOLD" + height="15" + layout="topleft" + left="10" + name="me_homepage_text" + text_color="white" + top_pad="0" + width="280"> + Homepage: + </text> + <text + follows="left|top" + height="15" + layout="topleft" + left="10" + name="homepage_edit" + top_pad="0" + value="http://librarianavengers.org" + width="280" + word_wrap="false" + use_ellipses="true" + /> + <text + follows="left|top" + font.style="BOLD" + height="10" + layout="topleft" + left="10" + name="title_member_text" + text_color="white" + top_pad="10" + value="Member Since:" + width="280" /> + <text + follows="left|top" + height="15" + layout="topleft" + left="10" + name="register_date" + value="05/31/1976" + width="280" + word_wrap="true" /> + <text + follows="left|top" + font.style="BOLD" + height="15" + layout="topleft" + left="10" + name="title_acc_status_text" + text_color="white" + top_pad="10" + value="Account Status:" + width="280" /> + <!-- <text + type="string" + follows="left|top" + font="SansSerifSmall" + height="15" + layout="topleft" + left_pad="10" + name="my_account_link" + top_delta="0" + value="Go to Dashboard" + width="100"/> --> + <text + follows="left|top" + height="20" + layout="topleft" + left="10" + name="acc_status_text" + top_pad="0" + value="Resident. No payment info on file." + width="280" + word_wrap="true" /> + <text + follows="left|top" + font.style="BOLD" + height="15" + layout="topleft" + left="10" + name="title_partner_text" + text_color="white" + top_pad="5" + value="Partner:" + width="280" /> + <panel + follows="left|top" + height="15" + layout="topleft" + left="10" + name="partner_data_panel" + top_pad="0" + width="280"> + <text + follows="left|top" + height="10" + layout="topleft" + left="0" + name="partner_text" + top="0" + value="[FIRST] [LAST]" + width="280" + word_wrap="true" /> + </panel> + <text + follows="left|top" + font.style="BOLD" + height="15" + layout="topleft" + left="10" + name="title_groups_text" + text_color="white" + top_pad="8" + value="Groups:" + width="280" /> + <expandable_text + follows="left|top|bottom" + height="60" + layout="topleft" + left="10" + name="sl_groups" + top_pad="0" + width="280" + expanded_bg_visible="true" + expanded_bg_color="DkGray"> + Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. + </expandable_text> + </panel> + </scroll_container> + <panel + follows="bottom|left" + layout="topleft" + left="0" + name="profile_buttons_panel" + top_pad="2" + bottom="10" + height="19" + width="303"> + <button + follows="bottom|left" + height="19" + label="Add Friend" + layout="topleft" + left="0" + mouse_opaque="false" + name="add_friend" + top="5" + width="75" /> + <button + follows="bottom|left" + height="19" + label="IM" + layout="topleft" + name="im" + top="5" + left_pad="5" + width="45" /> + <button + follows="bottom|left" + height="19" + label="Call" + layout="topleft" + name="call" + left_pad="5" + top="5" + width="45" /> + <button + enabled="false" + follows="bottom|left" + height="19" + label="Map" + layout="topleft" + name="show_on_map_btn" + top="5" + left_pad="5" + width="45" /> + <button + follows="bottom|left" + height="19" + label="Teleport" + layout="topleft" + name="teleport" + left_pad="5" + top="5" + width="80" /> + </panel> + <panel + follows="bottom|left" + layout="topleft" + left="0" + top_pad="-17" + name="profile_me_buttons_panel" + visible="false" + height="19" + width="303"> + <button + follows="bottom|right" + font="SansSerifSmall" + height="19" + left="10" + label="Edit Profile" + name="edit_profile_btn" + width="130" /> + <button + follows="bottom|right" + height="19" + label="Edit Appearance" + left_pad="10" + name="edit_appearance_btn" + right="-10" + width="130" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml index 5cefe3e4ab..ece58180f7 100644 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -24,7 +24,7 @@ top="10" visible="false" width="313"> - There are no any picks/classifieds here + There are no picks/classifieds here </text> <accordion follows="all" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 5a4b0a3892..fac0d5c60f 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -309,4 +309,13 @@ name="send_im_to_email" top_pad="5" width="400" /> + <check_box + enabled="false" + height="16" + label="Enable plain text chat history" + layout="topleft" + left_delta="0" + name="plain_text_chat_history" + top_pad="5" + width="400" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index d02354a647..95242a9639 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -102,9 +102,9 @@ background_visible="true" > <panel - class="panel_me_profile_view" - name="panel_me_profile" - filename="panel_me_profile.xml" + class="panel_me" + name="panel_me" + filename="panel_me.xml" label="Me" /> </sidetray_tab> diff --git a/indra/newview/skins/default/xui/fr/panel_me.xml b/indra/newview/skins/default/xui/fr/panel_me.xml new file mode 100644 index 0000000000..5bedee4616 --- /dev/null +++ b/indra/newview/skins/default/xui/fr/panel_me.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Moi" name="panel_me"> + <tab_container name="tabs"> + <panel label="Mon Profil" name="panel_profile"/> + <panel label="Préférences" name="panel_picks"/> + </tab_container> +</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_me.xml b/indra/newview/skins/default/xui/ja/panel_me.xml new file mode 100644 index 0000000000..84151f43cf --- /dev/null +++ b/indra/newview/skins/default/xui/ja/panel_me.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="ミー" name="panel_me"> + <tab_container name="tabs"> + <panel label="プロフィール" name="panel_profile"/> + <panel label="ピック" name="panel_picks"/> + </tab_container> +</panel> |