diff options
-rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/newview/llconversationlog.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llconversationloglist.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llconversationloglistitem.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llconversationloglistitem.h | 2 | ||||
-rw-r--r-- | indra/newview/llconversationmodel.cpp | 46 | ||||
-rw-r--r-- | indra/newview/llconversationmodel.h | 19 | ||||
-rw-r--r-- | indra/newview/llconversationview.cpp | 78 | ||||
-rw-r--r-- | indra/newview/llconversationview.h | 58 | ||||
-rw-r--r-- | indra/newview/llimfloater.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llimfloatercontainer.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llnotificationscripthandler.cpp | 42 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 3 |
13 files changed, 208 insertions, 93 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9553476aaf..c49c625dbd 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -138,6 +138,7 @@ set(viewer_SOURCE_FILES llconversationloglist.cpp llconversationloglistitem.cpp llconversationmodel.cpp + llconversationview.cpp llcurrencyuimanager.cpp llcylinder.cpp lldateutil.cpp @@ -721,6 +722,7 @@ set(viewer_HEADER_FILES llconversationloglist.h llconversationloglistitem.h llconversationmodel.h + llconversationview.h llcurrencyuimanager.h llcylinder.h lldateutil.h diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index b6713465f3..486cea4064 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -238,10 +238,8 @@ void LLConversationLog::cache() std::string LLConversationLog::getFileName() { - std::string agent_id_string; - gAgent.getID().toString(agent_id_string); - - return gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, agent_id_string) + ".call_log"; + std::string filename = "conversation"; + return gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, filename) + ".log"; } bool LLConversationLog::saveToFile(const std::string& filename) diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 0433719a89..257ec082a5 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -193,7 +193,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) break; case LLIMModel::LLIMSession::GROUP_SESSION: - LLGroupActions::startIM(selected_id); + LLGroupActions::startIM(getSelectedConversation()->getSessionID()); break; default: @@ -209,7 +209,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) break; case LLIMModel::LLIMSession::GROUP_SESSION: - LLGroupActions::startCall(selected_id); + LLGroupActions::startCall(getSelectedConversation()->getSessionID()); break; default: @@ -225,7 +225,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) break; case LLIMModel::LLIMSession::GROUP_SESSION: - LLGroupActions::show(selected_id); + LLGroupActions::show(getSelectedConversation()->getSessionID()); break; default: diff --git a/indra/newview/llconversationloglistitem.cpp b/indra/newview/llconversationloglistitem.cpp index fc2e757864..dddf216592 100644 --- a/indra/newview/llconversationloglistitem.cpp +++ b/indra/newview/llconversationloglistitem.cpp @@ -31,9 +31,11 @@ #include "lltextutil.h" // newview +#include "llavataractions.h" #include "llavatariconctrl.h" #include "llconversationlog.h" #include "llconversationloglistitem.h" +#include "llgroupactions.h" #include "llgroupiconctrl.h" #include "llinventoryicon.h" @@ -74,6 +76,7 @@ BOOL LLConversationLogListItem::postBuild() mConversationDate->setValue(mConversation->getTimestamp()); getChild<LLButton>("delete_btn")->setClickedCallback(boost::bind(&LLConversationLogListItem::onRemoveBtnClicked, this)); + setDoubleClickCallback(boost::bind(&LLConversationLogListItem::onDoubleClick, this)); return TRUE; } @@ -155,3 +158,20 @@ void LLConversationLogListItem::highlightNameDate(const std::string& highlited_t LLTextUtil::textboxSetHighlightedVal(mConversationName, params, mConversation->getConversationName(), highlited_text); LLTextUtil::textboxSetHighlightedVal(mConversationDate, params, mConversation->getTimestamp(), highlited_text); } + +void LLConversationLogListItem::onDoubleClick() +{ + switch (mConversation->getConversationType()) + { + case LLIMModel::LLIMSession::P2P_SESSION: + LLAvatarActions::startIM(mConversation->getParticipantID()); + break; + + case LLIMModel::LLIMSession::GROUP_SESSION: + LLGroupActions::startIM(mConversation->getSessionID()); + break; + + default: + break; + } +} diff --git a/indra/newview/llconversationloglistitem.h b/indra/newview/llconversationloglistitem.h index deba7d4563..8943e11604 100644 --- a/indra/newview/llconversationloglistitem.h +++ b/indra/newview/llconversationloglistitem.h @@ -62,6 +62,8 @@ public: void highlightNameDate(const std::string& highlited_text); + void onDoubleClick(); + private: void initIcons(); diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 0c23e2654e..832dc3c3e4 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -28,57 +28,23 @@ #include "llviewerprecompiledheaders.h" #include "llconversationmodel.h" -#include "llimconversation.h" -#include "llimfloatercontainer.h" // Conversation items -LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& uuid, LLIMFloaterContainer* containerp) : - LLFolderViewModelItemCommon(containerp->getRootViewModel()), +LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) : + LLFolderViewModelItemCommon(root_view_model), mName(display_name), - mUUID(uuid), - mContainer(containerp) + mUUID(uuid) { } -LLConversationItem::LLConversationItem(LLIMFloaterContainer* containerp) : - LLFolderViewModelItemCommon(containerp->getRootViewModel()), +LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_model) : + LLFolderViewModelItemCommon(root_view_model), mName(""), - mUUID(), - mContainer(NULL) + mUUID() { } - // Virtual action callbacks -void LLConversationItem::selectItem(void) -{ - LLFloater* session_floater = LLIMConversation::getConversation(mUUID); - LLMultiFloater* host_floater = session_floater->getHost(); - -// LLIMFloater::show(mUUID); - if (host_floater == mContainer) - { - // Always expand the message pane if the panel is hosted by the container - mContainer->collapseMessagesPane(false); - // Switch to the conversation floater that is being selected - mContainer->selectFloater(session_floater); - } - // Set the focus on the selected floater - session_floater->setFocus(TRUE); -} - -void LLConversationItem::setVisibleIfDetached(BOOL visible) -{ - // Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized - // Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here - LLFloater* session_floater = LLIMConversation::getConversation(mUUID); - - if (session_floater && !session_floater->getHost() && !session_floater->isMinimized()) - { - session_floater->setVisible(visible); - } -} - void LLConversationItem::performAction(LLInventoryModel* model, std::string action) { } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 56a5b73c15..cb03128cac 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -27,19 +27,9 @@ #ifndef LL_LLCONVERSATIONMODEL_H #define LL_LLCONVERSATIONMODEL_H -//#include <map> -//#include <vector> - #include "llfolderviewitem.h" #include "llfolderviewmodel.h" -class LLButton; -class LLFloater; -class LLLayoutPanel; -class LLLayoutStack; -class LLTabContainer; -class LLIMFloaterContainer; - // Implementation of conversations list class LLConversationItem; @@ -52,8 +42,8 @@ typedef std::map<LLUUID, LLFolderViewItem*> conversations_widgets_map; class LLConversationItem : public LLFolderViewModelItemCommon { public: - LLConversationItem(std::string display_name, const LLUUID& uuid, LLIMFloaterContainer* containerp); - LLConversationItem(LLIMFloaterContainer* containerp); + LLConversationItem(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model); + LLConversationItem(LLFolderViewModelInterface& root_view_model); virtual ~LLConversationItem() {} // Stub those things we won't really be using in this conversation context @@ -95,11 +85,9 @@ public: virtual void openItem( void ); virtual void closeItem( void ); virtual void previewItem( void ); - virtual void selectItem(void); + virtual void selectItem(void) { } virtual void showProperties(void); - void setVisibleIfDetached(BOOL visible); - // This method will be called to determine if a drop can be // performed, and will set drop to TRUE if a drop is // requested. @@ -114,7 +102,6 @@ public: private: std::string mName; const LLUUID mUUID; - LLIMFloaterContainer* mContainer; }; // We don't want to ever filter conversations but we need to declare that class to create a conversation view model. diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp new file mode 100644 index 0000000000..6cc911ecef --- /dev/null +++ b/indra/newview/llconversationview.cpp @@ -0,0 +1,78 @@ +/** + * @file llconversationview.cpp + * @brief Implementation of conversations list widgets and views + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" + +#include "llconversationview.h" +#include "llconversationmodel.h" +#include "llimconversation.h" +#include "llimfloatercontainer.h" + +LLConversationViewSession::Params::Params() : + container() +{} + +LLConversationViewSession::LLConversationViewSession( const LLConversationViewSession::Params& p ): + LLFolderViewFolder(p), + mContainer(p.container) +{ +} + +void LLConversationViewSession::selectItem() +{ + LLFolderViewItem::selectItem(); + + LLConversationItem* item = dynamic_cast<LLConversationItem*>(mViewModelItem); + LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID()); + LLMultiFloater* host_floater = session_floater->getHost(); + + if (host_floater == mContainer) + { + // Always expand the message pane if the panel is hosted by the container + mContainer->collapseMessagesPane(false); + // Switch to the conversation floater that is being selected + mContainer->selectFloater(session_floater); + } + + // Set the focus on the selected floater + session_floater->setFocus(TRUE); +} + +void LLConversationViewSession::setVisibleIfDetached(BOOL visible) +{ + // Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized + // Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here + LLConversationItem* item = dynamic_cast<LLConversationItem*>(mViewModelItem); + LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID()); + + if (session_floater && !session_floater->getHost() && !session_floater->isMinimized()) + { + session_floater->setVisible(visible); + } +} + +// EOF diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h new file mode 100644 index 0000000000..6a51e719c8 --- /dev/null +++ b/indra/newview/llconversationview.h @@ -0,0 +1,58 @@ +/** + * @file llconversationview.h + * @brief Implementation of conversations list widgets and views + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLCONVERSATIONVIEW_H +#define LL_LLCONVERSATIONVIEW_H + +#include "llfolderviewitem.h" + +class LLIMFloaterContainer; + +// Implementation of conversations list widgets + +class LLConversationViewSession : public LLFolderViewFolder +{ +public: + struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params> + { + Optional<LLIMFloaterContainer*> container; + + Params(); + }; + +protected: + friend class LLUICtrlFactory; + LLConversationViewSession( const Params& p ); + + LLIMFloaterContainer* mContainer; + +public: + virtual ~LLConversationViewSession( void ) { } + virtual void selectItem(); + void setVisibleIfDetached(BOOL visible); +}; + +#endif // LL_LLCONVERSATIONVIEW_H diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 5780ac52a5..1c6445610f 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -789,7 +789,7 @@ void LLIMFloater::setVisible(BOOL visible) } } - if (visible) + if (visible && isInVisibleChain()) { sIMFloaterShowedSignal(mSessionID); } diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 1e136b721c..35b9f404c3 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -43,6 +43,7 @@ #include "llimview.h" #include "lltransientfloatermgr.h" #include "llviewercontrol.h" +#include "llconversationview.h" // // LLIMFloaterContainer @@ -111,7 +112,7 @@ BOOL LLIMFloaterContainer::postBuild() mConversationsListPanel = getChild<LLPanel>("conversations_list_panel"); // CHUI-98 : View Model for conversations - LLConversationItem* base_item = new LLConversationItem(this); + LLConversationItem* base_item = new LLConversationItem(getRootViewModel()); LLFolderView::Params p; p.view_model = &mConversationViewModel; p.parent_panel = mConversationsListPanel; @@ -327,10 +328,10 @@ void LLIMFloaterContainer::setVisible(BOOL visible) // We need to show/hide all the associated conversations that have been torn off // (and therefore, are not longer managed by the multifloater), // so that they show/hide with the conversations manager. - conversations_items_map::iterator item_it = mConversationsItems.begin(); - for (;item_it != mConversationsItems.end(); ++item_it) + conversations_widgets_map::iterator item_it = mConversationsWidgets.begin(); + for (;item_it != mConversationsWidgets.end(); ++item_it) { - LLConversationItem* item = item_it->second; + LLConversationViewSession* item = dynamic_cast<LLConversationViewSession*>(item_it->second); item->setVisibleIfDetached(visible); } @@ -470,7 +471,7 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid) removeConversationListItem(uuid,false); // Create a conversation item - LLConversationItem* item = new LLConversationItem(display_name, uuid, this); + LLConversationItem* item = new LLConversationItem(display_name, uuid, getRootViewModel()); mConversationsItems[uuid] = item; // Create a widget from it @@ -519,12 +520,11 @@ void LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c item->selectItem(); } } - return; } LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversationItem* item) { - LLFolderViewItem::Params params; + LLConversationViewSession::Params params; params.name = item->getDisplayName(); //params.icon = bridge->getIcon(); @@ -534,8 +534,9 @@ LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversat params.listener = item; params.rect = LLRect (0, 0, 0, 0); params.tool_tip = params.name; + params.container = this; - return LLUICtrlFactory::create<LLFolderViewItem>(params); + return LLUICtrlFactory::create<LLConversationViewSession>(params); } // EOF diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 7e9c0d4f4b..5dcd84b400 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -78,33 +78,33 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification) } if (notification->canLogToIM()) - { - LLHandlerUtil::logToIMP2P(notification); - } + { + LLHandlerUtil::logToIMP2P(notification); + } - if(notification->hasFormElements()) + if(notification->hasFormElements() && !notification->canShowToast()) + { + LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); + } + else + { + LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); + + LLToast::Params p; + p.notif_id = notification->getID(); + p.notification = notification; + p.panel = notify_box; + p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1); + + LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get()); + if(channel) { - LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); + channel->addToast(p); } - else - { - LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); - - LLToast::Params p; - p.notif_id = notification->getID(); - p.notification = notification; - p.panel = notify_box; - p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1); - - LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get()); - if(channel) - { - channel->addToast(p); - } } return false; - } +} void LLScriptHandler::onDelete( LLNotificationPtr notification ) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 64db7cd969..933135954f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6742,6 +6742,7 @@ If you stay in this region you will be logged out. <notification icon="notify.tga" name="LoadWebPage" + show_toast="false" type="notify"> Load web page [URL]? @@ -6844,6 +6845,7 @@ It is rare that such a request is legitimate. Do not allow access if you do not <notification icon="notify.tga" name="ScriptDialog" + show_toast="false" type="notify"> [NAME]'s '<nolink>[TITLE]</nolink>' [MESSAGE] @@ -6862,6 +6864,7 @@ It is rare that such a request is legitimate. Do not allow access if you do not <notification icon="notify.tga" name="ScriptDialogGroup" + show_toast="false" type="notify"> <tag>group</tag> [GROUPNAME]'s '<nolink>[TITLE]</nolink>' |