summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-05-21 17:16:34 -0700
committerRichard Linden <none@none>2012-05-21 17:16:34 -0700
commit723f596bf6f2fac2c24360790024ec3a4e778793 (patch)
tree1153ec6b49f00783499af3c1e6af58fe1de86409 /indra/newview
parent32717690ee6a9f33ca909f0df0226e9533f69399 (diff)
parent61bc25211be31ad28b8ae342c17b4ea1c32d955c (diff)
Automated merge with ssh://hg.lindenlab.com/richard/viewer-chui
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llnotificationalerthandler.cpp62
-rw-r--r--indra/newview/llnotificationhandler.h2
-rw-r--r--indra/newview/llnotificationstorage.cpp18
-rw-r--r--indra/newview/llscreenchannel.cpp17
-rw-r--r--indra/newview/lltoastnotifypanel.cpp24
5 files changed, 54 insertions, 69 deletions
diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp
index d13e2b629d..2bc9cdd3c1 100644
--- a/indra/newview/llnotificationalerthandler.cpp
+++ b/indra/newview/llnotificationalerthandler.cpp
@@ -82,39 +82,39 @@ bool LLAlertHandler::processNotification(const LLNotificationPtr& notification)
}
if (notification->canLogToIM() && notification->hasFormElements())
- {
- const std::string name = LLHandlerUtil::getSubstitutionName(notification);
-
- LLUUID from_id = notification->getPayload()["from_id"];
-
- // firstly create session...
- LLHandlerUtil::spawnIMSession(name, from_id);
-
- // ...then log message to have IM Well notified about new message
- LLHandlerUtil::logToIMP2P(notification);
- }
-
- LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
- LLToast::Params p;
- p.notif_id = notification->getID();
- p.notification = notification;
- p.panel = dynamic_cast<LLToastPanel*>(alert_dialog);
- p.enable_hide_btn = false;
- p.can_fade = false;
- p.is_modal = mIsModal;
- p.on_delete_toast = boost::bind(&LLAlertHandler::onDeleteToast, this, _1);
-
- // Show alert in middle of progress view (during teleport) (EXT-1093)
- LLProgressView* progress = gViewerWindow->getProgressView();
- LLRect rc = progress && progress->getVisible() ? progress->getRect() : gViewerWindow->getWorldViewRectScaled();
- mChannel.get()->updatePositionAndSize(rc);
-
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
- if(channel)
- channel->addToast(p);
+ {
+ const std::string name = LLHandlerUtil::getSubstitutionName(notification);
+
+ LLUUID from_id = notification->getPayload()["from_id"];
+
+ // firstly create session...
+ LLHandlerUtil::spawnIMSession(name, from_id);
+
+ // ...then log message to have IM Well notified about new message
+ LLHandlerUtil::logToIMP2P(notification);
+ }
+
+ LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
+ LLToast::Params p;
+ p.notif_id = notification->getID();
+ p.notification = notification;
+ p.panel = dynamic_cast<LLToastPanel*>(alert_dialog);
+ p.enable_hide_btn = false;
+ p.can_fade = false;
+ p.is_modal = mIsModal;
+ p.on_delete_toast = boost::bind(&LLAlertHandler::onDeleteToast, this, _1);
+
+ // Show alert in middle of progress view (during teleport) (EXT-1093)
+ LLProgressView* progress = gViewerWindow->getProgressView();
+ LLRect rc = progress && progress->getVisible() ? progress->getRect() : gViewerWindow->getWorldViewRectScaled();
+ mChannel.get()->updatePositionAndSize(rc);
+
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
+ if(channel)
+ channel->addToast(p);
return false;
- }
+}
void LLAlertHandler::onChange( LLNotificationPtr notification )
{
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 4d54bb78fc..0899625242 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -258,7 +258,7 @@ public:
: LLNotificationChannel("Outbox", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "outbox"))
{}
/*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); }
- /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); }
+ /*virtual*/ void onChange(LLNotificationPtr p) { }
/*virtual*/ void onDelete(LLNotificationPtr p);
bool processNotification(const LLNotificationPtr& p);
};
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index fb1adc7ddf..a31b95811e 100644
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -84,9 +84,11 @@ bool LLPersistentNotificationStorage::onPersistentChannelChanged(const LLSD& pay
return false;
}
+static LLFastTimer::DeclareTimer FTM_SAVE_NOTIFICATIONS("Save Notifications");
+
void LLPersistentNotificationStorage::saveNotifications()
{
- // TODO - think about save optimization.
+ LLFastTimer _(FTM_SAVE_NOTIFICATIONS);
llofstream notify_file(mFileName.c_str());
if (!notify_file.is_open())
@@ -98,10 +100,15 @@ void LLPersistentNotificationStorage::saveNotifications()
LLSD output;
LLSD& data = output["data"];
- LLNotificationChannelPtr history_channel = LLNotifications::instance().getChannel("Persistent");
- LLNotificationSet::iterator it = history_channel->begin();
+ boost::intrusive_ptr<LLPersistentNotificationChannel> history_channel = boost::dynamic_pointer_cast<LLPersistentNotificationChannel>(LLNotifications::instance().getChannel("Persistent"));
+ if (!history_channel)
+ {
+ return;
+ }
- for ( ; history_channel->end() != it; ++it)
+ for ( std::vector<LLNotificationPtr>::iterator it = history_channel->beginHistory(), end_it = history_channel->endHistory();
+ it != end_it;
+ ++it)
{
LLNotificationPtr notification = *it;
@@ -120,8 +127,11 @@ void LLPersistentNotificationStorage::saveNotifications()
formatter->format(output, notify_file, LLSDFormatter::OPTIONS_PRETTY);
}
+static LLFastTimer::DeclareTimer FTM_LOAD_NOTIFICATIONS("Load Notifications");
+
void LLPersistentNotificationStorage::loadNotifications()
{
+ LLFastTimer _(FTM_LOAD_NOTIFICATIONS);
LLResponderRegistry::registerResponders();
LLNotifications::instance().getChannel("Persistent")->
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 839ca0f9c5..157821d554 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -499,21 +499,20 @@ void LLScreenChannel::killToastByNotificationID(LLUUID id)
void LLScreenChannel::removeToastByNotificationID(LLUUID id)
{
- std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), id);
- if( it != mToastList.end())
+ std::vector<ToastElem>::iterator it = mToastList.begin();
+ while( it != mToastList.end())
{
+ // find next toast with matching id
+ it = find(it, mToastList.end(), id);
deleteToast(it->getToast());
mToastList.erase(it);
redrawToasts();
}
- else
+ it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
+ if (it != mStoredToastList.end())
{
- it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
- if (it != mStoredToastList.end())
- {
- deleteToast(it->getToast());
- mStoredToastList.erase(it);
- }
+ deleteToast(it->getToast());
+ mStoredToastList.erase(it);
}
}
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 3692fd5672..97b43d6197 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -60,19 +60,6 @@ LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, co
LLInstanceTracker<LLToastNotifyPanel, LLUUID>(notification->getID())
{
init(rect, show_images);
-
-
- //if(notification->isRespondedTo())
- //{
- // // User selected an option in toast, now disable required buttons in IM window
- // disableRespondedOptions(notification);
- //}
- //
- //if(notification->isReusable())
- //{
- // mButtonClickConnection = sButtonClickSignal.connect(
- // boost::bind(&LLToastNotifyPanel::disableRespondedOptions, this, notification));
- //}
}
void LLToastNotifyPanel::addDefaultButton()
{
@@ -355,17 +342,6 @@ void LLToastNotifyPanel::onClickButton(void* data)
response[button_name] = true;
}
- bool is_reusable = self->mNotification->isReusable();
- // When we call respond(), LLOfferInfo will delete itself in inventory_offer_callback(),
- // lets copy it while it's still valid.
- LLOfferInfo* old_info = static_cast<LLOfferInfo*>(self->mNotification->getResponder());
- LLOfferInfo* new_info = NULL;
- if(is_reusable && old_info)
- {
- new_info = new LLOfferInfo(*old_info);
- self->mNotification->setResponder(new_info);
- }
-
// disable all buttons
self->mControlPanel->setEnabled(FALSE);