From 60c72c85e2360284ecc3326871dcc76fcce0e945 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Mon, 3 Dec 2012 19:06:52 -0800 Subject: Cleaning up some unreferenced member variables and related types from LLNotifications. --- indra/llui/CMakeLists.txt | 2 - indra/llui/llnotifications.cpp | 3 - indra/llui/llnotifications.h | 4 - indra/llui/llnotificationslistener.cpp | 354 --------------------------------- indra/llui/llnotificationslistener.h | 69 ------- indra/llui/llnotificationtemplate.h | 1 - 6 files changed, 433 deletions(-) delete mode 100644 indra/llui/llnotificationslistener.cpp delete mode 100644 indra/llui/llnotificationslistener.h diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index ccc7aa8cec..9c961d67d6 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -71,7 +71,6 @@ set(llui_SOURCE_FILES llmultislider.cpp llmultisliderctrl.cpp llnotifications.cpp - llnotificationslistener.cpp llnotificationsutil.cpp llpanel.cpp llprogressbar.cpp @@ -181,7 +180,6 @@ set(llui_HEADER_FILES llmultislider.h llnotificationptr.h llnotifications.h - llnotificationslistener.h llnotificationsutil.h llnotificationtemplate.h llnotificationvisibilityrule.h diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 66144671c9..61d5dcf12c 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -39,7 +39,6 @@ #include "lldir.h" #include "llsdserialize.h" #include "lltrans.h" -#include "llnotificationslistener.h" #include "llstring.h" #include "llsdparam.h" #include "llsdutil.h" @@ -1167,8 +1166,6 @@ LLNotifications::LLNotifications() mIgnoreAllNotifications(false) { LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); - - mListener.reset(new LLNotificationsListener(*this)); } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 088931858a..a41e9fa5a3 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -92,7 +92,6 @@ #include "llevents.h" #include "llfunctorregistry.h" #include "llinitparam.h" -#include "llnotificationslistener.h" #include "llnotificationptr.h" #include "llpointer.h" #include "llrefcount.h" @@ -672,7 +671,6 @@ namespace LLNotificationComparators }; typedef boost::function LLNotificationFilter; -typedef boost::function LLNotificationComparator; typedef std::set LLNotificationSet; typedef std::multimap LLNotificationMap; @@ -822,7 +820,6 @@ public: private: std::string mName; std::string mParent; - LLNotificationComparator mComparator; }; // An interface class to provide a clean linker seam to the LLNotifications class. @@ -942,7 +939,6 @@ private: bool mIgnoreAllNotifications; - boost::scoped_ptr mListener; std::vector mDefaultChannels; }; diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp deleted file mode 100644 index e4e127336b..0000000000 --- a/indra/llui/llnotificationslistener.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/** - * @file llnotificationslistener.cpp - * @author Brad Kittenbrink - * @date 2009-07-08 - * @brief Implementation for llnotificationslistener. - * - * $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 "linden_common.h" -#include "llnotificationslistener.h" -#include "llnotifications.h" -#include "llnotificationtemplate.h" -#include "llsd.h" -#include "llui.h" - -LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) : - LLEventAPI("LLNotifications", - "LLNotifications listener to (e.g.) pop up a notification"), - mNotifications(notifications) -{ - add("requestAdd", - "Add a notification with specified [\"name\"], [\"substitutions\"] and [\"payload\"].\n" - "If optional [\"reply\"] specified, arrange to send user response on that LLEventPump.", - &LLNotificationsListener::requestAdd); - add("listChannels", - "Post to [\"reply\"] a map of info on existing channels", - &LLNotificationsListener::listChannels, - LLSD().with("reply", LLSD())); - add("listChannelNotifications", - "Post to [\"reply\"] an array of info on notifications in channel [\"channel\"]", - &LLNotificationsListener::listChannelNotifications, - LLSD().with("reply", LLSD()).with("channel", LLSD())); - add("respond", - "Respond to notification [\"uuid\"] with data in [\"response\"]", - &LLNotificationsListener::respond, - LLSD().with("uuid", LLSD())); - add("cancel", - "Cancel notification [\"uuid\"]", - &LLNotificationsListener::cancel, - LLSD().with("uuid", LLSD())); - add("ignore", - "Ignore future notification [\"name\"]\n" - "(from in notifications.xml)\n" - "according to boolean [\"ignore\"].\n" - "If [\"name\"] is omitted or undefined, [un]ignore all future notifications.\n" - "Note that ignored notifications are not forwarded unless intercepted before\n" - "the \"Ignore\" channel.", - &LLNotificationsListener::ignore); - add("forward", - "Forward to [\"pump\"] future notifications on channel [\"channel\"]\n" - "according to boolean [\"forward\"]. When enabled, only types matching\n" - "[\"types\"] are forwarded, as follows:\n" - "omitted or undefined: forward all notifications\n" - "string: forward only the specific named [sig]type\n" - "array of string: forward any notification matching any named [sig]type.\n" - "When boolean [\"respond\"] is true, we auto-respond to each forwarded\n" - "notification.", - &LLNotificationsListener::forward, - LLSD().with("channel", LLSD())); -} - -// This is here in the .cpp file so we don't need the definition of class -// Forwarder in the header file. -LLNotificationsListener::~LLNotificationsListener() -{ -} - -void LLNotificationsListener::requestAdd(const LLSD& event_data) const -{ - if(event_data.has("reply")) - { - mNotifications.add(event_data["name"], - event_data["substitutions"], - event_data["payload"], - boost::bind(&LLNotificationsListener::NotificationResponder, - this, - event_data["reply"].asString(), - _1, _2 - ) - ); - } - else - { - mNotifications.add(event_data["name"], - event_data["substitutions"], - event_data["payload"]); - } -} - -void LLNotificationsListener::NotificationResponder(const std::string& reply_pump, - const LLSD& notification, - const LLSD& response) const -{ - LLSD reponse_event; - reponse_event["notification"] = notification; - reponse_event["response"] = response; - LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event); -} - -void LLNotificationsListener::listChannels(const LLSD& params) const -{ - LLReqID reqID(params); - LLSD response(reqID.makeResponse()); - for (LLNotificationChannel::instance_iter cmi(LLNotificationChannel::beginInstances()), - cmend(LLNotificationChannel::endInstances()); - cmi != cmend; ++cmi) - { - LLSD channelInfo; - //channelInfo["parent"] = cmi->second->getParentChannelName(); - response[cmi->getName()] = channelInfo; - } - LLEventPumps::instance().obtain(params["reply"]).post(response); -} - -void LLNotificationsListener::listChannelNotifications(const LLSD& params) const -{ - LLReqID reqID(params); - LLSD response(reqID.makeResponse()); - LLNotificationChannelPtr channel(mNotifications.getChannel(params["channel"])); - if (channel) - { - LLSD notifications(LLSD::emptyArray()); - for (LLNotificationChannel::Iterator ni(channel->begin()), nend(channel->end()); - ni != nend; ++ni) - { - notifications.append(asLLSD(*ni)); - } - response["notifications"] = notifications; - } - LLEventPumps::instance().obtain(params["reply"]).post(response); -} - -void LLNotificationsListener::respond(const LLSD& params) const -{ - LLNotificationPtr notification(mNotifications.find(params["uuid"])); - if (notification) - { - notification->respond(params["response"]); - } -} - -void LLNotificationsListener::cancel(const LLSD& params) const -{ - LLNotificationPtr notification(mNotifications.find(params["uuid"])); - if (notification) - { - mNotifications.cancel(notification); - } -} - -void LLNotificationsListener::ignore(const LLSD& params) const -{ - // Calling a method named "ignore", but omitting its "ignore" Boolean - // argument, should by default cause something to be ignored. Explicitly - // pass ["ignore"] = false to cancel ignore. - bool ignore = true; - if (params.has("ignore")) - { - ignore = params["ignore"].asBoolean(); - } - // This method can be used to affect either a single notification name or - // all future notifications. The two use substantially different mechanisms. - if (params["name"].isDefined()) - { - // ["name"] was passed: ignore just that notification - LLNotificationTemplatePtr templatep = mNotifications.getTemplate(params["name"]); - if (templatep) - { - templatep->mForm->setIgnored(ignore); - } - } - else - { - // no ["name"]: ignore all future notifications - mNotifications.setIgnoreAllNotifications(ignore); - } -} - -class LLNotificationsListener::Forwarder: public LLEventTrackable -{ - LOG_CLASS(LLNotificationsListener::Forwarder); -public: - Forwarder(LLNotifications& llnotifications, const std::string& channel): - mNotifications(llnotifications), - mRespond(false) - { - // Connect to the specified channel on construction. Because - // LLEventTrackable is a base, we should automatically disconnect when - // destroyed. - LLNotificationChannelPtr channelptr(llnotifications.getChannel(channel)); - if (channelptr) - { - // Insert our processing as a "passed filter" listener. This way - // we get to run before all the "changed" listeners, and we get to - // swipe it (hide it from the other listeners) if desired. - channelptr->connectPassedFilter(boost::bind(&Forwarder::handle, this, _1)); - } - } - - void setPumpName(const std::string& name) { mPumpName = name; } - void setTypes(const LLSD& types) { mTypes = types; } - void setRespond(bool respond) { mRespond = respond; } - -private: - bool handle(const LLSD& notification) const; - bool matchType(const LLSD& filter, const std::string& type) const; - - LLNotifications& mNotifications; - std::string mPumpName; - LLSD mTypes; - bool mRespond; -}; - -void LLNotificationsListener::forward(const LLSD& params) -{ - std::string channel(params["channel"]); - // First decide whether we're supposed to start forwarding or stop it. - // Default to true. - bool forward = true; - if (params.has("forward")) - { - forward = params["forward"].asBoolean(); - } - if (! forward) - { - // This is a request to stop forwarding notifications on the specified - // channel. The rest of the params don't matter. - // Because mForwarders contains scoped_ptrs, erasing the map entry - // DOES delete the heap Forwarder object. Because Forwarder derives - // from LLEventTrackable, destroying it disconnects it from the - // channel. - mForwarders.erase(channel); - return; - } - // From here on, we know we're being asked to start (or modify) forwarding - // on the specified channel. Find or create an appropriate Forwarder. - ForwarderMap::iterator - entry(mForwarders.insert(ForwarderMap::value_type(channel, ForwarderMap::mapped_type())).first); - if (! entry->second) - { - entry->second.reset(new Forwarder(mNotifications, channel)); - } - // Now, whether this Forwarder is brand-new or not, update it with the new - // request info. - Forwarder& fwd(*entry->second); - fwd.setPumpName(params["pump"]); - fwd.setTypes(params["types"]); - fwd.setRespond(params["respond"]); -} - -bool LLNotificationsListener::Forwarder::handle(const LLSD& notification) const -{ - LL_INFOS("LLNotificationsListener") << "handle(" << notification << ")" << LL_ENDL; - if (notification["sigtype"].asString() == "delete") - { - LL_INFOS("LLNotificationsListener") << "ignoring delete" << LL_ENDL; - // let other listeners see the "delete" operation - return false; - } - LLNotificationPtr note(mNotifications.find(notification["id"])); - if (! note) - { - LL_INFOS("LLNotificationsListener") << notification["id"] << " not found" << LL_ENDL; - return false; - } - if (! matchType(mTypes, note->getType())) - { - LL_INFOS("LLNotificationsListener") << "didn't match types " << mTypes << LL_ENDL; - // We're not supposed to intercept this particular notification. Let - // other listeners process it. - return false; - } - LL_INFOS("LLNotificationsListener") << "sending via '" << mPumpName << "'" << LL_ENDL; - // This is a notification we care about. Forward it through specified - // LLEventPump. - LLEventPumps::instance().obtain(mPumpName).post(asLLSD(note)); - // Are we also being asked to auto-respond? - if (mRespond) - { - LL_INFOS("LLNotificationsListener") << "should respond" << LL_ENDL; - note->respond(LLSD::emptyMap()); - // Did that succeed in removing the notification? Only cancel() if - // it's still around -- otherwise we get an LL_ERRS crash! - note = mNotifications.find(notification["id"]); - if (note) - { - LL_INFOS("LLNotificationsListener") << "respond() didn't clear, canceling" << LL_ENDL; - mNotifications.cancel(note); - } - } - // If we've auto-responded to this notification, then it's going to be - // deleted. Other listeners would get the change operation, try to look it - // up and be baffled by lookup failure. So when we auto-respond, suppress - // this notification: don't pass it to other listeners. - return mRespond; -} - -bool LLNotificationsListener::Forwarder::matchType(const LLSD& filter, const std::string& type) const -{ - // Decide whether this notification matches filter: - // undefined: forward all notifications - if (filter.isUndefined()) - { - return true; - } - // array of string: forward any notification matching any named type - if (filter.isArray()) - { - for (LLSD::array_const_iterator ti(filter.beginArray()), tend(filter.endArray()); - ti != tend; ++ti) - { - if (ti->asString() == type) - { - return true; - } - } - // Didn't match any entry in the array - return false; - } - // string: forward only the specific named type - return (filter.asString() == type); -} - -LLSD LLNotificationsListener::asLLSD(LLNotificationPtr note) -{ - LLSD notificationInfo(note->asLLSD()); - // For some reason the following aren't included in LLNotification::asLLSD(). - notificationInfo["summary"] = note->summarize(); - notificationInfo["id"] = note->id(); - notificationInfo["type"] = note->getType(); - notificationInfo["message"] = note->getMessage(); - notificationInfo["label"] = note->getLabel(); - return notificationInfo; -} diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h deleted file mode 100644 index f9f7641de6..0000000000 --- a/indra/llui/llnotificationslistener.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file llnotificationslistener.h - * @author Brad Kittenbrink - * @date 2009-07-08 - * @brief Wrap subset of LLNotifications API in event API for test scripts. - * - * $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_LLNOTIFICATIONSLISTENER_H -#define LL_LLNOTIFICATIONSLISTENER_H - -#include "lleventapi.h" -#include "llnotificationptr.h" -#include -#include -#include - -class LLNotifications; -class LLSD; - -class LLNotificationsListener : public LLEventAPI -{ -public: - LLNotificationsListener(LLNotifications & notifications); - ~LLNotificationsListener(); - -private: - void requestAdd(LLSD const & event_data) const; - - void NotificationResponder(const std::string& replypump, - const LLSD& notification, - const LLSD& response) const; - - void listChannels(const LLSD& params) const; - void listChannelNotifications(const LLSD& params) const; - void respond(const LLSD& params) const; - void cancel(const LLSD& params) const; - void ignore(const LLSD& params) const; - void forward(const LLSD& params); - - static LLSD asLLSD(LLNotificationPtr); - - class Forwarder; - typedef std::map > ForwarderMap; - ForwarderMap mForwarders; - LLNotifications & mNotifications; -}; - -#endif // LL_LLNOTIFICATIONSLISTENER_H diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index 906b83a400..18a82190b5 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -49,7 +49,6 @@ //#include "llfunctorregistry.h" //#include "llpointer.h" #include "llinitparam.h" -//#include "llnotificationslistener.h" //#include "llnotificationptr.h" //#include "llcachename.h" #include "llnotifications.h" -- cgit v1.2.3 From 9da625d439a9a911733564177e32facc3669dc58 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Thu, 6 Dec 2012 20:28:25 -0800 Subject: CHUI-494: WIP First pass at getting the suppression of events in DND working. --- indra/newview/llbrowsernotification.cpp | 5 + indra/newview/llfloateroutbox.cpp | 17 +-- indra/newview/llimhandler.cpp | 2 +- indra/newview/llnotificationalerthandler.cpp | 28 ++++- indra/newview/llnotificationgrouphandler.cpp | 2 +- indra/newview/llnotificationhandler.h | 145 ++++++++++++++++---------- indra/newview/llnotificationhandlerutil.cpp | 12 ++- indra/newview/llnotificationhinthandler.cpp | 27 ++++- indra/newview/llnotificationofferhandler.cpp | 2 +- indra/newview/llnotificationscripthandler.cpp | 2 +- indra/newview/llnotificationtiphandler.cpp | 2 +- indra/newview/llviewerwindow.cpp | 31 ++---- indra/newview/llviewerwindow.h | 9 +- 13 files changed, 184 insertions(+), 100 deletions(-) diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index 9e608d2c8b..19747757db 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -35,6 +35,11 @@ using namespace LLNotificationsUI; +LLBrowserNotification::LLBrowserNotification() + : LLSystemNotificationHandler("Browser", "browser") +{ +} + bool LLBrowserNotification::processNotification(const LLNotificationPtr& notification) { LLUUID media_id = notification->getPayload()["media_id"].asUUID(); diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 18ed36d0f3..29a3e6ac3a 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -49,6 +49,11 @@ /// LLOutboxNotification class ///---------------------------------------------------------------------------- +LLNotificationsUI::LLOutboxNotification::LLOutboxNotification() + : LLSystemNotificationHandler("Outbox", "outbox") +{ +} + bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLNotificationPtr& notify) { LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance("outbox"); @@ -60,10 +65,10 @@ bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLNotifi void LLNotificationsUI::LLOutboxNotification::onDelete(LLNotificationPtr p) { - LLNotificationsUI::LLSysHandler * sys_handler = dynamic_cast(LLNotifications::instance().getChannel("AlertModal").get()); - if (sys_handler) + LLNotificationsUI::LLNotificationHandler * notification_handler = dynamic_cast(LLNotifications::instance().getChannel("AlertModal").get()); + if (notification_handler) { - sys_handler->onDelete(p); + notification_handler->onDelete(p); } } @@ -524,9 +529,9 @@ void LLFloaterOutbox::initializationReportError(U32 status, const LLSD& content) void LLFloaterOutbox::showNotification(const LLNotificationPtr& notification) { - LLNotificationsUI::LLSysHandler * sys_handler = dynamic_cast(LLNotifications::instance().getChannel("AlertModal").get()); - llassert(sys_handler); + LLNotificationsUI::LLNotificationHandler * notification_handler = dynamic_cast(LLNotifications::instance().getChannel("AlertModal").get()); + llassert(notification_handler); - sys_handler->processNotification(notification); + notification_handler->processNotification(notification); } diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp index 047472a282..72967eb6c7 100644 --- a/indra/newview/llimhandler.cpp +++ b/indra/newview/llimhandler.cpp @@ -38,7 +38,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLIMHandler::LLIMHandler() -: LLSysHandler("IM Notifications", "notifytoast") +: LLCommunicationNotificationHandler("IM Notifications", "notifytoast") { // Getting a Channel for our notifications mChannel = LLChannelManager::getInstance()->createNotificationChannel()->getHandle(); diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index 2bc9cdd3c1..58a9b01a45 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -29,6 +29,7 @@ #include "llnotificationhandler.h" +#include "llagentcamera.h" #include "llnotifications.h" #include "llprogressview.h" #include "lltoastnotifypanel.h" @@ -41,7 +42,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLAlertHandler::LLAlertHandler(const std::string& name, const std::string& notification_type, bool is_modal) -: LLSysHandler(name, notification_type), +: LLSystemNotificationHandler(name, notification_type), mIsModal(is_modal) { LLScreenChannelBase::Params p; @@ -123,3 +124,28 @@ void LLAlertHandler::onChange( LLNotificationPtr notification ) if(channel) channel->modifyToastByNotificationID(notification->getID(), (LLToastPanel*)alert_dialog); } + +//-------------------------------------------------------------------------- +LLViewerAlertHandler::LLViewerAlertHandler(const std::string& name, const std::string& notification_type) + : LLSystemNotificationHandler(name, notification_type) +{ +} + +bool LLViewerAlertHandler::processNotification(const LLNotificationPtr& p) +{ + if (gHeadlessClient) + { + LL_INFOS("LLViewerAlertHandler") << "Alert: " << p->getName() << LL_ENDL; + } + + // If we're in mouselook, the mouse is hidden and so the user can't click + // the dialog buttons. In that case, change to First Person instead. + if( gAgentCamera.cameraMouselook() ) + { + gAgentCamera.changeCameraToDefault(); + } + + return false; +} + + diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index 18cd94e685..8fef102cf8 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -38,7 +38,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLGroupHandler::LLGroupHandler() -: LLSysHandler("Group Notifications", "groupnotify") +: LLCommunicationNotificationHandler("Group Notifications", "groupnotify") { // Getting a Channel for our notifications LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel(); diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 4bded6ab30..98b0eecd0d 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -27,6 +27,7 @@ #ifndef LL_LLNOTIFICATIONHANDLER_H #define LL_LLNOTIFICATIONHANDLER_H +#include #include "llwindow.h" @@ -86,23 +87,39 @@ protected: /** * Handler for system notifications. */ -class LLSysHandler : public LLEventHandler, public LLNotificationChannel +class LLNotificationHandler : public LLEventHandler, public LLNotificationChannel { public: - LLSysHandler(const std::string& name, const std::string& notification_type); - virtual ~LLSysHandler() {}; + LLNotificationHandler(const std::string& name, const std::string& notification_type, const std::string& parentName); + virtual ~LLNotificationHandler() {}; // base interface functions - /*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ void onLoad(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ void onDelete(LLNotificationPtr p) { if (mChannel.get()) mChannel.get()->removeToastByNotificationID(p->getID());} + virtual void onAdd(LLNotificationPtr p) { processNotification(p); } + virtual void onChange(LLNotificationPtr p) { processNotification(p); } + virtual void onLoad(LLNotificationPtr p) { processNotification(p); } + virtual void onDelete(LLNotificationPtr p) { if (mChannel.get()) mChannel.get()->removeToastByNotificationID(p->getID());} - virtual bool processNotification(const LLNotificationPtr& notify)=0; + virtual bool processNotification(const LLNotificationPtr& notify) = 0; +}; + +class LLSystemNotificationHandler : public LLNotificationHandler +{ +public: + LLSystemNotificationHandler(const std::string& name, const std::string& notification_type); + virtual ~LLSystemNotificationHandler() {}; +}; + +class LLCommunicationNotificationHandler : public LLNotificationHandler +{ +public: + LLCommunicationNotificationHandler(const std::string& name, const std::string& notification_type); + virtual ~LLCommunicationNotificationHandler() {}; }; /** - * Handler for chat message notifications. + * Handler for chat message notifications. */ +// XXX stinson 12/06/2012 : can I just remove the LLChatHandler class? class LLChatHandler : public LLEventHandler { public: @@ -115,67 +132,62 @@ public: * Handler for IM notifications. * It manages life time of IMs, group messages. */ -class LLIMHandler : public LLSysHandler +class LLIMHandler : public LLCommunicationNotificationHandler { public: LLIMHandler(); virtual ~LLIMHandler(); + bool processNotification(const LLNotificationPtr& p); protected: - bool processNotification(const LLNotificationPtr& p); - /*virtual*/ void initChannel(); + virtual void initChannel(); }; /** * Handler for system informational notices. * It manages life time of tip notices. */ -class LLTipHandler : public LLSysHandler +class LLTipHandler : public LLSystemNotificationHandler { public: LLTipHandler(); virtual ~LLTipHandler(); - // base interface functions - /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ bool processNotification(const LLNotificationPtr& p); + virtual bool processNotification(const LLNotificationPtr& p); protected: - /*virtual*/ void initChannel(); + virtual void initChannel(); }; /** * Handler for system informational notices. * It manages life time of script notices. */ -class LLScriptHandler : public LLSysHandler +class LLScriptHandler : public LLSystemNotificationHandler { public: LLScriptHandler(); virtual ~LLScriptHandler(); - /*virtual*/ void onDelete(LLNotificationPtr p); - // base interface functions - /*virtual*/ bool processNotification(const LLNotificationPtr& p); + virtual void onDelete(LLNotificationPtr p); + virtual bool processNotification(const LLNotificationPtr& p); protected: - /*virtual*/ void onDeleteToast(LLToast* toast); - /*virtual*/ void initChannel(); + virtual void onDeleteToast(LLToast* toast); + virtual void initChannel(); }; /** * Handler for group system notices. */ -class LLGroupHandler : public LLSysHandler +class LLGroupHandler : public LLCommunicationNotificationHandler { public: LLGroupHandler(); virtual ~LLGroupHandler(); - // base interface functions - /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ bool processNotification(const LLNotificationPtr& p); + virtual bool processNotification(const LLNotificationPtr& p); protected: virtual void initChannel(); @@ -184,15 +196,14 @@ protected: /** * Handler for alert system notices. */ -class LLAlertHandler : public LLSysHandler +class LLAlertHandler : public LLSystemNotificationHandler { public: LLAlertHandler(const std::string& name, const std::string& notification_type, bool is_modal); virtual ~LLAlertHandler(); - /*virtual*/ void onChange(LLNotificationPtr p); - /*virtual*/ void onLoad(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ bool processNotification(const LLNotificationPtr& p); + virtual void onChange(LLNotificationPtr p); + virtual bool processNotification(const LLNotificationPtr& p); protected: virtual void initChannel(); @@ -200,67 +211,87 @@ protected: bool mIsModal; }; +class LLViewerAlertHandler : public LLSystemNotificationHandler +{ + LOG_CLASS(LLViewerAlertHandler); +public: + LLViewerAlertHandler(const std::string& name, const std::string& notification_type); + virtual ~LLViewerAlertHandler() {}; + + virtual void onDelete(LLNotificationPtr p) {}; + virtual bool processNotification(const LLNotificationPtr& p); + +protected: + virtual void initChannel() {}; +}; + +typedef boost::intrusive_ptr LLViewerAlertHandlerPtr; + /** * Handler for offers notices. * It manages life time of offer notices. */ -class LLOfferHandler : public LLSysHandler +class LLOfferHandler : public LLCommunicationNotificationHandler { public: LLOfferHandler(); virtual ~LLOfferHandler(); - // base interface functions - /*virtual*/ void onChange(LLNotificationPtr p); - /*virtual*/ void onDelete(LLNotificationPtr notification); - /*virtual*/ bool processNotification(const LLNotificationPtr& p); + virtual void onChange(LLNotificationPtr p); + virtual void onDelete(LLNotificationPtr notification); + virtual bool processNotification(const LLNotificationPtr& p); protected: - /*virtual*/ void initChannel(); + virtual void initChannel(); }; /** * Handler for UI hints. */ -class LLHintHandler : public LLNotificationChannel +class LLHintHandler : public LLSystemNotificationHandler { public: - LLHintHandler() : LLNotificationChannel("Hints", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "hint")) - {} + LLHintHandler(); virtual ~LLHintHandler() {} - /*virtual*/ void onAdd(LLNotificationPtr p); - /*virtual*/ void onLoad(LLNotificationPtr p); - /*virtual*/ void onDelete(LLNotificationPtr p); + virtual void onAdd(LLNotificationPtr p); + virtual void onLoad(LLNotificationPtr p); + virtual void onDelete(LLNotificationPtr p); + virtual bool processNotification(const LLNotificationPtr& p); + +protected: + virtual void initChannel() {}; }; /** * Handler for browser notifications */ -class LLBrowserNotification : public LLNotificationChannel +class LLBrowserNotification : public LLSystemNotificationHandler { public: - LLBrowserNotification() - : LLNotificationChannel("Browser", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "browser")) - {} - /*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); } - bool processNotification(const LLNotificationPtr& p); + LLBrowserNotification(); + virtual ~LLBrowserNotification() {} + + virtual bool processNotification(const LLNotificationPtr& p); + +protected: + virtual void initChannel() {}; }; /** * Handler for outbox notifications */ -class LLOutboxNotification : public LLNotificationChannel +class LLOutboxNotification : public LLSystemNotificationHandler { public: - LLOutboxNotification() - : LLNotificationChannel("Outbox", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "outbox")) - {} - /*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ void onChange(LLNotificationPtr p) { } - /*virtual*/ void onDelete(LLNotificationPtr p); - bool processNotification(const LLNotificationPtr& p); + LLOutboxNotification(); + virtual ~LLOutboxNotification() {}; + virtual void onChange(LLNotificationPtr p) { } + virtual void onDelete(LLNotificationPtr p); + virtual bool processNotification(const LLNotificationPtr& p); + +protected: + virtual void initChannel() {}; }; class LLHandlerUtil diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 7f1216ff40..f0175d677c 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -41,8 +41,16 @@ using namespace LLNotificationsUI; -LLSysHandler::LLSysHandler(const std::string& name, const std::string& notification_type) -: LLNotificationChannel(name, "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, notification_type)) +LLNotificationHandler::LLNotificationHandler(const std::string& name, const std::string& notification_type, const std::string& parentName) +: LLNotificationChannel(name, parentName, LLNotificationFilters::filterBy(&LLNotification::getType, notification_type)) +{} + +LLSystemNotificationHandler::LLSystemNotificationHandler(const std::string& name, const std::string& notification_type) + : LLNotificationHandler(name, notification_type, "System") +{} + +LLCommunicationNotificationHandler::LLCommunicationNotificationHandler(const std::string& name, const std::string& notification_type) + : LLNotificationHandler(name, notification_type, "Communication") {} // static diff --git a/indra/newview/llnotificationhinthandler.cpp b/indra/newview/llnotificationhinthandler.cpp index 271f418507..f40369a2e0 100644 --- a/indra/newview/llnotificationhinthandler.cpp +++ b/indra/newview/llnotificationhinthandler.cpp @@ -33,6 +33,27 @@ using namespace LLNotificationsUI; -void LLHintHandler::onAdd(LLNotificationPtr p) { LLHints::show(p); } -void LLHintHandler::onLoad(LLNotificationPtr p) { LLHints::show(p); } -void LLHintHandler::onDelete(LLNotificationPtr p) { LLHints::hide(p); } +LLHintHandler::LLHintHandler() + : LLSystemNotificationHandler("Hints", "hint") +{ +} + +void LLHintHandler::onAdd(LLNotificationPtr p) +{ + LLHints::show(p); +} + +void LLHintHandler::onLoad(LLNotificationPtr p) +{ + LLHints::show(p); +} + +void LLHintHandler::onDelete(LLNotificationPtr p) +{ + LLHints::hide(p); +} + +bool LLHintHandler::processNotification(const LLNotificationPtr& p) +{ + return false; +} diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index ff5b5e21f7..da38c9063b 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -41,7 +41,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLOfferHandler::LLOfferHandler() -: LLSysHandler("Offer", "offer") +: LLCommunicationNotificationHandler("Offer", "offer") { // Getting a Channel for our notifications LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel(); diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 290a81f91c..e2d4e9f8ce 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -39,7 +39,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLScriptHandler::LLScriptHandler() -: LLSysHandler("Notifications", "notify") +: LLSystemNotificationHandler("Notifications", "notify") { // Getting a Channel for our notifications LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel(); diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index faa67b5ea4..a85335f1ba 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -42,7 +42,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLTipHandler::LLTipHandler() -: LLSysHandler("NotificationTips", "notifytip") +: LLSystemNotificationHandler("NotificationTips", "notifytip") { // Getting a Channel for our notifications LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1b45e6f85d..7b1cf6e180 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -39,6 +39,7 @@ #include "llagentcamera.h" #include "llfloaterreg.h" #include "llmeshrepository.h" +#include "llnotificationhandler.h" #include "llpanellogin.h" #include "llviewerkeyboard.h" #include "llviewermenu.h" @@ -127,6 +128,7 @@ #include "llmorphview.h" #include "llmoveview.h" #include "llnavigationbar.h" +#include "llnotificationhandler.h" #include "llpanelpathfindingrebakenavmesh.h" #include "llpaneltopinfobar.h" #include "llpopupview.h" @@ -1554,11 +1556,13 @@ LLViewerWindow::LLViewerWindow(const Params& p) mWindowListener.reset(new LLWindowListener(this, boost::lambda::var(gKeyboard))); mViewerWindowListener.reset(new LLViewerWindowListener(this)); - mAlertsChannel.reset(new LLNotificationChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "alert"))); - mModalAlertsChannel.reset(new LLNotificationChannel("VW_alertmodal", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "alertmodal"))); + mSystemChannel.reset(new LLNotificationChannel("System", "Visible", LLNotificationFilters::includeEverything)); + mCommunicationChannel.reset(new LLNotificationChannel("Communication", "Visible", boost::bind(&LLAgent::isDoNotDisturb, &gAgent))); + mAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alerts", "alert")); + mModalAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alertmodal", "alertmodal")); - mAlertsChannel->connectChanged(&LLViewerWindow::onAlert); - mModalAlertsChannel->connectChanged(&LLViewerWindow::onAlert); + //mAlertsChannel->connectChanged(&LLViewerWindow::onAlert); + //mModalAlertsChannel->connectChanged(&LLViewerWindow::onAlert); bool ignore = gSavedSettings.getBOOL("IgnoreAllNotifications"); LLNotifications::instance().setIgnoreAllNotifications(ignore); if (ignore) @@ -5001,25 +5005,6 @@ LLRect LLViewerWindow::getChatConsoleRect() //---------------------------------------------------------------------------- -//static -bool LLViewerWindow::onAlert(const LLSD& notify) -{ - LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); - - if (gHeadlessClient) - { - llinfos << "Alert: " << notification->getName() << llendl; - } - - // If we're in mouselook, the mouse is hidden and so the user can't click - // the dialog buttons. In that case, change to First Person instead. - if( gAgentCamera.cameraMouselook() ) - { - gAgentCamera.changeCameraToDefault(); - } - return false; -} - void LLViewerWindow::setUIVisibility(bool visible) { mUIVisible = visible; diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ee6a7793f8..b828a05384 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -43,6 +43,8 @@ #include "lltimer.h" #include "llstat.h" #include "llmousehandler.h" +#include "llnotifications.h" +#include "llnotificationhandler.h" #include "llhandle.h" #include "llinitparam.h" @@ -401,7 +403,6 @@ public: private: bool shouldShowToolTipFor(LLMouseHandler *mh); - static bool onAlert(const LLSD& notify); void switchToolByMask(MASK mask); void destroyWindow(); @@ -418,8 +419,10 @@ private: bool mActive; bool mUIVisible; - boost::shared_ptr mAlertsChannel, - mModalAlertsChannel; + LLNotificationChannelPtr mSystemChannel; + LLNotificationChannelPtr mCommunicationChannel; + LLNotificationsUI::LLViewerAlertHandlerPtr mAlertsChannel; + LLNotificationsUI::LLViewerAlertHandlerPtr mModalAlertsChannel; LLRect mWindowRectRaw; // whole window, including UI LLRect mWindowRectScaled; // whole window, scaled by UI size -- cgit v1.2.3 From 4d3590ae9c0040d010badc026b755634e7b3ac77 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Mon, 10 Dec 2012 19:14:37 -0800 Subject: Correcting a mac build error. --- indra/newview/llnotificationhandler.h | 2 -- indra/newview/llviewerwindow.cpp | 2 -- indra/newview/llviewerwindow.h | 9 ++++----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 98b0eecd0d..a78f0c067b 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -225,8 +225,6 @@ protected: virtual void initChannel() {}; }; -typedef boost::intrusive_ptr LLViewerAlertHandlerPtr; - /** * Handler for offers notices. * It manages life time of offer notices. diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7b1cf6e180..eae5112b03 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1561,8 +1561,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) mAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alerts", "alert")); mModalAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alertmodal", "alertmodal")); - //mAlertsChannel->connectChanged(&LLViewerWindow::onAlert); - //mModalAlertsChannel->connectChanged(&LLViewerWindow::onAlert); bool ignore = gSavedSettings.getBOOL("IgnoreAllNotifications"); LLNotifications::instance().setIgnoreAllNotifications(ignore); if (ignore) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index b828a05384..5a0d9652b8 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -44,7 +44,6 @@ #include "llstat.h" #include "llmousehandler.h" #include "llnotifications.h" -#include "llnotificationhandler.h" #include "llhandle.h" #include "llinitparam.h" @@ -419,10 +418,10 @@ private: bool mActive; bool mUIVisible; - LLNotificationChannelPtr mSystemChannel; - LLNotificationChannelPtr mCommunicationChannel; - LLNotificationsUI::LLViewerAlertHandlerPtr mAlertsChannel; - LLNotificationsUI::LLViewerAlertHandlerPtr mModalAlertsChannel; + LLNotificationChannelPtr mSystemChannel; + LLNotificationChannelPtr mCommunicationChannel; + LLNotificationChannelPtr mAlertsChannel; + LLNotificationChannelPtr mModalAlertsChannel; LLRect mWindowRectRaw; // whole window, including UI LLRect mWindowRectScaled; // whole window, scaled by UI size -- cgit v1.2.3 From b5db4952590321acef60a4ff8726eb4162305c9f Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 11 Dec 2012 18:48:29 -0800 Subject: CHUI-494: Toggling the behavior of the communication notification channel filter as it should be true when not in DND mode and false when in DND mode. --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index eae5112b03..fcd65f7df2 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1557,7 +1557,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) mViewerWindowListener.reset(new LLViewerWindowListener(this)); mSystemChannel.reset(new LLNotificationChannel("System", "Visible", LLNotificationFilters::includeEverything)); - mCommunicationChannel.reset(new LLNotificationChannel("Communication", "Visible", boost::bind(&LLAgent::isDoNotDisturb, &gAgent))); + mCommunicationChannel.reset(new LLNotificationChannel("Communication", "Visible", !boost::bind(&LLAgent::isDoNotDisturb, &gAgent))); mAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alerts", "alert")); mModalAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alertmodal", "alertmodal")); -- cgit v1.2.3 From 79cb158e118d14bfaf7050f79e5ece1fa2052471 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 11 Dec 2012 20:03:05 -0800 Subject: Removing cruft code. --- indra/newview/llchatbar.cpp | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 27138e6c06..7d0331757b 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -669,47 +669,3 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl) mGestureCombo->setFocus(FALSE); } } - - -/* Cruft - global gChatHandler declared below has been commented out, - so this class is never used. See similar code in llfloaterimnearbychatbar.cpp -class LLChatHandler : public LLCommandHandler -{ -public: - // not allowed from outside the app - LLChatHandler() : LLCommandHandler("chat", UNTRUSTED_BLOCK) { } - - // Your code here - bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) - { - bool retval = false; - // Need at least 2 tokens to have a valid message. - if (tokens.size() < 2) - { - retval = false; - } - else - { - S32 channel = tokens[0].asInteger(); - // VWR-19499 Restrict function to chat channels greater than 0. - if ((channel > 0) && (channel < CHAT_CHANNEL_DEBUG)) - { - retval = true; - // Say mesg on channel - std::string mesg = tokens[1].asString(); - send_chat_from_viewer(mesg, CHAT_TYPE_NORMAL, channel); - } - else - { - retval = false; - // Tell us this is an unsupported SLurl. - } - } - return retval; - } -}; - -// Creating the object registers with the dispatcher. -//LLChatHandler gChatHandler; -cruft */ -- cgit v1.2.3 From 3636b10d479043c6e7386bc60af3228bd856f737 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 11 Dec 2012 20:46:10 -0800 Subject: CHUI-494: Removing the creation of a new session while receiving an IM in DND mode. --- indra/newview/llimview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4e2ac09dd8..5bbe14a8b9 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2499,7 +2499,7 @@ void LLIMMgr::addMessage( } bool new_session = !hasSession(new_session_id); - if (new_session) + if (new_session && !gAgent.isDoNotDisturb()) { LLAvatarName av_name; if (LLAvatarNameCache::get(other_participant_id, &av_name) && !name_is_setted) -- cgit v1.2.3 From 5df9d52d48b56a5d8f36a45ced0393c99473f536 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Wed, 12 Dec 2012 18:49:07 -0800 Subject: CHUI-499: Refactoring the persistent notification storage so that I can reuse the functionality for do-not-disturb mode. --- indra/llui/llnotifications.h | 2 +- indra/newview/CMakeLists.txt | 2 + indra/newview/llchannelmanager.cpp | 2 +- indra/newview/llnotificationstorage.cpp | 203 ++++----------------- indra/newview/llnotificationstorage.h | 34 ++-- indra/newview/llpersistentnotificationstorage.cpp | 210 ++++++++++++++++++++++ indra/newview/llpersistentnotificationstorage.h | 63 +++++++ 7 files changed, 322 insertions(+), 194 deletions(-) create mode 100644 indra/newview/llpersistentnotificationstorage.cpp create mode 100644 indra/newview/llpersistentnotificationstorage.h diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 056a316d40..8bb79b57e3 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -1026,7 +1026,7 @@ protected: // Stores only persistent notifications. // Class users can use connectChanged() to process persistent notifications -// (see LLNotificationStorage for example). +// (see LLPersistentNotificationStorage for example). class LLPersistentNotificationChannel : public LLNotificationChannel { LOG_CLASS(LLPersistentNotificationChannel); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c9176d71fb..da1d96414b 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -448,6 +448,7 @@ set(viewer_SOURCE_FILES llpathfindingobject.cpp llpathfindingobjectlist.cpp llpathfindingpathtool.cpp + llpersistentnotificationstorage.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llplacesinventorybridge.cpp @@ -1021,6 +1022,7 @@ set(viewer_HEADER_FILES llpathfindingobject.h llpathfindingobjectlist.h llpathfindingpathtool.h + llpersistentnotificationstorage.h llphysicsmotion.h llphysicsshapebuilderutil.h llplacesinventorybridge.h diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 987651fc80..79e2d376ea 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -29,7 +29,7 @@ #include "llchannelmanager.h" #include "llappviewer.h" -#include "llnotificationstorage.h" +#include "llpersistentnotificationstorage.h" #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llrootview.h" diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index a31b95811e..d25a212059 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -25,207 +25,68 @@ */ #include "llviewerprecompiledheaders.h" // must be first include + #include "llnotificationstorage.h" -#include "llxmlnode.h" // for linux compilers +#include -#include "llchannelmanager.h" -#include "llscreenchannel.h" -#include "llscriptfloater.h" +#include "llerror.h" +#include "llfile.h" +#include "llpointer.h" +#include "llsd.h" #include "llsdserialize.h" -#include "llviewermessage.h" - -////////////////////////////////////////////////////////////////////////// - -class LLResponderRegistry -{ -public: - - static void registerResponders(); - - static LLNotificationResponderInterface* createResponder(const std::string& notification_name, const LLSD& params); - -private: - - template - static LLNotificationResponderInterface* create(const LLSD& params) - { - RESPONDER_TYPE* responder = new RESPONDER_TYPE(); - responder->fromLLSD(params); - return responder; - } - - typedef boost::function responder_constructor_t; - - static void add(const std::string& notification_name, const responder_constructor_t& ctr); - -private: - - typedef std::map build_map_t; - - static build_map_t sBuildMap; -}; -////////////////////////////////////////////////////////////////////////// -LLPersistentNotificationStorage::LLPersistentNotificationStorage() +LLNotificationStorage::LLNotificationStorage(std::string pFileName) + : mFileName(pFileName) { - mFileName = gDirUtilp->getExpandedFilename ( LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml" ); } -bool LLPersistentNotificationStorage::onPersistentChannelChanged(const LLSD& payload) +LLNotificationStorage::~LLNotificationStorage() { - // we ignore "load" messages, but rewrite the persistence file on any other - const std::string sigtype = payload["sigtype"].asString(); - if ("load" != sigtype) - { - saveNotifications(); - } - return false; } -static LLFastTimer::DeclareTimer FTM_SAVE_NOTIFICATIONS("Save Notifications"); - -void LLPersistentNotificationStorage::saveNotifications() +bool LLNotificationStorage::writeNotifications(const LLSD& pNotificationData) const { - LLFastTimer _(FTM_SAVE_NOTIFICATIONS); - - llofstream notify_file(mFileName.c_str()); - if (!notify_file.is_open()) - { - llwarns << "Failed to open " << mFileName << llendl; - return; - } - LLSD output; - LLSD& data = output["data"]; + llofstream notifyFile(mFileName.c_str()); + bool didFileOpen = notifyFile.is_open(); - boost::intrusive_ptr history_channel = boost::dynamic_pointer_cast(LLNotifications::instance().getChannel("Persistent")); - if (!history_channel) + if (!didFileOpen) { - return; + LL_WARNS("LLNotificationStorage") << "Failed to open file '" << mFileName << "'" << LL_ENDL; } - - for ( std::vector::iterator it = history_channel->beginHistory(), end_it = history_channel->endHistory(); - it != end_it; - ++it) + else { - LLNotificationPtr notification = *it; - - // After a notification was placed in Persist channel, it can become - // responded, expired or canceled - in this case we are should not save it - if(notification->isRespondedTo() || notification->isCancelled() - || notification->isExpired()) - { - continue; - } - - data.append(notification->asLLSD()); + LLPointer formatter = new LLSDXMLFormatter(); + formatter->format(pNotificationData, notifyFile, LLSDFormatter::OPTIONS_PRETTY); } - LLPointer formatter = new LLSDXMLFormatter(); - formatter->format(output, notify_file, LLSDFormatter::OPTIONS_PRETTY); + return didFileOpen; } -static LLFastTimer::DeclareTimer FTM_LOAD_NOTIFICATIONS("Load Notifications"); - -void LLPersistentNotificationStorage::loadNotifications() +bool LLNotificationStorage::readNotifications(LLSD& pNotificationData) const { - LLFastTimer _(FTM_LOAD_NOTIFICATIONS); - LLResponderRegistry::registerResponders(); + bool didFileRead; - LLNotifications::instance().getChannel("Persistent")-> - connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); + pNotificationData.clear(); - llifstream notify_file(mFileName.c_str()); - if (!notify_file.is_open()) + llifstream notifyFile(mFileName.c_str()); + didFileRead = notifyFile.is_open(); + if (!didFileRead) { - llwarns << "Failed to open " << mFileName << llendl; - return; + LL_WARNS("LLNotificationStorage") << "Failed to open file '" << mFileName << "'" << LL_ENDL; } - - LLSD input; - LLPointer parser = new LLSDXMLParser(); - if (parser->parse(notify_file, input, LLSDSerialize::SIZE_UNLIMITED) < 0) + else { - llwarns << "Failed to parse open notifications" << llendl; - return; - } - - if (input.isUndefined()) - { - return; - } - - LLSD& data = input["data"]; - if (data.isUndefined()) - { - return; - } - - using namespace LLNotificationsUI; - LLScreenChannel* notification_channel = dynamic_cast(LLChannelManager::getInstance()-> - findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); - - LLNotifications& instance = LLNotifications::instance(); - - for (LLSD::array_const_iterator notification_it = data.beginArray(); - notification_it != data.endArray(); - ++notification_it) - { - LLSD notification_params = *notification_it; - LLNotificationPtr notification(new LLNotification(notification_params)); - - LLNotificationResponderPtr responder(LLResponderRegistry:: - createResponder(notification_params["name"], notification_params["responder"])); - notification->setResponseFunctor(responder); - - instance.add(notification); - - // hide script floaters so they don't confuse the user and don't overlap startup toast - LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false); - - if(notification_channel) + LLPointer parser = new LLSDXMLParser(); + didFileRead = (parser->parse(notifyFile, pNotificationData, LLSDSerialize::SIZE_UNLIMITED) >= 0); + if (!didFileRead) { - // hide saved toasts so they don't confuse the user - notification_channel->hideToast(notification->getID()); + LL_WARNS("LLNotificationStorage") << "Failed to parse open notifications from file '" << mFileName + << "'" << LL_ENDL; } } -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -LLResponderRegistry::build_map_t LLResponderRegistry::sBuildMap; - -void LLResponderRegistry::registerResponders() -{ - sBuildMap.clear(); - - add("ObjectGiveItem", &create); - add("UserGiveItem", &create); -} - -LLNotificationResponderInterface* LLResponderRegistry::createResponder(const std::string& notification_name, const LLSD& params) -{ - build_map_t::const_iterator it = sBuildMap.find(notification_name); - if(sBuildMap.end() == it) - { - return NULL; - } - responder_constructor_t ctr = it->second; - return ctr(params); + return didFileRead; } - -void LLResponderRegistry::add(const std::string& notification_name, const responder_constructor_t& ctr) -{ - if(sBuildMap.find(notification_name) != sBuildMap.end()) - { - llwarns << "Responder is already registered : " << notification_name << llendl; - llassert(!"Responder already registered"); - } - sBuildMap[notification_name] = ctr; -} - -// EOF diff --git a/indra/newview/llnotificationstorage.h b/indra/newview/llnotificationstorage.h index 8635c797c0..ab4da4e73f 100644 --- a/indra/newview/llnotificationstorage.h +++ b/indra/newview/llnotificationstorage.h @@ -27,32 +27,24 @@ #ifndef LL_NOTIFICATIONSTORAGE_H #define LL_NOTIFICATIONSTORAGE_H -#include "llnotifications.h" - -// Class that saves not responded(unread) notifications. -// Unread notifications are saved in open_notifications.xml in SL account folder -// -// Notifications that should be saved(if unread) are marked with persist="true" in notifications.xml -// Notifications using functor responders are saved automatically (see llviewermessage.cpp -// lure_callback_reg for example). -// Notifications using object responders(LLOfferInfo) need additional tuning. Responder object should -// be a) serializable(implement LLNotificationResponderInterface), -// b) registered with LLResponderRegistry (found in llnotificationstorage.cpp). -class LLPersistentNotificationStorage : public LLSingleton -{ - LOG_CLASS(LLPersistentNotificationStorage); -public: +#include - LLPersistentNotificationStorage(); +#include "llerror.h" - void saveNotifications(); +class LLSD; - void loadNotifications(); - -private: +class LLNotificationStorage +{ + LOG_CLASS(LLNotificationStorage); +public: + LLNotificationStorage(std::string pFileName); + ~LLNotificationStorage(); - bool onPersistentChannelChanged(const LLSD& payload); +protected: + bool writeNotifications(const LLSD& pNotificationData) const; + bool readNotifications(LLSD& pNotificationData) const; +private: std::string mFileName; }; diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp new file mode 100644 index 0000000000..7aaad64fd7 --- /dev/null +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -0,0 +1,210 @@ +/** +* @file llpersistentnotificationstorage.cpp +* @brief Implementation of llpersistentnotificationstorage +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, 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 "llpersistentnotificationstorage.h" + +#include "llchannelmanager.h" +#include "llnotificationstorage.h" +#include "llscreenchannel.h" +#include "llscriptfloater.h" +#include "llviewermessage.h" + +class LLResponderRegistry +{ +public: + + static void registerResponders(); + + static LLNotificationResponderInterface* createResponder(const std::string& notification_name, const LLSD& params); + +protected: + +private: + template + static LLNotificationResponderInterface* create(const LLSD& params) + { + RESPONDER_TYPE* responder = new RESPONDER_TYPE(); + responder->fromLLSD(params); + return responder; + } + + typedef boost::function responder_constructor_t; + + static void add(const std::string& notification_name, const responder_constructor_t& ctr); + + typedef std::map build_map_t; + + static build_map_t sBuildMap; +}; + +LLPersistentNotificationStorage::LLPersistentNotificationStorage() + : LLSingleton() + , LLNotificationStorage(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml")) +{ +} + +LLPersistentNotificationStorage::~LLPersistentNotificationStorage() +{ +} + +static LLFastTimer::DeclareTimer FTM_SAVE_NOTIFICATIONS("Save Notifications"); + +void LLPersistentNotificationStorage::saveNotifications() +{ + LLFastTimer _(FTM_SAVE_NOTIFICATIONS); + + boost::intrusive_ptr history_channel = boost::dynamic_pointer_cast(LLNotifications::instance().getChannel("Persistent")); + if (!history_channel) + { + return; + } + + LLSD output = LLSD::emptyMap(); + LLSD& data = output["data"]; + + for ( std::vector::iterator it = history_channel->beginHistory(), end_it = history_channel->endHistory(); + it != end_it; + ++it) + { + LLNotificationPtr notification = *it; + + // After a notification was placed in Persist channel, it can become + // responded, expired or canceled - in this case we are should not save it + if(notification->isRespondedTo() || notification->isCancelled() + || notification->isExpired()) + { + continue; + } + + data.append(notification->asLLSD()); + } + + writeNotifications(output); +} + +static LLFastTimer::DeclareTimer FTM_LOAD_NOTIFICATIONS("Load Notifications"); + +void LLPersistentNotificationStorage::loadNotifications() +{ + LLFastTimer _(FTM_LOAD_NOTIFICATIONS); + LLResponderRegistry::registerResponders(); + + LLNotifications::instance().getChannel("Persistent")-> + connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); + + LLSD input; + if (!readNotifications(input) ||input.isUndefined()) + { + return; + } + + LLSD& data = input["data"]; + if (data.isUndefined()) + { + return; + } + + using namespace LLNotificationsUI; + LLScreenChannel* notification_channel = dynamic_cast(LLChannelManager::getInstance()-> + findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); + + LLNotifications& instance = LLNotifications::instance(); + + for (LLSD::array_const_iterator notification_it = data.beginArray(); + notification_it != data.endArray(); + ++notification_it) + { + LLSD notification_params = *notification_it; + LLNotificationPtr notification(new LLNotification(notification_params)); + + LLNotificationResponderPtr responder(LLResponderRegistry:: + createResponder(notification_params["name"], notification_params["responder"])); + notification->setResponseFunctor(responder); + + instance.add(notification); + + // hide script floaters so they don't confuse the user and don't overlap startup toast + LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false); + + if(notification_channel) + { + // hide saved toasts so they don't confuse the user + notification_channel->hideToast(notification->getID()); + } + } +} + +bool LLPersistentNotificationStorage::onPersistentChannelChanged(const LLSD& payload) +{ + // we ignore "load" messages, but rewrite the persistence file on any other + const std::string sigtype = payload["sigtype"].asString(); + if ("load" != sigtype) + { + saveNotifications(); + } + return false; +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLResponderRegistry::build_map_t LLResponderRegistry::sBuildMap; + +void LLResponderRegistry::registerResponders() +{ + sBuildMap.clear(); + + add("ObjectGiveItem", &create); + add("UserGiveItem", &create); +} + +LLNotificationResponderInterface* LLResponderRegistry::createResponder(const std::string& notification_name, const LLSD& params) +{ + build_map_t::const_iterator it = sBuildMap.find(notification_name); + if(sBuildMap.end() == it) + { + return NULL; + } + responder_constructor_t ctr = it->second; + return ctr(params); +} + +void LLResponderRegistry::add(const std::string& notification_name, const responder_constructor_t& ctr) +{ + if(sBuildMap.find(notification_name) != sBuildMap.end()) + { + llwarns << "Responder is already registered : " << notification_name << llendl; + llassert(!"Responder already registered"); + } + sBuildMap[notification_name] = ctr; +} + +// EOF diff --git a/indra/newview/llpersistentnotificationstorage.h b/indra/newview/llpersistentnotificationstorage.h new file mode 100644 index 0000000000..98a825d2c1 --- /dev/null +++ b/indra/newview/llpersistentnotificationstorage.h @@ -0,0 +1,63 @@ +/** +* @file llpersistentnotificationstorage.h +* @brief Header file for llpersistentnotificationstorage +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, 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_LLPERSISTENTNOTIFICATIONSTORAGE_H +#define LL_LLPERSISTENTNOTIFICATIONSTORAGE_H + +#include "llerror.h" +#include "llnotificationstorage.h" +#include "llsingleton.h" + +class LLSD; + +// Class that saves not responded(unread) notifications. +// Unread notifications are saved in open_notifications.xml in SL account folder +// +// Notifications that should be saved(if unread) are marked with persist="true" in notifications.xml +// Notifications using functor responders are saved automatically (see llviewermessage.cpp +// lure_callback_reg for example). +// Notifications using object responders(LLOfferInfo) need additional tuning. Responder object should +// be a) serializable(implement LLNotificationResponderInterface), +// b) registered with LLResponderRegistry (found in llpersistentnotificationstorage.cpp). + +class LLPersistentNotificationStorage : public LLSingleton, public LLNotificationStorage +{ + LOG_CLASS(LLPersistentNotificationStorage); +public: + LLPersistentNotificationStorage(); + ~LLPersistentNotificationStorage(); + + void saveNotifications(); + void loadNotifications(); + +protected: + +private: + bool onPersistentChannelChanged(const LLSD& payload); +}; + +#endif // LL_LLPERSISTENTNOTIFICATIONSTORAGE_H + -- cgit v1.2.3 From 22c2fff4ba4198b8dca8367ae3f03d189e815770 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 14 Dec 2012 19:56:05 +0200 Subject: CHUI-566 Flashing and color on Conversations FUI button and conversation line item --- indra/llui/llbutton.cpp | 36 +++++++------------ indra/newview/llimview.cpp | 42 ++++++++++++++-------- indra/newview/skins/default/colors.xml | 3 ++ .../skins/default/xui/en/widgets/toolbar.xml | 12 +++---- 4 files changed, 48 insertions(+), 45 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index f82cdc64a9..99384439d2 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -613,29 +613,11 @@ void LLButton::draw() static LLCachedControl sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true); F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); - bool flash = false; if (mFlashingTimer) { mFlashing = mFlashingTimer->isFlashingInProgress(); - flash = mFlashing && (!sEnableButtonFlashing || mFlashingTimer->isCurrentlyHighlighted()); - } - else - { - if(mFlashing) - { - if ( sEnableButtonFlashing) - { - F32 elapsed = mFrameTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); - // flash on or off? - flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); - } - else - { // otherwise just highlight button in flash color - flash = true; - } - } } + bool flash = mFlashing && sEnableButtonFlashing; bool pressed_by_keyboard = FALSE; if (hasFocus()) @@ -660,7 +642,8 @@ void LLButton::draw() bool selected = getToggleState(); bool use_glow_effect = FALSE; - LLColor4 glow_color = LLColor4::white; + LLColor4 highlighting_color = LLColor4::white; + LLColor4 glow_color; LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; LLUIImage* imagep = NULL; if (pressed && mDisplayPressedState) @@ -733,10 +716,15 @@ void LLButton::draw() LLColor4 flash_color = mFlashBgColor.get(); use_glow_effect = TRUE; glow_type = LLRender::BT_ALPHA; // blend the glow - if (mNeedsHighlight) // highlighted AND flashing - glow_color = (glow_color*0.5f + flash_color*0.5f) % 2.0f; // average between flash and highlight colour, with sum of the opacity - else + + if (mFlashingTimer->isCurrentlyHighlighted()) + { glow_color = flash_color; + } + else if (mNeedsHighlight) + { + glow_color = highlighting_color; + } } } @@ -785,7 +773,7 @@ void LLButton::draw() if (use_glow_effect) { mCurGlowStrength = lerp(mCurGlowStrength, - mFlashing ? (flash? 1.0 : 0.0) + mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 7e02915b43..5b4d5466a1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -160,10 +160,16 @@ void on_new_message(const LLSD& msg) LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); //session floater not focused (visible or not) - bool sessionFloaterNotFocused = session_floater && !session_floater->hasFocus(); + bool session_floater_not_focused = session_floater && !session_floater->hasFocus(); + //conv. floater is closed + bool conversation_floater_is_closed = + !( im_box + && im_box->isInVisibleChain() + && !im_box->isMinimized()); //conversation floater not focused (visible or not) - bool conversationFloaterNotFocused = im_box && !im_box->hasFocus(); + bool conversation_floater_not_focused = + conversation_floater_is_closed || !im_box->hasFocus(); if ("toast" == action) { @@ -187,12 +193,12 @@ void on_new_message(const LLSD& msg) } //User is not focused on conversation containing the message - if(sessionFloaterNotFocused) + if(session_floater_not_focused) { im_box->flashConversationItemWidget(session_id, true); //The conversation floater isn't focused/open - if(conversationFloaterNotFocused) + if(conversation_floater_not_focused) { gToolBarView->flashCommand(LLCommandId("chat"), true); @@ -204,23 +210,29 @@ void on_new_message(const LLSD& msg) } } } + else if ("flash" == action) { - //User is not focused on conversation containing the message - if(sessionFloaterNotFocused && conversationFloaterNotFocused) - { - gToolBarView->flashCommand(LLCommandId("chat"), true); - } - //conversation floater is open but a different conversation is focused - else if(sessionFloaterNotFocused) - { - im_box->flashConversationItemWidget(session_id, true); - } + if (session_floater_not_focused) + { + //User is not focused on conversation containing the message + + if(conversation_floater_not_focused) + { + gToolBarView->flashCommand(LLCommandId("chat"), true); + } + //conversation floater is open but a different conversation is focused + else + { + im_box->flashConversationItemWidget(session_id, true); + } + } } + else if("openconversations" == action) { //User is not focused on conversation containing the message - if(sessionFloaterNotFocused) + if(session_floater_not_focused) { //Flash line item im_box->flashConversationItemWidget(session_id, true); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 05230b8bd5..afd8ee4ba1 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -11,6 +11,9 @@ + diff --git a/indra/newview/skins/default/xui/en/widgets/toolbar.xml b/indra/newview/skins/default/xui/en/widgets/toolbar.xml index 053b213ef4..0ace37a5dc 100644 --- a/indra/newview/skins/default/xui/en/widgets/toolbar.xml +++ b/indra/newview/skins/default/xui/en/widgets/toolbar.xml @@ -30,9 +30,9 @@ image_overlay_alignment="left" use_ellipses="true" auto_resize="true" - button_flash_count="3" - button_flash_rate="0.25" - flash_color="EmphasisColor"/> + button_flash_count="4" + button_flash_rate="0.5" + flash_color="BeaconColor"/> + button_flash_count="4" + button_flash_rate="0.5" + flash_color="BeaconColor"/> -- cgit v1.2.3 From 64dffe46118f9c435115edd2b714a0314242e752 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Sat, 15 Dec 2012 20:37:18 +0200 Subject: CHUI-598 : Fixed : Conversation log file created even when keep conversation log preference is off : Checked the status of the another ("KeepConversationLogTranscripts") setting too. --- indra/newview/llconversationlog.cpp | 3 ++- indra/newview/llfloaterconversationlog.cpp | 3 ++- indra/newview/llimview.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index a0765f5e16..1171b3db41 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -191,7 +191,8 @@ LLConversationLog::LLConversationLog() if (ctrl) { ctrl->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); - if (ctrl->getValue().asBoolean()) + if (ctrl->getValue().asBoolean() + && gSavedSettings.getBOOL("KeepConversationLogTranscripts")) { enableLogging(true); } diff --git a/indra/newview/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp index 089aec1905..a40a000bab 100644 --- a/indra/newview/llfloaterconversationlog.cpp +++ b/indra/newview/llfloaterconversationlog.cpp @@ -67,7 +67,8 @@ BOOL LLFloaterConversationLog::postBuild() if (ctrl) { ctrl->getSignal()->connect(boost::bind(&LLFloaterConversationLog::onCallLoggingEnabledDisabled, this, _2)); - onCallLoggingEnabledDisabled(ctrl->getValue().asBoolean()); + onCallLoggingEnabledDisabled(ctrl->getValue().asBoolean() + && gSavedSettings.getBOOL("KeepConversationLogTranscripts")); } return LLFloater::postBuild(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4e2ac09dd8..cdd08ededf 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -857,7 +857,8 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, bool LLIMModel::logToFile(const std::string& file_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { - if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) + if (gSavedPerAccountSettings.getBOOL("LogInstantMessages") + && gSavedSettings.getBOOL("KeepConversationLogTranscripts")) { std::string from_name = from; -- cgit v1.2.3 From 56973ed9a4e3bba8529071a5e37e576f17490296 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Sat, 15 Dec 2012 17:35:24 +0200 Subject: CHUI-505 : Fixed : Don't open Call Log on login if the user doesn't want a Call Log: Checked the setting status --- indra/newview/llimview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cdd08ededf..da3d2e89bf 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2478,8 +2478,8 @@ void LLIMMgr::addMessage( new_session_id = computeSessionID(dialog, other_participant_id); } - // Open conversation log if offline messages are present - if (is_offline_msg) + // Open conversation log if offline messages are present and user allows a Call Log + if (is_offline_msg && gSavedSettings.getBOOL("KeepConversationLogTranscripts")) { LLFloaterConversationLog* floater_log = LLFloaterReg::getTypedInstance("conversation"); -- cgit v1.2.3 From 01bdfb3ecb88ce71078494274a8d7835d181c50e Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Sat, 15 Dec 2012 21:28:38 +0200 Subject: CHUI-591 FIXED Issues with resizing conversations floater --- indra/llui/lllayoutstack.cpp | 6 +++- indra/llui/lllayoutstack.h | 2 ++ indra/llui/llmultifloater.cpp | 4 +-- indra/llui/llresizebar.cpp | 8 ++++- indra/llui/llresizebar.h | 2 ++ indra/llui/llview.cpp | 21 +++++++++++-- indra/newview/llfloaterimcontainer.cpp | 35 +++++++++------------- indra/newview/llfloaterimcontainer.h | 3 +- indra/newview/llfloaterimnearbychat.cpp | 24 +++++++-------- indra/newview/llfloaterimnearbychat.h | 4 +-- .../skins/default/xui/en/floater_im_container.xml | 31 +++++++++---------- 11 files changed, 79 insertions(+), 61 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 0674275612..e642883991 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -32,7 +32,6 @@ #include "lllocalcliprect.h" #include "llpanel.h" -#include "llresizebar.h" #include "llcriticaldamp.h" #include "boost/foreach.hpp" @@ -796,6 +795,11 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& } else { + if (new_auto_resize_headroom < 1.f) + { + new_auto_resize_headroom = 1.f; + } + F32 new_fractional_size = llclamp(total_visible_fraction * (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) / new_auto_resize_headroom, MIN_FRACTIONAL_SIZE, diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 883331c792..02c664f1a0 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -29,6 +29,7 @@ #define LL_LLLAYOUTSTACK_H #include "llpanel.h" +#include "llresizebar.h" class LLLayoutPanel; @@ -178,6 +179,7 @@ public: F32 getAutoResizeFactor() const; F32 getVisibleAmount() const; S32 getVisibleDim() const; + LLResizeBar* getResizeBar() { return mResizeBar; } bool isCollapsed() const { return mCollapsed;} diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 02ff64dbc6..179b251cdb 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -41,8 +41,8 @@ LLMultiFloater::LLMultiFloater(const LLSD& key, const LLFloater::Params& params) mTabContainer(NULL), mTabPos(LLTabContainer::TOP), mAutoResize(TRUE), - mOrigMinWidth(0), - mOrigMinHeight(0) + mOrigMinWidth(params.min_width), + mOrigMinHeight(params.min_height) { } diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 87aeb4d7a7..4b9add820f 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -45,7 +45,8 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) mSide( p.side ), mSnappingEnabled(p.snapping_enabled), mAllowDoubleClickSnapping(p.allow_double_click_snapping), - mResizingView(p.resizing_view) + mResizingView(p.resizing_view), + mResizeListener(NULL) { setFollowsNone(); // set up some generically good follow code. @@ -261,6 +262,11 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask) } } + if (mResizeListener) + { + mResizeListener(NULL); + } + return handled; } // end LLResizeBar::handleHover diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index 6daf191918..8190a95a71 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -71,6 +71,7 @@ public: void setEnableSnapping(BOOL enable) { mSnappingEnabled = enable; } void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; } bool canResize() { return getEnabled() && mMaxSize > mMinSize; } + void setResizeListener(boost::function listener) {mResizeListener = listener;} private: S32 mDragLastScreenX; @@ -84,6 +85,7 @@ private: BOOL mSnappingEnabled; BOOL mAllowDoubleClickSnapping; LLView* mResizingView; + boost::function mResizeListener; }; #endif // LL_RESIZEBAR_H diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 5bcdae921d..3613a40e2c 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -55,6 +55,8 @@ #include "lltexteditor.h" #include "lltextbox.h" +static const S32 LINE_HEIGHT = 15; + S32 LLView::sDepth = 0; bool LLView::sDebugRects = false; bool LLView::sDebugRectsShowNames = true; @@ -1203,11 +1205,24 @@ void LLView::drawDebugRect() && preview_iter == sPreviewHighlightedElements.end() && sDebugRectsShowNames) { - //char temp[256]; S32 x, y; gGL.color4fv( border_color.mV ); - x = debug_rect.getWidth()/2; - y = debug_rect.getHeight()/2; + + x = debug_rect.getWidth() / 2; + + S32 rect_height = debug_rect.getHeight(); + S32 lines = rect_height / LINE_HEIGHT + 1; + + S32 depth = 0; + LLView * viewp = this; + while (NULL != viewp) + { + viewp = viewp->getParent(); + depth++; + } + + y = rect_height - LINE_HEIGHT * (depth % lines + 1); + std::string debug_text = llformat("%s (%d x %d)", getName().c_str(), debug_rect.getWidth(), debug_rect.getHeight()); LLFontGL::getFontSansSerifSmall()->renderUTF8(debug_text, 0, (F32)x, (F32)y, border_color, diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 3c85f21188..ba5ec363d6 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -51,8 +51,8 @@ #include "llconversationview.h" #include "llcallbacklist.h" #include "llworld.h" - #include "llsdserialize.h" + // // LLFloaterIMContainer // @@ -171,6 +171,9 @@ BOOL LLFloaterIMContainer::postBuild() // Open IM session with selected participant on double click event mConversationsListPanel->setDoubleClickCallback(boost::bind(&LLFloaterIMContainer::doToSelected, this, LLSD("im"))); + // The resize limits for LLFloaterIMContainer should be updated, based on current values of width of conversation and message panels + mConversationsPane->getResizeBar()->setResizeListener(boost::bind(&LLFloaterIMContainer::assignResizeLimits, this)); + // Create the root model and view for all conversation sessions LLConversationItem* base_item = new LLConversationItem(getRootViewModel()); @@ -247,6 +250,7 @@ void LLFloaterIMContainer::onOpen(const LLSD& key) { LLMultiFloater::onOpen(key); openNearbyChat(); + assignResizeLimits(); } // virtual @@ -308,26 +312,6 @@ void LLFloaterIMContainer::onCloseFloater(LLUUID& id) setFocus(TRUE); } -// virtual -void LLFloaterIMContainer::computeResizeLimits(S32& new_min_width, S32& new_min_height) -{ - // possibly increase floater's minimum height according to children's minimums - for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) - { - LLFloater* floaterp = dynamic_cast(mTabContainer->getPanelByIndex(tab_idx)); - if (floaterp) - { - new_min_height = llmax(new_min_height, floaterp->getMinHeight()); - } - } - - S32 conversations_pane_min_dim = mConversationsPane->getRelevantMinDim(); - S32 messages_pane_min_dim = mMessagesPane->getRelevantMinDim(); - - // set floater's minimum width according to relevant minimal children's dimensionals - new_min_width = conversations_pane_min_dim + messages_pane_min_dim + LLPANEL_BORDER_WIDTH*2; -} - void LLFloaterIMContainer::onNewMessageReceived(const LLSD& data) { LLUUID session_id = data["session_id"].asUUID(); @@ -728,6 +712,15 @@ void LLFloaterIMContainer::updateState(bool collapse, S32 delta_width) setResizeLimits(expanded_min_size, expanded_min_size); } + assignResizeLimits(); +} + +void LLFloaterIMContainer::assignResizeLimits() +{ + const LLRect& conv_rect = mConversationsPane->isCollapsed() ? LLRect() : mConversationsPane->getRect(); + S32 msg_limits = mMessagesPane->isCollapsed() ? 0 : mMessagesPane->getExpandedMinDim(); + S32 x_limits = conv_rect.getWidth() + msg_limits; + setResizeLimits(x_limits + LLPANEL_BORDER_WIDTH * 3, getMinHeight()); } void LLFloaterIMContainer::onAddButtonClicked() diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 1a3e64f759..5db1565cea 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -110,7 +110,7 @@ private: avatarID_panel_map_t mSessions; boost::signals2::connection mNewMessageConnection; - /*virtual*/ void computeResizeLimits(S32& new_min_width, S32& new_min_height); + /*virtual*/ void computeResizeLimits(S32& new_min_width, S32& new_min_height) {} void onNewMessageReceived(const LLSD& data); @@ -153,6 +153,7 @@ private: void toggleAllowTextChat(const LLUUID& participant_uuid); void toggleMute(const LLUUID& participant_id, U32 flags); void openNearbyChat(); + void assignResizeLimits(); LLButton* mExpandCollapseBtn; LLButton* mStubCollapseBtn; diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index a9a3611970..797d590e1f 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -113,8 +113,8 @@ BOOL LLFloaterIMNearbyChat::postBuild() BOOL result = LLFloaterIMSessionTab::postBuild(); mInputEditor->setCommitCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxCommit, this)); - mInputEditor->setKeystrokeCallback(boost::bind(&onChatBoxKeystroke, _1, this)); - mInputEditor->setFocusLostCallback(boost::bind(&onChatBoxFocusLost, _1, this)); + mInputEditor->setKeystrokeCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxKeystroke, this)); + mInputEditor->setFocusLostCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxFocusLost, this)); mInputEditor->setFocusReceivedCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxFocusReceived, this)); mInputEditor->setLabel(LLTrans::getString("NearbyChatTitle")); @@ -354,13 +354,11 @@ BOOL LLFloaterIMNearbyChat::matchChatTypeTrigger(const std::string& in_str, std: return string_was_found; } -void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userdata) +void LLFloaterIMNearbyChat::onChatBoxKeystroke() { LLFirstUse::otherAvatarChatFirst(false); - LLFloaterIMNearbyChat* self = (LLFloaterIMNearbyChat *)userdata; - - LLWString raw_text = self->mInputEditor->getWText(); + LLWString raw_text = mInputEditor->getWText(); // Can't trim the end, because that will cause autocompletion // to eat trailing spaces that might be part of a gesture. @@ -386,8 +384,8 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userd // the selection will already be deleted, but we need to trim // off the character before std::string new_text = raw_text.substr(0, length-1); - self->mInputEditor->setText( new_text ); - self->mInputEditor->setCursorToEnd(); + mInputEditor->setText( new_text ); + mInputEditor->setCursorToEnd(); length = length - 1; } */ @@ -407,17 +405,17 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userd if (LLGestureMgr::instance().matchPrefix(utf8_trigger, &utf8_out_str)) { std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size()); - self->mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part + mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part // Select to end of line, starting from the character // after the last one the user typed. - self->mInputEditor->selectNext(rest_of_match, false); + mInputEditor->selectNext(rest_of_match, false); } else if (matchChatTypeTrigger(utf8_trigger, &utf8_out_str)) { std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size()); - self->mInputEditor->setText(utf8_trigger + rest_of_match + " "); // keep original capitalization for user-entered part - self->mInputEditor->endOfDoc(); + mInputEditor->setText(utf8_trigger + rest_of_match + " "); // keep original capitalization for user-entered part + mInputEditor->endOfDoc(); } //llinfos << "GESTUREDEBUG " << trigger @@ -428,7 +426,7 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userd } // static -void LLFloaterIMNearbyChat::onChatBoxFocusLost(LLFocusableElement* caller, void* userdata) +void LLFloaterIMNearbyChat::onChatBoxFocusLost() { // stop typing animation gAgent.stopTyping(); diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h index a38824dc78..f4213eda5a 100644 --- a/indra/newview/llfloaterimnearbychat.h +++ b/indra/newview/llfloaterimnearbychat.h @@ -83,8 +83,8 @@ public: protected: static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str); - static void onChatBoxKeystroke(LLTextEditor* caller, void* userdata); - static void onChatBoxFocusLost(LLFocusableElement* caller, void* userdata); + void onChatBoxKeystroke(); + void onChatBoxFocusLost(); void onChatBoxFocusReceived(); void sendChat( EChatType type ); diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 1128b8fef6..37a3b9ac59 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -15,7 +15,7 @@ title="CONVERSATIONS" bottom="-50" right="-5" - width="450"> + width="500"> @@ -24,22 +24,21 @@ value="Conv_toolbar_expand"/> + right="-1" + top="0"> + width="225" + expanded_min_dim="200"> + right="-1" + top="0"> + right="-1"/> + right="-1" + top="0"> + right="-1"> + + diff --git a/indra/newview/skins/default/xui/es/menu_notification_well_button.xml b/indra/newview/skins/default/xui/es/menu_notification_well_button.xml new file mode 100644 index 0000000000..0562d35be7 --- /dev/null +++ b/indra/newview/skins/default/xui/es/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/fr/menu_notification_well_button.xml b/indra/newview/skins/default/xui/fr/menu_notification_well_button.xml new file mode 100644 index 0000000000..323bfdbf16 --- /dev/null +++ b/indra/newview/skins/default/xui/fr/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/it/menu_notification_well_button.xml b/indra/newview/skins/default/xui/it/menu_notification_well_button.xml new file mode 100644 index 0000000000..8c82e30f0e --- /dev/null +++ b/indra/newview/skins/default/xui/it/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/ja/menu_notification_well_button.xml b/indra/newview/skins/default/xui/ja/menu_notification_well_button.xml new file mode 100644 index 0000000000..913bae8958 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/pl/menu_notification_well_button.xml b/indra/newview/skins/default/xui/pl/menu_notification_well_button.xml new file mode 100644 index 0000000000..bd3d42f9b1 --- /dev/null +++ b/indra/newview/skins/default/xui/pl/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/pt/menu_notification_well_button.xml b/indra/newview/skins/default/xui/pt/menu_notification_well_button.xml new file mode 100644 index 0000000000..43ad4134ec --- /dev/null +++ b/indra/newview/skins/default/xui/pt/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/ru/menu_notification_well_button.xml b/indra/newview/skins/default/xui/ru/menu_notification_well_button.xml new file mode 100644 index 0000000000..4d067e232a --- /dev/null +++ b/indra/newview/skins/default/xui/ru/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/tr/menu_notification_well_button.xml b/indra/newview/skins/default/xui/tr/menu_notification_well_button.xml new file mode 100644 index 0000000000..39c66268f5 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/zh/menu_notification_well_button.xml b/indra/newview/skins/default/xui/zh/menu_notification_well_button.xml new file mode 100644 index 0000000000..b629f73584 --- /dev/null +++ b/indra/newview/skins/default/xui/zh/menu_notification_well_button.xml @@ -0,0 +1,4 @@ + + + + -- cgit v1.2.3 From 13a619cb5fc8da621d4e7becbf95ca2a8014deb3 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 18 Dec 2012 18:15:28 -0800 Subject: CHUI-385: Problem: When the new session was created with multiple participants the old conversation floater was being recycled. When the conversation floater was re-initialized it did not remove and update the chat messages. Resolution: When the conversation floater is recycled simply call reloadMessages(). --- indra/newview/llfloaterimsession.cpp | 5 +---- indra/newview/llfloaterimsession.h | 4 ---- indra/newview/llimview.cpp | 3 ++- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index f2afe9d7bb..ff07ddfcbf 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -73,8 +73,7 @@ LLFloaterIMSession::LLFloaterIMSession(const LLUUID& session_id) mTypingTimer(), mTypingTimeoutTimer(), mPositioned(false), - mSessionInitialized(false), - mStartConferenceInSameFloater(false) + mSessionInitialized(false) { mIsNearbyChat = false; @@ -462,8 +461,6 @@ void LLFloaterIMSession::addP2PSessionParticipants(const LLSD& notification, con return; } - mStartConferenceInSameFloater = true; - LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); // first check whether this is a voice session diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h index 43d84eb8c0..6a2f4b29eb 100644 --- a/indra/newview/llfloaterimsession.h +++ b/indra/newview/llfloaterimsession.h @@ -127,8 +127,6 @@ public: //used as a callback on receiving new IM message static void sRemoveTypingIndicator(const LLSD& data); static void onIMChicletCreated(const LLUUID& session_id); - - bool getStartConferenceInSameFloater() const { return mStartConferenceInSameFloater; } const LLUUID& getOtherParticipantUUID() {return mOtherParticipantUUID;} static boost::signals2::connection setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb); @@ -188,8 +186,6 @@ private: bool mSessionInitialized; LLSD mQueuedMsgsForInit; - bool mStartConferenceInSameFloater; - uuid_vec_t mInvitedParticipants; // connection to voice channel state change signal diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index da3d2e89bf..868dba9687 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2699,12 +2699,13 @@ LLUUID LLIMMgr::addSession( { LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(floater_id); - if (im_floater && im_floater->getStartConferenceInSameFloater()) + if (im_floater) { // The IM floater should be initialized with a new session_id // so that it is found by that id when creating a chiclet in LLFloaterIMSession::onIMChicletCreated, // and a new floater is not created. im_floater->initIMSession(session_id); + im_floater->reloadMessages(); } } -- cgit v1.2.3 From c73947ac1fc6c48bca75ea7d6beeda63eb695b2b Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 18 Dec 2012 18:48:15 -0800 Subject: CHUI-499: Adding ability to serialize the communication notifications to local disk per user. --- indra/llui/llnotifications.cpp | 2 + indra/llui/llnotifications.h | 3 + indra/newview/CMakeLists.txt | 4 + indra/newview/llchannelmanager.cpp | 2 + indra/newview/llcommunicationchannel.cpp | 73 ++++++++++++++ indra/newview/llcommunicationchannel.h | 59 ++++++++++++ .../newview/lldonotdisturbnotificationstorage.cpp | 106 +++++++++++++++++++++ indra/newview/lldonotdisturbnotificationstorage.h | 57 +++++++++++ indra/newview/llimview.cpp | 6 +- indra/newview/llnotificationhandler.h | 1 - indra/newview/llviewerwindow.cpp | 3 +- 11 files changed, 311 insertions(+), 5 deletions(-) create mode 100644 indra/newview/llcommunicationchannel.cpp create mode 100644 indra/newview/llcommunicationchannel.h create mode 100644 indra/newview/lldonotdisturbnotificationstorage.cpp create mode 100644 indra/newview/lldonotdisturbnotificationstorage.h diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 937dcf0afc..c9b4399bef 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -992,10 +992,12 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt bool abortProcessing = false; if (passesFilter) { + onFilterPass(pNotification); abortProcessing = mPassedFilter(payload); } else { + onFilterFail(pNotification); abortProcessing = mFailedFilter(payload); } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 8bb79b57e3..42dee4c3e9 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -774,6 +774,9 @@ protected: virtual void onDelete(LLNotificationPtr p) {} virtual void onChange(LLNotificationPtr p) {} + virtual void onFilterPass(LLNotificationPtr p) {} + virtual void onFilterFail(LLNotificationPtr p) {} + bool updateItem(const LLSD& payload, LLNotificationPtr pNotification); LLNotificationFilter mFilter; }; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index da1d96414b..d43f9e9988 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -137,6 +137,7 @@ set(viewer_SOURCE_FILES llcommanddispatcherlistener.cpp llcommandhandler.cpp llcommandlineparser.cpp + llcommunicationchannel.cpp llcompilequeue.cpp llconfirmationmanager.cpp llconversationlog.cpp @@ -152,6 +153,7 @@ set(viewer_SOURCE_FILES lldebugview.cpp lldelayedgestureerror.cpp lldirpicker.cpp + lldonotdisturbnotificationstorage.cpp lldndbutton.cpp lldrawable.cpp lldrawpool.cpp @@ -723,6 +725,7 @@ set(viewer_HEADER_FILES llcommanddispatcherlistener.h llcommandhandler.h llcommandlineparser.h + llcommunicationchannel.h llcompilequeue.h llconfirmationmanager.h llconversationlog.h @@ -738,6 +741,7 @@ set(viewer_HEADER_FILES lldebugview.h lldelayedgestureerror.h lldirpicker.h + lldonotdisturbnotificationstorage.h lldndbutton.h lldrawable.h lldrawpool.h diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 79e2d376ea..dd2bcc742b 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -29,6 +29,7 @@ #include "llchannelmanager.h" #include "llappviewer.h" +#include "lldonotdisturbnotificationstorage.h" #include "llpersistentnotificationstorage.h" #include "llviewercontrol.h" #include "llviewerwindow.h" @@ -138,6 +139,7 @@ void LLChannelManager::onLoginCompleted() } LLPersistentNotificationStorage::getInstance()->loadNotifications(); + LLDoNotDisturbNotificationStorage::getInstance()->initialize(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp new file mode 100644 index 0000000000..353447e4b6 --- /dev/null +++ b/indra/newview/llcommunicationchannel.cpp @@ -0,0 +1,73 @@ +/** +* @file llcommunicationchannel.cpp +* @brief Implementation of llcommunicationchannel +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, 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" // must be first include + +#include "llcommunicationchannel.h" + +#include +#include + +#include "llagent.h" +#include "lldate.h" +#include "llnotifications.h" + + +LLCommunicationChannel::LLCommunicationChannel(const std::string& pName, const std::string& pParentName) + : LLNotificationChannel(pName, pParentName, filterByDoNotDisturbStatus) +{ +} + +LLCommunicationChannel::~LLCommunicationChannel() +{ +} + +bool LLCommunicationChannel::filterByDoNotDisturbStatus(LLNotificationPtr) +{ + return !gAgent.isDoNotDisturb(); +} + +LLCommunicationChannel::history_list_t::const_iterator LLCommunicationChannel::beginHistory() const +{ + return mHistory.begin(); +} + +LLCommunicationChannel::history_list_t::const_iterator LLCommunicationChannel::endHistory() const +{ + return mHistory.end(); +} + +void LLCommunicationChannel::onFilterFail(LLNotificationPtr pNotificationPtr) +{ + std::string notificationType = pNotificationPtr->getType(); + if ((notificationType == "groupnotify") + || (notificationType == "offer") + || (notificationType == "notifytoast")) + { + mHistory.insert(std::make_pair(pNotificationPtr->getDate(), pNotificationPtr)); + } +} diff --git a/indra/newview/llcommunicationchannel.h b/indra/newview/llcommunicationchannel.h new file mode 100644 index 0000000000..a4756b8993 --- /dev/null +++ b/indra/newview/llcommunicationchannel.h @@ -0,0 +1,59 @@ +/** +* @file llcommunicationchannel.h +* @brief Header file for llcommunicationchannel +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, 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_LLCOMMUNICATIONCHANNEL_H +#define LL_LLCOMMUNICATIONCHANNEL_H + +#include +#include + +#include "lldate.h" +#include "llerror.h" +#include "llnotifications.h" + +class LLCommunicationChannel : public LLNotificationChannel +{ + LOG_CLASS(LLCommunicationChannel); +public: + LLCommunicationChannel(const std::string& pName, const std::string& pParentName); + virtual ~LLCommunicationChannel(); + + static bool filterByDoNotDisturbStatus(LLNotificationPtr); + + typedef std::multimap history_list_t; + history_list_t::const_iterator beginHistory() const; + history_list_t::const_iterator endHistory() const; + +protected: + virtual void onFilterFail(LLNotificationPtr pNotificationPtr); + +private: + + history_list_t mHistory; +}; + +#endif // LL_LLCOMMUNICATIONCHANNEL_H + diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp new file mode 100644 index 0000000000..472a0dd9ee --- /dev/null +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -0,0 +1,106 @@ +/** +* @file lldonotdisturbnotificationstorage.cpp +* @brief Implementation of lldonotdisturbnotificationstorage +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, 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 "lldonotdisturbnotificationstorage.h" + +#include "llcommunicationchannel.h" +#include "lldir.h" +#include "llerror.h" +#include "llfasttimer_class.h" +#include "llnotifications.h" +#include "llnotificationstorage.h" +#include "llsd.h" +#include "llsingleton.h" + +LLDoNotDisturbNotificationStorage::LLDoNotDisturbNotificationStorage() + : LLSingleton() + , LLNotificationStorage(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "dnd_notifications.xml")) +{ +} + +LLDoNotDisturbNotificationStorage::~LLDoNotDisturbNotificationStorage() +{ +} + +void LLDoNotDisturbNotificationStorage::initialize() +{ + getCommunicationChannel()->connectFailedFilter(boost::bind(&LLDoNotDisturbNotificationStorage::onChannelChanged, this, _1)); +} + +static LLFastTimer::DeclareTimer FTM_SAVE_DND_NOTIFICATIONS("Save DND Notifications"); + +void LLDoNotDisturbNotificationStorage::saveNotifications() +{ + LLFastTimer _(FTM_SAVE_DND_NOTIFICATIONS); + + LLNotificationChannelPtr channelPtr = getCommunicationChannel(); + const LLCommunicationChannel *commChannel = dynamic_cast(channelPtr.get()); + llassert(commChannel != NULL); + + LLSD output = LLSD::emptyMap(); + LLSD& data = output["data"]; + data = LLSD::emptyArray(); + + for (LLCommunicationChannel::history_list_t::const_iterator historyIter = commChannel->beginHistory(); + historyIter != commChannel->endHistory(); ++historyIter) + { + LLNotificationPtr notificationPtr = historyIter->second; + + if (!notificationPtr->isRespondedTo() && !notificationPtr->isCancelled() && !notificationPtr->isExpired()) + { + data.append(notificationPtr->asLLSD()); + } + } + + writeNotifications(output); +} + +static LLFastTimer::DeclareTimer FTM_LOAD_DND_NOTIFICATIONS("Load DND Notifications"); + +void LLDoNotDisturbNotificationStorage::loadNotifications() +{ +} + +LLNotificationChannelPtr LLDoNotDisturbNotificationStorage::getCommunicationChannel() const +{ + LLNotificationChannelPtr channelPtr = LLNotifications::getInstance()->getChannel("Communication"); + llassert(channelPtr); + return channelPtr; +} + + +bool LLDoNotDisturbNotificationStorage::onChannelChanged(const LLSD& pPayload) +{ + if (pPayload["sigtype"].asString() != "load") + { + saveNotifications(); + } + + return false; +} diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h new file mode 100644 index 0000000000..60bcd89ec3 --- /dev/null +++ b/indra/newview/lldonotdisturbnotificationstorage.h @@ -0,0 +1,57 @@ +/** +* @file lldonotdisturbnotificationstorage.h +* @brief Header file for lldonotdisturbnotificationstorage +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, 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_LLDONOTDISTURBNOTIFICATIONSTORAGE_H +#define LL_LLDONOTDISTURBNOTIFICATIONSTORAGE_H + +#include "llerror.h" +#include "llnotifications.h" +#include "llnotificationstorage.h" +#include "llsingleton.h" + +class LLSD; + +class LLDoNotDisturbNotificationStorage : public LLSingleton, public LLNotificationStorage +{ + LOG_CLASS(LLDoNotDisturbNotificationStorage); +public: + LLDoNotDisturbNotificationStorage(); + ~LLDoNotDisturbNotificationStorage(); + + void initialize(); + + void saveNotifications(); + void loadNotifications(); + +protected: + +private: + LLNotificationChannelPtr getCommunicationChannel() const; + bool onChannelChanged(const LLSD& pPayload); +}; + +#endif // LL_LLDONOTDISTURBNOTIFICATIONSTORAGE_H + diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c9672413bf..26be7f6bbf 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -149,7 +149,7 @@ void on_new_message(const LLSD& msg) } // do not show notification in "do not disturb" mode or it goes from agent - if (gAgent.isDoNotDisturb() || gAgent.getID() == participant_id) + if (gAgent.getID() == participant_id) { return; } @@ -2500,7 +2500,7 @@ void LLIMMgr::addMessage( } bool new_session = !hasSession(new_session_id); - if (new_session && !gAgent.isDoNotDisturb()) + if (new_session) { LLAvatarName av_name; if (LLAvatarNameCache::get(other_participant_id, &av_name) && !name_is_setted) @@ -2543,7 +2543,7 @@ void LLIMMgr::addMessage( } //Play sound for new conversations - if(gSavedSettings.getBOOL("PlaySoundNewConversation") == TRUE) + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation") == TRUE)) { make_ui_sound("UISndNewIncomingIMSession"); } diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index a78f0c067b..bff4efa9ea 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -119,7 +119,6 @@ public: /** * Handler for chat message notifications. */ -// XXX stinson 12/06/2012 : can I just remove the LLChatHandler class? class LLChatHandler : public LLEventHandler { public: diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 424898536e..1c463015e2 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -37,6 +37,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llcommunicationchannel.h" #include "llfloaterreg.h" #include "llmeshrepository.h" #include "llnotificationhandler.h" @@ -1557,7 +1558,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) mViewerWindowListener.reset(new LLViewerWindowListener(this)); mSystemChannel.reset(new LLNotificationChannel("System", "Visible", LLNotificationFilters::includeEverything)); - mCommunicationChannel.reset(new LLNotificationChannel("Communication", "Visible", !boost::bind(&LLAgent::isDoNotDisturb, &gAgent))); + mCommunicationChannel.reset(new LLCommunicationChannel("Communication", "Visible")); mAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alerts", "alert")); mModalAlertsChannel.reset(new LLNotificationsUI::LLViewerAlertHandler("VW_alertmodal", "alertmodal")); -- cgit v1.2.3 From a4975ace20faa3b6de952f26865dca53dcb9060c Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 18 Dec 2012 19:10:19 -0800 Subject: CHUI-569: Ensure that we create a friend request notification even in the case of do-not-disturb mode. The DND mode will log it to a file to be re-created when DND mode is exited. --- indra/newview/llviewermessage.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5bb7db5c0d..04dd7c911b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3169,17 +3169,16 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["online"] = (offline == IM_ONLINE); payload["sender"] = msg->getSender().getIPandPort(); - if (is_do_not_disturb) - { - send_do_not_disturb_message(msg, from_id); - LLNotifications::instance().forceResponse(LLNotification::Params("OfferFriendship").payload(payload), 1); - } - else if (is_muted) + if (is_muted) { LLNotifications::instance().forceResponse(LLNotification::Params("OfferFriendship").payload(payload), 1); } else { + if (is_do_not_disturb) + { + send_do_not_disturb_message(msg, from_id); + } args["NAME_SLURL"] = LLSLURL("agent", from_id, "about").getSLURLString(); if(message.empty()) { -- cgit v1.2.3 From da59ef8013801eac3695cea0ae8c1097275b6832 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 18 Dec 2012 19:22:21 -0800 Subject: Removing copy from the DoNotDisturbModeSet notification as we are no longer auto deleting inventory offers. --- indra/newview/skins/default/xui/en/notifications.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 94307d2f93..35ce787847 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3696,7 +3696,6 @@ Do Not Disturb is on. You will not be notified of incoming communications. - Other residents will receive your Do Not Disturb response (set in Preferences > General). - Teleportation offers will be declined. - Voice calls will be rejected. -- Inventory offers will go to your Trash. Date: Tue, 18 Dec 2012 22:57:56 -0800 Subject: CHUI-600 : WIP : Flash conversation item in different color than select and start flashing only when shown --- indra/llui/llfolderviewitem.cpp | 46 +++++++++++++++++++++------------- indra/llui/llfolderviewitem.h | 5 +++- indra/newview/llconversationview.cpp | 20 ++++++++++++--- indra/newview/llconversationview.h | 5 +++- indra/newview/skins/default/colors.xml | 6 +++++ 5 files changed, 60 insertions(+), 22 deletions(-) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 0a06ce66aa..100904c5a2 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -50,6 +50,7 @@ std::map LLFolderViewItem::sFonts; // map of styles to fonts bool LLFolderViewItem::sColorSetInitialized = false; LLUIColor LLFolderViewItem::sFgColor; LLUIColor LLFolderViewItem::sHighlightBgColor; +LLUIColor LLFolderViewItem::sFlashBgColor; LLUIColor LLFolderViewItem::sFocusOutlineColor; LLUIColor LLFolderViewItem::sMouseOverColor; LLUIColor LLFolderViewItem::sFilterBGColor; @@ -151,6 +152,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) { sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE); @@ -686,26 +688,31 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L return mIsCurSelection; } -void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &bgColor, +void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor, const LLUIColor &focusOutlineColor, const LLUIColor &mouseOverColor) { - - //--------------------------------------------------------------------------------// - // Draw highlight for selected items - // - const S32 focus_top = getRect().getHeight(); const S32 focus_bottom = getRect().getHeight() - mItemHeight; const bool folder_open = (getRect().getHeight() > mItemHeight + 4); const S32 FOCUS_LEFT = 1; + + // Determine which background color to use for highlighting + LLUIColor bgColor = (isFlashing() ? flashColor : selectColor); - if (isHighlightAllowed()) // always render "current" item (only render other selected items if - // mShowSingleSelection is FALSE) or flashing item + //--------------------------------------------------------------------------------// + // Draw highlight for selected items + // Note: Always render "current" item or flashing item, only render other selected + // items if mShowSingleSelection is FALSE. + // + if (isHighlightAllowed()) + { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLColor4 bg_color = bgColor; - if (!isHighlightActive()) + + // Highlight for selected but not current items + if (!isHighlightActive() && !isFlashing()) { + LLColor4 bg_color = bgColor; // do time-based fade of extra objects F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f); if (getRoot() && getRoot()->getShowSingleSelection()) @@ -718,25 +725,30 @@ void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeybo // fading in bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, 0.f, bg_color.mV[VALPHA]); } + gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + bg_color, hasKeyboardFocus); } - if (isHighlightAllowed() || isHighlightActive()) + // Highlight for currently selected or flashing item + if (isHighlightActive()) { + // Background gl_rect_2d(FOCUS_LEFT, focus_top, getRect().getWidth() - 2, focus_bottom, - bg_color, hasKeyboardFocus); - } - - if (isHighlightActive()) - { + bgColor, hasKeyboardFocus); + // Outline gl_rect_2d(FOCUS_LEFT, focus_top, getRect().getWidth() - 2, focus_bottom, focusOutlineColor, FALSE); } + if (folder_open) { gl_rect_2d(FOCUS_LEFT, @@ -810,7 +822,7 @@ void LLFolderViewItem::draw() drawOpenFolderArrow(default_params, sFgColor); - drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(show_context, filled, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); //--------------------------------------------------------------------------------// // Draw open icon diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index d7f5e86aea..ca31931e19 100755 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -128,6 +128,7 @@ protected: static LLUIColor sFgColor; static LLUIColor sFgDisabledColor; static LLUIColor sHighlightBgColor; + static LLUIColor sFlashBgColor; static LLUIColor sFocusOutlineColor; static LLUIColor sMouseOverColor; static LLUIColor sFilterBGColor; @@ -141,6 +142,8 @@ protected: virtual void addFolder(LLFolderViewFolder*) { } virtual bool isHighlightAllowed(); virtual bool isHighlightActive(); + virtual bool isFlashing() { return false; } + virtual void setFlashState(bool) { } static LLFontGL* getLabelFontForStyle(U8 style); @@ -269,7 +272,7 @@ public: // virtual void handleDropped(); virtual void draw(); void drawOpenFolderArrow(const Params& default_params, const LLUIColor& fg_color); - void drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &bgColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor); + void drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor); void drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index c0a209f22d..d3a0e882f5 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -101,7 +101,17 @@ LLConversationViewSession::~LLConversationViewSession() void LLConversationViewSession::setFlashState(bool flash_state) { mFlashStateOn = flash_state; - (flash_state ? mFlashTimer->startFlashing() : mFlashTimer->stopFlashing()); + mFlashStarted = false; + mFlashTimer->stopFlashing(); +} + +void LLConversationViewSession::startFlashing() +{ + if (mFlashStateOn && !mFlashStarted) + { + mFlashStarted = true; + mFlashTimer->startFlashing(); + } } bool LLConversationViewSession::isHighlightAllowed() @@ -198,8 +208,11 @@ void LLConversationViewSession::draw() drawOpenFolderArrow(default_params, sFgColor); } + // Indicate that flash can start (moot operation if already started, done or not flashing) + startFlashing(); + // draw highlight for selected items - drawHighlight(show_context, true, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(show_context, true, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); // Draw children if root folder, or any other folder that is open. Do not draw children when animating to closed state or you get rendering overlap. bool draw_children = getRoot() == static_cast(this) || isOpen(); @@ -427,6 +440,7 @@ void LLConversationViewParticipant::draw() static LLUIColor sFgDisabledColor = LLUIColorTable::instance().getColor("MenuItemDisabledColor", DEFAULT_WHITE); static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); @@ -450,7 +464,7 @@ void LLConversationViewParticipant::draw() color = mIsSelected ? sHighlightFgColor : sFgColor; } - drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); drawLabel(font, text_left, y, color, right_x); refresh(); diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 1e20fb8b7e..74443e1d88 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -58,6 +58,7 @@ protected: /*virtual*/ bool isHighlightAllowed(); /*virtual*/ bool isHighlightActive(); + /*virtual*/ bool isFlashing() { return mFlashStateOn; } LLFloaterIMContainer* mContainer; @@ -83,11 +84,12 @@ public: virtual void refresh(); - void setFlashState(bool flash_state); + /*virtual*/ void setFlashState(bool flash_state); private: void onCurrentVoiceSessionChanged(const LLUUID& session_id); + void startFlashing(); LLPanel* mItemPanel; LLPanel* mCallIconLayoutPanel; @@ -95,6 +97,7 @@ private: LLOutputMonitorCtrl* mSpeakingIndicator; LLFlashTimer* mFlashTimer; bool mFlashStateOn; + bool mFlashStarted; bool mCollapsedMode; bool mHasArrow; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 05230b8bd5..becdbda067 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -11,6 +11,9 @@ + @@ -522,6 +525,9 @@ + -- cgit v1.2.3 From 6b9ead91459d702727b54ab7e51614c2d5959f5f Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 18 Dec 2012 23:07:27 -0800 Subject: CHUI-499: Refactoring the LLPersistentNotificationStorage implementation for shared usage with the new LLDoNotDisturbNotificationStorage class. --- indra/newview/llnotificationstorage.cpp | 69 +++++++++++++++++++++++ indra/newview/llnotificationstorage.h | 3 + indra/newview/llpersistentnotificationstorage.cpp | 67 +--------------------- 3 files changed, 73 insertions(+), 66 deletions(-) diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index d25a212059..4746e4bbd4 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -29,14 +29,39 @@ #include "llnotificationstorage.h" #include +#include #include "llerror.h" #include "llfile.h" +#include "llnotifications.h" #include "llpointer.h" #include "llsd.h" #include "llsdserialize.h" +#include "llsingleton.h" +#include "llviewermessage.h" +class LLResponderRegistry : public LLSingleton +{ +public: + LLResponderRegistry(); + ~LLResponderRegistry(); + + LLNotificationResponderInterface* createResponder(const std::string& pNotificationName, const LLSD& pParams); + +protected: + +private: + template static LLNotificationResponderInterface* create(const LLSD& pParams); + + typedef boost::function responder_constructor_t; + + void add(const std::string& pNotificationName, const responder_constructor_t& pConstructor); + + typedef std::map build_map_t; + build_map_t mBuildMap; +}; + LLNotificationStorage::LLNotificationStorage(std::string pFileName) : mFileName(pFileName) { @@ -90,3 +115,47 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData) const return didFileRead; } + +LLNotificationResponderInterface* LLNotificationStorage::createResponder(const std::string& pNotificationName, const LLSD& pParams) const +{ + return LLResponderRegistry::getInstance()->createResponder(pNotificationName, pParams); +} + +LLResponderRegistry::LLResponderRegistry() + : LLSingleton() + , mBuildMap() +{ + add("ObjectGiveItem", &create); + add("UserGiveItem", &create); +} + +LLResponderRegistry::~LLResponderRegistry() +{ +} + +LLNotificationResponderInterface* LLResponderRegistry::createResponder(const std::string& pNotificationName, const LLSD& pParams) +{ + build_map_t::const_iterator it = mBuildMap.find(pNotificationName); + if(mBuildMap.end() == it) + { + return NULL; + } + responder_constructor_t ctr = it->second; + return ctr(pParams); +} + +template LLNotificationResponderInterface* LLResponderRegistry::create(const LLSD& pParams) +{ + RESPONDER_TYPE* responder = new RESPONDER_TYPE(); + responder->fromLLSD(pParams); + return responder; +} + +void LLResponderRegistry::add(const std::string& pNotificationName, const responder_constructor_t& pConstructor) +{ + if (mBuildMap.find(pNotificationName) != mBuildMap.end()) + { + LL_ERRS("LLResponderRegistry") << "Responder is already registered : " << pNotificationName << LL_ENDL; + } + mBuildMap.insert(std::make_pair(pNotificationName, pConstructor)); +} diff --git a/indra/newview/llnotificationstorage.h b/indra/newview/llnotificationstorage.h index ab4da4e73f..7aabf7d09e 100644 --- a/indra/newview/llnotificationstorage.h +++ b/indra/newview/llnotificationstorage.h @@ -31,6 +31,7 @@ #include "llerror.h" +class LLNotificationResponderInterface; class LLSD; class LLNotificationStorage @@ -44,6 +45,8 @@ protected: bool writeNotifications(const LLSD& pNotificationData) const; bool readNotifications(LLSD& pNotificationData) const; + LLNotificationResponderInterface* createResponder(const std::string& pNotificationName, const LLSD& pParams) const; + private: std::string mFileName; }; diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 7aaad64fd7..224aaa2146 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -36,34 +36,6 @@ #include "llscriptfloater.h" #include "llviewermessage.h" -class LLResponderRegistry -{ -public: - - static void registerResponders(); - - static LLNotificationResponderInterface* createResponder(const std::string& notification_name, const LLSD& params); - -protected: - -private: - template - static LLNotificationResponderInterface* create(const LLSD& params) - { - RESPONDER_TYPE* responder = new RESPONDER_TYPE(); - responder->fromLLSD(params); - return responder; - } - - typedef boost::function responder_constructor_t; - - static void add(const std::string& notification_name, const responder_constructor_t& ctr); - - typedef std::map build_map_t; - - static build_map_t sBuildMap; -}; - LLPersistentNotificationStorage::LLPersistentNotificationStorage() : LLSingleton() , LLNotificationStorage(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml")) @@ -114,7 +86,6 @@ static LLFastTimer::DeclareTimer FTM_LOAD_NOTIFICATIONS("Load Notifications"); void LLPersistentNotificationStorage::loadNotifications() { LLFastTimer _(FTM_LOAD_NOTIFICATIONS); - LLResponderRegistry::registerResponders(); LLNotifications::instance().getChannel("Persistent")-> connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); @@ -144,8 +115,7 @@ void LLPersistentNotificationStorage::loadNotifications() LLSD notification_params = *notification_it; LLNotificationPtr notification(new LLNotification(notification_params)); - LLNotificationResponderPtr responder(LLResponderRegistry:: - createResponder(notification_params["name"], notification_params["responder"])); + LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"])); notification->setResponseFunctor(responder); instance.add(notification); @@ -172,39 +142,4 @@ bool LLPersistentNotificationStorage::onPersistentChannelChanged(const LLSD& pay return false; } -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -LLResponderRegistry::build_map_t LLResponderRegistry::sBuildMap; - -void LLResponderRegistry::registerResponders() -{ - sBuildMap.clear(); - - add("ObjectGiveItem", &create); - add("UserGiveItem", &create); -} - -LLNotificationResponderInterface* LLResponderRegistry::createResponder(const std::string& notification_name, const LLSD& params) -{ - build_map_t::const_iterator it = sBuildMap.find(notification_name); - if(sBuildMap.end() == it) - { - return NULL; - } - responder_constructor_t ctr = it->second; - return ctr(params); -} - -void LLResponderRegistry::add(const std::string& notification_name, const responder_constructor_t& ctr) -{ - if(sBuildMap.find(notification_name) != sBuildMap.end()) - { - llwarns << "Responder is already registered : " << notification_name << llendl; - llassert(!"Responder already registered"); - } - sBuildMap[notification_name] = ctr; -} - // EOF -- cgit v1.2.3 From bd6d34d312c3e3322ab62f3a60253fb88fcbc9e3 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Wed, 19 Dec 2012 01:48:37 -0800 Subject: CHUI-499: Loading the DND notifications upon exit from DND mode and after login. --- indra/newview/llagent.cpp | 14 ++-- indra/newview/llchannelmanager.cpp | 2 + indra/newview/llcommunicationchannel.cpp | 6 ++ indra/newview/llcommunicationchannel.h | 2 + .../newview/lldonotdisturbnotificationstorage.cpp | 76 ++++++++++++++++++++++ 5 files changed, 96 insertions(+), 4 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 49c570c30b..fc3be9ca21 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -41,6 +41,7 @@ #include "llchannelmanager.h" #include "llchicletbar.h" #include "llconsole.h" +#include "lldonotdisturbnotificationstorage.h" #include "llenvmanager.h" #include "llfirstuse.h" #include "llfloatercamera.h" @@ -1389,11 +1390,16 @@ BOOL LLAgent::getAFK() const //----------------------------------------------------------------------------- // setDoNotDisturb() //----------------------------------------------------------------------------- -void LLAgent::setDoNotDisturb(bool pIsDotNotDisturb) +void LLAgent::setDoNotDisturb(bool pIsDoNotDisturb) { - mIsDoNotDisturb = pIsDotNotDisturb; - sendAnimationRequest(ANIM_AGENT_DO_NOT_DISTURB, (pIsDotNotDisturb ? ANIM_REQUEST_START : ANIM_REQUEST_STOP)); - LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(pIsDotNotDisturb); + bool isDoNotDisturbSwitchedOff = (mIsDoNotDisturb && !pIsDoNotDisturb); + mIsDoNotDisturb = pIsDoNotDisturb; + sendAnimationRequest(ANIM_AGENT_DO_NOT_DISTURB, (pIsDoNotDisturb ? ANIM_REQUEST_START : ANIM_REQUEST_STOP)); + LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(pIsDoNotDisturb); + if (isDoNotDisturbSwitchedOff) + { + LLDoNotDisturbNotificationStorage::getInstance()->loadNotifications(); + } } //----------------------------------------------------------------------------- diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index dd2bcc742b..43757d0174 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -139,7 +139,9 @@ void LLChannelManager::onLoginCompleted() } LLPersistentNotificationStorage::getInstance()->loadNotifications(); + LLDoNotDisturbNotificationStorage::getInstance()->initialize(); + LLDoNotDisturbNotificationStorage::getInstance()->loadNotifications(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp index 353447e4b6..4b0a70ffd8 100644 --- a/indra/newview/llcommunicationchannel.cpp +++ b/indra/newview/llcommunicationchannel.cpp @@ -39,6 +39,7 @@ LLCommunicationChannel::LLCommunicationChannel(const std::string& pName, const std::string& pParentName) : LLNotificationChannel(pName, pParentName, filterByDoNotDisturbStatus) + , mHistory() { } @@ -61,6 +62,11 @@ LLCommunicationChannel::history_list_t::const_iterator LLCommunicationChannel::e return mHistory.end(); } +void LLCommunicationChannel::clearHistory() +{ + mHistory.clear(); +} + void LLCommunicationChannel::onFilterFail(LLNotificationPtr pNotificationPtr) { std::string notificationType = pNotificationPtr->getType(); diff --git a/indra/newview/llcommunicationchannel.h b/indra/newview/llcommunicationchannel.h index a4756b8993..0e15e1cd15 100644 --- a/indra/newview/llcommunicationchannel.h +++ b/indra/newview/llcommunicationchannel.h @@ -46,6 +46,8 @@ public: typedef std::multimap history_list_t; history_list_t::const_iterator beginHistory() const; history_list_t::const_iterator endHistory() const; + + void clearHistory(); protected: virtual void onFilterFail(LLNotificationPtr pNotificationPtr); diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 472a0dd9ee..43fd7705aa 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -29,14 +29,25 @@ #include "lldonotdisturbnotificationstorage.h" +#define XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT 0 + +#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT +#include "llchannelmanager.h" +#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT #include "llcommunicationchannel.h" #include "lldir.h" #include "llerror.h" #include "llfasttimer_class.h" #include "llnotifications.h" +#include "llnotificationhandler.h" #include "llnotificationstorage.h" +#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT +#include "llscreenchannel.h" +#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT +#include "llscriptfloater.h" #include "llsd.h" #include "llsingleton.h" +#include "lluuid.h" LLDoNotDisturbNotificationStorage::LLDoNotDisturbNotificationStorage() : LLSingleton() @@ -85,6 +96,71 @@ static LLFastTimer::DeclareTimer FTM_LOAD_DND_NOTIFICATIONS("Load DND Notificati void LLDoNotDisturbNotificationStorage::loadNotifications() { + LLFastTimer _(FTM_LOAD_DND_NOTIFICATIONS); + + LL_INFOS("stinsonDebug") << "STINSON DEBUG: loading notifiations" << LL_ENDL; + + LLSD input; + if (!readNotifications(input) ||input.isUndefined()) + { + return; + } + + LLSD& data = input["data"]; + if (data.isUndefined()) + { + return; + } + +#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT + LLNotificationsUI::LLScreenChannel* notification_channel = + dynamic_cast(LLNotificationsUI::LLChannelManager::getInstance()-> + findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); +#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT + + LLNotifications& instance = LLNotifications::instance(); + + for (LLSD::array_const_iterator notification_it = data.beginArray(); + notification_it != data.endArray(); + ++notification_it) + { + LLSD notification_params = *notification_it; + LLNotificationPtr notification(new LLNotification(notification_params)); + + LL_INFOS("stinsonDebug") << "STINSON DEBUG: loading notification of type '" << notification->getType() << "'" << LL_ENDL; + + const LLUUID& notificationID = notification->id(); + if (instance.find(notificationID)) + { + instance.update(notification); + } + else + { + LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"])); + notification->setResponseFunctor(responder); + + instance.add(notification); + } + +#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT + // hide script floaters so they don't confuse the user and don't overlap startup toast + LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false); + + if(notification_channel) + { + // hide saved toasts so they don't confuse the user + notification_channel->hideToast(notification->getID()); + } +#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT + } + + // Clear the communication channel history and rewrite the save file to empty it as well + LLNotificationChannelPtr channelPtr = getCommunicationChannel(); + LLCommunicationChannel *commChannel = dynamic_cast(channelPtr.get()); + llassert(commChannel != NULL); + commChannel->clearHistory(); + + saveNotifications(); } LLNotificationChannelPtr LLDoNotDisturbNotificationStorage::getCommunicationChannel() const -- cgit v1.2.3 From ca4c5d3bcb18afefc181bdc164d1c338abef7488 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Wed, 19 Dec 2012 11:28:38 -0800 Subject: Switching some notification types from "offer" to be "notify" as the notifications were not offers. --- indra/newview/skins/default/xui/en/notifications.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 35ce787847..05798da8e2 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6583,7 +6583,7 @@ However, this region contains content accessible to adults only. log_to_im="true" log_to_chat="false" show_toast="false" - type="offer"> + type="notify"> Teleport offer sent to [TO_NAME] @@ -6636,7 +6636,7 @@ However, this region contains content accessible to adults only. name="FriendshipOffered" log_to_im="true" show_toast="false" - type="offer"> + type="notify"> friendship You have offered friendship to [TO_NAME] @@ -6666,7 +6666,7 @@ However, this region contains content accessible to adults only. icon="notify.tga" name="FriendshipAccepted" log_to_im="true" - type="offer"> + type="notify"> friendship <nolink>[NAME]</nolink> accepted your friendship offer. @@ -6686,7 +6686,7 @@ However, this region contains content accessible to adults only. name="FriendshipAcceptedByMe" log_to_im="true" show_toast="false" - type="offer"> + type="notify"> friendship Friendship offer accepted. @@ -6696,7 +6696,7 @@ Friendship offer accepted. name="FriendshipDeclinedByMe" log_to_im="true" show_toast="false" - type="offer"> + type="notify"> friendship Friendship offer declined. -- cgit v1.2.3 From dcfcc191dd3caaa84d0f789a928a83adf55c13b1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 19 Dec 2012 12:45:59 -0800 Subject: Pull merge from richard/viewer-chui --- indra/newview/llconversationview.cpp | 1 + indra/newview/llimview.cpp | 14 +++++++------- indra/newview/skins/default/colors.xml | 3 --- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index d3a0e882f5..fdba5b7289 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -109,6 +109,7 @@ void LLConversationViewSession::startFlashing() { if (mFlashStateOn && !mFlashStarted) { + llinfos << "Merov debug : Start the flashing for " << getName() << llendl; mFlashStarted = true; mFlashTimer->startFlashing(); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 5b4d5466a1..39f54dfd4d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -155,6 +155,8 @@ void on_new_message(const LLSD& msg) } // execution of the action + llinfos << "Merov debug : on_new_message action = " << action << llendl; + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance("im_container"); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); @@ -174,13 +176,11 @@ void on_new_message(const LLSD& msg) if ("toast" == action) { // Skip toasting if we have open window of IM with this session id - if ( - session_floater + if (session_floater && session_floater->isInVisibleChain() && session_floater->hasFocus() && !session_floater->isMinimized() - && !(session_floater->getHost() - && session_floater->getHost()->isMinimized()) + && !(session_floater->getHost() && session_floater->getHost()->isMinimized()) ) { return; @@ -222,10 +222,10 @@ void on_new_message(const LLSD& msg) gToolBarView->flashCommand(LLCommandId("chat"), true); } //conversation floater is open but a different conversation is focused - else - { + //else + //{ im_box->flashConversationItemWidget(session_id, true); - } + //} } } diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index c3df04d0a6..becdbda067 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -11,9 +11,6 @@ - -- cgit v1.2.3 From ef6121cba1c72549cca10763645254ae3aaf2887 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Wed, 19 Dec 2012 15:37:12 -0800 Subject: CHUI-499: Code clean-up and adding some more types badly defined. --- indra/newview/lldonotdisturbnotificationstorage.cpp | 17 +++++++++++------ indra/newview/llnotificationstorage.cpp | 6 ++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 43fd7705aa..bf3dcae1f3 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -98,8 +98,6 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() { LLFastTimer _(FTM_LOAD_DND_NOTIFICATIONS); - LL_INFOS("stinsonDebug") << "STINSON DEBUG: loading notifiations" << LL_ENDL; - LLSD input; if (!readNotifications(input) ||input.isUndefined()) { @@ -127,8 +125,6 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() LLSD notification_params = *notification_it; LLNotificationPtr notification(new LLNotification(notification_params)); - LL_INFOS("stinsonDebug") << "STINSON DEBUG: loading notification of type '" << notification->getType() << "'" << LL_ENDL; - const LLUUID& notificationID = notification->id(); if (instance.find(notificationID)) { @@ -136,8 +132,17 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() } else { - LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"])); - notification->setResponseFunctor(responder); + LLNotificationResponderInterface* responder = createResponder(notification_params["name"], notification_params["responder"]); + if (responder == NULL) + { + LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '" + << notification->getType() << "'" << LL_ENDL; + } + else + { + LLNotificationResponderPtr responderPtr(responder); + notification->setResponseFunctor(responderPtr); + } instance.add(notification); } diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index 4746e4bbd4..b797775369 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -126,7 +126,13 @@ LLResponderRegistry::LLResponderRegistry() , mBuildMap() { add("ObjectGiveItem", &create); + add("OwnObjectGiveItem", &create); add("UserGiveItem", &create); + + add("TeleportOffered", &create); + add("TeleportOffered_MaturityExceeded", &create); + + add("OfferFriendship", &create); } LLResponderRegistry::~LLResponderRegistry() -- cgit v1.2.3 From c81cf89086b0282121c6577b6fde75e050c1a0e8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 19 Dec 2012 17:10:31 -0800 Subject: CHUI-600 : Fix the orange (provided by Leo), fix the conversation item flashing (when shown) --- indra/newview/llconversationview.cpp | 6 ++++-- indra/newview/llfloaterimcontainer.cpp | 25 ++++++++++++++----------- indra/newview/llfloaterimcontainer.h | 1 + indra/newview/llimview.cpp | 3 --- indra/newview/skins/default/colors.xml | 2 +- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index fdba5b7289..e51efd48f5 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -81,7 +81,9 @@ LLConversationViewSession::LLConversationViewSession(const LLConversationViewSes mSpeakingIndicator(NULL), mVoiceClientObserver(NULL), mCollapsedMode(false), - mHasArrow(true) + mHasArrow(true), + mFlashStateOn(false), + mFlashStarted(false) { mFlashTimer = new LLFlashTimer(); } @@ -109,7 +111,6 @@ void LLConversationViewSession::startFlashing() { if (mFlashStateOn && !mFlashStarted) { - llinfos << "Merov debug : Start the flashing for " << getName() << llendl; mFlashStarted = true; mFlashTimer->startFlashing(); } @@ -245,6 +246,7 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask ) if(result && getRoot()->getCurSelectedItem() == this) { LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance("im_container"); + im_container->clearAllFlashStates(); im_container->selectConversationPair(session_id, false); im_container->collapseMessagesPane(false); } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 390eec84f6..58ba186b57 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1229,6 +1229,20 @@ void LLFloaterIMContainer::showConversation(const LLUUID& session_id) selectConversationPair(session_id, true); } +void LLFloaterIMContainer::clearAllFlashStates() +{ + llinfos << "Merov debug : clear all flash states" << llendl; + conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); + for (;widget_it != mConversationsWidgets.end(); ++widget_it) + { + LLConversationViewSession* widget = dynamic_cast(widget_it->second); + if (widget) + { + widget->setFlashState(false); + } + } +} + void LLFloaterIMContainer::selectConversation(const LLUUID& session_id) { selectConversationPair(session_id, true); @@ -1240,17 +1254,6 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool BOOL handled = TRUE; LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id); - // On selection, stop the flash state on all conversation widgets - conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); - for (;widget_it != mConversationsWidgets.end(); ++widget_it) - { - LLConversationViewSession* widget = dynamic_cast(widget_it->second); - if (widget) - { - widget->setFlashState(false); - } - } - /* widget processing */ if (select_widget) { diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 5db1565cea..09a24c0105 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -69,6 +69,7 @@ public: void showConversation(const LLUUID& session_id); void selectConversation(const LLUUID& session_id); BOOL selectConversationPair(const LLUUID& session_id, bool select_widget); + void clearAllFlashStates(); /*virtual*/ void tabClose(); void showStub(bool visible); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 39f54dfd4d..65048e352e 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -155,9 +155,6 @@ void on_new_message(const LLSD& msg) } // execution of the action - llinfos << "Merov debug : on_new_message action = " << action << llendl; - - LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance("im_container"); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index becdbda067..0de217fc0d 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -13,7 +13,7 @@ value="0.38 0.694 0.573 0.35" /> + value="0.749 0.298 0 1" /> -- cgit v1.2.3 From b15ba74485e24db9a996a2f6a9438ac48224ea7a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 19 Dec 2012 17:19:48 -0800 Subject: CHUI-607: Due to a problem in design we have two checkboxes that determine whether a conversation transcript should be saved. By defaut commiting a change that makes both checkboxes checked by default. This makes it so that a new user can see their transcript/chat history. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 24fa0a0cd4..ebc915ec5a 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4676,7 +4676,7 @@ Type Boolean Value - 0 + 1 LandBrushSize -- cgit v1.2.3 From ba297b167f75d8a09c959952a300d492f2aec88b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 19 Dec 2012 20:07:08 -0800 Subject: CHUI-600 : Fixed! Modified the button flash state so it sticks after the animation and is dismissed on toggle --- indra/llui/llbutton.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 99384439d2..7ca9b869a8 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -311,7 +311,7 @@ void LLButton::onCommit() { make_ui_sound("UISndClickRelease"); } - + if (mIsToggle) { toggleState(); @@ -613,10 +613,6 @@ void LLButton::draw() static LLCachedControl sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true); F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); - if (mFlashingTimer) - { - mFlashing = mFlashingTimer->isFlashingInProgress(); - } bool flash = mFlashing && sEnableButtonFlashing; bool pressed_by_keyboard = FALSE; @@ -701,7 +697,8 @@ void LLButton::draw() imagep = mImageDisabled; } - if (mFlashing) + // Selected has a higher priority than flashing. If both are set, flashing is ignored. + if (mFlashing && !selected) { // if button should flash and we have icon for flashing, use it as image for button if(flash && mImageFlash) @@ -711,13 +708,13 @@ void LLButton::draw() imagep = mImageFlash; } // else use usual flashing via flash_color - else + else if (mFlashingTimer) { LLColor4 flash_color = mFlashBgColor.get(); use_glow_effect = TRUE; glow_type = LLRender::BT_ALPHA; // blend the glow - if (mFlashingTimer->isCurrentlyHighlighted()) + if (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress()) { glow_color = flash_color; } @@ -773,8 +770,7 @@ void LLButton::draw() if (use_glow_effect) { mCurGlowStrength = lerp(mCurGlowStrength, - mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || mNeedsHighlight? 1.0 : 0.0) - : mHoverGlowStrength, + mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); } else @@ -961,23 +957,18 @@ void LLButton::setToggleState(BOOL b) { setControlValue(b); // will fire LLControlVariable callbacks (if any) setValue(b); // may or may not be redundant + setFlashing(false); // stop flash state whenever the selected/unselected state if reset // Unselected label assignments autoResize(); } } -void LLButton::setFlashing( bool b ) +void LLButton::setFlashing(bool b) { if (mFlashingTimer) { - if (b) - { - mFlashingTimer->startFlashing(); - } - else - { - mFlashingTimer->stopFlashing(); - } + mFlashing = b; + (b ? mFlashingTimer->startFlashing() : mFlashingTimer->stopFlashing()); } else if (b != mFlashing) { -- cgit v1.2.3 From ed716d996987722c32a105fac79daf1af4e5fb23 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Thu, 20 Dec 2012 09:42:34 +0200 Subject: CHUI-588 (Clicking nearby chat toast doesn't highlight proper conversation line item) --- indra/newview/llfloaterimsessiontab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 7984034ded..53d2f31b79 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -308,7 +308,7 @@ void LLFloaterIMSessionTab::onFocusReceived() LLFloaterIMContainer* container = LLFloaterReg::getTypedInstance("im_container"); if (container) { - container->selectConversationPair(mSessionID, ! getHost()); + container->selectConversationPair(mSessionID, true); container->showStub(! getHost()); } } -- cgit v1.2.3 From eb68845767309900b6b5915f6358ae5027fb7136 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Thu, 20 Dec 2012 15:01:50 +0200 Subject: CHUI-606 Default settings in CHUI viewer do not keep IM logs for users: Preferences > Chat > Keep a convers. log was turned on --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 24fa0a0cd4..ebc915ec5a 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4676,7 +4676,7 @@ Type Boolean Value - 0 + 1 LandBrushSize -- cgit v1.2.3 From c81a0b0a5701425aa52521d8600a280d05040517 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Thu, 20 Dec 2012 15:23:36 +0200 Subject: CHUI-602 FIXED Don't call getUUID() if there is no selected participants --- indra/newview/llfloaterimcontainer.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 58ba186b57..92ea6dacde 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1101,7 +1101,14 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) uuid_vec_t uuids; getParticipantUUIDs(uuids); - if("can_activate_group" == item) + + // If nothing is selected, everything needs to be disabled + if (uuids.size() <= 0) + { + return false; + } + + if("can_activate_group" == item) { LLUUID selected_group_id = getCurSelectedViewModelItem()->getUUID(); return gAgent.getGroupID() != selected_group_id; @@ -1116,12 +1123,6 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v { return gSavedSettings.getBOOL("KeepConversationLogTranscripts"); } - - // If nothing is selected, everything needs to be disabled - if (uuids.size() <= 0) - { - return false; - } // Extract the single select info bool is_single_select = (uuids.size() == 1); -- cgit v1.2.3 From 2aefdb47ca1d02bfe8b74928dee479072ef151a3 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Thu, 20 Dec 2012 15:24:14 +0200 Subject: CHUI-618 User sees no indication of offline messages received with conversation log preference turned off: flashing of CHUI button if offline messages was received --- indra/newview/llimview.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 65048e352e..cdc51ad2fc 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2488,16 +2488,23 @@ void LLIMMgr::addMessage( } // Open conversation log if offline messages are present and user allows a Call Log - if (is_offline_msg && gSavedSettings.getBOOL("KeepConversationLogTranscripts")) - { - LLFloaterConversationLog* floater_log = - LLFloaterReg::getTypedInstance("conversation"); - if (floater_log && !(floater_log->isFrontmost())) + if (is_offline_msg) + { + if (gSavedSettings.getBOOL("KeepConversationLogTranscripts")) { - floater_log->openFloater(); - floater_log->setFrontmost(TRUE); + LLFloaterConversationLog* floater_log = + LLFloaterReg::getTypedInstance("conversation"); + if (floater_log && !(floater_log->isFrontmost())) + { + floater_log->openFloater(); + floater_log->setFrontmost(TRUE); + } } - } + else + { + gToolBarView->flashCommand(LLCommandId("chat"), true); + } + } //*NOTE session_name is empty in case of incoming P2P sessions std::string fixed_session_name = from; -- cgit v1.2.3 From 95380b0aaa635c18c03801048559ba811640bc02 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 20 Dec 2012 22:37:04 +0200 Subject: CHUI-513 FIXED Revise initial conversation floater size --- indra/newview/app_settings/settings_per_account.xml | 2 +- indra/newview/skins/default/xui/en/floater_im_container.xml | 7 ++----- indra/newview/skins/default/xui/en/floater_im_session.xml | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index ca22041671..4ff494fbfb 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -53,7 +53,7 @@ Type S32 Value - 268 + 205 ConversationsMessagePaneCollapsed diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 3475c7da33..cbf1830093 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -3,9 +3,8 @@ can_close="true" can_minimize="true" can_resize="true" - height="230" + height="210" layout="topleft" - min_height="50" name="floater_im_box" help_topic="floater_im_box" save_rect="true" @@ -15,7 +14,7 @@ title="CONVERSATIONS" bottom="-50" right="-5" - width="500"> + width="450"> @@ -37,7 +36,6 @@ user_resize="true" name="conversations_layout_panel" min_dim="38" - width="225" expanded_min_dim="156"> + min_width="221"> Date: Thu, 20 Dec 2012 18:36:01 -0800 Subject: CHUI-429 : Fixed! Add a flag to filter multi/single selection situations in menu building. Implement in conversation contextual menu. --- indra/llui/llfolderview.cpp | 5 +- indra/llui/llfolderview.h | 1 + indra/newview/llconversationmodel.cpp | 67 ++++++++++++---------- indra/newview/llconversationmodel.h | 2 +- indra/newview/llfloaterimcontainer.cpp | 1 - .../skins/default/xui/en/menu_conversation.xml | 7 +++ 6 files changed, 50 insertions(+), 33 deletions(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index a33ffc4240..7ae79d94fe 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1913,14 +1913,15 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) // Successively filter out invalid options - U32 flags = FIRST_SELECTED_ITEM; + U32 multi_select_flag = (mSelectedItems.size() > 1 ? ITEM_IN_MULTI_SELECTION : 0x0); + U32 flags = multi_select_flag | FIRST_SELECTED_ITEM; for (selected_items_t::iterator item_itor = mSelectedItems.begin(); item_itor != mSelectedItems.end(); ++item_itor) { LLFolderViewItem* selected_item = (*item_itor); selected_item->buildContextMenu(*menu, flags); - flags = 0x0; + flags = multi_select_flag; } addNoOptions(menu); diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index d4a1434c73..2ee7417240 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -400,5 +400,6 @@ public: // Flags for buildContextMenu() const U32 SUPPRESS_OPEN_ITEM = 0x1; const U32 FIRST_SELECTED_ITEM = 0x2; +const U32 ITEM_IN_MULTI_SELECTION = 0x4; #endif // LL_LLFOLDERVIEW_H diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index d03ad92fbc..005439301a 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -102,35 +102,44 @@ void LLConversationItem::showProperties(void) { } -void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items) -{ - items.push_back(std::string("view_profile")); - items.push_back(std::string("im")); - items.push_back(std::string("offer_teleport")); - items.push_back(std::string("voice_call")); - items.push_back(std::string("chat_history")); - items.push_back(std::string("separator_chat_history")); - items.push_back(std::string("add_friend")); - items.push_back(std::string("remove_friend")); - items.push_back(std::string("invite_to_group")); - items.push_back(std::string("separator_invite_to_group")); - items.push_back(std::string("map")); - items.push_back(std::string("share")); - items.push_back(std::string("pay")); - items.push_back(std::string("block_unblock")); - items.push_back(std::string("MuteText")); - - if(this->getType() != CONV_SESSION_1_ON_1 && mDisplayModeratorOptions) +void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32 flags) +{ + if (flags & ITEM_IN_MULTI_SELECTION) { - items.push_back(std::string("Moderator Options Separator")); - items.push_back(std::string("Moderator Options")); - items.push_back(std::string("AllowTextChat")); - items.push_back(std::string("moderate_voice_separator")); - items.push_back(std::string("ModerateVoiceToggleMuteSelected")); - items.push_back(std::string("ModerateVoiceMute")); - items.push_back(std::string("ModerateVoiceUnmute")); + items.push_back(std::string("im")); + items.push_back(std::string("offer_teleport")); + items.push_back(std::string("voice_call")); + items.push_back(std::string("remove_friends")); + } + else + { + items.push_back(std::string("view_profile")); + items.push_back(std::string("im")); + items.push_back(std::string("offer_teleport")); + items.push_back(std::string("voice_call")); + items.push_back(std::string("chat_history")); + items.push_back(std::string("separator_chat_history")); + items.push_back(std::string("add_friend")); + items.push_back(std::string("remove_friend")); + items.push_back(std::string("invite_to_group")); + items.push_back(std::string("separator_invite_to_group")); + items.push_back(std::string("map")); + items.push_back(std::string("share")); + items.push_back(std::string("pay")); + items.push_back(std::string("block_unblock")); + items.push_back(std::string("MuteText")); + + if ((getType() != CONV_SESSION_1_ON_1) && mDisplayModeratorOptions) + { + items.push_back(std::string("Moderator Options Separator")); + items.push_back(std::string("Moderator Options")); + items.push_back(std::string("AllowTextChat")); + items.push_back(std::string("moderate_voice_separator")); + items.push_back(std::string("ModerateVoiceToggleMuteSelected")); + items.push_back(std::string("ModerateVoiceMute")); + items.push_back(std::string("ModerateVoiceUnmute")); + } } - } // @@ -306,7 +315,7 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("close_conversation")); items.push_back(std::string("separator_disconnect_from_voice")); - buildParticipantMenuOptions(items); + buildParticipantMenuOptions(items, flags); } else if(this->getType() == CONV_SESSION_GROUP) { @@ -440,7 +449,7 @@ void LLConversationItemParticipant::buildContextMenu(LLMenuGL& menu, U32 flags) menuentry_vec_t items; menuentry_vec_t disabled_items; - buildParticipantMenuOptions(items); + buildParticipantMenuOptions(items, flags); hide_context_entries(menu, items, disabled_items); } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 743a6ba40b..02002d8f70 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -130,7 +130,7 @@ public: void postEvent(const std::string& event_type, LLConversationItemSession* session, LLConversationItemParticipant* participant); - void buildParticipantMenuOptions(menuentry_vec_t& items); + void buildParticipantMenuOptions(menuentry_vec_t& items, U32 flags); protected: std::string mName; // Name of the session or the participant diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 92ea6dacde..2019a35faa 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1232,7 +1232,6 @@ void LLFloaterIMContainer::showConversation(const LLUUID& session_id) void LLFloaterIMContainer::clearAllFlashStates() { - llinfos << "Merov debug : clear all flash states" << llendl; conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); for (;widget_it != mConversationsWidgets.end(); ++widget_it) { diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index e0edf384d6..46c6e19fa5 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -75,6 +75,13 @@ + + + + Date: Thu, 20 Dec 2012 19:57:51 +0200 Subject: CHUI-605 : Fixed : Keep conversation log requires restart to change preference: connected LLConversationLog::enableLogging() as listener to "LogInstantMessages" control changes --- indra/newview/llconversationlog.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 1171b3db41..eb3a3731ee 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -187,16 +187,23 @@ void LLConversationLogFriendObserver::changed(U32 mask) LLConversationLog::LLConversationLog() { - LLControlVariable* ctrl = gSavedPerAccountSettings.getControl("LogInstantMessages").get(); - if (ctrl) + LLControlVariable* log_instant_message = gSavedPerAccountSettings.getControl("LogInstantMessages").get(); + LLControlVariable* keep_convers_log = gSavedSettings.getControl("KeepConversationLogTranscripts").get(); + bool is_log_message = false; + bool is_keep_log = false; + + if (log_instant_message) { - ctrl->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); - if (ctrl->getValue().asBoolean() - && gSavedSettings.getBOOL("KeepConversationLogTranscripts")) - { - enableLogging(true); - } + log_instant_message->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); + is_log_message = log_instant_message->getValue().asBoolean(); } + if (keep_convers_log) + { + keep_convers_log->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); + is_keep_log = keep_convers_log->getValue().asBoolean(); + } + + enableLogging(is_log_message && is_keep_log); } void LLConversationLog::enableLogging(bool enable) -- cgit v1.2.3 From 2610af9798374ce9fff7623d7aa7e269b2a78174 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 21 Dec 2012 15:35:56 +0200 Subject: CHUI-619 FUI button and conversation line items blink at different rates: changed rate --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llimview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ebc915ec5a..507eb33f2d 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13173,7 +13173,7 @@ Type F32 Value - 0.25 + 0.5 WindLightUseAtmosShaders diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cdc51ad2fc..708400cbe1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -964,7 +964,7 @@ const std::string LLIMModel::getName(const LLUUID& session_id) const { LLIMSession* session = findIMSession(session_id); - if (!session) + if (!session) { llwarns << "session " << session_id << "does not exist " << llendl; return LLTrans::getString("no_session_message"); -- cgit v1.2.3 From 7549a392cc32dc36f0bc673a6569f01731cc1bbd Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 21 Dec 2012 16:28:33 +0200 Subject: CHUI-566 Flashing and color on Conversations FUI button and conversation line item: change behavior for the case "If conversations (container) floater open but not on top" --- indra/newview/llimview.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 708400cbe1..d736b81bb7 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -160,6 +160,7 @@ void on_new_message(const LLSD& msg) //session floater not focused (visible or not) bool session_floater_not_focused = session_floater && !session_floater->hasFocus(); + //conv. floater is closed bool conversation_floater_is_closed = !( im_box @@ -210,20 +211,16 @@ void on_new_message(const LLSD& msg) else if ("flash" == action) { - if (session_floater_not_focused) + if (conversation_floater_not_focused) { - //User is not focused on conversation containing the message - - if(conversation_floater_not_focused) + if(session_floater_not_focused) { + //User is not focused on conversation containing the message gToolBarView->flashCommand(LLCommandId("chat"), true); } - //conversation floater is open but a different conversation is focused - //else - //{ - im_box->flashConversationItemWidget(session_id, true); - //} - } + + im_box->flashConversationItemWidget(session_id, true); + } } else if("openconversations" == action) -- cgit v1.2.3 From 765a5a73dd3e2e7a88141e26f4aa7b479229ad2e Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 21 Dec 2012 16:45:58 +0200 Subject: CHUI-621 FIXED Notification chiclet UI error --- indra/newview/llchiclet.cpp | 2 +- .../skins/default/textures/bottomtray/Notices_Unread.png | Bin 0 -> 3693 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 indra/newview/skins/default/textures/bottomtray/Notices_Unread.png diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 2fdcb17570..3dbb43c657 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -76,7 +76,7 @@ LLSysWellChiclet::LLSysWellChiclet(const Params& p) LLSysWellChiclet::~LLSysWellChiclet() { - delete mFlashToLitTimer; + mFlashToLitTimer->unset(); } void LLSysWellChiclet::setCounter(S32 counter) diff --git a/indra/newview/skins/default/textures/bottomtray/Notices_Unread.png b/indra/newview/skins/default/textures/bottomtray/Notices_Unread.png new file mode 100644 index 0000000000..0ac5b72b8f Binary files /dev/null and b/indra/newview/skins/default/textures/bottomtray/Notices_Unread.png differ -- cgit v1.2.3 From dd7509f56de5e8a47680b33176e90c11ed518066 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 21 Dec 2012 20:05:40 +0200 Subject: CHUI-411 Entries in chat history viewer do not show all dates of entries and some entries show on multiple pages Type of variable for the time saving was changed from S32 to long int ("capacity" of S32-timer is only ~18 hours!) --- indra/newview/llconversationlog.cpp | 45 +++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index eb3a3731ee..e44749fd79 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -236,17 +236,20 @@ void LLConversationLog::logConversation(const LLUUID& session_id, BOOL has_offli const LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); LLConversation* conversation = findConversation(session); - if (session && conversation) + if (session) { - if(has_offline_msg) + if (conversation) { - updateOfflineIMs(session, has_offline_msg); + if(has_offline_msg) + { + updateOfflineIMs(session, has_offline_msg); + } + updateConversationTimestamp(conversation); + } + else + { + createConversation(session); } - updateConversationTimestamp(conversation); - } - else if (session && !conversation) - { - createConversation(session); } } @@ -307,19 +310,17 @@ void LLConversationLog::updateConversationTimestamp(LLConversation* conversation LLConversation* LLConversationLog::findConversation(const LLIMModel::LLIMSession* session) { - if (!session) + if (session) { - return NULL; - } + const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID; - const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID; - - conversations_vec_t::iterator conv_it = mConversations.begin(); - for(; conv_it != mConversations.end(); ++conv_it) - { - if (conv_it->getSessionID() == session_id) + conversations_vec_t::iterator conv_it = mConversations.begin(); + for(; conv_it != mConversations.end(); ++conv_it) { - return &*conv_it; + if (conv_it->getSessionID() == session_id) + { + return &*conv_it; + } } } @@ -411,8 +412,8 @@ bool LLConversationLog::saveToFile(const std::string& filename) // [1343221177] 0 1 0 John Doe| 7e4ec5be-783f-49f5-71dz-16c58c64c145 4ec62a74-c246-0d25-2af6-846beac2aa55 john.doe| // [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a| - fprintf(fp, "[%d] %d %d %d %s| %s %s %s|\n", - (S32)conv_it->getTime(), + fprintf(fp, "[%ld] %d %d %d %s| %s %s %s|\n", + conv_it->getTime(), (S32)conv_it->getConversationType(), (S32)0, (S32)conv_it->hasOfflineMessages(), @@ -446,7 +447,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) char history_file_name[MAX_STRING]; int has_offline_ims; int stype; - S32 time; + time_t time; // before CHUI-348 it was a flag of conversation voice state int prereserved_unused; @@ -456,7 +457,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) part_id_buffer[0] = '\0'; conv_id_buffer[0] = '\0'; - sscanf(buffer, "[%d] %d %d %d %[^|]| %s %s %[^|]|", + sscanf(buffer, "[%ld] %d %d %d %[^|]| %s %s %[^|]|", &time, &stype, &prereserved_unused, -- cgit v1.2.3 From 6df0377d1dd810cc1656c6c2664af2c7c87705fc Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 21 Dec 2012 20:11:01 +0200 Subject: CHUI-622 FIXED Default size of conversation log floater seems large --- .../default/xui/en/floater_conversation_log.xml | 163 ++++++++++----------- 1 file changed, 80 insertions(+), 83 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_conversation_log.xml b/indra/newview/skins/default/xui/en/floater_conversation_log.xml index c9c52e5ce5..960db137b3 100644 --- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml +++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml @@ -1,91 +1,88 @@ - + can_resize="true" + positioning="cascading" + height="200" + min_height="100" + min_width="200" + layout="topleft" + name="floater_conversation_log" + save_rect="true" + single_instance="true" + reuse_instance="true" + title="CONVERSATION LOG" + width="300"> Conversations are not being logged. To log conversations in the future, select "Save IM logs on my computer" under Preferences > Privacy. - - - - - - - + + + + + + - + allow_select="true" + bottom="-8" + opaque="true" + follows="all" + left="8" + keep_selection_visible_on_reshape="true" + item_pad="2" + multi_select="false" + name="conversation_log_list" + right="-8" + top="0" /> + -- cgit v1.2.3 From 923262f154748eea5ce1eda37df1b9df1eaf0f43 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Mon, 24 Dec 2012 14:20:25 +0200 Subject: CHUI-583 FIXED Link will be opened in external browser if this preference is set. --- indra/newview/llviewermenu.cpp | 15 +++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 14 +++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index fe9c00cc27..be9f7d645a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7586,6 +7586,20 @@ void handle_web_content_test(const LLSD& param) LLWeb::loadURLInternal(url); } +void handle_show_url(const LLSD& param) +{ + std::string url = param.asString(); + if(gSavedSettings.getBOOL("UseExternalBrowser")) + { + LLWeb::loadURLExternal(url); + } + else + { + LLWeb::loadURLInternal(url); + } + +} + void handle_buy_currency_test(void*) { std::string url = @@ -8415,6 +8429,7 @@ void initialize_menus() // Advanced > UI commit.add("Advanced.WebBrowserTest", boost::bind(&handle_web_browser_test, _2)); // sigh! this one opens the MEDIA browser commit.add("Advanced.WebContentTest", boost::bind(&handle_web_content_test, _2)); // this one opens the Web Content floater + commit.add("Advanced.ShowURL", boost::bind(&handle_show_url, _2)); view_listener_t::addMenu(new LLAdvancedBuyCurrencyTest(), "Advanced.BuyCurrencyTest"); view_listener_t::addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr"); view_listener_t::addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 00424e97f6..76de81559b 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1273,35 +1273,35 @@ label="User’s guide" name="User’s guide"> @@ -1309,14 +1309,14 @@ label="[SECOND_LIFE] News" name="Second Life News"> -- cgit v1.2.3 From 32944ef9e41a96950aa645a016c8f2c6bf71a351 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Mon, 24 Dec 2012 19:01:27 +0200 Subject: CHUI-627 FIXED Unnecessary attributes are deleted in xml --- indra/newview/skins/default/xui/en/floater_conversation_log.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_conversation_log.xml b/indra/newview/skins/default/xui/en/floater_conversation_log.xml index 960db137b3..cf61348a66 100644 --- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml +++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml @@ -17,12 +17,10 @@ Conversations are not being logged. To log conversations in the future, select "Save IM logs on my computer" under Preferences > Privacy. Date: Tue, 25 Dec 2012 21:16:30 +0200 Subject: CHUI-623 FIXED No vertical scrollbar in conversation list --- indra/newview/skins/default/xui/en/floater_im_container.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index cbf1830093..e7638fe669 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -113,11 +113,12 @@ @@ -127,7 +128,7 @@ name="messages_layout_panel" expanded_min_dim="222"> Date: Wed, 26 Dec 2012 11:23:59 +0200 Subject: CHUI-632 FIXED Disable Gear button if nothing is selected --- indra/newview/llpanelblockedlist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index ecab7d2167..df1ccdd9fc 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -137,6 +137,7 @@ void LLPanelBlockedList::updateButtons() { bool hasSelected = NULL != mBlockedList->getSelectedItem(); getChildView("unblock_btn")->setEnabled(hasSelected); + getChildView("blocked_gear_btn")->setEnabled(hasSelected); } void LLPanelBlockedList::unblockItem() -- cgit v1.2.3 From d05df4087c334fe30a9d0fe5224a828c677d0244 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Wed, 26 Dec 2012 11:46:29 +0200 Subject: CHUI-617 FIXED Update Gear button state after initing session. mConversationsRoot creation is moved to postBuild(). --- indra/newview/llfloaterimsession.cpp | 4 +-- indra/newview/llfloaterimsessiontab.cpp | 44 ++++++++++++++------------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index ff07ddfcbf..d36b138c21 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -86,7 +86,7 @@ LLFloaterIMSession::LLFloaterIMSession(const LLUUID& session_id) mCommitCallbackRegistrar.add("Avatar.GearDoToSelected", boost::bind(&LLFloaterIMSession::GearDoToSelected, this, _2)); mEnableCallbackRegistrar.add("Avatar.CheckGearItem", boost::bind(&LLFloaterIMSession::checkGearMenuItem, this, _2)); - setDocked(true); + setDocked(true); } @@ -754,7 +754,7 @@ void LLFloaterIMSession::sessionInitReplyReceived(const LLUUID& im_session_id) } initIMFloater(); - + LLFloaterIMSessionTab::updateGearBtn(); //*TODO here we should remove "starting session..." warning message if we added it in postBuild() (IB) //need to send delayed messages collected while waiting for session initialization diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 53d2f31b79..f5b657fa60 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -240,7 +240,24 @@ BOOL LLFloaterIMSessionTab::postBuild() result = LLDockableFloater::postBuild(); } - // Now ready to build the conversation and participants list + // Create the root using an ad-hoc base item + LLConversationItem* base_item = new LLConversationItem(mSessionID, mConversationViewModel); + LLFolderView::Params p(LLUICtrlFactory::getDefaultParams()); + p.rect = LLRect(0, 0, getRect().getWidth(), 0); + p.parent_panel = mParticipantListPanel; + p.listener = base_item; + p.view_model = &mConversationViewModel; + p.root = NULL; + p.use_ellipses = true; + p.options_menu = "menu_conversation.xml"; + mConversationsRoot = LLUICtrlFactory::create(p); + mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); + // Attach that root to the scroller + mScroller->addChild(mConversationsRoot); + mConversationsRoot->setScrollContainer(mScroller); + mConversationsRoot->setFollowsAll(); + mConversationsRoot->addChild(mConversationsRoot->mStatusTextBox); + buildConversationViewParticipant(); refreshConversation(); @@ -388,31 +405,6 @@ void LLFloaterIMSessionTab::buildConversationViewParticipant() return; } - // Create or recreate the root folder: this is a dummy folder (not shown) but required by the LLFolderView architecture - // We need to redo this when rebuilding as the session id (mSessionID) *may* have changed - if (mConversationsRoot) - { - // Remove the old root if any - mScroller->removeChild(mConversationsRoot); - } - // Create the root using an ad-hoc base item - LLConversationItem* base_item = new LLConversationItem(mSessionID, mConversationViewModel); - LLFolderView::Params p(LLUICtrlFactory::getDefaultParams()); - p.rect = LLRect(0, 0, getRect().getWidth(), 0); - p.parent_panel = mParticipantListPanel; - p.listener = base_item; - p.view_model = &mConversationViewModel; - p.root = NULL; - p.use_ellipses = true; - p.options_menu = "menu_conversation.xml"; - mConversationsRoot = LLUICtrlFactory::create(p); - mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); - // Attach that root to the scroller - mScroller->addChild(mConversationsRoot); - mConversationsRoot->setScrollContainer(mScroller); - mConversationsRoot->setFollowsAll(); - mConversationsRoot->addChild(mConversationsRoot->mStatusTextBox); - // Create the participants widgets now LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = item->getChildrenBegin(); LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = item->getChildrenEnd(); -- cgit v1.2.3 From 099c9bcc6ffd9760cf935b6bcff8d796d0dff09d Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 26 Dec 2012 20:25:56 +0200 Subject: CHUI-629 FIXED Windows crash on exit when closing viewer with conversation log open with unread offline messages --- indra/newview/llconversationlog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index e44749fd79..0479733706 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -412,7 +412,7 @@ bool LLConversationLog::saveToFile(const std::string& filename) // [1343221177] 0 1 0 John Doe| 7e4ec5be-783f-49f5-71dz-16c58c64c145 4ec62a74-c246-0d25-2af6-846beac2aa55 john.doe| // [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a| - fprintf(fp, "[%ld] %d %d %d %s| %s %s %s|\n", + fprintf(fp, "[%lld] %d %d %d %s| %s %s %s|\n", conv_it->getTime(), (S32)conv_it->getConversationType(), (S32)0, -- cgit v1.2.3 From 1eae887434331357e057498905f7f5ff8f9f9c77 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 26 Dec 2012 23:55:23 +0200 Subject: CHUI-629 FIXED Resolve build problems; --- indra/newview/llconversationlog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 0479733706..8c86871134 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -413,7 +413,7 @@ bool LLConversationLog::saveToFile(const std::string& filename) // [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a| fprintf(fp, "[%lld] %d %d %d %s| %s %s %s|\n", - conv_it->getTime(), + (S64)conv_it->getTime(), (S32)conv_it->getConversationType(), (S32)0, (S32)conv_it->hasOfflineMessages(), -- cgit v1.2.3 From 7e8d336749b42ce134a67dfe1f1990644f1b263a Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Fri, 28 Dec 2012 15:28:19 +0200 Subject: CHUI-639 FIXED Min. width is increased to avoid overlapping --- indra/newview/skins/default/xui/en/floater_conversation_log.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_conversation_log.xml b/indra/newview/skins/default/xui/en/floater_conversation_log.xml index cf61348a66..256e03c4d7 100644 --- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml +++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml @@ -5,7 +5,7 @@ positioning="cascading" height="200" min_height="100" - min_width="200" + min_width="230" layout="topleft" name="floater_conversation_log" save_rect="true" -- cgit v1.2.3 From d99fa985c8ff65913e85dfaa9fd91892a197c4cc Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 28 Dec 2012 18:55:24 +0200 Subject: CHUI-566 ADD. FIX Flashing and color on Conversations FUI button and conversation line item Cancel sticking of color, if the button is pressed, or when a flashing of the previously selected button is ended --- indra/llui/llbutton.cpp | 18 +++++++++++++----- indra/newview/llimview.cpp | 16 ++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 7ca9b869a8..a8149a9a1d 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -311,7 +311,7 @@ void LLButton::onCommit() { make_ui_sound("UISndClickRelease"); } - + if (mIsToggle) { toggleState(); @@ -613,8 +613,6 @@ void LLButton::draw() static LLCachedControl sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true); F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); - bool flash = mFlashing && sEnableButtonFlashing; - bool pressed_by_keyboard = FALSE; if (hasFocus()) { @@ -642,6 +640,17 @@ void LLButton::draw() LLColor4 glow_color; LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; LLUIImage* imagep = NULL; + + // Cancel sticking of color, if the button is pressed, + // or when a flashing of the previously selected button is ended + if (mFlashingTimer + && ((selected && !mFlashingTimer->isFlashingInProgress()) || pressed)) + { + mFlashing = false; + } + + bool flash = mFlashing && sEnableButtonFlashing; + if (pressed && mDisplayPressedState) { imagep = selected ? mImagePressedSelected : mImagePressed; @@ -697,8 +706,7 @@ void LLButton::draw() imagep = mImageDisabled; } - // Selected has a higher priority than flashing. If both are set, flashing is ignored. - if (mFlashing && !selected) + if (mFlashing) { // if button should flash and we have icon for flashing, use it as image for button if(flash && mImageFlash) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d736b81bb7..48cf7b3463 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -122,7 +122,7 @@ void on_new_message(const LLSD& msg) LLUUID session_id = msg["session_id"].asUUID(); LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); - // determine action for this session + // determine action for this session if (session_id.isNull()) { @@ -148,13 +148,14 @@ void on_new_message(const LLSD& msg) action = gSavedSettings.getString("NotificationGroupChatOptions"); } - // do not show notification in "do not disturb" mode or it goes from agent + // do not show notification which goes from agent if (gAgent.getID() == participant_id) { return; } // execution of the action + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance("im_container"); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); @@ -173,7 +174,7 @@ void on_new_message(const LLSD& msg) if ("toast" == action) { - // Skip toasting if we have open window of IM with this session id + // Skip toasting and flashing if we have open window of IM with this session id if (session_floater && session_floater->isInVisibleChain() && session_floater->hasFocus() @@ -184,12 +185,6 @@ void on_new_message(const LLSD& msg) return; } - // Skip toasting for system messages and for nearby chat - if (participant_id.isNull()) - { - return; - } - //User is not focused on conversation containing the message if(session_floater_not_focused) { @@ -201,7 +196,8 @@ void on_new_message(const LLSD& msg) gToolBarView->flashCommand(LLCommandId("chat"), true); //Show IM toasts (upper right toasts) - if(session_id.notNull()) + // Skip toasting for system messages and for nearby chat + if(session_id.notNull() && participant_id.notNull()) { LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); } -- cgit v1.2.3 From a25e6eb733bb8f6a0e9f8de1094155f685c6216d Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 28 Dec 2012 16:11:05 +0200 Subject: CHUI-453 FIXED Tooltip on chevron in torn-off conversation is incorrect: implemented suitable tool-tips; fixed a small separate bug ("tooltip_to_separate_window"/"tooltip_to_main_window" for Tear-Off Button: was shown reverse) --- indra/newview/llfloaterimsessiontab.cpp | 24 ++++++++++++++-------- .../skins/default/xui/en/floater_im_session.xml | 9 ++++++++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 4e79bd0ac8..a79b4b3f1d 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -606,8 +606,8 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar() // prevent start conversation before its container LLFloaterIMContainer::getInstance(); - bool is_torn_off = checkIfTornOff(); - if (!is_torn_off) + bool is_not_torn_off = !checkIfTornOff(); + if (is_not_torn_off) { hideAllStandardButtons(); } @@ -616,7 +616,7 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar() // Participant list should be visible only in torn off floaters. bool is_participant_list_visible = - is_torn_off + !is_not_torn_off && gSavedSettings.getBOOL("IMShowControlPanel") && !mIsP2PChat; @@ -624,22 +624,28 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar() // Display collapse image (<<) if the floater is hosted // or if it is torn off but has an open control panel. - bool is_expanded = !is_torn_off || is_participant_list_visible; + bool is_expanded = is_not_torn_off || is_participant_list_visible; mExpandCollapseBtn->setImageOverlay(getString(is_expanded ? "collapse_icon" : "expand_icon")); + mExpandCollapseBtn->setToolTip( + is_not_torn_off? + getString("expcol_button_not_tearoff_tooltip") : + (is_expanded? + getString("expcol_button_tearoff_and_expanded_tooltip") : + getString("expcol_button_tearoff_and_collapsed_tooltip"))); // toggle floater's drag handle and title visibility if (mDragHandle) { - mDragHandle->setTitleVisible(is_torn_off); + mDragHandle->setTitleVisible(!is_not_torn_off); } // The button (>>) should be disabled for torn off P2P conversations. - mExpandCollapseBtn->setEnabled(!is_torn_off || !mIsP2PChat); + mExpandCollapseBtn->setEnabled(is_not_torn_off || !mIsP2PChat); - mTearOffBtn->setImageOverlay(getString(is_torn_off? "return_icon" : "tear_off_icon")); - mTearOffBtn->setToolTip(getString(!is_torn_off? "tooltip_to_separate_window" : "tooltip_to_main_window")); + mTearOffBtn->setImageOverlay(getString(is_not_torn_off? "tear_off_icon" : "return_icon")); + mTearOffBtn->setToolTip(getString(is_not_torn_off? "tooltip_to_separate_window" : "tooltip_to_main_window")); - mCloseBtn->setVisible(!is_torn_off && !mIsNearbyChat); + mCloseBtn->setVisible(is_not_torn_off && !mIsNearbyChat); enableDisableCallBtn(); 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 9e2132dc3b..8f0574177f 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -49,6 +49,15 @@ + + + Date: Wed, 2 Jan 2013 13:10:42 -0800 Subject: CHUI-499: Removing debug code --- .../newview/lldonotdisturbnotificationstorage.cpp | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index bf3dcae1f3..f4560d5668 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -29,11 +29,6 @@ #include "lldonotdisturbnotificationstorage.h" -#define XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT 0 - -#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT -#include "llchannelmanager.h" -#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT #include "llcommunicationchannel.h" #include "lldir.h" #include "llerror.h" @@ -41,9 +36,6 @@ #include "llnotifications.h" #include "llnotificationhandler.h" #include "llnotificationstorage.h" -#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT -#include "llscreenchannel.h" -#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT #include "llscriptfloater.h" #include "llsd.h" #include "llsingleton.h" @@ -109,12 +101,6 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() { return; } - -#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT - LLNotificationsUI::LLScreenChannel* notification_channel = - dynamic_cast(LLNotificationsUI::LLChannelManager::getInstance()-> - findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); -#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT LLNotifications& instance = LLNotifications::instance(); @@ -146,17 +132,6 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() instance.add(notification); } - -#if XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT - // hide script floaters so they don't confuse the user and don't overlap startup toast - LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false); - - if(notification_channel) - { - // hide saved toasts so they don't confuse the user - notification_channel->hideToast(notification->getID()); - } -#endif // XXX_STINSON_HIDE_NOTIFICATIONS_ON_DND_EXIT } // Clear the communication channel history and rewrite the save file to empty it as well -- cgit v1.2.3 From f40ee4792d948ca99d19bdd6f645faea07e15f47 Mon Sep 17 00:00:00 2001 From: maximbproductengine Date: Thu, 3 Jan 2013 06:35:40 +0200 Subject: CHUI-616 (Left Click on participant name in torn off conference moves focus to conversation floater) --- indra/newview/llconversationview.cpp | 21 --------------------- indra/newview/llconversationview.h | 2 -- 2 files changed, 23 deletions(-) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index e51efd48f5..903dd2a407 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -547,27 +547,6 @@ void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask) LLFolderViewItem::onMouseLeave(x, y, mask); } -BOOL LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask ) -{ - LLConversationItem* item = NULL; - LLConversationViewSession* session_widget = - dynamic_cast(this->getParentFolder()); - if (session_widget) - { - item = dynamic_cast(session_widget->getViewModelItem()); - } - LLUUID session_id = item? item->getUUID() : LLUUID(); - BOOL result = LLFolderViewItem::handleMouseDown(x, y, mask); - - if(result) - { - (LLFloaterReg::getTypedInstance("im_container"))-> - selectConversationPair(session_id, false); - } - - return result; -} - S32 LLConversationViewParticipant::getLabelXPos() { return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 74443e1d88..5f6acfb9ab 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -132,8 +132,6 @@ public: void addToFolder(LLFolderViewFolder* folder); void addToSession(const LLUUID& session_id); - /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask); -- cgit v1.2.3 From 3d83fc3da5b0fa20bb631bfd2c94368946905675 Mon Sep 17 00:00:00 2001 From: maximbproductengine Date: Thu, 3 Jan 2013 06:43:25 +0200 Subject: CHUI-608 (Conversations floater can be resized too small once a conversation is torn off) --- indra/newview/llfloaterimcontainer.h | 3 ++- indra/newview/llfloaterimsessiontab.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 09a24c0105..8daed46c7d 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -106,6 +106,8 @@ public: bool enableContextMenuItem(const std::string& item, uuid_vec_t& selectedIDS); void doToParticipants(const std::string& item, uuid_vec_t& selectedIDS); + void assignResizeLimits(); + private: typedef std::map avatarID_panel_map_t; avatarID_panel_map_t mSessions; @@ -154,7 +156,6 @@ private: void toggleAllowTextChat(const LLUUID& participant_uuid); void toggleMute(const LLUUID& participant_id, U32 flags); void openNearbyChat(); - void assignResizeLimits(); LLButton* mExpandCollapseBtn; LLButton* mStubCollapseBtn; diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index f5b657fa60..4e79bd0ac8 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -751,6 +751,11 @@ void LLFloaterIMSessionTab::onTearOffClicked() { forceReshape(); } + LLFloaterIMContainer* container = LLFloaterIMContainer::getInstance(); + if (container) + { + container->assignResizeLimits(); + } refreshConversation(); updateGearBtn(); } -- cgit v1.2.3 From c464adc8ae35d3656e8de6aa459eb4615bb34c6f Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Thu, 3 Jan 2013 14:03:33 +0200 Subject: CHUI-636 FIXED Enable group context menu options, if uuid is empty and selected model item is group chat. In addition enable Chat history item for ad-hoc and group conversations. --- indra/newview/llfloaterimcontainer.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 2019a35faa..61a67a1f9f 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1101,12 +1101,20 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) uuid_vec_t uuids; getParticipantUUIDs(uuids); + //Enable Chat history item for ad-hoc and group conversations + if ("can_chat_history" == item) + { + if (getCurSelectedViewModelItem()->getType() != LLConversationItem::CONV_PARTICIPANT) + { + return isConversationLoggingAllowed(); + } + } - // If nothing is selected, everything needs to be disabled + // If nothing is selected(and selected item is not group chat), everything needs to be disabled if (uuids.size() <= 0) - { - return false; - } + { + return getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_GROUP; + } if("can_activate_group" == item) { @@ -1123,7 +1131,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v { return gSavedSettings.getBOOL("KeepConversationLogTranscripts"); } - + // Extract the single select info bool is_single_select = (uuids.size() == 1); const LLUUID& single_id = uuids.front(); -- cgit v1.2.3 From f4902521f58956eda7701770eec51763a7663d3c Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Thu, 3 Jan 2013 15:12:11 +0200 Subject: CHUI-631 FIXED 'Nearby chat' is not selected in Conversations floater after closing separate conversation if list of participants was expand in Conversations floater: force select 'Nearby chat' when session floater is destroyed --- indra/newview/llfloaterimsessiontab.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index a79b4b3f1d..76643b0235 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -82,6 +82,13 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) LLFloaterIMSessionTab::~LLFloaterIMSessionTab() { delete mRefreshTimer; + + // Select Nearby Chat session + LLFloaterIMContainer* container = LLFloaterReg::getTypedInstance("im_container"); + if (container) + { + container->selectConversationPair(LLUUID(NULL), true); + } } //static -- cgit v1.2.3 From 799c1f241f66db6d8701ee8c4339a5cce41c3c47 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Thu, 3 Jan 2013 18:59:20 +0200 Subject: CHUI-628 FIXED Open conversation log menu option not active in conversation floater when nearby chat is selected: Determination of the availability menu item was moved to the right place --- indra/newview/llfloaterimcontainer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 61a67a1f9f..50acd4ae24 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1101,6 +1101,11 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) uuid_vec_t uuids; getParticipantUUIDs(uuids); + if ("conversation_log" == item) + { + return gSavedSettings.getBOOL("KeepConversationLogTranscripts"); + } + //Enable Chat history item for ad-hoc and group conversations if ("can_chat_history" == item) { @@ -1127,11 +1132,6 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_vec_t& uuids) { - if ("conversation_log" == item) - { - return gSavedSettings.getBOOL("KeepConversationLogTranscripts"); - } - // Extract the single select info bool is_single_select = (uuids.size() == 1); const LLUUID& single_id = uuids.front(); -- cgit v1.2.3 From 0e6ff3e7021b2e72f02b22550bbb96bc3674cba4 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 3 Jan 2013 14:37:24 -0800 Subject: CHUI-654 : Fixed! Select the Nearby Chat directly when one conversation only left, don't finesse with a root UUID that might not be NULL --- indra/newview/llfloaterimcontainer.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 50acd4ae24..9fe67e99da 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1430,11 +1430,10 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c { is_widget_selected = widget->isSelected(); new_selection = mConversationsRoot->getNextFromChild(widget); - if(new_selection == NULL) + if (!new_selection) { new_selection = mConversationsRoot->getPreviousFromChild(widget); } - widget->destroyView(); } @@ -1446,14 +1445,20 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c if (change_focus) { setFocus(TRUE); - if(new_selection != NULL) + if (new_selection) { if (mConversationsWidgets.size() == 1) - new_selection = new_selection->getParentFolder(); - LLConversationItem* vmi = dynamic_cast(new_selection->getViewModelItem()); - if(vmi != NULL) { - selectConversationPair(vmi->getUUID(), true); + // If only one widget is left, it has to be the Nearby Chat. Select it directly. + selectConversationPair(LLUUID(NULL), true); + } + else + { + LLConversationItem* vmi = dynamic_cast(new_selection->getViewModelItem()); + if (vmi) + { + selectConversationPair(vmi->getUUID(), true); + } } } } -- cgit v1.2.3 From 3d1feec7641051386733405186cfe81b68a929ca Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 3 Jan 2013 15:11:53 -0800 Subject: CHUI-656 : Fixed. getTypedInstance() will create an instance if not found. Do not use that in destructors (bad...) or in places where creation is not required. Use findTypedInstance() instead. --- indra/newview/llfloaterimsessiontab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 76643b0235..7b34a86f24 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -84,7 +84,7 @@ LLFloaterIMSessionTab::~LLFloaterIMSessionTab() delete mRefreshTimer; // Select Nearby Chat session - LLFloaterIMContainer* container = LLFloaterReg::getTypedInstance("im_container"); + LLFloaterIMContainer* container = LLFloaterReg::findTypedInstance("im_container"); if (container) { container->selectConversationPair(LLUUID(NULL), true); @@ -329,7 +329,7 @@ void LLFloaterIMSessionTab::onFocusReceived() LLTransientDockableFloater::onFocusReceived(); - LLFloaterIMContainer* container = LLFloaterReg::getTypedInstance("im_container"); + LLFloaterIMContainer* container = LLFloaterReg::findTypedInstance("im_container"); if (container) { container->selectConversationPair(mSessionID, true); -- cgit v1.2.3 From 9d687cc0042a6972a603778359055394c1cf0850 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Fri, 4 Jan 2013 15:14:24 +0200 Subject: CHUI-637 FIXED Call requestArrange() to update widget state. --- indra/newview/llfloaterimcontainer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 9fe67e99da..22db4dd0eb 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -678,6 +678,7 @@ void LLFloaterIMContainer::collapseConversationsPane(bool collapse) { widget->setOpen(false); } + widget->requestArrange(); } } } -- cgit v1.2.3 From 4d971c43518f02fe202cf437f059250061cd9756 Mon Sep 17 00:00:00 2001 From: maximbproductengine Date: Fri, 4 Jan 2013 16:48:34 +0200 Subject: CHUI-608 (Conversations floater can be resized too small once a conversation is torn off) --- indra/newview/llfloaterimcontainer.cpp | 6 ++++++ indra/newview/llfloaterimcontainer.h | 1 + indra/newview/llfloaterimsessiontab.cpp | 5 ----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 2019a35faa..151d901708 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -605,6 +605,12 @@ void LLFloaterIMContainer::setVisible(BOOL visible) LLMultiFloater::setVisible(visible); } +void LLFloaterIMContainer::updateResizeLimits() +{ + LLMultiFloater::updateResizeLimits(); + assignResizeLimits(); +} + void LLFloaterIMContainer::collapseMessagesPane(bool collapse) { if (mMessagesPane->isCollapsed() == collapse) diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 8daed46c7d..0cd1b6759b 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -60,6 +60,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void draw(); /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ void updateResizeLimits(); void onCloseFloater(LLUUID& id); /*virtual*/ void addFloater(LLFloater* floaterp, diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 4e79bd0ac8..f5b657fa60 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -751,11 +751,6 @@ void LLFloaterIMSessionTab::onTearOffClicked() { forceReshape(); } - LLFloaterIMContainer* container = LLFloaterIMContainer::getInstance(); - if (container) - { - container->assignResizeLimits(); - } refreshConversation(); updateGearBtn(); } -- cgit v1.2.3