diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-02-08 19:13:33 +0200 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-02-08 19:13:33 +0200 |
commit | b98351d1956093d1672c5b8efe2728b2206525c6 (patch) | |
tree | e93201be17a48aac2f6e2b8e0eaac77db3d16fc6 /indra | |
parent | acc0a2962bc645335f19bb5e6142690ea99df449 (diff) | |
parent | d60d73a9e09dac3fa4508d8eddb8202614ff3536 (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llfontfreetype.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llchathistory.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llchiclet.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llscriptfloater.cpp | 261 | ||||
-rw-r--r-- | indra/newview/llscriptfloater.h | 45 | ||||
-rw-r--r-- | indra/newview/llsyswellwindow.cpp | 112 | ||||
-rw-r--r-- | indra/newview/llsyswellwindow.h | 23 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 60 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 5 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llviewerparcelmedia.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llworldmapview.cpp | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 15 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_active_object_row.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_notices.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_landmark_info.xml | 1 |
16 files changed, 201 insertions, 381 deletions
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 59e7d890f4..22fad792da 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -504,8 +504,13 @@ void LLFontFreetype::resetBitmapCache() mCharGlyphInfoMap.clear(); mFontBitmapCachep->reset(); - // Add the empty glyph - addGlyphFromFont(this, 0, 0); + // Adding default glyph is skipped for fallback fonts here as well as in loadFace(). + // This if was added as fix for EXT-4971. + if(!mIsFallback) + { + // Add the empty glyph + addGlyphFromFont(this, 0, 0); + } } void LLFontFreetype::destroyGL() diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 3aea70d1b4..929457046c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -444,6 +444,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) editor_params.rect = getLocalRect(); editor_params.follows.flags = FOLLOWS_ALL; editor_params.enabled = false; // read only + editor_params.show_context_menu = "true"; mEditor = LLUICtrlFactory::create<LLTextEditor>(editor_params, this); } diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index db804c7c8b..8efa814a2e 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1159,10 +1159,10 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ void object_chiclet_callback(const LLSD& data) { - LLUUID object_id = data["object_id"]; + LLUUID notification_id = data["notification_id"]; bool new_message = data["new_message"]; - std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(object_id); + std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(notification_id); std::list<LLChiclet *>::iterator iter; for (iter = chiclets.begin(); iter != chiclets.end(); iter++) { @@ -1894,12 +1894,8 @@ void LLScriptChiclet::setSessionId(const LLUUID& session_id) setShowNewMessagesIcon( getSessionId() != session_id ); LLIMChiclet::setSessionId(session_id); - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(notification) - { - setToolTip(notification->getSubstitutions()["TITLE"].asString()); - } + + setToolTip(LLScriptFloaterManager::getObjectName(session_id)); } void LLScriptChiclet::setCounter(S32 counter) @@ -1948,13 +1944,10 @@ void LLInvOfferChiclet::setSessionId(const LLUUID& session_id) { setShowNewMessagesIcon( getSessionId() != session_id ); + setToolTip(LLScriptFloaterManager::getObjectName(session_id)); + LLIMChiclet::setSessionId(session_id); - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(notification) - { - setToolTip(notification->getSubstitutions()["TITLE"].asString()); - } + LLNotificationPtr notification = LLNotifications::getInstance()->find(session_id); if ( notification && notification->getName() == INVENTORY_USER_OFFER ) { diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 0d9cf06bc3..465d36b8de 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -38,9 +38,11 @@ #include "llchiclet.h" #include "llfloaterreg.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "llscreenchannel.h" #include "llsyswellwindow.h" #include "lltoastnotifypanel.h" +#include "lltrans.h" #include "llviewerwindow.h" #include "llimfloater.h" @@ -70,12 +72,11 @@ LLScriptFloater::LLScriptFloater(const LLSD& key) setOverlapsScreenChannel(true); } -bool LLScriptFloater::toggle(const LLUUID& object_id) +bool LLScriptFloater::toggle(const LLUUID& notification_id) { // Force chiclet toggle on here because first onFocusReceived() will not toggle it on. - LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(object_id, true); + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(notification_id, true); - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id); // show existing floater @@ -96,22 +97,21 @@ bool LLScriptFloater::toggle(const LLUUID& object_id) // create and show new floater else { - show(object_id); + show(notification_id); return true; } } -LLScriptFloater* LLScriptFloater::show(const LLUUID& object_id) +LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id) { - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); - LLScriptFloater* floater = LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id); - floater->setObjectId(object_id); - floater->createForm(object_id); + + floater->setNotificationId(notification_id); + floater->createForm(notification_id); if (floater->getDockControl() == NULL) { - LLChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(object_id); + LLChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(notification_id); if (chiclet == NULL) { llerror("Dock chiclet for LLScriptFloater doesn't exist", 0); @@ -133,7 +133,7 @@ void LLScriptFloater::getAllowedRect(LLRect& rect) rect = gViewerWindow->getWorldViewRectRaw(); } -void LLScriptFloater::createForm(const LLUUID& object_id) +void LLScriptFloater::createForm(const LLUUID& notification_id) { // delete old form if(mScriptForm) @@ -142,8 +142,7 @@ void LLScriptFloater::createForm(const LLUUID& object_id) mScriptForm->die(); } - LLNotificationPtr notification = LLNotifications::getInstance()->find( - LLScriptFloaterManager::getInstance()->findNotificationId(object_id)); + LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); if(NULL == notification) { return; @@ -165,9 +164,9 @@ void LLScriptFloater::createForm(const LLUUID& object_id) void LLScriptFloater::onClose(bool app_quitting) { - if(getObjectId().notNull()) + if(getNotificationId().notNull()) { - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(getObjectId()); + LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId()); } } @@ -186,7 +185,7 @@ void LLScriptFloater::setVisible(BOOL visible) if(!visible) { - LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getObjectId()); + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId()); if(chiclet) { chiclet->setToggleState(false); @@ -196,10 +195,10 @@ void LLScriptFloater::setVisible(BOOL visible) void LLScriptFloater::onMouseDown() { - if(getObjectId().notNull()) + if(getNotificationId().notNull()) { // Remove new message icon - LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getObjectId()); + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId()); if (chiclet == NULL) { llerror("Dock chiclet for LLScriptFloater doesn't exist", 0); @@ -213,15 +212,18 @@ void LLScriptFloater::onMouseDown() void LLScriptFloater::onFocusLost() { - LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getObjectId(), false); + if(getNotificationId().notNull()) + { + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), false); + } } void LLScriptFloater::onFocusReceived() { // first focus will be received before setObjectId() call - don't toggle chiclet - if(getObjectId().notNull()) + if(getNotificationId().notNull()) { - LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getObjectId(), true); + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), true); } } @@ -246,200 +248,203 @@ void LLScriptFloater::hideToastsIfNeeded() void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) { - // get scripted Object's ID - LLUUID object_id = notification_id_to_object_id(notification_id); - if(object_id.isNull()) + if(notification_id.isNull()) { - llwarns << "Invalid notification, no object id" << llendl; + llwarns << "Invalid notification ID" << llendl; return; } + // get scripted Object's ID + LLUUID object_id = notification_id_to_object_id(notification_id); + // Need to indicate of "new message" for object chiclets according to requirements // specified in the Message Bar design specification. See EXT-3142. bool set_new_message = false; + EObjectType obj_type = getObjectType(notification_id); - // If an Object spawns more-than-one floater, only the newest one is shown. - // The previous is automatically closed. - script_notification_map_t::iterator it = mNotifications.find(object_id); - if(it != mNotifications.end()) + // LLDialog can spawn only one instance, LLLoadURL and LLGiveInventory can spawn unlimited number of instances + if(OBJ_SCRIPT == obj_type) { - LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(object_id); - if(chiclet) + // If an Object spawns more-than-one floater, only the newest one is shown. + // The previous is automatically closed. + script_notification_map_t::const_iterator it = findUsingObjectId(object_id); + if(it != mNotifications.end()) { - // Pass the new_message icon state further. - set_new_message = chiclet->getShowNewMessagesIcon(); - } + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(it->first); + if(chiclet) + { + // Pass the new_message icon state further. + set_new_message = chiclet->getShowNewMessagesIcon(); + } - LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->second.notification_id); - if(floater) - { - // Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142. - set_new_message |= !floater->hasFocus(); - } + LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->first); + if(floater) + { + // Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142. + set_new_message |= !floater->hasFocus(); + } - onRemoveNotification(it->second.notification_id); + onRemoveNotification(it->first); + } } - LLNotificationData nd = {notification_id}; - mNotifications.insert(std::make_pair(object_id, nd)); + mNotifications.insert(std::make_pair(notification_id, object_id)); // Create inventory offer chiclet for offer type notifications - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if( notification && notification->getType() == "offer" ) + if( OBJ_GIVE_INVENTORY == obj_type ) { - LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(object_id); + LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(notification_id); } else { - LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(object_id); + LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(notification_id); } - LLIMWellWindow::getInstance()->addObjectRow(object_id, set_new_message); + LLIMWellWindow::getInstance()->addObjectRow(notification_id, set_new_message); LLSD data; - data["object_id"] = object_id; + data["notification_id"] = notification_id; data["new_message"] = set_new_message; data["unread"] = 1; // each object has got only one floater mNewObjectSignal(data); - toggleScriptFloater(object_id, set_new_message); + toggleScriptFloater(notification_id, set_new_message); } void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) { - LLUUID object_id = findObjectId(notification_id); - if(object_id.isNull()) + if(notification_id.isNull()) { - llwarns << "Invalid notification, no object id" << llendl; + llwarns << "Invalid notification ID" << llendl; return; } - using namespace LLNotificationsUI; - - // remove related toast - LLUUID channel_id(gSavedSettings.getString("NotificationChannelUUID")); - LLScreenChannel* channel = dynamic_cast<LLScreenChannel*> - (LLChannelManager::getInstance()->findChannelByID(channel_id)); - LLUUID n_toast_id = findNotificationToastId(object_id); - if(channel && n_toast_id.notNull()) - { - channel->killToastByNotificationID(n_toast_id); - } - // remove related chiclet - LLBottomTray::getInstance()->getChicletPanel()->removeChiclet(object_id); + LLBottomTray::getInstance()->getChicletPanel()->removeChiclet(notification_id); - LLIMWellWindow::getInstance()->removeObjectRow(object_id); + LLIMWellWindow::getInstance()->removeObjectRow(notification_id); // close floater LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id); if(floater) { - floater->setObjectId(LLUUID::null); + floater->setNotificationId(LLUUID::null); floater->closeFloater(); } - mNotifications.erase(object_id); -} - -void LLScriptFloaterManager::removeNotificationByObjectId(const LLUUID& object_id) -{ - // Check we have not removed notification yet - LLNotificationPtr notification = LLNotifications::getInstance()->find( - findNotificationId(object_id)); - if(notification) - { - onRemoveNotification(notification->getID()); - } + mNotifications.erase(notification_id); } -void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& object_id, bool set_new_message) +void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& notification_id, bool set_new_message) { - // kill toast - using namespace LLNotificationsUI; - LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(LLChannelManager::getInstance()->findChannelByID( - LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); - if(channel) - { - channel->killToastByNotificationID(findNotificationToastId(object_id)); - } - LLSD data; - data["object_id"] = object_id; + data["notification_id"] = notification_id; data["new_message"] = set_new_message; mToggleFloaterSignal(data); // toggle floater - LLScriptFloater::toggle(object_id); + LLScriptFloater::toggle(notification_id); } -void LLScriptFloaterManager::setNotificationToastId(const LLUUID& object_id, const LLUUID& notification_id) +LLUUID LLScriptFloaterManager::findObjectId(const LLUUID& notification_id) { - script_notification_map_t::iterator it = mNotifications.find(object_id); + script_notification_map_t::const_iterator it = mNotifications.find(notification_id); if(mNotifications.end() != it) { - it->second.toast_notification_id = notification_id; + return it->second; } + return LLUUID::null; } -LLUUID LLScriptFloaterManager::findObjectId(const LLUUID& notification_id) +LLUUID LLScriptFloaterManager::findNotificationId(const LLUUID& object_id) { - if(notification_id.notNull()) + if(object_id.notNull()) { - script_notification_map_t::const_iterator it = mNotifications.begin(); - for(; mNotifications.end() != it; ++it) + script_notification_map_t::const_iterator it = findUsingObjectId(object_id); + if(mNotifications.end() != it) { - if(notification_id == it->second.notification_id) - { - return it->first; - } + return it->first; } } return LLUUID::null; } -LLUUID LLScriptFloaterManager::findNotificationId(const LLUUID& object_id) +// static +LLScriptFloaterManager::EObjectType LLScriptFloaterManager::getObjectType(const LLUUID& notification_id) { - script_notification_map_t::const_iterator it = mNotifications.find(object_id); - if(mNotifications.end() != it) + if(notification_id.isNull()) { - return it->second.notification_id; + llwarns << "Invalid notification ID" << llendl; + return OBJ_UNKNOWN; } - return LLUUID::null; -} -LLUUID LLScriptFloaterManager::findNotificationToastId(const LLUUID& object_id) -{ - script_notification_map_t::const_iterator it = mNotifications.find(object_id); - if(mNotifications.end() != it) + static const object_type_map TYPE_MAP = initObjectTypeMap(); + + LLNotificationPtr notification = LLNotificationsUtil::find(notification_id); + object_type_map::const_iterator it = TYPE_MAP.find(notification->getName()); + if(it != TYPE_MAP.end()) { - return it->second.toast_notification_id; + return it->second; } - return LLUUID::null; + + llwarns << "Unknown object type" << llendl; + return OBJ_UNKNOWN; } -//static -void LLScriptFloaterManager::onToastButtonClick(const LLSD¬ification, const LLSD&response) +// static +std::string LLScriptFloaterManager::getObjectName(const LLUUID& notification_id) { - S32 option = LLNotification::getSelectedOption(notification, response); - LLUUID object_id = notification["payload"]["object_id"].asUUID(); + using namespace LLNotificationsUI; + LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); + if(!notification) + { + llwarns << "Invalid notification" << llendl; + return LLStringUtil::null; + } + + std::string text; - switch(option) + switch(LLScriptFloaterManager::getObjectType(notification_id)) { - case 0: // "Open" - LLScriptFloaterManager::getInstance()->toggleScriptFloater(object_id); + case LLScriptFloaterManager::OBJ_SCRIPT: + text = notification->getSubstitutions()["TITLE"].asString(); break; - case 1: // "Ignore" - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(object_id); + case LLScriptFloaterManager::OBJ_LOAD_URL: + text = notification->getSubstitutions()["OBJECTNAME"].asString(); break; - case 2: // "Block" - LLMuteList::getInstance()->add(LLMute(object_id, notification["substitutions"]["TITLE"], LLMute::OBJECT)); - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(object_id); + case LLScriptFloaterManager::OBJ_GIVE_INVENTORY: + text = notification->getSubstitutions()["NAME"].asString(); break; default: - llwarns << "Unexpected value" << llendl; + text = LLTrans::getString("object"); break; } + + return text; +} + +//static +LLScriptFloaterManager::object_type_map LLScriptFloaterManager::initObjectTypeMap() +{ + object_type_map type_map; + type_map["ScriptDialog"] = OBJ_SCRIPT; + type_map["ScriptDialogGroup"] = OBJ_SCRIPT; + type_map["LoadWebPage"] = OBJ_LOAD_URL; + type_map["ObjectGiveItem"] = OBJ_GIVE_INVENTORY; + return type_map; +} + +LLScriptFloaterManager::script_notification_map_t::const_iterator LLScriptFloaterManager::findUsingObjectId(const LLUUID& object_id) +{ + script_notification_map_t::const_iterator it = mNotifications.begin(); + for(; mNotifications.end() != it; ++it) + { + if(object_id == it->second) + { + return it; + } + } + return mNotifications.end(); } // EOF diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index f86605c5d1..f7efff83f9 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -48,6 +48,15 @@ class LLScriptFloaterManager : public LLSingleton<LLScriptFloaterManager> // know how script notifications should look like. public: + typedef enum e_object_type + { + OBJ_SCRIPT, + OBJ_GIVE_INVENTORY, + OBJ_LOAD_URL, + + OBJ_UNKNOWN + }EObjectType; + /** * Handles new notifications. * Saves notification and object ids, removes old notification if needed, creates script chiclet @@ -62,11 +71,6 @@ public: void onRemoveNotification(const LLUUID& notification_id); /** - * Wrapper for onRemoveNotification, removes notification by object id. - */ - void removeNotificationByObjectId(const LLUUID& object_id); - - /** * Toggles script floater. * Removes "new message" icon from chiclet and removes notification toast. */ @@ -76,12 +80,9 @@ public: LLUUID findNotificationId(const LLUUID& object_id); - LLUUID findNotificationToastId(const LLUUID& object_id); + static EObjectType getObjectType(const LLUUID& notification_id); - /** - * Associate notification toast id with object id. - */ - void setNotificationToastId(const LLUUID& object_id, const LLUUID& notification_id); + static std::string getObjectName(const LLUUID& notification_id); /** * Callback for notification toast buttons. @@ -93,16 +94,18 @@ public: boost::signals2::connection addNewObjectCallback(const object_signal_t::slot_type& cb) { return mNewObjectSignal.connect(cb); } boost::signals2::connection addToggleObjectFloaterCallback(const object_signal_t::slot_type& cb) { return mToggleFloaterSignal.connect(cb); } -private: +protected: - struct LLNotificationData - { - LLUUID notification_id; - LLUUID toast_notification_id; - }; + typedef std::map<std::string, EObjectType> object_type_map; + + static object_type_map initObjectTypeMap(); - // <object_id, notification_data> - typedef std::map<LLUUID, LLNotificationData> script_notification_map_t; + // <notification_id, object_id> + typedef std::map<LLUUID, LLUUID> script_notification_map_t; + + script_notification_map_t::const_iterator findUsingObjectId(const LLUUID& object_id); + +private: script_notification_map_t mNotifications; @@ -136,9 +139,9 @@ public: */ static LLScriptFloater* show(const LLUUID& object_id); - const LLUUID& getObjectId() { return mObjectId; } + const LLUUID& getNotificationId() { return mNotificationId; } - void setObjectId(const LLUUID& id) { mObjectId = id; } + void setNotificationId(const LLUUID& id) { mNotificationId = id; } /** * Close notification if script floater is closed. @@ -180,7 +183,7 @@ protected: private: LLToastNotifyPanel* mScriptForm; - LLUUID mObjectId; + LLUUID mNotificationId; }; #endif //LL_SCRIPTFLOATER_H diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index ba15053381..4d1718be6a 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -418,16 +418,16 @@ BOOL LLIMWellWindow::RowPanel::handleRightMouseDown(S32 x, S32 y, MASK mask) /* ObjectRowPanel implementation */ /************************************************************************/ -LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& object_id, bool new_message/* = false*/) +LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& notification_id, bool new_message/* = false*/) : LLPanel() , mChiclet(NULL) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_active_object_row.xml", NULL); - initChiclet(object_id); + initChiclet(notification_id); LLTextBox* obj_name = getChild<LLTextBox>("object_name"); - obj_name->setValue(getObjectName(object_id)); + obj_name->setValue(LLScriptFloaterManager::getObjectName(notification_id)); mCloseBtn = getChild<LLButton>("hide_btn"); mCloseBtn->setCommitCallback(boost::bind(&LLIMWellWindow::ObjectRowPanel::onClosePanel, this)); @@ -438,90 +438,18 @@ LLIMWellWindow::ObjectRowPanel::~ObjectRowPanel() { } -std::string LLIMWellWindow::ObjectRowPanel::getObjectName(const LLUUID& object_id) -{ - using namespace LLNotificationsUI; - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(!notification) - { - llwarns << "Invalid notification" << llendl; - return LLStringUtil::null; - } - - std::string text; - - switch(getObjectType(notification)) - { - case OBJ_SCRIPT: - text = notification->getSubstitutions()["TITLE"].asString(); - break; - case OBJ_LOAD_URL: - text = notification->getSubstitutions()["OBJECTNAME"].asString(); - break; - case OBJ_GIVE_INVENTORY: - text = notification->getSubstitutions()["NAME"].asString(); - break; - default: - text = getString("unknown_obj"); - break; - } - - return text; -} - //--------------------------------------------------------------------------------- void LLIMWellWindow::ObjectRowPanel::onClosePanel() { - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(mChiclet->getSessionId()); -} - -//static -LLIMWellWindow::ObjectRowPanel::object_type_map LLIMWellWindow::ObjectRowPanel::initObjectTypeMap() -{ - object_type_map type_map; - type_map["ScriptDialog"] = OBJ_SCRIPT; - type_map["LoadWebPage"] = OBJ_LOAD_URL; - type_map["ObjectGiveItem"] = OBJ_GIVE_INVENTORY; - return type_map; -} - -// static -LLIMWellWindow::ObjectRowPanel::EObjectType LLIMWellWindow::ObjectRowPanel::getObjectType(const LLNotificationPtr& notification) -{ - if(!notification) - { - llwarns << "Invalid notification" << llendl; - return OBJ_UNKNOWN; - } - - static object_type_map type_map = initObjectTypeMap(); - std::string name = notification->getName(); - object_type_map::const_iterator it = type_map.find(name); - if(it != type_map.end()) - { - return it->second; - } - - llwarns << "Unknown object type" << llendl; - return OBJ_UNKNOWN; + LLScriptFloaterManager::getInstance()->onRemoveNotification(mChiclet->getSessionId()); } -void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& object_id, bool new_message/* = false*/) +void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& notification_id, bool new_message/* = false*/) { - using namespace LLNotificationsUI; - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(!notification) - { - llwarns << "Invalid notification" << llendl; - return; - } - // Choose which of the pre-created chiclets to use. - switch(getObjectType(notification)) + switch(LLScriptFloaterManager::getObjectType(notification_id)) { - case OBJ_GIVE_INVENTORY: + case LLScriptFloaterManager::OBJ_GIVE_INVENTORY: mChiclet = getChild<LLInvOfferChiclet>("inv_offer_chiclet"); break; default: @@ -530,8 +458,7 @@ void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& object_id, bool n } mChiclet->setVisible(true); - mChiclet->setSessionId(object_id); -// mChiclet->setShowNewMessagesIcon(new_message); + mChiclet->setSessionId(notification_id); } //--------------------------------------------------------------------------------- @@ -780,10 +707,10 @@ void LLIMWellWindow::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID } } -LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& object_id) +LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& notification_id) { LLChiclet* res = NULL; - ObjectRowPanel* panel = mMessageList->getTypedItemByValue<ObjectRowPanel>(object_id); + ObjectRowPanel* panel = mMessageList->getTypedItemByValue<ObjectRowPanel>(notification_id); if (panel != NULL) { res = panel->mChiclet; @@ -861,33 +788,33 @@ void LLIMWellWindow::delIMRow(const LLUUID& sessionId) } } -void LLIMWellWindow::addObjectRow(const LLUUID& object_id, bool new_message/* = false*/) +void LLIMWellWindow::addObjectRow(const LLUUID& notification_id, bool new_message/* = false*/) { - if (mMessageList->getItemByValue(object_id) == NULL) + if (mMessageList->getItemByValue(notification_id) == NULL) { - ObjectRowPanel* item = new ObjectRowPanel(object_id, new_message); - if (mMessageList->insertItemAfter(mSeparator, item, object_id)) + ObjectRowPanel* item = new ObjectRowPanel(notification_id, new_message); + if (mMessageList->insertItemAfter(mSeparator, item, notification_id)) { handleItemAdded(IT_INSTANT_MESSAGE); } else { - llwarns << "Unable to add Object Row into the list, objectID: " << object_id << llendl; + llwarns << "Unable to add Object Row into the list, notificationID: " << notification_id << llendl; item->die(); } reshapeWindow(); } } -void LLIMWellWindow::removeObjectRow(const LLUUID& object_id) +void LLIMWellWindow::removeObjectRow(const LLUUID& notification_id) { - if (mMessageList->removeItemByValue(object_id)) + if (mMessageList->removeItemByValue(notification_id)) { handleItemRemoved(IT_INSTANT_MESSAGE); } else { - llwarns << "Unable to remove Object Row from the list, objectID: " << object_id << llendl; + llwarns << "Unable to remove Object Row from the list, notificationID: " << notification_id << llendl; } reshapeWindow(); @@ -967,8 +894,7 @@ void LLIMWellWindow::closeAllImpl() ObjectRowPanel* obj_panel = dynamic_cast <ObjectRowPanel*> (panel); if (obj_panel) { - LLScriptFloaterManager::instance() - .removeNotificationByObjectId(*iter); + LLScriptFloaterManager::instance().onRemoveNotification(*iter); } } } diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 0c81d1f369..3790aa3ea9 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -188,8 +188,8 @@ public: /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); - void addObjectRow(const LLUUID& object_id, bool new_message = false); - void removeObjectRow(const LLUUID& object_id); + void addObjectRow(const LLUUID& notification_id, bool new_message = false); + void removeObjectRow(const LLUUID& notification_id); void addIMRow(const LLUUID& session_id); bool hasIMRow(const LLUUID& session_id); @@ -201,7 +201,7 @@ protected: private: LLChiclet * findIMChiclet(const LLUUID& sessionId); - LLChiclet* findObjectChiclet(const LLUUID& object_id); + LLChiclet* findObjectChiclet(const LLUUID& notification_id); void addIMRow(const LLUUID& sessionId, S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId); void delIMRow(const LLUUID& sessionId); @@ -235,17 +235,8 @@ private: class ObjectRowPanel: public LLPanel { - typedef enum e_object_type - { - OBJ_UNKNOWN, - - OBJ_SCRIPT, - OBJ_GIVE_INVENTORY, - OBJ_LOAD_URL - }EObjectType; - public: - ObjectRowPanel(const LLUUID& object_id, bool new_message = false); + ObjectRowPanel(const LLUUID& notification_id, bool new_message = false); virtual ~ObjectRowPanel(); /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); @@ -254,12 +245,8 @@ private: private: void onClosePanel(); - static EObjectType getObjectType(const LLNotificationPtr& notification); - void initChiclet(const LLUUID& object_id, bool new_message = false); - std::string getObjectName(const LLUUID& object_id); + void initChiclet(const LLUUID& notification_id, bool new_message = false); - typedef std::map<std::string, EObjectType> object_type_map; - static object_type_map initObjectTypeMap(); public: LLIMChiclet* mChiclet; private: diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9ced0194a2..da090d074c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -712,7 +712,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) std::vector<LLViewerMediaImpl*> proximity_order; bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); - bool needs_first_run = LLViewerMedia::needsMediaFirstRun(); U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); @@ -838,12 +837,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) if(!pimpl->getUsedInUI()) { new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; - if(needs_first_run) - { - // Don't do this more than once in this loop. - needs_first_run = false; - LLViewerMedia::displayMediaFirstRun(); - } } } @@ -913,59 +906,6 @@ void LLViewerMedia::cleanupClass() gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerMedia::needsMediaFirstRun() -{ - return gWarningSettings.getBOOL("FirstStreamingMedia"); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -void LLViewerMedia::displayMediaFirstRun() -{ - gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); - - LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(firstRunCallback, _1, _2)); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - // user has elected to automatically play media. - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); - gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); - - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - if (parcel) - { - // play media right now, if available - LLViewerParcelMedia::play(parcel); - - // play music right now, if available - std::string music_url = parcel->getMusicURL(); - if (gAudiop && !music_url.empty()) - gAudiop->startInternetStream(music_url); - } - } - else - { - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); - gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); - gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); - } - return false; -} - - ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ff18ed605a..daad70f14f 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -117,11 +117,6 @@ class LLViewerMedia // This is the comparitor used to sort the list. static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); - // For displaying the media first-run dialog. - static bool needsMediaFirstRun(); - static void displayMediaFirstRun(); - static bool firstRunCallback(const LLSD& notification, const LLSD& response); - }; // Implementation functions not exported into header file diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c5d3d7cb25..42f7793b5a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1263,10 +1263,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gInventory.addObserver(opener); } - // Remove script dialog because there is no need in it no more. - LLUUID object_id = notification["payload"]["object_id"].asUUID(); - LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); - delete this; return false; } @@ -1440,10 +1436,6 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const gInventory.addObserver(opener); } - // Remove script dialog because there is no need in it no more. - LLUUID object_id = notification["payload"]["object_id"].asUUID(); - LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); - delete this; return false; } @@ -1594,7 +1586,6 @@ void inventory_offer_handler(LLOfferInfo* info) { payload["give_inventory_notification"] = TRUE; LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); - LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); } } } diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index c4fc2e5cab..2c5c0a37e8 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -105,15 +105,6 @@ void LLViewerParcelMedia::update(LLParcel* parcel) std::string mediaUrl = std::string ( parcel->getMediaURL () ); std::string mediaCurrentUrl = std::string( parcel->getMediaCurrentURL()); - // First use warning - if( (!mediaUrl.empty() || - !parcel->getMusicURL().empty()) - && LLViewerMedia::needsMediaFirstRun()) - { - LLViewerMedia::displayMediaFirstRun(); - return; - } - // if we have a current (link sharing) url, use it instead if (mediaCurrentUrl != "" && parcel->getMediaType() == "text/html") { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 1940d65ae4..5edf72d4ae 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -128,10 +128,10 @@ void LLWorldMapView::initClass() sHomeImage = LLUI::getUIImage("map_home.tga"); sTelehubImage = LLUI::getUIImage("map_telehub.tga"); sInfohubImage = LLUI::getUIImage("map_infohub.tga"); - sEventImage = LLUI::getUIImage("map_event.tga"); - sEventMatureImage = LLUI::getUIImage("map_event_mature.tga"); + sEventImage = LLUI::getUIImage("Parcel_PG_Dark"); + sEventMatureImage = LLUI::getUIImage("Parcel_M_Dark"); // To Do: update the image resource for adult events. - sEventAdultImage = LLUI::getUIImage("map_event_adult.tga"); + sEventAdultImage = LLUI::getUIImage("Parcel_R_Dark"); sTrackCircleImage = LLUI::getUIImage("map_track_16.tga"); sTrackArrowImage = LLUI::getUIImage("direction_arrow.tga"); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 72ac457882..90381c2af4 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1733,21 +1733,6 @@ Try selecting a single parcel. <notification icon="alertmodal.tga" - name="ParcelCanPlayMedia" - type="alertmodal"> -This location can play streaming media. -Streaming media requires a fast Internet connection. - -Play streaming media when available? -(You can change this option later under Preferences > Privacy.) - <usetemplate - name="okcancelbuttons" - notext="Disable" - yestext="Play Media"/> - </notification> - - <notification - icon="alertmodal.tga" name="CannotDeedLandWaitingForServer" type="alertmodal"> Unable to deed land: diff --git a/indra/newview/skins/default/xui/en/panel_active_object_row.xml b/indra/newview/skins/default/xui/en/panel_active_object_row.xml index 7657fb8055..bef5f8dafd 100644 --- a/indra/newview/skins/default/xui/en/panel_active_object_row.xml +++ b/indra/newview/skins/default/xui/en/panel_active_object_row.xml @@ -10,10 +10,6 @@ background_opaque="false" background_visible="true" bg_alpha_color="0.0 0.0 0.0 0.0" > - <string - name="unknown_obj"> - Unknown Object - </string> <chiclet_script name="object_chiclet" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml index 5f46ad7860..1f16aea2ef 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -159,6 +159,7 @@ Maximum 200 per group daily left_pad="3" max_length="511" name="create_message" + text_type="ascii" top_delta="0" width="220" word_wrap="true" /> diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index d1b22a34bb..6927906d3d 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -269,6 +269,7 @@ name="notes_editor" read_only="true" text_readonly_color="white" + text_type="ascii" top_pad="5" width="290" wrap="true" /> |